VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtAttachmentManager Class Reference

The attachment manager maintains a tree of sub-parts for the state repository class. More...

Inheritance diagram for DtAttachmentManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtAttachmentManager (DtSimObjectStateRepository *owner)
 Constructor.
 DtAttachmentManager (const DtAttachmentManager &orig)
 Copy Constructor.
const DtAttachmentManageroperator= (const DtAttachmentManager &orig)
 Assignment Operator.
virtual ~DtAttachmentManager ()
 Destructor.
virtual DtAttachmentManagerclone () 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.
DtSimObjectStateRepositorymyOwner
DtSimObjectStateRepositoryIteratormyIterator

Private Member Functions

 DtAttachmentManager ()
 Default Constructor. Do not use.

Detailed Description

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.


Constructor & Destructor Documentation

Default Constructor. Do not use.

Constructor.

Copy Constructor.

Destructor.


Member Function Documentation

const DtAttachmentManager& DtAttachmentManager::operator= ( const DtAttachmentManager orig)

Assignment Operator.

virtual DtAttachmentManager* DtAttachmentManager::clone ( ) const [virtual]

Creates a new manager calling the copy constructor and returns the result.

Reimplemented in DtVrfAttachmentManager.

virtual void DtAttachmentManager::attachPart ( DtSimObjectStateRepository part) [virtual]

Attach a part.

virtual void DtAttachmentManager::detachPart ( DtSimObjectStateRepository part) [virtual]

Detach a part.

goes through all elements and their children looking for the part with the specified type.

virtual const DtSimObjectStateRepository* DtAttachmentManager::findPartByType ( const DtObjectType childType) const [virtual]
virtual int DtAttachmentManager::numAttachments ( ) const [virtual]

Returns the number of SRs attached.

Referenced by DtRecursiveStateRepositoryIterator::next().

Spawns an iterator that just iterates over the elements in this manager, but does not go down to any of the children.

The caller MUST DELETE the iterator when doen using it!

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 DtVector DtAttachmentManager::getPartAttachPoint ( const DtObjectType partType,
bool  recurse = false 
) const [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.

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 DtAttachmentManager::setCoordinateSystem ( const Coordinate_System coordinateSystem) [virtual]
const DtList& DtAttachmentManager::elements ( ) const [inline]
void DtAttachmentManager::emptyList ( ) [protected]

Clean out the DtList of SR pointers, deleting as we go.

void DtAttachmentManager::copyList ( const DtList &  otherElements) [protected]

Copy a list of state repositories.

Each repository is cloned. Used by assignent operator and copy constructor.


Member Data Documentation

DtList DtAttachmentManager::myElements [protected]

The DtList of pointers to the attached state repositories.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)