GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Private Attributes | List of all members
GLC_RenderProperties Class Reference

GLC_RenderProperties encapsulate the render properties off all GLC_3DViewInstance class. More...

#include <glc_renderproperties.h>

Public Member Functions

Constructor / Destructor
 GLC_RenderProperties ()
 Default constructor.
 
 GLC_RenderProperties (const GLC_RenderProperties &)
 Copy constructor.
 
GLC_RenderPropertiesoperator= (const GLC_RenderProperties &)
 Assignement operator.
 
virtual ~GLC_RenderProperties ()
 Destructor.
 
Get Functions
bool isSelected () const
 Return true if it is selected.
 
glc::RenderMode renderingMode () const
 Return the rendering mode.
 
glc::RenderMode savedRenderingMode () const
 Return the saved rendering mode.
 
GLC_MaterialoverwriteMaterial () const
 Return an handle to the overwrite material.
 
float overwriteTransparency () const
 Return the overwrite transparency.
 
QSet< GLC_uint > * setOfSelectedPrimitivesId () const
 Return an handle to the set of selected primitives id of the current body.
 
bool setOfSelectedPrimitiveIdIsEmpty () const
 Return true if the set of selected primitive id is empty.
 
bool primitiveIsSelected (int index, GLC_uint id) const
 Return true if the specified primitive id of the specified body index is selected.
 
QHash< GLC_uint, GLC_Material * > * hashOfOverwritePrimitiveMaterials () const
 Return an handle to the overwrite primitive material Hash.
 
bool hashOfOverwritePrimitiveMaterialsIsEmpty () const
 Return true if the hash of overwrite primitive material is empty.
 
GLenum polyFaceMode () const
 Get the PolyFace mode.
 
GLenum polygonMode () const
 Get the Polygon mode.
 
glc::RenderFlag renderingFlag () const
 Return rendering flag render flag.
 
bool needToRenderWithTransparency () const
 Return true if rendering properties needs to render with transparency.
 
int currentBodyIndex () const
 Return the current body index.
 
bool isDefault () const
 Return true if this rendering properties has defaut value.
 
Set Functions
void clear ()
 Clear the content of the render properties and update materials usage.
 
void select (bool primitive)
 Select the instance.
 
void unselect (void)
 Unselect the instance.
 
void setRenderingMode (glc::RenderMode mode)
 Set the rendering mode.
 
void setOverwriteMaterial (GLC_Material *)
 Set the overwrite material.
 
void setOverwriteTransparency (float alpha)
 Set the overwrite transparency.
 
void addSetOfSelectedPrimitivesId (const QSet< GLC_uint > &, int body=0)
 Add the set of selected primitives id of the specified body.
 
void addSelectedPrimitive (GLC_uint, int body=0)
 Add a selected primitive of the specified body.
 
void clearSelectedPrimitives ()
 Clear selectedPrimitive Set.
 
void addOverwritePrimitiveMaterial (GLC_uint, GLC_Material *, int bodyIndex=0)
 Add an overwrite primitive material.
 
void clearOverwritePrimitiveMaterials ()
 Clear overwrite primitive materials.
 
void setPolygonMode (GLenum Face, GLenum Mode)
 Polygon's display style.
 
void setRenderingFlag (glc::RenderFlag flag)
 Set the rendering flag.
 
void setCurrentBodyIndex (int index)
 Set the current body index.
 
void useMaterial (GLC_Material *)
 Used the specified material.
 
void unUseMaterial (GLC_Material *)
 Unused the specified material.
 

Private Attributes

GLC_uint m_Uid
 The render properties uid : GLC_GenUserID (For GLC_Material usage)
 
bool m_IsSelected
 Flag to know if it is selected.
 
GLenum m_PolyFace
 OpenGL polygon rendering mode.
 
GLenum m_PolyMode
 
glc::RenderMode m_RenderMode
 Geometry rendering mode.
 
glc::RenderMode m_SavedRenderMode
 Geometry saved rendering mode.
 
GLC_Materialm_pOverwriteMaterial
 The overwrite material.
 
