VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions
DtSpatialVrfObjectManagerInterface Class Referenceabstract

Abstract interface for a spatial object manager.

Inheritance diagram for DtSpatialVrfObjectManagerInterface:
Inheritance graph
[legend]

Public Types

typedef std::vector< const
DtSimObject * > 
DtVrfObjectUniqueContainer
 
typedef std::vector< const
DtSimObject * > 
DtVrfConstObjectUniqueContainer
 
typedef std::vector< const
DtSimObject * > 
DtVrfObjectContainer
 

Public Member Functions

virtual ~DtSpatialVrfObjectManagerInterface ()
 
virtual void addVrfObjects (const DtManagedObjectListConstPtr &vrfObjects)=0
 
virtual void removeVrfObject (const DtSimObject *vrfObject)=0
 
virtual bool setResolutions (unsigned int xRes, unsigned int yRes, unsigned int zRes)=0
 
virtual void clearVrfObjects ()=0
 
virtual void reset (const DtManagedObjectListConstPtr &vrfObjects)=0
 
virtual bool getVrfObjects (const DtExtent &extent, DtVrfConstObjectUniqueContainer &objects) const =0
 
virtual bool getVrfObjects (const DtVrfObjectPredicate &predicate, const DtExtent &extent, DtVrfConstObjectUniqueContainer &objects) const =0
 
virtual bool getVrfObjects (const DtChord &chord, std::list< const DtSimObject * > &objects) const =0
 
virtual bool getVrfObjects (const DtVrfObjectPredicate &predicate, const DtChord &chord, std::list< const DtSimObject * > &objects) const =0
 
virtual void visitVrfObjects (const DtExtent &extent, DtSpatialSelectionFunctor &callback) const =0
 
virtual void visitVrfObjects (const DtChord &chord, DtSpatialSelectionFunctor &callback) const =0
 
virtual unsigned int numObjects () const =0
 

Constructor & Destructor Documentation

virtual DtSpatialVrfObjectManagerInterface::~DtSpatialVrfObjectManagerInterface ( )
inlinevirtual

Member Function Documentation

virtual void DtSpatialVrfObjectManagerInterface::addVrfObjects ( const DtManagedObjectListConstPtr vrfObjects)
pure virtual

Spatially sorts the vrfObjects associated in the vrfObjects.

Implemented in DtSpatialVrfObjectManager, DtSpatialVrfObjectManagerHybrid, and DtSpatialVrfObjectManagerOctree.

virtual void DtSpatialVrfObjectManagerInterface::removeVrfObject ( const DtSimObject vrfObject)
pure virtual

Removes vrfObject from the set of vrfObjects we are maintaining.

Parameters
vrfObjectPointer to the object to be removed.

Implemented in DtSpatialVrfObjectManager, DtSpatialVrfObjectManagerHybrid, and DtSpatialVrfObjectManagerOctree.

virtual bool DtSpatialVrfObjectManagerInterface::setResolutions ( unsigned int  xRes,
unsigned int  yRes,
unsigned int  zRes 
)
pure virtual

Deprecated – doesn't apply to octree manager. Still necessary for DtSpatialVrfObjectManager. TODO need to push this all into the manager class, instead of having the DtPhysicalWorld assume that things are uniformly subdivided.

Implemented in DtSpatialVrfObjectManager, DtSpatialVrfObjectManagerHybrid, and DtSpatialVrfObjectManagerOctree.

virtual void DtSpatialVrfObjectManagerInterface::clearVrfObjects ( )
pure virtual

Clears all managed objects from the manager. Does not affect the spatial container, other than to empty its cells of any elements.

Implemented in DtSpatialVrfObjectManager, DtSpatialVrfObjectManagerHybrid, and DtSpatialVrfObjectManagerOctree.

virtual void DtSpatialVrfObjectManagerInterface::reset ( const DtManagedObjectListConstPtr vrfObjects)
pure virtual

Clears out the current DtSimObjects, 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.

Implemented in DtSpatialVrfObjectManager, DtSpatialVrfObjectManagerHybrid, and DtSpatialVrfObjectManagerOctree.

virtual void DtSpatialVrfObjectManagerInterface::visitVrfObjects ( const DtExtent extent,
DtSpatialSelectionFunctor callback 
) const
pure virtual

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.

Implemented in DtSpatialVrfObjectManager, DtSpatialVrfObjectManagerHybrid, and DtSpatialVrfObjectManagerOctree.

virtual void DtSpatialVrfObjectManagerInterface::visitVrfObjects ( const DtChord chord,
DtSpatialSelectionFunctor callback 
) const
pure virtual
virtual unsigned int DtSpatialVrfObjectManagerInterface::numObjects ( ) const
pure virtual

Number of objects in the octree.

Implemented in DtSpatialVrfObjectManagerHybrid, and DtSpatialVrfObjectManagerOctree.


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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)