GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes | List of all members
GLC_Factory Class Reference

GLC_Factory : Factory for all geometrical objects this class is a singleton. More...

#include <glc_factory.h>

+ Inheritance diagram for GLC_Factory:

Signals

void currentQuantum (int) const
 For progress bar management.
 

Public Member Functions

 ~GLC_Factory ()
 Destructor.
 

Static Public Member Functions

static GLC_Factoryinstance ()
 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_Factorym_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_WorldReaderHandlerloadingHandler (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_FileLoadercreateFileLoader () const
 Create a GLC_FileLoader.
 
GLC_MaterialcreateMaterial () const
 Create default material.
 
GLC_MaterialcreateMaterial (const GLfloat *pAmbiantColor) const
 create a material with an ambient color
 
GLC_MaterialcreateMaterial (const QColor &color) const
 create a material with an ambient color
 
GLC_MaterialcreateMaterial (GLC_Texture *pTexture) const
 create a material textured with a texture
 
GLC_MaterialcreateMaterial (const QString &textureFullFileName) const
 create a material textured with a image file name
 
GLC_MaterialcreateMaterial (const QImage &) const
 create a material textured with a QImage
 
GLC_TexturecreateTexture (const QString &textureFullFileName) const
 Create a GLC_Texture.
 
GLC_TexturecreateTexture (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.
 

Detailed Description

GLC_Factory : Factory for all geometrical objects this class is a singleton.

Definition at line 67 of file glc_factory.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

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_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().

GLC_3DViewInstance GLC_Factory::createBox ( const GLC_BoundingBox boundingBox) const
GLC_3DRep GLC_Factory::createCircle ( double  radius,
double  angle = 2 * glc::PI 
) const

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 
)
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

Create default material.

Definition at line 267 of file glc_factory.cpp.

Referenced by createMaterial().

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 QColor &  color) const

create a material with an ambient color

Definition at line 277 of file glc_factory.cpp.

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 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 ( 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_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::createPoint ( double  x,
double  y,
double  z 
) const

Definition at line 90 of file glc_factory.cpp.

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::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 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::createPointSprite ( float  size,
GLC_Material pMaterial 
) const

Create a GLC_PointSprite.

Definition at line 121 of file glc_factory.cpp.

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_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::createSphere ( double  radius) const

Create a GLC_Sphere.

Definition at line 171 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_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_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
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.

Member Data Documentation

GLC_Factory * GLC_Factory::m_pFactory = NULL
staticprivate

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
staticprivate

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
staticprivate

The list off worldReader plugins.

Definition at line 202 of file glc_factory.h.

Referenced by loadingHandler(), loadPlugins(), and worldReaderPlugins().


The documentation for this class was generated from the following files:

©2005-2013 Laurent Ribon