float m_OverwriteOpacity
 The overwrite opacity.
 
QHash< int, QSet< GLC_uint > * > * m_pBodySelectedPrimitvesId
 The selected primitive id regrouped by body.
 
QHash< int, QHash< GLC_uint,
GLC_Material * > * > * 
m_pOverwritePrimitiveMaterialMaps
 The overwrite primitive material mapping.
 
glc::RenderFlag m_RenderingFlag
 Transparent material render flag.
 
int m_CurrentBody
 The current rendere body.
 
QHash< GLC_Material *, int > m_MaterialsUsage
 The Hash table of overwrite primitive maped to the number of usages in this render properties.
 

Detailed Description

GLC_RenderProperties encapsulate the render properties off all GLC_3DViewInstance class.

Definition at line 67 of file glc_renderproperties.h.

Constructor & Destructor Documentation

GLC_RenderProperties::GLC_RenderProperties ( )

Default constructor.

Definition at line 27 of file glc_renderproperties.cpp.

GLC_RenderProperties::GLC_RenderProperties ( const GLC_RenderProperties renderProperties)
GLC_RenderProperties::~GLC_RenderProperties ( )
virtual

Destructor.

Definition at line 167 of file glc_renderproperties.cpp.

References clear().

Member Function Documentation

void GLC_RenderProperties::addOverwritePrimitiveMaterial ( GLC_uint  id,
GLC_Material pMaterial,
int  bodyIndex = 0 
)

Add an overwrite primitive material.

Definition at line 310 of file glc_renderproperties.cpp.

References m_pOverwritePrimitiveMaterialMaps, unUseMaterial(), and useMaterial().

void GLC_RenderProperties::addSelectedPrimitive ( GLC_uint  id,
int  body = 0 
)

Add a selected primitive of the specified body.

Definition at line 278 of file glc_renderproperties.cpp.

References m_pBodySelectedPrimitvesId.

void GLC_RenderProperties::addSetOfSelectedPrimitivesId ( const QSet< GLC_uint > &  set,
int  body = 0 
)

Add the set of selected primitives id of the specified body.

Definition at line 260 of file glc_renderproperties.cpp.

References m_pBodySelectedPrimitvesId.

void GLC_RenderProperties::clear ( void  )

Clear the content of the render properties and update materials usage.

Definition at line 219 of file glc_renderproperties.cpp.

References clearOverwritePrimitiveMaterials(), clearSelectedPrimitives(), GLC_Material::delUsage(), GLC_Material::isUnused(), m_pOverwriteMaterial, and m_Uid.

Referenced by operator=(), and ~GLC_RenderProperties().

void GLC_RenderProperties::clearOverwritePrimitiveMaterials ( )
void GLC_RenderProperties::clearSelectedPrimitives ( )

Clear selectedPrimitive Set.

Definition at line 294 of file glc_renderproperties.cpp.

References m_pBodySelectedPrimitvesId.

Referenced by clear().

int GLC_RenderProperties::currentBodyIndex ( ) const
inline

Return the current body index.

Definition at line 159 of file glc_renderproperties.h.

QHash<GLC_uint, GLC_Material*>* GLC_RenderProperties::hashOfOverwritePrimitiveMaterials ( ) const
inline

Return an handle to the overwrite primitive material Hash.

Definition at line 129 of file glc_renderproperties.h.

Referenced by GLC_Mesh::primitiveRenderLoop(), GLC_Mesh::vboDrawSelectedPrimitivesGroupOf(), and GLC_Mesh::vertexArrayDrawSelectedPrimitivesGroupOf().

bool GLC_RenderProperties::hashOfOverwritePrimitiveMaterialsIsEmpty ( ) const
inline

Return true if the hash of overwrite primitive material is empty.

Definition at line 138 of file glc_renderproperties.h.

Referenced by GLC_Mesh::glDraw(), GLC_Mesh::vboDrawSelectedPrimitivesGroupOf(), and GLC_Mesh::vertexArrayDrawSelectedPrimitivesGroupOf().

bool GLC_RenderProperties::isDefault ( ) const
bool GLC_RenderProperties::isSelected ( void  ) const
inline
bool GLC_RenderProperties::needToRenderWithTransparency ( ) const
GLC_RenderProperties & GLC_RenderProperties::operator= ( const GLC_RenderProperties renderProperties)
GLC_Material* GLC_RenderProperties::overwriteMaterial ( ) const
inline
float GLC_RenderProperties::overwriteTransparency ( ) const
inline
GLenum GLC_RenderProperties::polyFaceMode ( ) const
inline

Get the PolyFace mode.

PolyFace Mode can Be : GL_FRONT_AND_BACK, GL_FRONT, or GL_BACK

Definition at line 143 of file glc_renderproperties.h.

GLenum GLC_RenderProperties::polygonMode ( ) const
inline

Get the Polygon mode.

Polygon Mode can Be : GL_POINT, GL_LINE, or GL_FILL

Definition at line 148 of file glc_renderproperties.h.

bool GLC_RenderProperties::primitiveIsSelected ( int  index,
GLC_uint  id 
) const

Return true if the specified primitive id of the specified body index is selected.

Definition at line 249 of file glc_renderproperties.cpp.

References m_CurrentBody, and m_pBodySelectedPrimitvesId.

glc::RenderFlag GLC_RenderProperties::renderingFlag ( ) const
inline
glc::RenderMode GLC_RenderProperties::renderingMode ( ) const
inline
glc::RenderMode GLC_RenderProperties::savedRenderingMode ( ) const
inline

Return the saved rendering mode.

Definition at line 101 of file glc_renderproperties.h.

Referenced by GLC_Mesh::glDraw().

void GLC_RenderProperties::select ( bool  primitive)
inline

Select the instance.

Definition at line 283 of file glc_renderproperties.h.

References m_IsSelected, m_RenderMode, m_SavedRenderMode, and glc::PrimitiveSelected.

void GLC_RenderProperties::setCurrentBodyIndex ( int  index)
inline

Set the current body index.

Definition at line 227 of file glc_renderproperties.h.

Referenced by GLC_3DViewInstance::render(), and GLC_3DViewInstance::renderForBodySelection().

bool GLC_RenderProperties::setOfSelectedPrimitiveIdIsEmpty ( ) const
inline

Return true if the set of selected primitive id is empty.

Definition at line 122 of file glc_renderproperties.h.

Referenced by GLC_Mesh::glDraw().

QSet<GLC_uint>* GLC_RenderProperties::setOfSelectedPrimitivesId ( ) const
inline

Return an handle to the set of selected primitives id of the current body.

Definition at line 113 of file glc_renderproperties.h.

Referenced by GLC_Mesh::vboDrawSelectedPrimitivesGroupOf(), and GLC_Mesh::vertexArrayDrawSelectedPrimitivesGroupOf().

void GLC_RenderProperties::setOverwriteMaterial ( GLC_Material pMaterial)
void GLC_RenderProperties::setOverwriteTransparency ( float  alpha)
inline

Set the overwrite transparency.

Definition at line 195 of file glc_renderproperties.h.

Referenced by GLC_3dxmlToWorld::loadGraphicProperties(), and GLC_3dxmlToWorld::loadV3DefaultViewProperty().

void GLC_RenderProperties::setPolygonMode ( GLenum  Face,
GLenum  Mode 
)
inline

Polygon's display style.

Face Polygon Mode can be : GL_FRONT_AND_BACK, GL_FRONT, or GL_BACK mode can be : GL_POINT, GL_LINE, or GL_FILL

Definition at line 216 of file glc_renderproperties.h.

void GLC_RenderProperties::setRenderingFlag ( glc::RenderFlag  flag)
inline

Set the rendering flag.

Definition at line 223 of file glc_renderproperties.h.

Referenced by GLC_RepCrossMover::glDraw(), GLC_RepTrackBallMover::glDraw(), and GLC_3DViewInstance::render().

