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 2.0.0 Beta 1, packaged on April 2010.
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 
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 // Private members
00160 
00161 private:
00163         static GLC_Factory* m_pFactory;
00164 
00166         static QGLContext* m_pQGLContext;
00167 
00168 };
00169 
00170 #endif /*GLC_FACTORY_*/

SourceForge.net Logo

©2005 Laurent Ribon