glc_factory.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00026
00027 #ifndef GLC_FACTORY_
00028 #define GLC_FACTORY_
00029
00030 #include <QObject>
00031 #include <QtOpenGL>
00032 #include <QString>
00033
00034
00035 #include "geometry/glc_point.h"
00036 #include "geometry/glc_pointsprite.h"
00037 #include "geometry/glc_line.h"
00038 #include "geometry/glc_circle.h"
00039 #include "geometry/glc_box.h"
00040 #include "geometry/glc_cylinder.h"
00041 #include "geometry/glc_rectangle.h"
00042 #include "geometry/glc_3drep.h"
00043 #include "shading/glc_material.h"
00044 #include "shading/glc_texture.h"
00045 #include "sceneGraph/glc_world.h"
00046 #include "sceneGraph/glc_3dviewinstance.h"
00047 #include "glc_boundingbox.h"
00048 #include "viewport/glc_movercontroller.h"
00049 #include "viewport/glc_viewport.h"
00050
00051
00052
00053 #include "glc_config.h"
00056
00059
00060 class GLC_LIB_EXPORT GLC_Factory : public QObject
00061 {
00062 Q_OBJECT
00063
00064 public:
00066 static GLC_Factory* instance(const QGLContext * pContext= NULL);
00067
00068 protected:
00070 GLC_Factory(const QGLContext *);
00071 public:
00073 ~GLC_Factory();
00074
00076
00078
00079 public:
00081 inline QGLContext* context() const
00082 {return m_pQGLContext;}
00083
00085 GLC_3DRep createPoint(const GLC_Point3d &coord) const;
00086
00087 GLC_3DRep createPoint(double x, double y, double z) const;
00088
00090 GLC_3DRep createPointSprite(float, GLC_Material*) const;
00091
00093 GLC_3DRep createLine(const GLC_Point3d&, const GLC_Point3d&) const;
00094
00096 GLC_3DRep createCircle(double radius, double angle= 2 * glc::PI) const;
00097
00099 GLC_3DRep createBox(double lx, double ly, double lz) const;
00100
00101 GLC_3DViewInstance createBox(const GLC_BoundingBox& boundingBox) const;
00102
00104 GLC_3DRep createCylinder(double radius, double length) const;
00105
00107 GLC_3DRep createRectangle(double, double);
00108
00110 GLC_3DViewInstance createRectangle(const GLC_Point3d& point, const GLC_Vector3d& normal, double l1, double l2);
00111
00113 GLC_3DViewInstance createCuttingPlane(const GLC_Point3d& point, const GLC_Vector3d& normal, double l1, double l2, GLC_Material* pMat);
00114
00116 GLC_World createWorldFromFile(QFile &file, QStringList* pAttachedFileName= NULL) const;
00117
00119 GLC_World createWorldStructureFrom3dxml(QFile &file) const;
00120
00122 GLC_3DRep create3DRepFromFile(const QString&) const;
00123
00125 GLC_Material* createMaterial() const;
00126
00128 GLC_Material* createMaterial(const GLfloat *pAmbiantColor) const;
00129
00131 GLC_Material* createMaterial(const QColor &color) const;
00132
00134 GLC_Material* createMaterial(GLC_Texture* pTexture) const;
00135
00137 GLC_Material* createMaterial(const QString &textureFullFileName) const;
00138
00140 GLC_Material* createMaterial(const QImage &) const;
00141
00143 GLC_Texture* createTexture(const QString &textureFullFileName) const;
00144
00146 GLC_Texture* createTexture(const QImage &, const QString& imageFileName= QString()) const;
00147
00149 GLC_MoverController createDefaultMoverController(const QColor&, GLC_Viewport*);
00150
00152
00153 signals:
00155 void currentQuantum(int) const;
00156
00158
00160
00161 private:
00163 static GLC_Factory* m_pFactory;
00164
00166 static QGLContext* m_pQGLContext;
00167
00168 };
00169
00170 #endif