void GLC_RenderProperties::setRenderingMode ( glc::RenderMode  mode)
inline
void GLC_RenderProperties::unselect ( void  )
inline

Unselect the instance.

Definition at line 294 of file glc_renderproperties.h.

References m_IsSelected, m_RenderMode, m_SavedRenderMode, and glc::PrimitiveSelected.

void GLC_RenderProperties::unUseMaterial ( GLC_Material pMaterial)
inline

Unused the specified material.

Definition at line 319 of file glc_renderproperties.h.

References GLC_Material::delUsage(), GLC_Material::isUnused(), m_MaterialsUsage, and m_Uid.

Referenced by addOverwritePrimitiveMaterial().

void GLC_RenderProperties::useMaterial ( GLC_Material pMaterial)
inline

Used the specified material.

Definition at line 303 of file glc_renderproperties.h.

References GLC_Material::addUsage(), m_MaterialsUsage, and m_Uid.

Referenced by addOverwritePrimitiveMaterial().

Member Data Documentation

int GLC_RenderProperties::m_CurrentBody
private

The current rendere body.

Definition at line 275 of file glc_renderproperties.h.

Referenced by operator=(), and primitiveIsSelected().

bool GLC_RenderProperties::m_IsSelected
private

Flag to know if it is selected.

Definition at line 247 of file glc_renderproperties.h.

Referenced by operator=(), select(), and unselect().

QHash<GLC_Material*, int> GLC_RenderProperties::m_MaterialsUsage
private

The Hash table of overwrite primitive maped to the number of usages in this render properties.

Definition at line 278 of file glc_renderproperties.h.

Referenced by clearOverwritePrimitiveMaterials(), GLC_RenderProperties(), unUseMaterial(), and useMaterial().

float GLC_RenderProperties::m_OverwriteOpacity
private

The overwrite opacity.

Definition at line 263 of file glc_renderproperties.h.

Referenced by isDefault(), needToRenderWithTransparency(), and operator=().

QHash<int, QSet<GLC_uint>* >* GLC_RenderProperties::m_pBodySelectedPrimitvesId
private

The selected primitive id regrouped by body.

Definition at line 266 of file glc_renderproperties.h.

Referenced by addSelectedPrimitive(), addSetOfSelectedPrimitivesId(), clearSelectedPrimitives(), GLC_RenderProperties(), operator=(), and primitiveIsSelected().

GLenum GLC_RenderProperties::m_PolyFace
private

OpenGL polygon rendering mode.

Definition at line 250 of file glc_renderproperties.h.

Referenced by operator=().

GLenum GLC_RenderProperties::m_PolyMode
private

Definition at line 251 of file glc_renderproperties.h.

Referenced by operator=().

GLC_Material* GLC_RenderProperties::m_pOverwriteMaterial
private
QHash<int, QHash<GLC_uint, GLC_Material* >* >* GLC_RenderProperties::m_pOverwritePrimitiveMaterialMaps
private
glc::RenderFlag GLC_RenderProperties::m_RenderingFlag
private

Transparent material render flag.

Definition at line 272 of file glc_renderproperties.h.

Referenced by operator=().

glc::RenderMode GLC_RenderProperties::m_RenderMode
private

Geometry rendering mode.

Definition at line 254 of file glc_renderproperties.h.

Referenced by needToRenderWithTransparency(), operator=(), select(), and unselect().

glc::RenderMode GLC_RenderProperties::m_SavedRenderMode
private

Geometry saved rendering mode.

Definition at line 257 of file glc_renderproperties.h.

Referenced by clearOverwritePrimitiveMaterials(), operator=(), select(), and unselect().

GLC_uint GLC_RenderProperties::m_Uid
private

The render properties uid : GLC_GenUserID (For GLC_Material usage)

Definition at line 244 of file glc_renderproperties.h.

Referenced by clear(), clearOverwritePrimitiveMaterials(), GLC_RenderProperties(), operator=(), setOverwriteMaterial(), unUseMaterial(), and useMaterial().


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

©2005-2013 Laurent Ribon