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
00055
00058
00059 class GLC_Factory : public QObject
00060 {
00061 Q_OBJECT
00062
00063 public:
00065 static GLC_Factory* instance(const QGLContext *);
00067 inline static GLC_Factory* instance()
00068 {return m_pFactory;}
00069
00070 protected:
00072 GLC_Factory(const QGLContext *);
00073 public:
00075 ~GLC_Factory();
00076
00078
00080
00081 public:
00083 GLC_3DRep createPoint(const GLC_Vector4d &coord) const;
00084 GLC_3DRep createPoint(double x, double y, double z) const;
00085
00087 GLC_3DRep createPointSprite(float, GLC_Material*) const;
00088
00090 GLC_3DRep createLine(const GLC_Point4d&, const GLC_Point4d&) const;
00091
00093 GLC_3DRep createCircle(double radius, double angle= 2 * glc::PI) const;
00094
00096 GLC_3DRep createBox(double lx, double ly, double lz) const;
00097 GLC_3DViewInstance createBox(const GLC_BoundingBox& boundingBox) const;
00098
00100 GLC_3DRep createCylinder(double radius, double length) const;
00101
00103 GLC_3DRep createRectangle(const GLC_Vector4d&, double, double);
00104
00106 GLC_World* createWorld(QFile &file, QStringList* pAttachedFileName= NULL) const;
00107
00109 GLC_World* createWorldStructureFrom3dxml(QFile &file) const;
00110
00112 GLC_3DRep create3DrepFromFile(const QString&) const;
00113
00115 GLC_Material* createMaterial() const;
00117 GLC_Material* createMaterial(const GLfloat *pAmbiantColor) const;
00119 GLC_Material* createMaterial(const QColor &color) const;
00121 GLC_Material* createMaterial(GLC_Texture* pTexture) const;
00123 GLC_Material* createMaterial(const QString &textureFullFileName) const;
00125 GLC_Material* createMaterial(const QImage &) const;
00126
00128 GLC_Texture* createTexture(const QString &textureFullFileName) const;
00130 GLC_Texture* createTexture(const QImage &) const;
00131
00132
00134 GLC_MoverController createDefaultMoverController(const QColor&, GLC_Viewport*);
00135
00137
00138 signals:
00140 void currentQuantum(int) const;
00141
00143
00145
00146 private:
00148 static GLC_Factory* m_pFactory;
00149
00151 const QGLContext* m_pQGLContext;
00152
00153 };
00154
00155 #endif