![]() |
VR-Forces 4.6 Class Documentation
|
The attachment manager maintains a tree of sub-parts for the state repository class. More...

Public Member Functions | |
| DtAttachmentManager (DtSimObjectStateRepository *owner) | |
| Constructor. | |
| DtAttachmentManager (const DtAttachmentManager &orig) | |
| Copy Constructor. | |
| const DtAttachmentManager & | operator= (const DtAttachmentManager &orig) |
| Assignment Operator. | |
| virtual | ~DtAttachmentManager () |
| Destructor. | |
| virtual DtAttachmentManager * | clone () const |
| Creates a new manager calling the copy constructor and returns the result. | |
| virtual void | attachPart (DtSimObjectStateRepository *part) |
| Attach a part. | |
| virtual void | detachPart (DtSimObjectStateRepository *part) |
| Detach a part. | |
| virtual DtSimObjectStateRepository * | findPartByType (const DtObjectType &childType) |
| goes through all elements and their children looking for the part with the specified type. | |
| virtual const DtSimObjectStateRepository * | findPartByType (const DtObjectType &childType) const |
| virtual int | numAttachments () const |
| Returns the number of SRs attached. | |
| virtual const DtSimObjectStateRepositoryIterator & | iterator () const |
| Spawns an iterator that just iterates over the elements in this manager, but does not go down to any of the children. | |
| virtual DtRecursiveStateRepositoryIterator * | spawnRecursiveIterator () const |
| Spawns an iterator that iterates over the elements in this manager, and all their children, sub children, etc. | |
| virtual DtVector | getPartAttachPoint (const DtObjectType &partType, bool recurse=false) const |
| This looks up the attachment geometry in the .epd file when creating art parts discovered on remote entities. | |
| virtual void | parentKinematicsChanged () |
| tell all elements that the kinematic state of the parent has changed so that they can invalidate cached vectors in the world coord system | |
| virtual void | setCoordinateSystem (const Coordinate_System *coordinateSystem) |
| const DtList & | elements () const |
Protected Member Functions | |
| void | emptyList () |
| Clean out the DtList of SR pointers, deleting as we go. | |
| void | copyList (const DtList &otherElements) |
| Copy a list of state repositories. | |
Protected Attributes | |
| DtList | myElements |
| The DtList of pointers to the attached state repositories. | |
| DtSimObjectStateRepository * | myOwner |
| DtSimObjectStateRepositoryIterator * | myIterator |
Private Member Functions | |
| DtAttachmentManager () | |
| Default Constructor. Do not use. | |
The attachment manager maintains a tree of sub-parts for the state repository class.
These parts are represented as other DtSimObjectStateRepositorys. Parts that need to maintain geometry with respect to some parent geometry use this manager.
Since some parts may be DtSimObjects in their own right (such as attached crates, vehicles in a transport plane, etc.) a reference state repository (see refSR.h) is used to represent these parts. Creation of the part state repositories is done outside the manager; parts are attached and detached as required. The manager can provide iterators to traverse just the top level SRs it maintains or the entire forest it represents.
The DtObjectType object is used to describe the part type. This entity type has a 'Kind' of DtSimArtPartKind, with a 'Category' that matches the DtArtPartType used to represent the part on the network.
Parts not described by reference state repositories are expected to have unique part types (nothing will break if they don't, by findPartByType() will find the first part that matches). For art parts, the DIS standard provides different art part type values for parts of the same logical type (e.g., two turrets could have part types DtPrimaryTurret1 and DtPrimaryTurret2) so this unique part type restriction should be easy to maintain. These part types can be found in the disEnums.h file under the DtArtPartType enumeration.
For attached sim objects, it may often be the case that the entity types are not unique. For this reason, findPartByType() ignores reference repositories when searching the elements contained in the attachment manager.
|
private |
Default Constructor. Do not use.
| DtAttachmentManager::DtAttachmentManager | ( | DtSimObjectStateRepository * | owner | ) |
Constructor.
| DtAttachmentManager::DtAttachmentManager | ( | const DtAttachmentManager & | orig | ) |
Copy Constructor.
|
virtual |
Destructor.
| const DtAttachmentManager& DtAttachmentManager::operator= | ( | const DtAttachmentManager & | orig | ) |
Assignment Operator.
|
virtual |
Creates a new manager calling the copy constructor and returns the result.
Reimplemented in DtVrfAttachmentManager.
|
virtual |
Attach a part.
|
virtual |
Detach a part.
|
virtual |
goes through all elements and their children looking for the part with the specified type.
|
virtual |
|
virtual |
Returns the number of SRs attached.
Referenced by DtRecursiveStateRepositoryIterator::next().
|
virtual |
Spawns an iterator that just iterates over the elements in this manager, but does not go down to any of the children.
|
virtual |
Spawns an iterator that iterates over the elements in this manager, and all their children, sub children, etc.
. The caller MUST DELETE the iterator when doen using it!
|
virtual |
This looks up the attachment geometry in the .epd file when creating art parts discovered on remote entities.
Need to give this a little more thought. If recurse is true recurse parent parts and add in their offset as well
Reimplemented in DtVrfAttachmentManager.
|
virtual |
tell all elements that the kinematic state of the parent has changed so that they can invalidate cached vectors in the world coord system
|
virtual |
|
inline |
Referenced by DtRecursiveStateRepositoryIterator::next().
|
protected |
Clean out the DtList of SR pointers, deleting as we go.
|
protected |
Copy a list of state repositories.
Each repository is cloned. Used by assignent operator and copy constructor.
|
protected |
The DtList of pointers to the attached state repositories.
|
protected |
|
protected |