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 (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.
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 (bool allShowState=false)
 Select all instances in current show state or in all 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 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.

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 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 55 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 64 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 445 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 539 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,
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 559 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 432 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 578 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 484 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 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.

int GLC_3DViewCollection::numberOfUsedShadingGroup (  )  const

Return the number of used shading group.

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

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

Referenced by GLC_StructOccurence::remove3DViewInstance(), GLC_3DWidgetManagerHandle::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 602 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 629 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 ( 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 254 of file glc_3dviewcollection.h.

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

Set the LOD usage.

Definition at line 229 of file glc_3dviewcollection.h.

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

Set the polygon mode for all Instance.

Definition at line 398 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.

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

Use the space partitioning.

Definition at line 242 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 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(), 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 225 of file glc_3dviewcollection.h.

bool GLC_3DViewCollection::unBindAllShader (  ) 

Unbind All shader.

Definition at line 111 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 78 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 454 of file glc_3dviewcollection.cpp.

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

bool GLC_3DViewCollection::unselect ( GLC_uint  key  ) 
void GLC_3DViewCollection::unselectAll (  ) 
void GLC_3DViewCollection::updateInstanceViewableState ( const GLC_Frustum frustum  ) 

Update the instance viewable state with the specified frustum.

Definition at line 479 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 470 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 516 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 498 of file glc_3dviewcollection.cpp.

References m_3DViewInstanceHash.


Member Data Documentation

Normal Node Hash Table.

Definition at line 306 of file glc_3dviewcollection.h.

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

The space partitioning.

Definition at line 318 of file glc_3dviewcollection.h.

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

The viewport associted to the collection for LOD Usage.

Definition at line 315 of file glc_3dviewcollection.h.

Referenced by glDrawInstancesOf(), and updateInstanceViewableState().

Selected Node Hash Table.

Definition at line 297 of file glc_3dviewcollection.h.

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

Level of detail usage.

Definition at line 312 of file glc_3dviewcollection.h.

Referenced by glDrawInstancesOf().

The space partition usage.

Definition at line 321 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-2011 Laurent Ribon