The purpose of this class is to organize all selectable objects into data structure, allowing to build set of BVH trees for each transformation persistence subclass of selectable objects. This allow to minify number of updates for BVH trees - for example 2D persistent object subclass depends only on camera's projection and the corresponding BVH tree needs to be updated when camera's projection parameters change, while another tree for non-persistent objects can be left unchanged in this case.
More...
#include <SelectMgr_SelectableObjectSet.hxx>
|
class | Iterator |
| Class to iterate sequentually over all objects from every subset. More...
|
|
The purpose of this class is to organize all selectable objects into data structure, allowing to build set of BVH trees for each transformation persistence subclass of selectable objects. This allow to minify number of updates for BVH trees - for example 2D persistent object subclass depends only on camera's projection and the corresponding BVH tree needs to be updated when camera's projection parameters change, while another tree for non-persistent objects can be left unchanged in this case.
This enumeration declares names for subsets of selectable objects. Each subset has independent BVH tree. The class maintains subsets of selectable objects by their persistence flag. This allows to restric rebuilding of the trees for particular subset when the camera change does not implicitly require it:
- BVHSubset_3d refers to the subset of normal world-space 3D objects. Associated BVH tree does not depend on the camera's state at all. This subset uses binned BVH builder with 32 bins and 1 element per leaf.
- BVHSubset_3dPersistent refers to the subset of 3D persistent selectable objects (rotate, pan, zoom persistence). Associated BVH tree needs to be updated when either the camera's projection and position change. This subset uses linear BVH builder with 32 levels of depth and 1 element per leaf.
- BVHSubset_2dPersistent refers to the subset of 2D persistent selectable objects. Associated BVH tree needs to be updated only when camera's projection changes. Bounding volumes for this object subclass is represented directly in eye space coordinates. This subset uses linear BVH builder with 32 levels of depth and 1 element per leaf.
Enumerator |
---|
BVHSubset_3d |
|
BVHSubset_3dPersistent |
|
BVHSubset_2dPersistent |
|
BVHSubsetNb |
|
SelectMgr_SelectableObjectSet::SelectMgr_SelectableObjectSet |
( |
| ) |
|
Creates new empty objects set and initializes BVH tree builders for each subset.
virtual SelectMgr_SelectableObjectSet::~SelectMgr_SelectableObjectSet |
( |
| ) |
|
|
inlinevirtual |
Releases resources of selectable object set.
Adds the new selectable object to the set. The selectable object is placed into one of the predefined subsets depending on its persistence type. After adding an object, this method marks the corresponding BVH tree for rebuild.
- Returns
- true if selectable object is added, otherwise returns false (selectable object is already in the set).
Returns computed BVH for the theSubset given.
Performs necessary updates when object's persistence types changes. This method should be called right after changing transformation persistence flags of the objects and before updating BVH tree - to provide up-to-date state of the object set.
Returns true if this objects set contains theObject given.
Returns object from subset theSubset by theIndex given. The method allows to get selectable object referred by the index of an element of the subset's BVH tree.
Returns true if the object set does not contain any selectable objects.
Returns true if the specified object subset is empty.
void SelectMgr_SelectableObjectSet::MarkDirty |
( |
| ) |
|
Marks every BVH subset for update.
Removes the selectable object from the set. The selectable object is removed from the subset it has been placed into. After removing an object, this method marks the corresponding BVH tree for rebuild.
- Returns
- true if selectable object is removed, otherwise returns false (selectable object is not in the set).
Updates outdated BVH trees and remembers the last state of the camera view-projection matrices and viewport (window) dimensions.
The documentation for this class was generated from the following file: