C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

Container for visual objects. More...

#include <vsn_rendercontainer.h>

Public Member Functions

 RenderContainer ()
 Default constructor.
 
virtual ~RenderContainer ()
 Destructor.
 
bool IsEmpty () const
 Checks if container is empty. More...
 
size_t GetSize () const
 Returns container size of scene objects. More...
 
std::list< RenderObject * > GetObjects ()
 Returns all RenderObject from the scene container. More...
 
std::list< RenderObject * > GetVisibleObjects ()
 Returns all visible RenderObject from the scene container. More...
 
RenderObjectGetObjectById (const NodeKey &objKey)
 Returns pointer to RenderObject by identifier from the container, if this object exists. More...
 
MbCube GetBoundingBox (bool allObjects=false)
 Returns bounding box of all visible objects. More...
 
size_t GetSelectionCount () const
 Returns count of selected objects. More...
 
std::map< NodeKey, RenderObject * > * GetSelection ()
 Returns map of selected objects. More...
 
bool IsExistViewObject3D (const NodeKey &objKey) const
 True if object exists in scene object container. More...
 
bool IsSelected (const NodeKey &objKey) const
 True if element is selected. More...
 
bool GetShowState () const
 Returns visibility state. More...
 
int GetShowObjectsCount () const
 Returns count of visible objects. More...
 
bool IsSpacePartitioningUsed () const
 True if space partitioning is used. More...
 
const std::shared_ptr< SpacePartitioning > GetSpacePartitioning () const
 Returns pointer to space partitioning (Octree). More...
 
bool IsVisible () const
 True if container is visible. More...
 
void SetVisible (bool bVisible)
 Sets visibility state for container. More...
 
bool AddObject (const RenderObject &obj, uint shaderId=0)
 Adds visual object to container. More...
 
bool RemoveViewObject (const NodeKey &objId)
 Removes object from container. More...
 
void Clear ()
 Removes all objects from container.
 
bool SetSelectObject (const NodeKey &objKey, bool primitive=false)
 Selects object by identifier. More...
 
void SelectAll (bool allShowState=false)
 Selects all objects. More...
 
bool UnselectObject (const NodeKey &objKey)
 Unselects object by identifier. More...
 
void UnselectAll ()
 Unselects all objects.
 
void SetPolygonModeForAll (DrawBufferMode face, PolygonMode mode)
 Sets mode for rendering polygon. More...
 
void SetVisibleObject (const NodeKey &objKey, bool bVisible)
 Sets object visibility by identifier. More...
 
void SetVisibleAll ()
 Makes all objects visible in container.
 
void SetInvisibleAll ()
 Makes all objects invisible in container.
 
void SwitchVisibleState ()
 Switches object visibility in container to opposite state(visible/invisible).
 
bool IsLevelOfDetailEnabled () const
 Returns flag of LOD usage. More...
 
void SetLevelOfDetailEnabled (bool bEnabled, Viewport *pView)
 Sets LOD usage. More...
 
void SetLinkSpatialSplit (std::shared_ptr< SpacePartitioning > pSpacePartitioning)
 Links space partitioning with object container. More...
 
void UnlinkSpacePartitioning ()
 Unlinks space partitioning from object container.
 
void SetSpatialSplitUsage (bool bSpacePartitioning)
 Sets flag of space partitioning usage. More...
 
void UpdateObjectVisibleState (Viewport *pViewport, Matrix3DF *pMatrix=nullptr)
 Updates object visibility in view frustum. More...
 
void UpdateObjectVisibleState (const Frustum &frustum)
 Updates visibility by specified view frustum. More...
 
void SetViewport (Viewport *pViewport)
 Sets viewport for container. More...
 
void PickObjectsInsideRect (const MbRect &rect, const Matrix3DF &viewMatrix, Filter filter, bool bUnifying, HitList &hits)
 NO TRANSLATION.
 
void DoRender (uint groupId, RenderMode renderingMode, Viewport *viewport=nullptr)
 Renders container groups. More...
 
RenderContainerIterator Begin () const
 Returns an iterator pointing to the first element in the list container.
 
RenderContainerIterator End () const
 Returns an iterator referring to the past-the-end element in the list container..
 

Detailed Description

Container for visual objects.

Contains visual object map.

Member Function Documentation

◆ IsEmpty()

bool VSN::RenderContainer::IsEmpty ( ) const

Checks if container is empty.

Returns
True if container is empty.

◆ GetSize()

size_t VSN::RenderContainer::GetSize ( ) const

Returns container size of scene objects.

Returns
Container size.

◆ GetObjects()

std::list<RenderObject*> VSN::RenderContainer::GetObjects ( )

Returns all RenderObject from the scene container.

Returns
List of all RenderObject in the scene container.

◆ GetVisibleObjects()

std::list<RenderObject*> VSN::RenderContainer::GetVisibleObjects ( )

Returns all visible RenderObject from the scene container.

Returns
List of all visible RenderObject in the scene container.

◆ GetObjectById()

RenderObject* VSN::RenderContainer::GetObjectById ( const NodeKey objKey)

Returns pointer to RenderObject by identifier from the container, if this object exists.

Parameters
[in]objKey- Object identifier.
Returns
Pointer to object. It can be null.

◆ GetBoundingBox()

MbCube VSN::RenderContainer::GetBoundingBox ( bool  allObjects = false)

Returns bounding box of all visible objects.

Parameters
[in]allObjects- If true, returns bounding box of only visible objects. Otherwise, returns bounding box of all objects.
Returns
Union bounding box.

◆ GetSelectionCount()

size_t VSN::RenderContainer::GetSelectionCount ( ) const

Returns count of selected objects.

Returns
Count of selected objects.

◆ GetSelection()

