![]() |
VR-Forces 4.0.4 Class Documentation
|
Instances of DtVectorObstructionManager are responsible for managing the vector obstructions in a simulation. More...
Public Types | |
| typedef std::list< std::pair < DtVectorObstructionID, std::vector < DtVectorObstruction > > > | DtVectorIDObstructionAssociations |
| typedef std::list< std::pair < DtVectorObstructionID, DtSpatialSubdivision < DtVectorObstruction * > * > > | DtObstructionSpatialContainers |
Public Member Functions | |
| DtVectorObstructionManager (const DtTerrainInterface &terrainDatabase) | |
| constructor | |
| virtual | ~DtVectorObstructionManager () |
| destructor | |
| virtual bool | init () |
| Initializes the vector obstruction manager. | |
| void | setExtrudeObstructions (bool extrude) |
| Sets whether obstructions should be extruded in the Z direction. | |
| virtual bool | getObstructions (const DtVectorObstructionID &vectorObstructionID, std::vector< DtVectorObstruction > *&vectorObstructions) |
| Gets a reference to a const container of vector obstructions of the specified vector obstruction ID. | |
| virtual bool | getObstructions (const DtVectorObstructionID &vectorObstructionID, DtExtent &extent, std::set< DtVectorObstruction * > &vectorObstructions) |
| virtual bool | createNewVectorObstructionCollection (const DtVectorObstructionID &vectorObstructionID, std::vector< DtVectorObstruction > *&newVectorObstructionCollection) |
| Creates a new container of vector obstructions from the vector network. | |
| virtual bool | createNewVectorObstructionSpatialContainer (const DtVectorObstructionID &vectorObstructionID, std::vector< DtVectorObstruction > &newVectorObstructionCollection, DtSpatialSubdivision< DtVectorObstruction * > *&obstructionSpatialContainer, unsigned int numXSubdivisions=100, unsigned int numYSubdivisions=100, unsigned int numZSubdivisions=1) |
| Creates a new spatial subdivision and fills it with the specified vector obstructions. | |
| virtual bool | addNewVectorObstructionType (const DtVectorObstructionID &vectorObstructionID, std::vector< DtVectorObstruction > *&newVectorObstructionCollection, DtSpatialSubdivision< DtVectorObstruction * > *&newVectorObstructionSpatialContainer) |
| Creates a new vector obstruction collection for the specified vector obstruction ID. | |
| virtual bool | getAllFeaturesInRange (double range, const DtVectorObstructionID &vectorObstructionID, std::list< const DtNetworkNode * > &nodes) |
| Selects all network elements within the specified range and with the specified vector obstruction ID from the vector network. | |
| virtual bool | getAllFeaturesInRange (double range, const DtVectorObstructionID &vectorObstructionID, std::list< const DtNetworkSegment * > &segments) |
| virtual bool | expandExtentToIncludeVectorObstructions (const std::vector< DtVectorObstruction > &vectorObstructions, DtExtent &extent) |
| Expands the specified extent to include all of the specified vector obstructions. | |
| virtual bool | addVectorObstructionsToSpatialContainer (std::vector< DtVectorObstruction > &vectorObstructions, DtSpatialSubdivision< DtVectorObstruction * > &newVectorObstructionSpatialContainer) |
| Uses a spatial subdivision inserter, specialized for DtVectorObstructions, to add all of the obstructions in the container, to the specified spatial subdivision. | |
Protected Member Functions | |
| virtual const Coordinate_System * | coordinateSystem () const |
| virtual const DtTerrainInterface * | terrainDatabase () const |
| virtual DtVectorIDObstructionAssociations & | vectorObstructionCollections () |
| virtual DtObstructionSpatialContainers & | vectorObstructionSpatialContainers () |
| virtual DtVectorIDObstructionAssociations & | obstructionCollections () |
| virtual DtObstructionSpatialContainers & | obstructionSpatialContainers () |
| bool | testInvariant () const |
| Tests the invariant of the class to ensure that its state is consistent and correct and that the invariants are upheld. | |
Protected Attributes | |
| DtVectorIDObstructionAssociations | myVectorObstructionCollections |
| Contains a list of std::pairs, each containing a vector obstruction ID and the list of vector obstructions associated with it. | |
| DtObstructionSpatialContainers | myVectorObstructionSpatialContainers |
| A container of all the vector obstruction spatial subdivisions. | |
| const DtTerrainInterface & | myTerrainDatabase |
| bool | myExtrudeObstructions |
| Indicated whether obstructions should be extruded in the Z direction. | |
Private Member Functions | |
| DtVectorObstructionManager (const DtVectorObstructionManager &orig) | |
| copy constructor - not implemented | |
| DtVectorObstructionManager & | operator= (const DtVectorObstructionManager &orig) |
| assignment operator - not implemented | |
Instances of DtVectorObstructionManager are responsible for managing the vector obstructions in a simulation.
They maintain containers of the vector obstructions, both spatially sorted and non-spatially sorted. This class is used by the DtCollisionDetector in determining potential obstructions for obstruction detection and collision avoidance.
| typedef std::list< std::pair<DtVectorObstructionID, std::vector<DtVectorObstruction> > > DtVectorObstructionManager::DtVectorIDObstructionAssociations |
| typedef std::list< std::pair<DtVectorObstructionID, DtSpatialSubdivision<DtVectorObstruction*>*> > DtVectorObstructionManager::DtObstructionSpatialContainers |
| DtVectorObstructionManager::DtVectorObstructionManager | ( | const DtTerrainInterface & | terrainDatabase | ) |
constructor
| virtual DtVectorObstructionManager::~DtVectorObstructionManager | ( | ) | [virtual] |
destructor
| DtVectorObstructionManager::DtVectorObstructionManager | ( | const DtVectorObstructionManager & | orig | ) | [private] |
copy constructor - not implemented
| DtVectorObstructionManager& DtVectorObstructionManager::operator= | ( | const DtVectorObstructionManager & | orig | ) | [private] |
assignment operator - not implemented
| virtual bool DtVectorObstructionManager::init | ( | ) | [virtual] |
Initializes the vector obstruction manager.
Removes any currently managed containers of vector obstructions.
| void DtVectorObstructionManager::setExtrudeObstructions | ( | bool | extrude | ) |
Sets whether obstructions should be extruded in the Z direction.
Defaults to false.
| virtual bool DtVectorObstructionManager::getObstructions | ( | const DtVectorObstructionID & | vectorObstructionID, |
| std::vector< DtVectorObstruction > *& | vectorObstructions | ||
| ) | [virtual] |
Gets a reference to a const container of vector obstructions of the specified vector obstruction ID.
| vectorObstructionID | specifies which types of vector obstructions to return in the container. |
| extent | If supplied, specified the volume of interest. The resulting container of vector obstructions will contain all obstructions that intersect the specified extent in any way. |
| vectorObstructions | a reference to a pointer to a const container of the vector obstructions. |
| virtual bool DtVectorObstructionManager::getObstructions | ( | const DtVectorObstructionID & | vectorObstructionID, |
| DtExtent & | extent, | ||
| std::set< DtVectorObstruction * > & | vectorObstructions | ||
| ) | [virtual] |
| virtual bool DtVectorObstructionManager::createNewVectorObstructionCollection | ( | const DtVectorObstructionID & | vectorObstructionID, |
| std::vector< DtVectorObstruction > *& | newVectorObstructionCollection | ||
| ) | [virtual] |
Creates a new container of vector obstructions from the vector network.
The container will have all vector obstructions of the specified type in the vector network.
| vectorObstructionID | the vector obstruction ID to select by. |
| newVectorObstructionCollection | a reference to a pointer to the new container of vector obstructions. |
| virtual bool DtVectorObstructionManager::createNewVectorObstructionSpatialContainer | ( | const DtVectorObstructionID & | vectorObstructionID, |
| std::vector< DtVectorObstruction > & | newVectorObstructionCollection, | ||
| DtSpatialSubdivision< DtVectorObstruction * > *& | obstructionSpatialContainer, | ||
| unsigned int | numXSubdivisions = 100, |
||
| unsigned int | numYSubdivisions = 100, |
||
| unsigned int | numZSubdivisions = 1 |
||
| ) | [virtual] |
Creates a new spatial subdivision and fills it with the specified vector obstructions.
First, deletes the specified spatial subdivision if not already NULL. Then determines the extent of the vector obstructions, and finally creates a new subdivision with the specified parameters, and adds the obstructions to it.
| vectorObstructionID | The vector obstructions to contain |
| newVectorObstructionCollection | The collection of all the new vector obstructions |
| obstructionSpatialContainer | The new spatial subdivision containing pointers to the vector obstructions. |
| virtual bool DtVectorObstructionManager::addNewVectorObstructionType | ( | const DtVectorObstructionID & | vectorObstructionID, |
| std::vector< DtVectorObstruction > *& | newVectorObstructionCollection, | ||
| DtSpatialSubdivision< DtVectorObstruction * > *& | newVectorObstructionSpatialContainer | ||
| ) | [virtual] |
Creates a new vector obstruction collection for the specified vector obstruction ID.
Then creates a new vector obstruction spatial container. If it is able to do this, than the user specified parameters are set to reference the new collection and container respectively.
| virtual bool DtVectorObstructionManager::getAllFeaturesInRange | ( | double | range, |
| const DtVectorObstructionID & | vectorObstructionID, | ||
| std::list< const DtNetworkNode * > & | nodes | ||
| ) | [virtual] |
Selects all network elements within the specified range and with the specified vector obstruction ID from the vector network.
If successful, the specified std::list is populated with the results.
| virtual bool DtVectorObstructionManager::getAllFeaturesInRange | ( | double | range, |
| const DtVectorObstructionID & | vectorObstructionID, | ||
| std::list< const DtNetworkSegment * > & | segments | ||
| ) | [virtual] |
| virtual bool DtVectorObstructionManager::expandExtentToIncludeVectorObstructions | ( | const std::vector< DtVectorObstruction > & | vectorObstructions, |
| DtExtent & | extent | ||
| ) | [virtual] |
Expands the specified extent to include all of the specified vector obstructions.
If successful, the extent is guaranteed to contain all of the vector obstructions.
| virtual bool DtVectorObstructionManager::addVectorObstructionsToSpatialContainer | ( | std::vector< DtVectorObstruction > & | vectorObstructions, |
| DtSpatialSubdivision< DtVectorObstruction * > & | newVectorObstructionSpatialContainer | ||
| ) | [virtual] |
Uses a spatial subdivision inserter, specialized for DtVectorObstructions, to add all of the obstructions in the container, to the specified spatial subdivision.
| virtual const Coordinate_System* DtVectorObstructionManager::coordinateSystem | ( | ) | const [protected, virtual] |
| virtual const DtTerrainInterface* DtVectorObstructionManager::terrainDatabase | ( | ) | const [protected, virtual] |
| virtual DtVectorIDObstructionAssociations& DtVectorObstructionManager::vectorObstructionCollections | ( | ) | [protected, virtual] |
| virtual DtObstructionSpatialContainers& DtVectorObstructionManager::vectorObstructionSpatialContainers | ( | ) | [protected, virtual] |
| virtual DtVectorIDObstructionAssociations& DtVectorObstructionManager::obstructionCollections | ( | ) | [protected, virtual] |
| virtual DtObstructionSpatialContainers& DtVectorObstructionManager::obstructionSpatialContainers | ( | ) | [protected, virtual] |
| bool DtVectorObstructionManager::testInvariant | ( | ) | const [protected] |
Tests the invariant of the class to ensure that its state is consistent and correct and that the invariants are upheld.
Called at the beginning of every non-const public function and at the end (before the return statement) of every public function, const and non-const.
DtVectorIDObstructionAssociations DtVectorObstructionManager::myVectorObstructionCollections [protected] |
Contains a list of std::pairs, each containing a vector obstruction ID and the list of vector obstructions associated with it.
DtObstructionSpatialContainers DtVectorObstructionManager::myVectorObstructionSpatialContainers [protected] |
A container of all the vector obstruction spatial subdivisions.
For every type of vector obstruction, the manager maintains a separate subdivision, so that the intersection results are appropriate as is, and no further sorting is necessary.
const DtTerrainInterface& DtVectorObstructionManager::myTerrainDatabase [protected] |
Indicated whether obstructions should be extruded in the Z direction.