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

GLC_3DViewCollection : GLC_3DViewInstance flat collection. More...

#include <glc_3dviewcollection.h>

Public Member Functions

Constructor / Destructor
 GLC_3DViewCollection ()
 Default constructor.
 
virtual ~GLC_3DViewCollection ()
 Destructor.
 
Get Functions
bool isEmpty () const
 Return true if the collection is empty.
 
int size (void) const
 Return the number of Node in the collection.
 
QList< GLC_3DViewInstance * > instancesHandle ()
 Return all GLC_3DViewInstance from collection.
 
QList< GLC_3DViewInstance * > visibleInstancesHandle ()
 Return all visible GLC_3DViewInstance from the collection.
 
QList< GLC_3DViewInstance * > viewableInstancesHandle ()
 Return all viewable GLC_3DViewInstance from the collection.
 
GLC_3DViewInstanceinstanceHandle (GLC_uint Key)
 Return a GLC_3DViewInstance from collection.
 
GLC_BoundingBox boundingBox (bool allObject=false)
 Return the entire collection Bounding Box.
 
int selectionSize (void) const
 Return the number of Node in the selection Hash.
 
PointerViewInstanceHashselection ()
 Get the Hash table of Selected Nodes.
 
bool contains (GLC_uint key) const
 Return true if the Instance Id is in the collection.
 
bool isSelected (GLC_uint key) const
 Return true if the element is selected.
 
bool showState () const
 Return the showing state.
 
int drawableObjectsSize () const
 Return the number of drawable objects.
 
GLC_uint shadingGroup (GLC_uint key) const
 Return the element shading group.
 
bool isInAShadingGroup (GLC_uint key) const
 Return true if the element is in a shading group.
 
QList< QString > instanceNamesFromShadingGroup (GLuint) const
 Return instances name from the specified shading group.
 
int numberOfUsedShadingGroup () const
 Return the number of used shading group.
 
bool spacePartitioningIsUsed () const
 Return true if the space partitioning is used.
 
GLC_SpacePartitioningspacePartitioningHandle ()
 Return an handle to the space partitioning.
 
bool isViewable () const
 Return true if the collection is viewable.
 
Set Functions
bool bindShader (GLC_uint shaderId)
 Bind the specified shader to the collection.
 
bool unBindShader (GLC_uint shaderId)
 Unbind the specified shader from the collection.
 
bool unBindAllShader ()
 Unbind All shader.
 
bool add (const GLC_3DViewInstance &, GLC_uint shaderID=0)
 Add a GLC_3DViewInstance in the collection.
 
void changeShadingGroup (GLC_uint instanceId, GLC_uint shaderId)
 Change instance shading group.
 
bool remove (GLC_uint instanceId)
 Remove a GLC_Geometry from the collection and delete it.
 
void clear (void)
 Remove and delete all GLC_Geometry from the collection.
 
bool select (GLC_uint instanceId, bool primitive=false)
 Select a Instance.
 
void selectAll (bool allShowState=false)
 Select all instances in current show state or in all show state.
 
bool unselect (GLC_uint instanceId)
 unselect a Instance
 
void unselectAll ()
 unselect all Instance
 
void setPolygonModeForAll (GLenum face, GLenum mode)
 Set the polygon mode for all Instance.
 
void setVisibility (const GLC_uint instanceId, const bool visible)
 Set Instance visibility.
 
void showAll ()
 Show all instances of the collection.
 
void hideAll ()
 Hide all instances of collection.
 
void swapShowState ()
 Set the Show or noShow state.
 
void setLodUsage (const bool usage, GLC_Viewport *pView)
 Set the LOD usage.
 
void bindSpacePartitioning (GLC_SpacePartitioning *)
 Bind the space partitioning.
 
void unbindSpacePartitioning ()
 Unbind the space partitioning.
 
void setSpacePartitionningUsage (bool use)
 Use the space partitioning.
 
void updateInstanceViewableState (GLC_Matrix4x4 *pMatrix=NULL)
 Update the instance viewable state.
 
void updateInstanceViewableState (const GLC_Frustum &)
 Update the instance viewable state with the specified frustum.
 
void updateSpacePartitionning ()
 Update space partitionning.
 
void setAttachedViewport (GLC_Viewport *pViewport)
 Set the attached viewport of this collection.
 
void setViewable (bool viewable)
 Set the collection viewable state.
 
void setVboUsage (bool usage)
 Set VBO usage.
 

Private Attributes

ViewInstancesHash m_3DViewInstanceHash
 GLC_3DViewInstance Hash Table.
 
PointerViewInstanceHash m_SelectedInstances
 Selected Node Hash Table.
 
HashList m_ShadedPointerViewInstanceHash
 List of other Node Hash Table.
 
