GLC_Factory Class Reference

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

#include <glc_factory.h>

List of all members.

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

Static Public Member Functions

static GLC_Factoryinstance (const QGLContext *pContext=NULL)
 Get unique instance of the factory.

Protected Member Functions

 GLC_Factory (const QGLContext *)
 Constructor.

Static Private Attributes

static GLC_Factorym_pFactory = NULL
 The unique instance of the factory.
static QGLContext * m_pQGLContext = NULL
 The QGLContext attached to the factory (rendering context).

Detailed Description

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

Definition at line 62 of file glc_factory.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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

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

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

Member Data Documentation

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


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

SourceForge.net Logo

©2005-2010 Laurent Ribon