GLC_Factory : Factory for all geometrical objects this class is a singleton. More...
#include <glc_factory.h>
Signals | |
| void | currentQuantum (int) const |
| For progress bar management. | |
Public Member Functions | |
| ~GLC_Factory () | |
| Destructor. | |
Get Functions | |
| QGLContext * | context () const |
| Return the current factory context. | |
| GLC_3DRep | createPoint (const GLC_Point3d &coord) const |
| Create a GLC_Point. | |
| GLC_3DRep | createPoint (double x, double y, double z) const |
| GLC_3DRep | createPointSprite (float, GLC_Material *) const |
| Create a GLC_PointSprite. | |
| GLC_3DRep | createLine (const GLC_Point3d &, const GLC_Point3d &) const |
| Create a GLC_Line. | |
| GLC_3DRep | createCircle (double radius, double angle=2 *glc::PI) const |
| Create a GLC_Circle. | |
| GLC_3DRep | createBox (double lx, double ly, double lz) const |
| Create a GLC_Box. | |
| GLC_3DViewInstance | createBox (const GLC_BoundingBox &boundingBox) const |
| GLC_3DRep | createCylinder (double radius, double length) const |
| Create a GLC_Cylinder. | |
| GLC_3DRep | createCone (double radius, double length) const |
| Create a GLC_Cone. | |
| GLC_3DRep | createSphere (double radius) const |
| Create a GLC_Sphere. | |
| GLC_3DRep | createRectangle (double, double) |
| Create a GLC_Rectangle. | |
| GLC_3DViewInstance | createRectangle (const GLC_Point3d &point, const GLC_Vector3d &normal, double l1, double l2) |
| Create a GLC_Rectangle from the given 3d point, normal and the given lenght. | |
| GLC_3DViewInstance | createCuttingPlane (const GLC_Point3d &point, const GLC_Vector3d &normal, double l1, double l2, GLC_Material *pMat) |
| Create the representation of a cutting from the given 3d point, normal, lenght and material. | |
| GLC_World | createWorldFromFile (QFile &file, QStringList *pAttachedFileName=NULL) const |
| Create a GLC_World from a QFile. | |
| GLC_World | createWorldStructureFrom3dxml (QFile &file) const |
| Create a GLC_World containing only the 3dxml structure. | |
| GLC_3DRep | create3DRepFromFile (const QString &) const |
| Create 3DRep from 3dxml or 3DRep file. | |
| GLC_Material * | createMaterial () const |
| Create default material. | |
| GLC_Material * | createMaterial (const GLfloat *pAmbiantColor) const |
| create a material with an ambient color | |
| GLC_Material * | createMaterial (const QColor &color) const |
| create a material with an ambient color | |
| GLC_Material * | createMaterial (GLC_Texture *pTexture) const |
| create a material textured with a texture | |
| GLC_Material * | createMaterial (const QString &textureFullFileName) const |
| create a material textured with a image file name | |
| GLC_Material * | createMaterial (const QImage &) const |
| create a material textured with a QImage | |
| GLC_Texture * | createTexture (const QString &textureFullFileName) const |
| Create a GLC_Texture. | |
| GLC_Texture * | createTexture (const QImage &, const QString &imageFileName=QString()) const |
| Create a GLC_Texture with a QImage. | |
| GLC_MoverController | createDefaultMoverController (const QColor &, GLC_Viewport *) |
| Create the default mover controller. | |
Static Public Member Functions | |
| static GLC_Factory * | instance (const QGLContext *pContext=NULL) |
| Get unique instance of the factory. | |
Protected Member Functions | |
| GLC_Factory (const QGLContext *) | |
| Constructor. | |
Static Private Attributes | |
| static GLC_Factory * | m_pFactory = NULL |
| The unique instance of the factory. | |
| static QGLContext * | m_pQGLContext = NULL |
| The QGLContext attached to the factory (rendering context). | |
GLC_Factory : Factory for all geometrical objects this class is a singleton.
Definition at line 62 of file glc_factory.h.
| GLC_Factory::GLC_Factory | ( | const QGLContext * | pContext | ) | [protected] |
Constructor.
Definition at line 76 of file glc_factory.cpp.
References m_pQGLContext.
Referenced by instance().
| GLC_Factory::~GLC_Factory | ( | ) |
Destructor.
Definition at line 82 of file glc_factory.cpp.
| QGLContext* GLC_Factory::context | ( | ) | const [inline] |
Return the current factory context.
Definition at line 83 of file glc_factory.h.
| GLC_3DRep GLC_Factory::create3DRepFromFile | ( | const QString & | fileName | ) | const |
Create 3DRep from 3dxml or 3DRep file.
Definition at line 295 of file glc_factory.cpp.
References GLC_3dxmlToWorld::create3DrepFrom3dxmlRep(), currentQuantum(), and m_pQGLContext.
Referenced by GLC_3DRep::load().
| GLC_3DViewInstance GLC_Factory::createBox | ( | const GLC_BoundingBox & | boundingBox | ) | const |
Definition at line 129 of file glc_factory.cpp.
References GLC_BoundingBox::center(), GLC_BoundingBox::lowerCorner(), GLC_3DViewInstance::translate(), GLC_BoundingBox::upperCorner(), GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().
| GLC_3DRep GLC_Factory::createBox | ( | double | lx, | |
| double | ly, | |||
| double | lz | |||
| ) | const |
Create a GLC_Box.
Definition at line 122 of file glc_factory.cpp.
Referenced by GLC_Octree::createBoxWithMaterial().
Create a GLC_Circle.
Definition at line 116 of file glc_factory.cpp.
| GLC_3DRep GLC_Factory::createCone | ( | double | radius, | |
| double | length | |||
| ) | const |
Create a GLC_Cone.
Definition at line 148 of file glc_factory.cpp.
Referenced by GLC_Axis::create3DviewInstance().
| GLC_3DViewInstance GLC_Factory::createCuttingPlane | ( | const GLC_Point3d & | point, | |
| const GLC_Vector3d & | normal, | |||
| double | l1, | |||
| double | l2, | |||
| GLC_Material * | pMat | |||
| ) |
Create the representation of a cutting from the given 3d point, normal, lenght and material.
Definition at line 179 of file glc_factory.cpp.
References GLC_Mesh::replaceMasterMaterial(), GLC_3DViewInstance::setMatrix(), and glc::Z_AXIS().
Referenced by GLC_CuttingPlane::create3DviewInstance().
| GLC_3DRep GLC_Factory::createCylinder | ( | double | radius, | |
| double | length | |||
| ) | const |
Create a GLC_Cylinder.
Definition at line 141 of file glc_factory.cpp.
Referenced by GLC_Axis::create3DviewInstance().
| GLC_MoverController GLC_Factory::createDefaultMoverController | ( | const QColor & | color, | |
| GLC_Viewport * | pViewport | |||
| ) |
Create the default mover controller.
Definition at line 352 of file glc_factory.cpp.
References GLC_MoverController::addMover(), GLC_RepMover::clone(), GLC_MoverController::Fly, GLC_MoverController::Pan, GLC_RepMover::setMainColor(), GLC_MoverController::Target, GLC_MoverController::TrackBall, GLC_MoverController::TurnTable, and GLC_MoverController::Zoom.
| GLC_3DRep GLC_Factory::createLine | ( | const GLC_Point3d & | point1, | |
| const GLC_Point3d & | point2 | |||
| ) | const |
Create a GLC_Line.
Definition at line 110 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | const QImage & | image | ) | const |
create a material textured with a QImage
Definition at line 336 of file glc_factory.cpp.
References createMaterial(), and createTexture().
| GLC_Material * GLC_Factory::createMaterial | ( | const QString & | textureFullFileName | ) | const |
create a material textured with a image file name
Definition at line 330 of file glc_factory.cpp.
References createMaterial(), and createTexture().
| GLC_Material * GLC_Factory::createMaterial | ( | GLC_Texture * | pTexture | ) | const |
create a material textured with a texture
Definition at line 325 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | const QColor & | color | ) | const |
create a material with an ambient color
Definition at line 320 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | const GLfloat * | pAmbiantColor | ) | const |
create a material with an ambient color
Definition at line 315 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | ) | const |
Create default material.
Definition at line 310 of file glc_factory.cpp.
Referenced by createMaterial().
| GLC_3DRep GLC_Factory::createPoint | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | const |
Definition at line 97 of file glc_factory.cpp.
| GLC_3DRep GLC_Factory::createPoint | ( | const GLC_Point3d & | coord | ) | const |
Create a GLC_Point.
Definition at line 91 of file glc_factory.cpp.
| GLC_3DRep GLC_Factory::createPointSprite | ( | float | size, | |
| GLC_Material * | pMaterial | |||
| ) | const |
Create a GLC_PointSprite.
Definition at line 104 of file glc_factory.cpp.
| GLC_3DViewInstance GLC_Factory::createRectangle | ( | const GLC_Point3d & | point, | |
| const GLC_Vector3d & | normal, | |||
| double | l1, | |||
| double | l2 | |||
| ) |
Create a GLC_Rectangle from the given 3d point, normal and the given lenght.
Definition at line 166 of file glc_factory.cpp.
References createRectangle(), GLC_3DViewInstance::setMatrix(), and glc::Z_AXIS().
| GLC_3DRep GLC_Factory::createRectangle | ( | double | l1, | |
| double | l2 | |||
| ) |
Create a GLC_Rectangle.
Definition at line 160 of file glc_factory.cpp.
Referenced by createRectangle().
| GLC_3DRep GLC_Factory::createSphere | ( | double | radius | ) | const |
Create a GLC_Sphere.
Definition at line 154 of file glc_factory.cpp.
| GLC_Texture * GLC_Factory::createTexture | ( | const QImage & | image, | |
| const QString & | imageFileName = QString() | |||
| ) | const |
Create a GLC_Texture with a QImage.
Definition at line 347 of file glc_factory.cpp.
References m_pQGLContext.
| GLC_Texture * GLC_Factory::createTexture | ( | const QString & | textureFullFileName | ) | const |
Create a GLC_Texture.
Definition at line 342 of file glc_factory.cpp.
References m_pQGLContext.
Referenced by createMaterial(), and GLC_ImagePlane::GLC_ImagePlane().
| GLC_World GLC_Factory::createWorldFromFile | ( | QFile & | file, | |
| QStringList * | pAttachedFileName = NULL | |||
| ) | const |
Create a GLC_World from a QFile.
Definition at line 196 of file glc_factory.cpp.
References GLC_3dsToWorld::CreateWorldFrom3ds(), GLC_3dxmlToWorld::createWorldFrom3dxml(), GLC_BSRepToWorld::CreateWorldFromBSRep(), GLC_ColladaToWorld::CreateWorldFromCollada(), GLC_ObjToWorld::CreateWorldFromObj(), GLC_OffToWorld::CreateWorldFromOff(), GLC_StlToWorld::CreateWorldFromStl(), currentQuantum(), GLC_FileFormatException::FileNotSupported, GLC_ColladaToWorld::listOfAttachedFileName(), GLC_3dxmlToWorld::listOfAttachedFileName(), GLC_3dsToWorld::listOfAttachedFileName(), GLC_ObjToWorld::listOfAttachedFileName(), and m_pQGLContext.
| GLC_World GLC_Factory::createWorldStructureFrom3dxml | ( | QFile & | file | ) | const |
Create a GLC_World containing only the 3dxml structure.
Definition at line 271 of file glc_factory.cpp.
References GLC_3dxmlToWorld::createWorldFrom3dxml(), currentQuantum(), GLC_FileFormatException::FileNotSupported, and m_pQGLContext.
| void GLC_Factory::currentQuantum | ( | int | ) | const [signal] |
For progress bar management.
Referenced by create3DRepFromFile(), createWorldFromFile(), and createWorldStructureFrom3dxml().
| GLC_Factory * GLC_Factory::instance | ( | const QGLContext * | pContext = NULL |
) | [static] |
Get unique instance of the factory.
Definition at line 58 of file glc_factory.cpp.
References GLC_Factory(), m_pFactory, and m_pQGLContext.
Referenced by GLC_CuttingPlane::create3DviewInstance(), GLC_Axis::create3DviewInstance(), GLC_Octree::createBoxWithMaterial(), GLC_ImagePlane::GLC_ImagePlane(), GLC_3DRep::load(), and operator>>().
GLC_Factory * GLC_Factory::m_pFactory = NULL [static, private] |
The unique instance of the factory.
Definition at line 171 of file glc_factory.h.
Referenced by instance().
QGLContext * GLC_Factory::m_pQGLContext = NULL [static, private] |
The QGLContext attached to the factory (rendering context).
Definition at line 174 of file glc_factory.h.
Referenced by create3DRepFromFile(), createTexture(), createWorldFromFile(), createWorldStructureFrom3dxml(), GLC_Factory(), and instance().