ShaderIdToInstancesId m_ShaderGroup
 Shader groups hash.
 
PointerViewInstanceHash m_MainInstances
 Normal Node Hash Table.
 
bool m_IsInShowSate
 Show State.
 
bool m_UseLod
 Level of detail usage.
 
GLC_Viewportm_pViewport
 The viewport associted to the collection for LOD Usage.
 
GLC_SpacePartitioningm_pSpacePartitioning
 The space partitioning.
 
bool m_UseSpacePartitioning
 The space partition usage.
 
bool m_IsViewable
 Viewable state.
 

OpenGL Functions

void render (GLuint, glc::RenderFlag)
 Display the specified collection group.
 
void renderShaderGroup (glc::RenderFlag)
 Display all shader group.
 
void glDraw (GLC_uint groupID, glc::RenderFlag renderFlag)
 Display collection's member.
 
void glDrawInstancesOf (PointerViewInstanceHash *, glc::RenderFlag)
 Draw instances of a PointerViewInstanceHash.
 

Detailed Description

GLC_3DViewCollection : GLC_3DViewInstance flat collection.

An GLC_3DViewCollection contains :

Definition at line 63 of file glc_3dviewcollection.h.

Constructor & Destructor Documentation

GLC_3DViewCollection::GLC_3DViewCollection ( )

Default constructor.

Definition at line 41 of file glc_3dviewcollection.cpp.

GLC_3DViewCollection::~GLC_3DViewCollection ( )
virtual

Destructor.

Delete all Node in the Hash Table and clear the Hash Table

Definition at line 56 of file glc_3dviewcollection.cpp.

References clear().

Member Function Documentation

bool GLC_3DViewCollection::add ( const GLC_3DViewInstance node,
GLC_uint  shaderID = 0 
)

Add a GLC_3DViewInstance in the collection.

return true if success false otherwise If shading group is specified, add instance in desire shading group

Definition at line 130 of file glc_3dviewcollection.cpp.

References GLC_Object::id(), GLC_3DViewInstance::isSelected(), m_3DViewInstanceHash, m_MainInstances, m_SelectedInstances, m_ShadedPointerViewInstanceHash, and m_ShaderGroup.

Referenced by GLC_3DWidgetManagerHandle::add3DViewInstance(), GLC_StructOccurence::create3DViewInstance(), and GLC_Octree::createBoxWithMaterial().

bool GLC_3DViewCollection::bindShader ( GLC_uint  shaderId)

Bind the specified shader to the collection.

Definition at line 65 of file glc_3dviewcollection.cpp.

References m_ShadedPointerViewInstanceHash.

Referenced by GLC_StructOccurence::create3DViewInstance().

void GLC_3DViewCollection::bindSpacePartitioning ( GLC_SpacePartitioning pSpacePartitioning)

Bind the space partitioning.

Definition at line 443 of file glc_3dviewcollection.cpp.

References GLC_SpacePartitioning::collectionHandle(), and m_pSpacePartitioning.

GLC_BoundingBox GLC_3DViewCollection::boundingBox ( bool  allObject = false)

Return the entire collection Bounding Box.

If all object is set to true, visible and non visible object are used

Definition at line 559 of file glc_3dviewcollection.cpp.

References GLC_BoundingBox::combine(), m_3DViewInstanceHash, and m_IsInShowSate.

Referenced by GLC_3dsToWorld::CreateWorldFrom3ds(), and GLC_Octree::updateSpacePartitioning().

void GLC_3DViewCollection::changeShadingGroup ( GLC_uint  instanceId,
GLC_uint  shaderId 
)
void GLC_3DViewCollection::clear ( void  )
bool GLC_3DViewCollection::contains ( GLC_uint  key) const
inline
int GLC_3DViewCollection::drawableObjectsSize ( ) const

Return the number of drawable objects.

Definition at line 579 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, and m_IsInShowSate.

void GLC_3DViewCollection::glDraw ( GLC_uint  groupID,
glc::RenderFlag  renderFlag 
)
private
void GLC_3DViewCollection::glDrawInstancesOf ( PointerViewInstanceHash pHash,
glc::RenderFlag  renderFlag 
)
inlineprivate
void GLC_3DViewCollection::hideAll ( )

Hide all instances of collection.

Definition at line 431 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

GLC_3DViewInstance * GLC_3DViewCollection::instanceHandle ( GLC_uint  Key)
QList< QString > GLC_3DViewCollection::instanceNamesFromShadingGroup ( GLuint  shaderId) const

Return instances name from the specified shading group.

Definition at line 598 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, m_ShaderGroup, and size().

QList< GLC_3DViewInstance * > GLC_3DViewCollection::instancesHandle ( )
bool GLC_3DViewCollection::isEmpty ( void  ) const
inline

Return true if the collection is empty.

