VR-Link API Documentation for HLA 1.3
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
DtArticulatedPartCollection Class Reference

A DtArticulatedPartCollection is a collection of articulated parts typically of an entity. More...

+ Collaboration diagram for DtArticulatedPartCollection:

Public Types

typedef std::map< unsigned int,
DtArticulatedPart * > 
PartMap
typedef PartMap::const_iterator const_iterator
typedef std::set< unsigned int > PartTypeSet

Public Member Functions

 DtArticulatedPartCollection (DtClock *clock=0)
 CTOR.
 DtArticulatedPartCollection (const DtArticulatedPartCollection &)
 Copy CTOR.
DtArticulatedPartCollectionoperator= (const DtArticulatedPartCollection &)
 Assignment operator.
virtual ~DtArticulatedPartCollection ()
 DTOR.
bool operator== (const DtArticulatedPartCollection &other) const
bool operator!= (const DtArticulatedPartCollection &other) const
virtual void getPartTypes (PartTypeSet &aSet)
 Get all of the part types by adding each part type to a part type set.
virtual DtArticulatedPartgetPart (unsigned int partType)
 Get the art part of a part type. If the part type does not exist it will be created.
virtual void removeAllParts ()
 Removes all parts.
virtual void removePart (unsigned int partType)
 Remove a part.
virtual void attachPart (DtArticulatedPart *childPart, DtArticulatedPart *parentPart)
 Attach a child part to a parent part.
void attachPart (unsigned int childPartType, unsigned int parentPartType)
 Helper function which looks up via type.
virtual unsigned int totalParameterCount () const
 Get the sum of the number of parameters for all parts.
virtual unsigned int partCount () const
 Get the number of parts.
virtual DtArticulatedPartcreatePart (DtArticulatedPart *copy=0) const
 Function used to create a part instance.
const_iterator begin () const
 Get a constant iterator to the first part.
const_iterator end () const
 Get a constant iterator beyond the last part.
virtual void setClock (DtClock *clock, bool setForAllParts=true)
 Set the clock object.
bool partsApproximateByDefault () const
 Get if parts approximate by default.
void setPartsApproximateByDefault (bool deadReckonByDefault)
 Set whether parts approximate by default.
void printDataToStream (std::ostream &stream) const
 Print the collection to a stream.
const std::vector
< DtArticulatedPart * > & 
getSortedList () const
 Get the parts in a sorted list useful for encoding.
virtual DtArticulatedPartfindPart (unsigned int partType)
 Search for a particular part.
virtual const DtArticulatedPartfindPart (unsigned int partType) const
 Search for a particular part.
DtClockclock ()
 Get the clock pointer, it may be NULL.
const DtClockclock () const
 Get the clock pointer, it may be NULL.

Protected Member Functions

virtual void sortArtParts () const
 Sort the internal list.
int calculatePartDistance (DtArticulatedPart *part) const
 Internal calculate distance function.

Protected Attributes

PartMap myPartMap
DtClockmyClock
bool myDefaultApproximatingFlag
std::vector< DtArticulatedPart * > mySortedList
bool myNeedsSortingFlag

Detailed Description

A DtArticulatedPartCollection is a collection of articulated parts typically of an entity.

Examples

Member Typedef Documentation

typedef PartMap::const_iterator DtArticulatedPartCollection::const_iterator
typedef std::set<unsigned int> DtArticulatedPartCollection::PartTypeSet

Constructor & Destructor Documentation

DtArticulatedPartCollection::DtArticulatedPartCollection ( DtClock clock = 0)

CTOR.

Parameters
Input
clockis an optional parameter for setting the clock. The clock is passed to each newly create part.
DtArticulatedPartCollection::DtArticulatedPartCollection ( const DtArticulatedPartCollection )

Copy CTOR.

Warning
If sub classing do not change the subclass copy constructor with this Copy CTOR as copying will not be done correctly. Chain the subclass with the default constructor and explicitly copy the internal parts using the desired class.
virtual DtArticulatedPartCollection::~DtArticulatedPartCollection ( )
virtual

DTOR.

Member Function Documentation

virtual void DtArticulatedPartCollection::attachPart ( DtArticulatedPart childPart,
DtArticulatedPart parentPart 
)
virtual

Attach a child part to a parent part.

Exceptions
DtCorruptedStateif childPart == parentPart

Referenced by attachPart().

void DtArticulatedPartCollection::attachPart ( unsigned int  childPartType,
unsigned int  parentPartType 
)
inline

Helper function which looks up via type.

References attachPart(), and findPart().