std::map<NodeKey, RenderObject*>* VSN::RenderContainer::GetSelection ( )

Returns map of selected objects.

Returns
Object map.

◆ IsExistViewObject3D()

bool VSN::RenderContainer::IsExistViewObject3D ( const NodeKey objKey) const

True if object exists in scene object container.

Parameters
[in]objKey- Object identifier.
Returns
True if object exists in container.

◆ IsSelected()

bool VSN::RenderContainer::IsSelected ( const NodeKey objKey) const

True if element is selected.

Parameters
[in]objKey- Object identifier.
Returns
True if object is selected.

◆ GetShowState()

bool VSN::RenderContainer::GetShowState ( ) const

Returns visibility state.

Returns visibility state computed by optimization mechanism.

Returns
True if object is visible.

◆ GetShowObjectsCount()

int VSN::RenderContainer::GetShowObjectsCount ( ) const

Returns count of visible objects.

Returns
Count of visible objects.

◆ IsSpacePartitioningUsed()

bool VSN::RenderContainer::IsSpacePartitioningUsed ( ) const

True if space partitioning is used.

Returns
True if space partitioning is used.

◆ GetSpacePartitioning()

const std::shared_ptr<SpacePartitioning> VSN::RenderContainer::GetSpacePartitioning ( ) const

Returns pointer to space partitioning (Octree).

Returns
Pointer to space partitioning.

◆ IsVisible()

bool VSN::RenderContainer::IsVisible ( ) const

True if container is visible.

Returns
True if container is visible.

◆ SetVisible()

void VSN::RenderContainer::SetVisible ( bool  bVisible)

Sets visibility state for container.

Parameters
[in]bVisible- Visibility flag.

◆ AddObject()

bool VSN::RenderContainer::AddObject ( const RenderObject obj,
uint  shaderId = 0 
)

Adds visual object to container.

Parameters
[in]obj- Added object.
[in]shaderId- Shader identifier.
Returns
True if operation was successfully done.

◆ RemoveViewObject()

bool VSN::RenderContainer::RemoveViewObject ( const NodeKey objId)

Removes object from container.

Removes object from container and removes all links with it.

Parameters
[in]objId- Removable object.
Returns
True if operation was successfully done.

◆ SetSelectObject()

bool VSN::RenderContainer::SetSelectObject ( const NodeKey objKey,
bool  primitive = false 
)

Selects object by identifier.

Parameters
[in]objKey- Object identifier.
[in]primitive- Primitive selection flag.
Returns
True if operation was successfully done.

◆ SelectAll()

void VSN::RenderContainer::SelectAll ( bool  allShowState = false)

Selects all objects.

Parameters
[in]allShowState- Sets selection state.

◆ UnselectObject()

bool VSN::RenderContainer::UnselectObject ( const NodeKey objKey)

Unselects object by identifier.

Parameters
[in]objKey- Visual object.
Returns
True if operation was successfully done.

◆ SetPolygonModeForAll()

void VSN::RenderContainer::SetPolygonModeForAll ( DrawBufferMode  face,
PolygonMode  mode 
)

Sets mode for rendering polygon.

Parameters
[in]face- Specifies that mode is applied to front, back sides or both of them. It must be GL_FRONT, GL_BACK and GL_FRONT_AND_BACK.
[in]mode- Specifies how polygon will be rendered. It accepts values: GL_POINT(renders only points), GL_LINE(renders lines) and GL_FILL(renders filled polygons).

◆ SetVisibleObject()

void VSN::RenderContainer::SetVisibleObject ( const NodeKey objKey,
bool  bVisible 
)

Sets object visibility by identifier.

Parameters
[in]objKey- Visual object.
[in]bVisible- Visibility flag.

◆ IsLevelOfDetailEnabled()

bool VSN::RenderContainer::IsLevelOfDetailEnabled ( ) const

Returns flag of LOD usage.

Returns
True if LOD is used.

◆ SetLevelOfDetailEnabled()

void VSN::RenderContainer::SetLevelOfDetailEnabled ( bool  bEnabled,
Viewport pView 
)

Sets LOD usage.

Parameters
[in]bEnabled- Flag of LOD usage.
[in]pView- Viewport.

◆ SetLinkSpatialSplit()

void VSN::RenderContainer::SetLinkSpatialSplit ( std::shared_ptr< SpacePartitioning >  pSpacePartitioning)

Links space partitioning with object container.

Parameters
[in]pSpacePartitioning- Space partitioning.

◆ SetSpatialSplitUsage()

void VSN::RenderContainer::SetSpatialSplitUsage ( bool  bSpacePartitioning)

Sets flag of space partitioning usage.

Parameters
[in]bSpacePartitioning- Flag of space partitioning usage.

◆ UpdateObjectVisibleState() [1/2]

void VSN::RenderContainer::UpdateObjectVisibleState ( Viewport pViewport,
Matrix3DF pMatrix = nullptr 
)

Updates object visibility in view frustum.

Parameters
[in]pViewport- A pointer to Viewport.
[in]pMatrix- New matrix in view frustum.

◆ UpdateObjectVisibleState() [2/2]

void VSN::RenderContainer::UpdateObjectVisibleState ( const Frustum &  frustum)

Updates visibility by specified view frustum.

Parameters
[in]frustum- Frustum source.

◆ SetViewport()

void VSN::RenderContainer::SetViewport ( Viewport pViewport)

Sets viewport for container.

Parameters
[in]pViewport- Pointer to viewport.

◆ DoRender()

void VSN::RenderContainer::DoRender ( uint  groupId,
RenderMode  renderingMode,
Viewport viewport = nullptr 
)

Renders container groups.

Parameters
[in]groupId- Group identifier.
[in]renderingMode- Rendering mode.
[in]viewport- Rendering parameters.

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