Definition at line 87 of file glc_3dviewcollection.h.

Referenced by render(), and renderShaderGroup().

bool GLC_3DViewCollection::isInAShadingGroup ( GLC_uint  key) const
inline

Return true if the element is in a shading group.

Definition at line 139 of file glc_3dviewcollection.h.

Referenced by GLC_StructOccurence::GLC_StructOccurence(), select(), selectAll(), unselect(), and unselectAll().

bool GLC_3DViewCollection::isSelected ( GLC_uint  key) const
inline

Return true if the element is selected.

Definition at line 124 of file glc_3dviewcollection.h.

bool GLC_3DViewCollection::isViewable ( ) const
inline

Return true if the collection is viewable.

Definition at line 157 of file glc_3dviewcollection.h.

int GLC_3DViewCollection::numberOfUsedShadingGroup ( ) const

Return the number of used shading group.

Definition at line 613 of file glc_3dviewcollection.cpp.

References m_ShaderGroup.

bool GLC_3DViewCollection::remove ( GLC_uint  instanceId)

Remove a GLC_Geometry from the collection and delete it.

  • Find the GLC_Geometry in the collection
    • Delete the GLC_Geometry
    • Remove the Geometry container from collection
    • Delete the associated OpenGL Display list
    • Remove the Display list container from collection
    • Invalidate the collection return true if success false otherwise

Definition at line 231 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, m_MainInstances, selectionSize(), and unselect().

Referenced by GLC_3DWidgetManagerHandle::remove3DViewInstance(), GLC_StructOccurence::remove3DViewInstance(), GLC_WorldHandle::removeOccurence(), and GLC_StructOccurence::unloadRepresentation().

void GLC_3DViewCollection::render ( GLuint  groupId,
glc::RenderFlag  renderFlag 
)

Display the specified collection group.

The main group is 0 The selection group is 1 User group are identified by user id

Definition at line 622 of file glc_3dviewcollection.cpp.

References GLC_Context::current(), GLC_Context::glcEnableLighting(), glDraw(), isEmpty(), GLC_State::isInSelectionMode(), m_IsViewable, and glc::WireRenderFlag.

Referenced by GLC_3DWidgetManagerHandle::render(), and GLC_Viewport::render3DWidget().

void GLC_3DViewCollection::renderShaderGroup ( glc::RenderFlag  renderFlag)
bool GLC_3DViewCollection::select ( GLC_uint  instanceId,
bool  primitive = false 
)
void GLC_3DViewCollection::selectAll ( bool  allShowState = false)
PointerViewInstanceHash* GLC_3DViewCollection::selection ( )
inline
int GLC_3DViewCollection::selectionSize ( void  ) const
inline

Return the number of Node in the selection Hash.

Definition at line 112 of file glc_3dviewcollection.h.

Referenced by GLC_SelectionSet::GLC_SelectionSet(), and remove().

void GLC_3DViewCollection::setAttachedViewport ( GLC_Viewport pViewport)
inline

Set the attached viewport of this collection.

Definition at line 260 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::setLodUsage ( const bool  usage,
GLC_Viewport pView 
)
inline

Set the LOD usage.

Definition at line 232 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::setPolygonModeForAll ( GLenum  face,
GLenum  mode 
)

Set the polygon mode for all Instance.

Definition at line 399 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

void GLC_3DViewCollection::setSpacePartitionningUsage ( bool  use)
inline

Use the space partitioning.

Definition at line 245 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::setVboUsage ( bool  usage)

Set VBO usage.

Definition at line 493 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

void GLC_3DViewCollection::setViewable ( bool  viewable)
inline

Set the collection viewable state.

Definition at line 264 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::setVisibility ( const GLC_uint  instanceId,
const bool  visible 
)
GLC_uint GLC_3DViewCollection::shadingGroup ( GLC_uint  key) const
inline

Return the element shading group.

Definition at line 135 of file glc_3dviewcollection.h.

Referenced by changeShadingGroup(), GLC_StructOccurence::GLC_StructOccurence(), select(), selectAll(), unselect(), and unselectAll().

void GLC_3DViewCollection::showAll ( )

Show all instances of the collection.

Definition at line 420 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

bool GLC_3DViewCollection::showState ( ) const
inline

Return the showing state.

Definition at line 128 of file glc_3dviewcollection.h.

int GLC_3DViewCollection::size ( void  ) const
inline

Return the number of Node in the collection.

Definition at line 91 of file glc_3dviewcollection.h.

Referenced by instanceNamesFromShadingGroup(), GLC_World::size(), and unBindAllShader().

GLC_SpacePartitioning* GLC_3DViewCollection::spacePartitioningHandle ( )
inline

Return an handle to the space partitioning.

Definition at line 153 of file glc_3dviewcollection.h.

