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_RenderProperties & | operator= (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_Material * | overwriteMaterial () 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_Material * | m_pOverwriteMaterial |
| The overwrite material. | |
| float | m_OverwriteTransparency |
| The overwrite transparency. | |
| 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. | |
GLC_RenderProperties encapsulate the render properties off all GLC_3DViewInstance class.
Definition at line 67 of file glc_renderproperties.h.
| GLC_RenderProperties::GLC_RenderProperties | ( | ) |
Default constructor.
Definition at line 29 of file glc_renderproperties.cpp.
| GLC_RenderProperties::GLC_RenderProperties | ( | const GLC_RenderProperties & | renderProperties | ) |
Copy constructor.
Definition at line 48 of file glc_renderproperties.cpp.
References GLC_Material::addUsage(), m_MaterialsUsage, m_pBodySelectedPrimitvesId, m_pOverwriteMaterial, m_pOverwritePrimitiveMaterialMaps, and m_Uid.
| GLC_RenderProperties::~GLC_RenderProperties | ( | ) | [virtual] |
| void GLC_RenderProperties::addOverwritePrimitiveMaterial | ( | GLC_uint | id, | |
| GLC_Material * | pMaterial, | |||
| int | bodyIndex = 0 | |||
| ) |
Add an overwrite primitive material.
Definition at line 312 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 280 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 262 of file glc_renderproperties.cpp.
References m_pBodySelectedPrimitvesId.
| void GLC_RenderProperties::clear | ( | ) |
Clear the content of the render properties and update materials usage.
Definition at line 221 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 | ( | ) |
Clear overwrite primitive materials.
Definition at line 358 of file glc_renderproperties.cpp.
References GLC_Material::delUsage(), GLC_Material::isUnused(), m_MaterialsUsage, m_pOverwritePrimitiveMaterialMaps, and m_Uid.
Referenced by clear().
| void GLC_RenderProperties::clearSelectedPrimitives | ( | ) |
Clear selectedPrimitive Set.
Definition at line 296 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 |
Return true if this rendering properties has defaut value.
Definition at line 213 of file glc_renderproperties.cpp.
References m_OverwriteTransparency, and m_pOverwriteMaterial.
Referenced by GLC_StructOccurence::detach(), GLC_WorldTo3dxml::exportAssemblyFromOccurence(), GLC_StructOccurence::GLC_StructOccurence(), and GLC_WorldTo3dxml::writeOccurenceDefaultViewProperty().
| bool GLC_RenderProperties::isSelected | ( | ) | const [inline] |
Return true if it is selected.
Definition at line 93 of file glc_renderproperties.h.
Referenced by GLC_3DViewCollection::glDrawInstancesOf(), GLC_Geometry::glPropGeom(), and GLC_Geometry::render().
| bool GLC_RenderProperties::needToRenderWithTransparency | ( | ) | const |
Return true if rendering properties needs to render with transparency.
Definition at line 175 of file glc_renderproperties.cpp.
References GLC_Material::isTransparent(), m_OverwriteTransparency, m_pOverwriteMaterial, m_pOverwritePrimitiveMaterialMaps, m_RenderMode, glc::OverwriteMaterial, glc::OverwritePrimitiveMaterial, glc::OverwriteTransparency, and glc::PrimitiveSelected.
Referenced by GLC_3DViewInstance::hasTransparentMaterials(), and GLC_3DViewInstance::isTransparent().
| GLC_RenderProperties & GLC_RenderProperties::operator= | ( | const GLC_RenderProperties & | renderProperties | ) |
Assignement operator.
Definition at line 106 of file glc_renderproperties.cpp.
References GLC_Material::addUsage(), clear(), m_CurrentBody, m_IsSelected, m_OverwriteTransparency, m_pBodySelectedPrimitvesId, m_PolyFace, m_PolyMode, m_pOverwriteMaterial, m_pOverwritePrimitiveMaterialMaps, m_RenderingFlag, m_RenderMode, m_SavedRenderMode, and m_Uid.
| GLC_Material* GLC_RenderProperties::overwriteMaterial | ( | ) | const [inline] |
Return an handle to the overwrite material.
Definition at line 105 of file glc_renderproperties.h.
Referenced by GLC_3DViewInstance::isTransparent(), and GLC_Mesh::OverwriteMaterialRenderLoop().
| float GLC_RenderProperties::overwriteTransparency | ( | ) | const [inline] |
Return the overwrite transparency.
Definition at line 109 of file glc_renderproperties.h.
Referenced by GLC_Mesh::OverwriteTransparencyRenderLoop(), and GLC_WorldTo3dxml::writeOccurenceDefaultViewProperty().
| 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 251 of file glc_renderproperties.cpp.
References m_CurrentBody, and m_pBodySelectedPrimitvesId.
| glc::RenderFlag GLC_RenderProperties::renderingFlag | ( | ) | const [inline] |
Return rendering flag render flag.
Definition at line 152 of file glc_renderproperties.h.
Referenced by GLC_Mesh::glDraw(), GLC_Mesh::normalRenderLoop(), GLC_Mesh::OverwriteMaterialRenderLoop(), GLC_Mesh::OverwriteTransparencyRenderLoop(), GLC_Mesh::primitiveRenderLoop(), GLC_Mesh::primitiveSelectedRenderLoop(), and GLC_Geometry::render().
| glc::RenderMode GLC_RenderProperties::renderingMode | ( | ) | const [inline] |
Return the rendering mode.
Definition at line 97 of file glc_renderproperties.h.
Referenced by GLC_Mesh::glDraw(), GLC_3DViewInstance::isTransparent(), GLC_3DViewInstance::renderForBodySelection(), and GLC_3DViewInstance::renderForPrimitiveSelection().
| 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 | ) |
Set the overwrite material.
Definition at line 237 of file glc_renderproperties.cpp.
References GLC_Material::addUsage(), GLC_Material::delUsage(), GLC_Material::isUnused(), m_pOverwriteMaterial, and m_Uid.
Referenced by GLC_3dxmlToWorld::loadDefaultViewProperty().
| void GLC_RenderProperties::setOverwriteTransparency | ( | float | alpha | ) | [inline] |
Set the overwrite transparency.
Definition at line 195 of file glc_renderproperties.h.
Referenced by GLC_3dxmlToWorld::loadDefaultViewProperty().
| 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_RepTrackBallMover::glDraw(), and GLC_3DViewInstance::render().
| void GLC_RenderProperties::setRenderingMode | ( | glc::RenderMode | mode | ) | [inline] |
Set the rendering mode.
Definition at line 188 of file glc_renderproperties.h.
Referenced by GLC_3dxmlToWorld::loadDefaultViewProperty(), GLC_3DViewInstance::renderForBodySelection(), and GLC_3DViewInstance::renderForPrimitiveSelection().
| 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().
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_OverwriteTransparency [private] |
The overwrite transparency.
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=().
The overwrite material.
Definition at line 260 of file glc_renderproperties.h.
Referenced by clear(), GLC_RenderProperties(), isDefault(), needToRenderWithTransparency(), operator=(), and setOverwriteMaterial().
QHash<int, QHash<GLC_uint, GLC_Material* >* >* GLC_RenderProperties::m_pOverwritePrimitiveMaterialMaps [private] |
The overwrite primitive material mapping.
Definition at line 269 of file glc_renderproperties.h.
Referenced by addOverwritePrimitiveMaterial(), clearOverwritePrimitiveMaterials(), GLC_RenderProperties(), needToRenderWithTransparency(), and operator=().
Transparent material render flag.
Definition at line 272 of file glc_renderproperties.h.
Referenced by operator=().
Geometry rendering mode.
Definition at line 254 of file glc_renderproperties.h.
Referenced by needToRenderWithTransparency(), operator=(), select(), and unselect().
Geometry saved rendering mode.
Definition at line 257 of file glc_renderproperties.h.
Referenced by 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().