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... | |
RenderObject * | GetObjectById (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.. | |
Container for visual objects.
Contains visual object map.
bool VSN::RenderContainer::IsEmpty | ( | ) | const |
Checks if container is empty.
size_t VSN::RenderContainer::GetSize | ( | ) | const |
Returns container size of scene objects.
std::list<RenderObject*> VSN::RenderContainer::GetObjects | ( | ) |
Returns all RenderObject from the scene container.
std::list<RenderObject*> VSN::RenderContainer::GetVisibleObjects | ( | ) |
Returns all visible RenderObject from the scene container.
RenderObject* VSN::RenderContainer::GetObjectById | ( | const NodeKey & | objKey | ) |
Returns pointer to RenderObject by identifier from the container, if this object exists.
[in] | objKey | - Object identifier. |
MbCube VSN::RenderContainer::GetBoundingBox | ( | bool | allObjects = false | ) |
Returns bounding box of all visible objects.
[in] | allObjects | - If true, returns bounding box of only visible objects. Otherwise, returns bounding box of all objects. |
size_t VSN::RenderContainer::GetSelectionCount | ( | ) | const |
Returns count of selected objects.
std::map<NodeKey, RenderObject*>* VSN::RenderContainer::GetSelection | ( | ) |
Returns map of selected objects.
bool VSN::RenderContainer::IsExistViewObject3D | ( | const NodeKey & | objKey | ) | const |
True if object exists in scene object container.
[in] | objKey | - Object identifier. |
bool VSN::RenderContainer::IsSelected | ( | const NodeKey & | objKey | ) | const |
True if element is selected.
[in] | objKey | - Object identifier. |
bool VSN::RenderContainer::GetShowState | ( | ) | const |
Returns visibility state.
Returns visibility state computed by optimization mechanism.
int VSN::RenderContainer::GetShowObjectsCount | ( | ) | const |
Returns count of visible objects.
bool VSN::RenderContainer::IsSpacePartitioningUsed | ( | ) | const |
True if space partitioning is used.
const std::shared_ptr<SpacePartitioning> VSN::RenderContainer::GetSpacePartitioning | ( | ) | const |
Returns pointer to space partitioning (Octree).
bool VSN::RenderContainer::IsVisible | ( | ) | const |
True if container is visible.
void VSN::RenderContainer::SetVisible | ( | bool | bVisible | ) |
Sets visibility state for container.
[in] | bVisible | - Visibility flag. |
bool VSN::RenderContainer::AddObject | ( | const RenderObject & | obj, |
uint | shaderId = 0 |
||
) |
Adds visual object to container.
[in] | obj | - Added object. |
[in] | shaderId | - Shader identifier. |
bool VSN::RenderContainer::RemoveViewObject | ( | const NodeKey & | objId | ) |
Removes object from container.
Removes object from container and removes all links with it.
[in] | objId | - Removable object. |
bool VSN::RenderContainer::SetSelectObject | ( | const NodeKey & | objKey, |
bool | primitive = false |
||
) |
Selects object by identifier.
[in] | objKey | - Object identifier. |
[in] | primitive | - Primitive selection flag. |
void VSN::RenderContainer::SelectAll | ( | bool | allShowState = false | ) |
Selects all objects.
[in] | allShowState | - Sets selection state. |
bool VSN::RenderContainer::UnselectObject | ( | const NodeKey & | objKey | ) |
Unselects object by identifier.
[in] | objKey | - Visual object. |
void VSN::RenderContainer::SetPolygonModeForAll | ( | DrawBufferMode | face, |
PolygonMode | mode | ||
) |
Sets mode for rendering polygon.
[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). |
Sets object visibility by identifier.
[in] | objKey | - Visual object. |
[in] | bVisible | - Visibility flag. |
bool VSN::RenderContainer::IsLevelOfDetailEnabled | ( | ) | const |
Returns flag of LOD usage.
Sets LOD usage.
[in] | bEnabled | - Flag of LOD usage. |
[in] | pView | - Viewport. |
void VSN::RenderContainer::SetLinkSpatialSplit | ( | std::shared_ptr< SpacePartitioning > | pSpacePartitioning | ) |
Links space partitioning with object container.
[in] | pSpacePartitioning | - Space partitioning. |
void VSN::RenderContainer::SetSpatialSplitUsage | ( | bool | bSpacePartitioning | ) |
Sets flag of space partitioning usage.
[in] | bSpacePartitioning | - Flag of space partitioning usage. |
void VSN::RenderContainer::UpdateObjectVisibleState | ( | Viewport * | pViewport, |
Matrix3DF * | pMatrix = nullptr |
||
) |
Updates object visibility in view frustum.
[in] | pViewport | - A pointer to Viewport. |
[in] | pMatrix | - New matrix in view frustum. |
void VSN::RenderContainer::UpdateObjectVisibleState | ( | const Frustum & | frustum | ) |
Updates visibility by specified view frustum.
[in] | frustum | - Frustum source. |
Sets viewport for container.
[in] | pViewport | - Pointer to viewport. |
void VSN::RenderContainer::DoRender | ( | uint | groupId, |
RenderMode | renderingMode, | ||
Viewport * | viewport = nullptr |
||
) |
Renders container groups.
[in] | groupId | - Group identifier. |
[in] | renderingMode | - Rendering mode. |
[in] | viewport | - Rendering parameters. |