bool GLC_3DViewCollection::spacePartitioningIsUsed ( ) const
inline

Return true if the space partitioning is used.

Definition at line 149 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::swapShowState ( )
inline

Set the Show or noShow state.

Definition at line 228 of file glc_3dviewcollection.h.

bool GLC_3DViewCollection::unBindAllShader ( )

Unbind All shader.

Definition at line 112 of file glc_3dviewcollection.cpp.

References m_ShadedPointerViewInstanceHash, size(), and unBindShader().

bool GLC_3DViewCollection::unBindShader ( GLC_uint  shaderId)

Unbind the specified shader from the collection.

Definition at line 79 of file glc_3dviewcollection.cpp.

References GLC_3DViewInstance::isSelected(), m_MainInstances, m_SelectedInstances, m_ShadedPointerViewInstanceHash, and m_ShaderGroup.

Referenced by unBindAllShader().

void GLC_3DViewCollection::unbindSpacePartitioning ( )

Unbind the space partitioning.

Definition at line 452 of file glc_3dviewcollection.cpp.

References GLC_3DViewInstance::FullViewable, m_3DViewInstanceHash, m_pSpacePartitioning, and m_UseSpacePartitioning.

bool GLC_3DViewCollection::unselect ( GLC_uint  instanceId)
void GLC_3DViewCollection::unselectAll ( )
void GLC_3DViewCollection::updateInstanceViewableState ( GLC_Matrix4x4 pMatrix = NULL)

Update the instance viewable state.

Update the frustrum culling from the viewport If the specified matrix pointer is not null

Definition at line 468 of file glc_3dviewcollection.cpp.

References GLC_Viewport::frustum(), m_pSpacePartitioning, m_pViewport, m_UseSpacePartitioning, GLC_Viewport::updateFrustum(), and GLC_SpacePartitioning::updateViewableInstances().

void GLC_3DViewCollection::updateInstanceViewableState ( const GLC_Frustum frustum)

Update the instance viewable state with the specified frustum.

Definition at line 477 of file glc_3dviewcollection.cpp.

References m_pSpacePartitioning, and GLC_SpacePartitioning::updateViewableInstances().

void GLC_3DViewCollection::updateSpacePartitionning ( )

Update space partitionning.

Definition at line 485 of file glc_3dviewcollection.cpp.

References m_pSpacePartitioning, and GLC_SpacePartitioning::updateSpacePartitioning().

QList< GLC_3DViewInstance * > GLC_3DViewCollection::viewableInstancesHandle ( )

Return all viewable GLC_3DViewInstance from the collection.

Definition at line 536 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, and m_IsInShowSate.

QList< GLC_3DViewInstance * > GLC_3DViewCollection::visibleInstancesHandle ( )

Return all visible GLC_3DViewInstance from the collection.

Definition at line 518 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

Member Data Documentation

ViewInstancesHash GLC_3DViewCollection::m_3DViewInstanceHash
private
bool GLC_3DViewCollection::m_IsInShowSate
private
bool GLC_3DViewCollection::m_IsViewable
private

Viewable state.

Definition at line 338 of file glc_3dviewcollection.h.

Referenced by render(), and renderShaderGroup().

PointerViewInstanceHash GLC_3DViewCollection::m_MainInstances
private

Normal Node Hash Table.

Definition at line 320 of file glc_3dviewcollection.h.

Referenced by add(), changeShadingGroup(), clear(), glDraw(), remove(), select(), selectAll(), unBindShader(), unselect(), and unselectAll().

GLC_SpacePartitioning* GLC_3DViewCollection::m_pSpacePartitioning
private
GLC_Viewport* GLC_3DViewCollection::m_pViewport
private

The viewport associted to the collection for LOD Usage.

Definition at line 329 of file glc_3dviewcollection.h.

Referenced by glDrawInstancesOf(), and updateInstanceViewableState().

PointerViewInstanceHash GLC_3DViewCollection::m_SelectedInstances
private

Selected Node Hash Table.

Definition at line 311 of file glc_3dviewcollection.h.

Referenced by add(), changeShadingGroup(), clear(), glDraw(), select(), selectAll(), unBindShader(), unselect(), and unselectAll().

HashList GLC_3DViewCollection::m_ShadedPointerViewInstanceHash
private
ShaderIdToInstancesId GLC_3DViewCollection::m_ShaderGroup
private
bool GLC_3DViewCollection::m_UseLod
private

Level of detail usage.

Definition at line 326 of file glc_3dviewcollection.h.

Referenced by glDrawInstancesOf().

bool GLC_3DViewCollection::m_UseSpacePartitioning
private

The space partition usage.

Definition at line 335 of file glc_3dviewcollection.h.

Referenced by unbindSpacePartitioning(), and updateInstanceViewableState().


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

©2005-2013 Laurent Ribon