Implementation of a spatial object manager based on DtSpatialSubdivision.
|
| | DtSpatialVrfObjectManager (unsigned int xRes=1, unsigned int yRes=1, unsigned int zRes=1) |
| |
| virtual | ~DtSpatialVrfObjectManager () |
| |
| virtual bool | initialize (const DtManagedObjectListConstPtr &vrfObjects, unsigned int cellCountX, unsigned int cellCountY, unsigned int cellCountZ) |
| |
| virtual void | addVrfObjects (const DtManagedObjectListConstPtr &vrfObjects) |
| |
| virtual void | removeVrfObject (const DtSimObject *vrfObject) |
| |
| virtual void | clearVrfObjects () |
| |
| virtual bool | setResolutions (unsigned int xRes, unsigned int yRes, unsigned int zRes) |
| |
| virtual unsigned int | xResolution () const |
| |
| virtual unsigned int | yResolution () const |
| |
| virtual unsigned int | zResolution () const |
| |
| virtual void | resolutions (unsigned int &xRes, unsigned int &yRes, unsigned int &zRes) const |
| |
| virtual void | reset (const DtManagedObjectListConstPtr &vrfObjects) |
| |
| bool | getVrfObjects (const DtExtent &extent, DtVrfConstObjectUniqueContainer &objects) const override |
| |
| bool | getVrfObjects (const DtVrfObjectPredicate &predicate, const DtExtent &extent, DtVrfConstObjectUniqueContainer &objects) const override |
| |
| bool | getVrfObjects (const DtChord &chord, std::list< const DtSimObject * > &objects) const override |
| |
| bool | getVrfObjects (const DtVrfObjectPredicate &predicate, const DtChord &chord, std::list< const DtSimObject * > &objects) const override |
| |
| void | visitVrfObjects (const DtExtent &extent, DtSpatialSelectionFunctor &callback) const override |
| |
| void | visitVrfObjects (const DtChord &chord, DtSpatialSelectionFunctor &callback) const override |
| |
| virtual const DtSpatialContainer * | spatialContainer () const |
| |
| virtual DtSpatialContainer * | spatialContainer () |
| |
virtual const
DtNonSpatialContainer * | nonSpatiallyOrganizedObjects () const |
| |
| virtual DtNonSpatialContainer * | nonSpatiallyOrganizedObjects () |
| |
| virtual | ~DtSpatialVrfObjectManagerInterface () |
| |
| virtual unsigned int | numObjects () const =0 |
| |
Constructor Creates a default container, with a single cell unless the resolutions are otherwise specified.
| virtual DtSpatialVrfObjectManager::~DtSpatialVrfObjectManager |
( |
| ) |
|
|
virtual |
Copy constructor and assignment operator not implemented.
Initializes the spatial object manager. This includes creating and initializing spatial container managed by this class.
Must be called immediately after creation and before any operations are performed or the container used in any way.
Spatially sorts the vrfObjects associated in the vrfObjects.
- Note
- Implementation detail: If the objects do not fit into the spatial container, then they are stored in a non-spatially sorted container.
Implements DtSpatialVrfObjectManagerInterface.
| virtual void DtSpatialVrfObjectManager::removeVrfObject |
( |
const DtSimObject * |
vrfObject | ) |
|
|
virtual |
| virtual void DtSpatialVrfObjectManager::clearVrfObjects |
( |
| ) |
|
|
virtual |
Clears all managed objects from the manager. Does not affect the spatial container, other than to empty its cells of any elements.
Implements DtSpatialVrfObjectManagerInterface.
| virtual unsigned int DtSpatialVrfObjectManager::xResolution |
( |
| ) |
const |
|
virtual |
- Returns
- The resolution in the X dimension.
| virtual unsigned int DtSpatialVrfObjectManager::yResolution |
( |
| ) |
const |
|
virtual |
- Returns
- The resolution in the Y dimension.
| virtual unsigned int DtSpatialVrfObjectManager::zResolution |
( |
| ) |
const |
|
virtual |
- Returns
- The resolution in the Z dimension.
- Returns
- The resolution in each dimension in the specified output parameters.
Clears out the current subdivision, sets it to have the minimum extent, that contains all of the DtSimObjects specified, and adds the specified DtSimObjects.
- Note
- This is provided as a memory optimization. Deleting and reallocating the spatial subdivision every tick was inefficient. So the spatial container is just cleared and resized to adjust for entities moving, being created destroyed, etc. This has the benefit of not causing a large memory reallocation, but at the disadvantage of not allowing the spatial subdivision to change its resolution.
Implements DtSpatialVrfObjectManagerInterface.
Functions that call the specified functor for every object intersecting the requested region (whether chord or extent). The functor should return false while additional processing should be done, and true if processing is complete and visitVrfObjects() should return. Note that processing is not guaranteed to stop immediately when the functor returns true; it is only a recommendation that processing can stop at any time.
- Note
- The functor may, and probably will, be called for additional DtSimObjects when a primitive is supplied. We are only guaranteed not to miss any that do intersect.
Implements DtSpatialVrfObjectManagerInterface.
- Returns
- A pointer to the spatial container of vrfObjects.
- Returns
- A pointer to the container of non-spatially organized objects
Creates an empty spatial container with the specified extent and resolution.
- Returns
- A boolean indicating success or failure in creating the container.
Updates the spatial container's extent to encompasses all the vrfObjects specified by the vrfObject iterator. This does not insert the specified vrfObjects into the spatial container.
- Note
- This will clear the spatial container of all currently managed objects.
-
The spatial subdivision member is assumed be valid when this is called. If it is not, nothing is done.
- See Also
- expandExtentToIncludeVrfObjects
Expands the specified extent to include all the extents of all vrfObjects specified in the vrfObject iterator.
| bool DtSpatialVrfObjectManager::testInvariant |
( |
| ) |
const |
|
protected |
- Returns
- a boolean indicating whether or not the class is respecting its invariant or not. If not, returns false.
Spatial container of DtSimObjects. (a pointer because it is not guaranteed to exist at construction.)
Container of objects that fall outside of the spatial subdivision. This is necessary because the spatial subdivision, as configured, may not contain all the vrfObjects specified. Thus the ones that do not fit in the spatial subdivision are stored in this container.
The documentation for this class was generated from the following file: