GLC_3DViewCollection Class Reference

GLC_3DViewCollection : GLC_3DViewInstance flat collection. More...

#include <glc_3dviewcollection.h>

List of all members.

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 (void)
 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.
GLuint 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.
Set Functions

bool bindShader (GLuint)
 Bind the specified shader to the collection.
bool unBindShader (GLuint)
 Unbind the specified shader from the collection.
bool unBindAllShader ()
 Unbind All shader.
bool add (const GLC_3DViewInstance &, GLuint shaderID=0)
 Add a GLC_3DViewInstance in the collection.
void changeShadingGroup (GLC_uint, GLuint)
 Change instance shading group.
bool remove (GLC_uint Key)
 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, bool primitive=false)
 Select a Instance.
void selectAll ()
 Select all instances in current show state.
bool unselect (GLC_uint)
 unselect a Instance
void unselectAll ()
 unselect all Instance
void setPolygonModeForAll (GLenum, GLenum)
 Set the polygon mode for all Instance.
void setVisibility (const GLC_uint, const bool)
 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 setAttachedViewport (GLC_Viewport *pViewport)
 Set the attached viewport of this collection.

Private Member Functions

Privates services Functions

void setBoundingBoxValidity (void)
 Set the Bounding box validity.

Private Attributes

ViewInstancesHash m_3DViewInstanceHash
 GLC_3DViewInstance Hash Table.
GLC_BoundingBoxm_pBoundingBox
 BoundingBox of the collection.
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.

OpenGL Functions



void render (GLuint, glc::RenderFlag)
 Display the specified collection group.
void renderShaderGroup (glc::RenderFlag)
 Display all shader group.
void glDraw (GLuint, glc::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 65 of file glc_3dviewcollection.h.


Constructor & Destructor Documentation

GLC_3DViewCollection::GLC_3DViewCollection (  ) 

Default constructor.

Definition at line 43 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 58 of file glc_3dviewcollection.cpp.

References clear().


Member Function Documentation

bool GLC_3DViewCollection::add ( const GLC_3DViewInstance node,
GLuint  shaderID = 0 
)
bool GLC_3DViewCollection::bindShader ( GLuint  shaderId  ) 

Bind the specified shader to the collection.

Definition at line 68 of file glc_3dviewcollection.cpp.

References m_ShadedPointerViewInstanceHash.

Referenced by GLC_WorldHandle::addOccurence().

void GLC_3DViewCollection::bindSpacePartitioning ( GLC_SpacePartitioning pSpacePartitioning  ) 

Bind the space partitioning.

Definition at line 511 of file glc_3dviewcollection.cpp.

References GLC_SpacePartitioning::collectionHandle(), and m_pSpacePartitioning.

GLC_BoundingBox GLC_3DViewCollection::boundingBox ( void   ) 
void GLC_3DViewCollection::changeShadingGroup ( GLC_uint  instanceId,
GLuint  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 643 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, and m_IsInShowSate.

void GLC_3DViewCollection::glDraw ( GLuint  groupId,
glc::RenderFlag  renderFlag 
) [private]
void GLC_3DViewCollection::glDrawInstancesOf ( PointerViewInstanceHash pHash,
glc::RenderFlag  renderFlag 
) [inline, private]
void GLC_3DViewCollection::hideAll (  ) 

Hide all instances of collection.

Definition at line 490 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, and m_pBoundingBox.

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 663 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, m_ShaderGroup, and size().

QList< GLC_3DViewInstance * > GLC_3DViewCollection::instancesHandle (  ) 

Return all GLC_3DViewInstance from collection.

Definition at line 553 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

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

bool GLC_3DViewCollection::isEmpty ( void   )  const [inline]

Return true if the collection is empty.

Definition at line 89 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 140 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 125 of file glc_3dviewcollection.h.

int GLC_3DViewCollection::numberOfUsedShadingGroup (  )  const

Return the number of used shading group.

Definition at line 679 of file glc_3dviewcollection.cpp.

References m_ShaderGroup.

bool GLC_3DViewCollection::remove ( GLC_uint  Key  ) 

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 247 of file glc_3dviewcollection.cpp.

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

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

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 688 of file glc_3dviewcollection.cpp.

References glDraw(), isEmpty(), GLC_State::isInSelectionMode(), and glc::WireRenderFlag.

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

void GLC_3DViewCollection::renderShaderGroup ( glc::RenderFlag  renderFlag  ) 

Display all shader group.

Definition at line 716 of file glc_3dviewcollection.cpp.

References glDraw(), isEmpty(), GLC_State::isInSelectionMode(), and m_ShadedPointerViewInstanceHash.

Referenced by GLC_3DWidgetManagerHandle::render().

bool GLC_3DViewCollection::select ( GLC_uint  key,
bool  primitive = false 
)
void GLC_3DViewCollection::selectAll (  ) 
PointerViewInstanceHash* GLC_3DViewCollection::selection (  )  [inline]

Get the Hash table of Selected Nodes.

Definition at line 117 of file glc_3dviewcollection.h.

int GLC_3DViewCollection::selectionSize ( void   )  const [inline]

Return the number of Node in the selection Hash.

Definition at line 113 of file glc_3dviewcollection.h.

Referenced by remove().

void GLC_3DViewCollection::setAttachedViewport ( GLC_Viewport pViewport  )  [inline]

Set the attached viewport of this collection.

Definition at line 263 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::setBoundingBoxValidity ( void   )  [private]

Set the Bounding box validity.

Definition at line 795 of file glc_3dviewcollection.cpp.

References GLC_BoundingBox::isEmpty(), m_3DViewInstanceHash, and m_pBoundingBox.

Referenced by boundingBox().

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

Set the LOD usage.

Definition at line 238 of file glc_3dviewcollection.h.

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

Set the polygon mode for all Instance.

Definition at line 439 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

void GLC_3DViewCollection::setSpacePartitionningUsage ( bool  use  )  [inline]

Use the space partitioning.

Definition at line 251 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::setVisibility ( const GLC_uint  key,
const bool  visibility 
)
GLuint GLC_3DViewCollection::shadingGroup ( GLC_uint  key  )  const [inline]

Return the element shading group.

Definition at line 136 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 469 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash, and m_pBoundingBox.

bool GLC_3DViewCollection::showState (  )  const [inline]

Return the showing state.

Definition at line 129 of file glc_3dviewcollection.h.

int GLC_3DViewCollection::size ( void   )  const [inline]

Return the number of Node in the collection.

Definition at line 93 of file glc_3dviewcollection.h.

Referenced by instanceNamesFromShadingGroup(), and unBindAllShader().

GLC_SpacePartitioning* GLC_3DViewCollection::spacePartitioningHandle (  )  [inline]

Return an handle to the space partitioning.

Definition at line 154 of file glc_3dviewcollection.h.

bool GLC_3DViewCollection::spacePartitioningIsUsed (  )  const [inline]

Return true if the space partitioning is used.

Definition at line 150 of file glc_3dviewcollection.h.

void GLC_3DViewCollection::swapShowState (  )  [inline]

Set the Show or noShow state.

Definition at line 226 of file glc_3dviewcollection.h.

bool GLC_3DViewCollection::unBindAllShader (  ) 

Unbind All shader.

Definition at line 117 of file glc_3dviewcollection.cpp.

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

bool GLC_3DViewCollection::unBindShader ( GLuint  shaderId  ) 

Unbind the specified shader from the collection.

Definition at line 83 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 521 of file glc_3dviewcollection.cpp.

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

bool GLC_3DViewCollection::unselect ( GLC_uint  key  ) 

unselect a Instance

Definition at line 379 of file glc_3dviewcollection.cpp.

References isInAShadingGroup(), m_MainInstances, m_SelectedInstances, m_ShadedPointerViewInstanceHash, and shadingGroup().

Referenced by remove().

void GLC_3DViewCollection::unselectAll (  ) 
void GLC_3DViewCollection::updateInstanceViewableState ( const GLC_Frustum frustum  ) 

Update the instance viewable state with the specified frustum.

Definition at line 547 of file glc_3dviewcollection.cpp.

References m_pSpacePartitioning, and GLC_SpacePartitioning::updateViewableInstances().

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 538 of file glc_3dviewcollection.cpp.

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

QList< GLC_3DViewInstance * > GLC_3DViewCollection::viewableInstancesHandle (  ) 

Return all viewable GLC_3DViewInstance from the collection.

Definition at line 587 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 568 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.


Member Data Documentation

Normal Node Hash Table.

Definition at line 329 of file glc_3dviewcollection.h.

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

BoundingBox of the collection.

Definition at line 317 of file glc_3dviewcollection.h.

Referenced by add(), boundingBox(), clear(), hideAll(), remove(), setBoundingBoxValidity(), setVisibility(), and showAll().

The space partitioning.

Definition at line 341 of file glc_3dviewcollection.h.

Referenced by bindSpacePartitioning(), clear(), unbindSpacePartitioning(), and updateInstanceViewableState().

The viewport associted to the collection for LOD Usage.

Definition at line 338 of file glc_3dviewcollection.h.

Referenced by glDrawInstancesOf(), and updateInstanceViewableState().

Selected Node Hash Table.

Definition at line 320 of file glc_3dviewcollection.h.

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

Level of detail usage.

Definition at line 335 of file glc_3dviewcollection.h.

Referenced by glDrawInstancesOf().

The space partition usage.

Definition at line 344 of file glc_3dviewcollection.h.

Referenced by unbindSpacePartitioning(), and updateInstanceViewableState().


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

SourceForge.net Logo

©2005-2010 Laurent Ribon