glc_factory.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  Version 1.2.0, packaged on September 2009.
00006 
00007  http://glc-lib.sourceforge.net
00008 
00009  GLC-lib is free software; you can redistribute it and/or modify
00010  it under the terms of the GNU General Public License as published by
00011  the Free Software Foundation; either version 2 of the License, or
00012  (at your option) any later version.
00013 
00014  GLC-lib is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with GLC-lib; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023 *****************************************************************************/
00024 
00026 
00027 #ifndef GLC_FACTORY_
00028 #define GLC_FACTORY_
00029 
00030 #include <QObject>
00031 #include <QtOpenGL>
00032 #include <QString>
00033 
00034 //class to built
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 // end of class to built
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 // Private members
00145 
00146 private:
00148         static GLC_Factory* m_pFactory;
00149 
00151         const QGLContext* m_pQGLContext;
00152 
00153 };
00154 
00155 #endif /*GLC_FACTORY_*/

SourceForge.net Logo

©2005 Laurent Ribon