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. | |
Static Public Member Functions | |
| static GLC_Factory * | instance () |
| Get unique instance of the factory. | |
Protected Member Functions | |
| GLC_Factory () | |
| Constructor. | |
Private Member Functions | |
| void | loadPlugins () |
| Load GLC_lib plugins. | |
Static Private Attributes | |
| static GLC_Factory * | m_pFactory = NULL |
| The unique instance of the factory. | |
| static QList < GLC_WorldReaderPlugin * > | m_WorldReaderPluginList |
| The list off worldReader plugins. | |
| static QSet< QString > | m_SupportedExtensionSet |
| The supported extension set. | |
Get Functions | |
|
| |
| static QList < GLC_WorldReaderPlugin * > | worldReaderPlugins () |
| Return the list of world reader plugin. | |
| static bool | canBeLoaded (const QString &extension) |
| Return true if the given file extension can be loaded. | |
| static GLC_WorldReaderHandler * | loadingHandler (const QString &fileName) |
| Return an handle to the plugin tu use for the given file. | |
| GLC_3DRep | createPoint (const GLC_Point3d &coord) const |
| Create a GLC_Point. | |
| GLC_3DRep | createPoint (double x, double y, double z) const |
| GLC_3DRep | createPointCloud (const GLfloatVector &data, const QColor &color) |
| Create a cloud of points. | |
| GLC_3DRep | createPointCloud (const QList< GLC_Point3d > &pointList, const QColor &color) |
| GLC_3DRep | createPointCloud (const QList< GLC_Point3df > &pointList, const QColor &color) |
| 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, bool GetExtRefName=false) const |
| Create a GLC_World containing only the 3dxml structure. | |
| GLC_3DRep | create3DRepFromFile (const QString &) const |
| Create 3DRep from 3dxml or 3DRep file. | |
| GLC_FileLoader * | createFileLoader () const |
| Create a GLC_FileLoader. | |
| 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. | |
GLC_Factory : Factory for all geometrical objects this class is a singleton.
Definition at line 67 of file glc_factory.h.
| GLC_Factory::GLC_Factory | ( | ) | [protected] |
Constructor.
Definition at line 69 of file glc_factory.cpp.
References loadPlugins().
Referenced by instance().
| GLC_Factory::~GLC_Factory | ( | ) |
Destructor.
Definition at line 75 of file glc_factory.cpp.
| bool GLC_Factory::canBeLoaded | ( | const QString & | extension | ) | [static] |
Return true if the given file extension can be loaded.
Definition at line 427 of file glc_factory.cpp.
References instance(), m_pFactory, and m_SupportedExtensionSet.
Referenced by GLC_FileLoader::createWorldFromFile(), and loadingHandler().
| GLC_3DRep GLC_Factory::create3DRepFromFile | ( | const QString & | fileName | ) | const |
Create 3DRep from 3dxml or 3DRep file.
Definition at line 247 of file glc_factory.cpp.
References GLC_3dxmlToWorld::create3DrepFrom3dxmlRep(), and currentQuantum().
Referenced by GLC_3DRep::load().
| GLC_3DViewInstance GLC_Factory::createBox | ( | const GLC_BoundingBox & | boundingBox | ) | const |
Definition at line 146 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 139 of file glc_factory.cpp.
Referenced by GLC_Octree::createBoxWithMaterial().
Create a GLC_Circle.
Definition at line 133 of file glc_factory.cpp.
| GLC_3DRep GLC_Factory::createCone | ( | double | radius, | |
| double | length | |||
| ) | const |
Create a GLC_Cone.
Definition at line 165 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 196 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 158 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 309 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::TSR, GLC_MoverController::TurnTable, and GLC_MoverController::Zoom.
| GLC_FileLoader * GLC_Factory::createFileLoader | ( | ) | const |
Create a GLC_FileLoader.
Definition at line 262 of file glc_factory.cpp.
Referenced by createWorldFromFile().
| GLC_3DRep GLC_Factory::createLine | ( | const GLC_Point3d & | point1, | |
| const GLC_Point3d & | point2 | |||
| ) | const |
Create a GLC_Line.
Definition at line 127 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | const QImage & | image | ) | const |
create a material textured with a QImage
Definition at line 293 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 287 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 282 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | const QColor & | color | ) | const |
create a material with an ambient color
Definition at line 277 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | const GLfloat * | pAmbiantColor | ) | const |
create a material with an ambient color
Definition at line 272 of file glc_factory.cpp.
| GLC_Material * GLC_Factory::createMaterial | ( | ) | const |
Create default material.
Definition at line 267 of file glc_factory.cpp.
Referenced by createMaterial().
| GLC_3DRep GLC_Factory::createPoint | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | const |
Definition at line 90 of file glc_factory.cpp.
| GLC_3DRep GLC_Factory::createPoint | ( | const GLC_Point3d & | coord | ) | const |
Create a GLC_Point.
Definition at line 84 of file glc_factory.cpp.
| GLC_3DRep GLC_Factory::createPointCloud | ( | const QList< GLC_Point3df > & | pointList, | |
| const QColor & | color | |||
| ) |
Definition at line 112 of file glc_factory.cpp.
References GLC_PointCloud::addPoint(), and GLC_Geometry::setWireColor().
| GLC_3DRep GLC_Factory::createPointCloud | ( | const QList< GLC_Point3d > & | pointList, | |
| const QColor & | color | |||
| ) |
Definition at line 104 of file glc_factory.cpp.
References GLC_PointCloud::addPoint(), and GLC_Geometry::setWireColor().
| GLC_3DRep GLC_Factory::createPointCloud | ( | const GLfloatVector & | data, | |
| const QColor & | color | |||
| ) |
Create a cloud of points.
Definition at line 96 of file glc_factory.cpp.
References GLC_PointCloud::addPoint(), and GLC_Geometry::setWireColor().
| GLC_3DRep GLC_Factory::createPointSprite | ( | float | size, | |
| GLC_Material * | pMaterial | |||
| ) | const |
Create a GLC_PointSprite.
Definition at line 121 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 183 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 177 of file glc_factory.cpp.
Referenced by createRectangle().
| GLC_3DRep GLC_Factory::createSphere | ( | double | radius | ) | const |
Create a GLC_Sphere.
Definition at line 171 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 304 of file glc_factory.cpp.
| GLC_Texture * GLC_Factory::createTexture | ( | const QString & | textureFullFileName | ) | const |
Create a GLC_Texture.
Definition at line 299 of file glc_factory.cpp.
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 213 of file glc_factory.cpp.
References createFileLoader(), GLC_FileLoader::createWorldFromFile(), and currentQuantum().
| GLC_World GLC_Factory::createWorldStructureFrom3dxml | ( | QFile & | file, | |
| bool | GetExtRefName = false | |||
| ) | const |
Create a GLC_World containing only the 3dxml structure.
Definition at line 223 of file glc_factory.cpp.
References GLC_3dxmlToWorld::createWorldFrom3dxml(), currentQuantum(), and GLC_FileFormatException::FileNotSupported.
| void GLC_Factory::currentQuantum | ( | int | ) | const [signal] |
For progress bar management.
Referenced by create3DRepFromFile(), createWorldFromFile(), and createWorldStructureFrom3dxml().
| GLC_Factory * GLC_Factory::instance | ( | ) | [static] |
Get unique instance of the factory.
Definition at line 55 of file glc_factory.cpp.
References GLC_Factory(), and m_pFactory.
Referenced by canBeLoaded(), GLC_CuttingPlane::create3DviewInstance(), GLC_Axis::create3DviewInstance(), GLC_Octree::createBoxWithMaterial(), GLC_ImagePlane::GLC_ImagePlane(), GLC_3DRep::load(), loadingHandler(), and worldReaderPlugins().
| GLC_WorldReaderHandler * GLC_Factory::loadingHandler | ( | const QString & | fileName | ) | [static] |
Return an handle to the plugin tu use for the given file.
Definition at line 437 of file glc_factory.cpp.
References canBeLoaded(), instance(), GLC_WorldReaderPlugin::keys(), m_pFactory, m_WorldReaderPluginList, and GLC_WorldReaderPlugin::readerHandler().
Referenced by GLC_FileLoader::createWorldFromFile().
| void GLC_Factory::loadPlugins | ( | ) | [private] |
Load GLC_lib plugins.
Definition at line 394 of file glc_factory.cpp.
References GLC_WorldReaderPlugin::keys(), m_SupportedExtensionSet, and m_WorldReaderPluginList.
Referenced by GLC_Factory().
| QList< GLC_WorldReaderPlugin * > GLC_Factory::worldReaderPlugins | ( | ) | [static] |
Return the list of world reader plugin.
Definition at line 418 of file glc_factory.cpp.
References instance(), m_pFactory, and m_WorldReaderPluginList.
GLC_Factory * GLC_Factory::m_pFactory = NULL [static, private] |
The unique instance of the factory.
Definition at line 199 of file glc_factory.h.
Referenced by canBeLoaded(), instance(), loadingHandler(), and worldReaderPlugins().
QSet< QString > GLC_Factory::m_SupportedExtensionSet [static, private] |
The supported extension set.
Definition at line 205 of file glc_factory.h.
Referenced by canBeLoaded(), and loadPlugins().
QList< GLC_WorldReaderPlugin * > GLC_Factory::m_WorldReaderPluginList [static, private] |
The list off worldReader plugins.
Definition at line 202 of file glc_factory.h.
Referenced by loadingHandler(), loadPlugins(), and worldReaderPlugins().