const_iterator DtArticulatedPartCollection::begin ( ) const

Get a constant iterator to the first part.

int DtArticulatedPartCollection::calculatePartDistance ( DtArticulatedPart part) const
protected

Internal calculate distance function.

Exceptions
DtCorruptedStateif a circulate dependency is detected.
DtClock* DtArticulatedPartCollection::clock ( )

Get the clock pointer, it may be NULL.

const DtClock* DtArticulatedPartCollection::clock ( ) const

Get the clock pointer, it may be NULL.

virtual DtArticulatedPart* DtArticulatedPartCollection::createPart ( DtArticulatedPart copy = 0) const
virtual

Function used to create a part instance.

This is a separate function to allow subclasses to create the part instances.

Parameters
Input
copyis an optional parameter which should be used with a copy constructor when copy is valid.
const_iterator DtArticulatedPartCollection::end ( ) const

Get a constant iterator beyond the last part.

virtual DtArticulatedPart* DtArticulatedPartCollection::findPart ( unsigned int  partType)
virtual

Search for a particular part.

If the part does not exist the function will return null.

Return values
0If the part is not found.
Warning
Do not delete the returned pointer it is owned and managed by the collection.
Do not hold on to the pointer it is owned and managed by the collection and may be deallocated anytime in the future.

Referenced by attachPart().

virtual const DtArticulatedPart* DtArticulatedPartCollection::findPart ( unsigned int  partType) const
virtual

Search for a particular part.

If the part does not exist the function will return null.

Return values
0If the part is not found.
Warning
Do not delete the returned pointer it is owned and managed by the collection.
Do not hold on to the pointer it is owned and managed by the collection and may be deallocated anytime in the future.
virtual DtArticulatedPart& DtArticulatedPartCollection::getPart ( unsigned int  partType)
virtual

Get the art part of a part type. If the part type does not exist it will be created.

virtual void DtArticulatedPartCollection::getPartTypes ( PartTypeSet aSet)
virtual

Get all of the part types by adding each part type to a part type set.

This

Parameters
Output
aSetis used to store the part types. Note aSet is not cleared.
const std::vector<DtArticulatedPart*>& DtArticulatedPartCollection::getSortedList ( ) const

Get the parts in a sorted list useful for encoding.

Exceptions
DtCorruptedStateif a circulate dependency is detected.
bool DtArticulatedPartCollection::operator!= ( const DtArticulatedPartCollection other) const
DtArticulatedPartCollection& DtArticulatedPartCollection::operator= ( const DtArticulatedPartCollection )

Assignment operator.

bool DtArticulatedPartCollection::operator== ( const DtArticulatedPartCollection other) const
virtual unsigned int DtArticulatedPartCollection::partCount ( ) const
virtual

Get the number of parts.

bool DtArticulatedPartCollection::partsApproximateByDefault ( ) const

Get if parts approximate by default.

This is true by default for all articulated part collections.

void DtArticulatedPartCollection::printDataToStream ( std::ostream &  stream) const

Print the collection to a stream.

virtual void DtArticulatedPartCollection::removeAllParts ( )
virtual

Removes all parts.

Warning
This function invalidates all iterators.
virtual void DtArticulatedPartCollection::removePart ( unsigned int  partType)
virtual

Remove a part.

If the part is not found the function does nothing.

Warning
This function may invalidate an iterator if it points to the part that was just removed.
virtual void DtArticulatedPartCollection::setClock ( DtClock clock,
bool  setForAllParts = true 
)
virtual

Set the clock object.

Optionally this will set the clock object for all existing parts.

Parameters
Input
clockthe clock pointer, which may be NULL.
setForAllPartscontrols whether each existing part get the new clock pointer as well.
void DtArticulatedPartCollection::setPartsApproximateByDefault ( bool  deadReckonByDefault)

Set whether parts approximate by default.

virtual void DtArticulatedPartCollection::sortArtParts ( ) const
protectedvirtual

Sort the internal list.

Exceptions
DtCorruptedStateif a circulate dependency is detected.
virtual unsigned int DtArticulatedPartCollection::totalParameterCount ( ) const
virtual

Get the sum of the number of parameters for all parts.

Member Data Documentation

DtClock* DtArticulatedPartCollection::myClock
protected
bool DtArticulatedPartCollection::myDefaultApproximatingFlag
protected
bool DtArticulatedPartCollection::myNeedsSortingFlag
mutableprotected
PartMap DtArticulatedPartCollection::myPartMap
protected
std::vector<DtArticulatedPart*> DtArticulatedPartCollection::mySortedList
mutableprotected

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

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)