VR-Link API Documentation for HLA 1516
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
DtArticulatedPart Class Reference

A single articulated part which has a number of parameters. More...

+ Collaboration diagram for DtArticulatedPart:

List of all members.

Classes

struct  Parameter
 A parameter structure. More...

Public Types

enum  ParameterMetrics {
  ParameterMetric_Position = 1, ParameterMetric_PositionRate = 2, ParameterMetric_Extension = 3, ParameterMetric_ExtensionRate = 4,
  ParameterMetric_X = 5, ParameterMetric_XRate = 6, ParameterMetric_Y = 7, ParameterMetric_YRate = 8,
  ParameterMetric_Z = 9, ParameterMetric_ZRate = 10, ParameterMetric_Azimuth = 11, ParameterMetric_AzimuthRate = 12,
  ParameterMetric_Elevation = 13, ParameterMetric_ElevationRate = 14, ParameterMetric_Rotation = 15, ParameterMetric_RotationRate = 16
}
 Standard parameter metrics enumerations. More...
typedef unsigned char ParameterMetric
 A Metric is only 5 bits, aka 0-31, only 1-16 are typically defined.

Public Member Functions

 DtArticulatedPart (DtClock *clock=0)
 CTOR.
 DtArticulatedPart (const DtArticulatedPart &copy)
 Copy CTOR.
DtArticulatedPartoperator= (const DtArticulatedPart &copy)
 Assignment operator.
virtual ~DtArticulatedPart ()
 DTOR.
bool operator== (const DtArticulatedPart &other) const
 Equality/Inequality operators.
bool operator!= (const DtArticulatedPart &other) const
virtual bool hasTheSameMetrics (const DtArticulatedPart &other) const
 Do the two parts have the same parameter metrics set (the values may be different.
virtual unsigned int parameterCount () const
 Get the number of set parameters.
virtual int partTypeAttachedTo () const
 Get the part type id attached too.
virtual void setPartTypeAttachedTo (int attachedTo)
 Set the attached to part id.
virtual unsigned short attachedToPartIndex () const
 Get an index for the attached to part. This should only be called by the Collection.
virtual void setAttachedToPartIndex (unsigned int index)
 Set an index for the attached to part. This should only be called by the Collection.
virtual unsigned int partType () const
 Get this articulated part type.
virtual void setPartType (unsigned int artPartType)
 Set the part type.
virtual void getParameterMetrics (std::vector< ParameterMetric > &metrics) const
 Get the set parameter metrics by adding the parameter metrics to the provided vector.
virtual bool setParameter (ParameterMetric parameterMetric, const Parameter &parameter, bool setOnlyValue=true)
 Set the parameter.
bool setParameter (ParameterMetric parameterMetric, float value)
 Set the parameter, set only the value.
virtual bool getParameter (ParameterMetric parameterMetric, Parameter &parameter) const
 Get the parameter written into the provided parameter.
virtual float getParameterValue (ParameterMetric parameterMetric, double time) const
 Get a parameter value.
float getParameterValue (ParameterMetric parameterMetric) const
 Get the parameter value using the internal clock.
virtual void unsetParameter (ParameterMetric parameterMetric)
 Clear a parameter so it appears the parameter is not set. Calls to getParameter will fail.
virtual void unsetAllParameters ()
 Clear all parameters. This is useful when decoding the complete 'state'.
virtual void incrementChange (ParameterMetric parameterMetric)
 Increment the change parameter for the metric.
virtual bool approximating () const
 Are we deadreckoning the values.
virtual void setApproximating (bool deadreckoning)
 Set whether we are deadreckoning the values.
virtual void setClock (DtClock *clock)
 Set the clock to use with approximating using the simTime.
virtual void printDataToStream (std::ostream &str) const
 Print the part data to the specified stream.
DtClockclock ()
 Get the clock.
const DtClockclock () const
 Get the clock.
bool isParameterSet (ParameterMetric parameterMetric) const
 Check to see if a parameter is set.
bool isParameterMetricValid (ParameterMetric parameterMetric) const
 Check to see if a parameter metric is valid.
bool isParameterApproximated (ParameterMetric parameterMetric) const
 Check to is if parameter is approximated.
unsigned int getParameterRateMetric (ParameterMetric parameterMetric) const
 Get the parameter metric for a parameter's rate.
bool hasTranslation () const
 Helper function to check to see if translation has been set.
DtVector translation () const
 Helper to get translation. The translation may be dead-reckoned.
DtVector translation (double time) const
 Helper to get translation. The translation may be dead-reckoned.
bool getTranslation (DtVector &vec) const
 Helper to get translation. The translation may be dead-reckoned.
bool getTranslation (DtVector &vec, double time) const
 Helper to get translation. The translation may be dead-reckoned.
void setTranslation (const DtVector &trans)
 Helper to set the translation.
bool hasTranslationRate () const
 Helper function to check to see if translation rate has been set.
DtVector translationRate () const
 Helper to get the translation rate.
bool getTranslationRate (DtVector &vec) const
 Helper to get the translation rate.
void setTranslationRate (const DtVector &transRate)
 Helper to set the translation rate.
bool hasOrientation () const
 Helper function to check to see if orientation has been set.
DtTaitBryan orientation () const
 Helper to get the orientation.
DtTaitBryan orientation (double time) const
 Helper to get orientation. The orientation may be dead-reckoned.
bool getOrientation (DtTaitBryan &ori) const
 Helper to get the orientation.
bool getOrientation (DtTaitBryan &ori, double time) const
 Helper to get the orientation if it is set.
void setOrientation (const DtTaitBryan &ori)
 Helper to set the orientation.
bool hasOrientationRate () const
 Helper function to check to see if orientation has been set.
DtVector orientationRate () const
 Helper to get orientation. The orientation may be dead-reckoned.
bool getOrientationRate (DtVector &oriRate) const
 Helper to get the orientation.
void setOrientationRate (const DtVector &oriRate)
 Helper to set the orientation rate.

Static Public Member Functions

static unsigned int decodeArtPartType (unsigned int type)
 Get the part type from the part and parameter value.
static unsigned char decodeArtPartParamMetric (unsigned int type)
 Get the parameter metric from the part and parameter value.
static unsigned int encodeArtPartParamType (unsigned int partType, unsigned char paramMetric)
static bool approximatingEnabledFlag ()
static void setApproximatingEnabledFlag (bool enabled)

Protected Attributes

int myPartTypeAttachedTo
unsigned short myAttachedToPartIndex
unsigned int myPartType
unsigned int myParameterMask
std::vector< ParametermyParameters
bool myApproximatingFlag
DtClockmyClock

Static Protected Attributes

static bool theApproximatingEnabledFlag

Detailed Description

A single articulated part which has a number of parameters.

Examples

Member Typedef Documentation

typedef unsigned char DtArticulatedPart::ParameterMetric

A Metric is only 5 bits, aka 0-31, only 1-16 are typically defined.


Member Enumeration Documentation

Standard parameter metrics enumerations.

These enumerations are equivalent to those in disEnums.h:1504. Typically HLA & DIS enumerations can directly be used. However if necessary map to these provided enumerations if using another protocol.

Enumerator:
ParameterMetric_Position 
ParameterMetric_PositionRate 
ParameterMetric_Extension 
ParameterMetric_ExtensionRate 
ParameterMetric_X 
ParameterMetric_XRate 
ParameterMetric_Y 
ParameterMetric_YRate 
ParameterMetric_Z 
ParameterMetric_ZRate 
ParameterMetric_Azimuth 
ParameterMetric_AzimuthRate 
ParameterMetric_Elevation 
ParameterMetric_ElevationRate 
ParameterMetric_Rotation 
ParameterMetric_RotationRate 

Constructor & Destructor Documentation

CTOR.

Parameters:
Input
clockpass in an optional clock to use for deadreckoning.

Copy CTOR.

DTOR.


Member Function Documentation

virtual bool DtArticulatedPart::approximating ( ) const [virtual]

Are we deadreckoning the values.

virtual unsigned short DtArticulatedPart::attachedToPartIndex ( ) const [virtual]

Get an index for the attached to part. This should only be called by the Collection.

Get the clock.

Get the clock.

static unsigned char DtArticulatedPart::decodeArtPartParamMetric ( unsigned int  type) [inline, static]

Get the parameter metric from the part and parameter value.

static unsigned int DtArticulatedPart::decodeArtPartType ( unsigned int  type) [inline, static]

Get the part type from the part and parameter value.

static unsigned int DtArticulatedPart::encodeArtPartParamType ( unsigned int  partType,
unsigned char  paramMetric 
) [inline, static]
bool DtArticulatedPart::getOrientation ( DtTaitBryan ori) const [inline]

Helper to get the orientation.

bool DtArticulatedPart::getOrientation ( DtTaitBryan ori,
double  time 
) const [inline]

Helper to get the orientation if it is set.

bool DtArticulatedPart::getOrientationRate ( DtVector oriRate) const [inline]

Helper to get the orientation.

virtual bool DtArticulatedPart::getParameter ( ParameterMetric  parameterMetric,
Parameter parameter 
) const [virtual]

Get the parameter written into the provided parameter.

The parameter's value is NOT dead reckoned.

Return values:
trueif the parameter metric was set and the parameter was written too.
falseif the parameter metric was NOT set.
virtual void DtArticulatedPart::getParameterMetrics ( std::vector< ParameterMetric > &  metrics) const [virtual]

Get the set parameter metrics by adding the parameter metrics to the provided vector.

unsigned int DtArticulatedPart::getParameterRateMetric ( ParameterMetric  parameterMetric) const [inline]

Get the parameter metric for a parameter's rate.

Parameters:
Input
parameterMetricthe parameter metric to get to rate of.
Return values:
theparameter metric of a rate. If the input is already a rate, the input is returned.
virtual float DtArticulatedPart::getParameterValue ( ParameterMetric  parameterMetric,
double  time 
) const [virtual]

Get a parameter value.

This value may be dead reckoned. If you do not want a dead reckoned value use getParameter.

Parameters:
Input
timePass in the time you want the value deadreckoned to, or use the default -1.0 to indicate using the internal clock.
Return values:
0.0if the parameter is not set.
float DtArticulatedPart::getParameterValue ( ParameterMetric  parameterMetric) const [inline]

Get the parameter value using the internal clock.

Parameters:
Input
parameterMetricthe metric to lookup.
bool DtArticulatedPart::getTranslation ( DtVector vec) const [inline]

Helper to get translation. The translation may be dead-reckoned.

bool DtArticulatedPart::getTranslation ( DtVector vec,
double  time 
) const [inline]

Helper to get translation. The translation may be dead-reckoned.

bool DtArticulatedPart::getTranslationRate ( DtVector vec) const [inline]

Helper to get the translation rate.

bool DtArticulatedPart::hasOrientation ( ) const [inline]

Helper function to check to see if orientation has been set.

bool DtArticulatedPart::hasOrientationRate ( ) const [inline]

Helper function to check to see if orientation has been set.

virtual bool DtArticulatedPart::hasTheSameMetrics ( const DtArticulatedPart other) const [virtual]

Do the two parts have the same parameter metrics set (the values may be different.

bool DtArticulatedPart::hasTranslation ( ) const [inline]

Helper function to check to see if translation has been set.

bool DtArticulatedPart::hasTranslationRate ( ) const [inline]

Helper function to check to see if translation rate has been set.

virtual void DtArticulatedPart::incrementChange ( ParameterMetric  parameterMetric) [virtual]

Increment the change parameter for the metric.

bool DtArticulatedPart::isParameterApproximated ( ParameterMetric  parameterMetric) const [inline]

Check to is if parameter is approximated.

bool DtArticulatedPart::isParameterMetricValid ( ParameterMetric  parameterMetric) const [inline]

Check to see if a parameter metric is valid.

bool DtArticulatedPart::isParameterSet ( ParameterMetric  parameterMetric) const [inline]

Check to see if a parameter is set.

bool DtArticulatedPart::operator!= ( const DtArticulatedPart other) const
DtArticulatedPart& DtArticulatedPart::operator= ( const DtArticulatedPart copy)

Assignment operator.

bool DtArticulatedPart::operator== ( const DtArticulatedPart other) const

Equality/Inequality operators.

These do not use dead-reckoned values to check for equality.

Helper to get the orientation.

DtTaitBryan DtArticulatedPart::orientation ( double  time) const [inline]

Helper to get orientation. The orientation may be dead-reckoned.

Helper to get orientation. The orientation may be dead-reckoned.

virtual unsigned int DtArticulatedPart::parameterCount ( ) const [virtual]

Get the number of set parameters.

The count will be between 0-32.

Return values:
0There are no parameter set.
virtual unsigned int DtArticulatedPart::partType ( ) const [virtual]

Get this articulated part type.

virtual int DtArticulatedPart::partTypeAttachedTo ( ) const [virtual]

Get the part type id attached too.

virtual void DtArticulatedPart::printDataToStream ( std::ostream &  str) const [virtual]

Print the part data to the specified stream.

virtual void DtArticulatedPart::setApproximating ( bool  deadreckoning) [virtual]

Set whether we are deadreckoning the values.

static void DtArticulatedPart::setApproximatingEnabledFlag ( bool  enabled) [static]
virtual void DtArticulatedPart::setAttachedToPartIndex ( unsigned int  index) [virtual]

Set an index for the attached to part. This should only be called by the Collection.

virtual void DtArticulatedPart::setClock ( DtClock clock) [virtual]

Set the clock to use with approximating using the simTime.

Parameters:
clockmay be either a valid clock or a NULL pointer. The clock may not be deallocated before articulated part.
void DtArticulatedPart::setOrientation ( const DtTaitBryan ori) [inline]

Helper to set the orientation.

void DtArticulatedPart::setOrientationRate ( const DtVector oriRate) [inline]

Helper to set the orientation rate.

virtual bool DtArticulatedPart::setParameter ( ParameterMetric  parameterMetric,
const Parameter parameter,
bool  setOnlyValue = true 
) [virtual]

Set the parameter.

Typically only the value is set parameter are copied. Typically only the decoder needs to set more than the value.

Parameters:
Input
parameterMetricthe specific parameter you wish to set.
parameterthe values you wish to set.
setOnlyValuecontrols if we are setting only the input 'value' field <default> or also the 'change' and 'time' fields.
Returns:
if the parameter was set correctly. This will fail if the metric is invalid.
Return values:
trueif the parameter was set.
falseif the parameter was not set.
Warning:
if the parameter metric is invalid no parameter is set.
bool DtArticulatedPart::setParameter ( ParameterMetric  parameterMetric,
float  value 
) [inline]

Set the parameter, set only the value.

Parameters:
Input
valuethe value to set.
Return values:
trueif the parameter was set.
falseif the parameter was not set.
Warning:
if the parameter metric is invalid no parameter is set.

References DtArticulatedPart::Parameter::value.

virtual void DtArticulatedPart::setPartType ( unsigned int  artPartType) [virtual]

Set the part type.

virtual void DtArticulatedPart::setPartTypeAttachedTo ( int  attachedTo) [virtual]

Set the attached to part id.

void DtArticulatedPart::setTranslation ( const DtVector trans) [inline]

Helper to set the translation.

void DtArticulatedPart::setTranslationRate ( const DtVector transRate) [inline]

Helper to set the translation rate.

Helper to get translation. The translation may be dead-reckoned.

DtVector DtArticulatedPart::translation ( double  time) const [inline]

Helper to get translation. The translation may be dead-reckoned.

Helper to get the translation rate.

virtual void DtArticulatedPart::unsetAllParameters ( ) [virtual]

Clear all parameters. This is useful when decoding the complete 'state'.

virtual void DtArticulatedPart::unsetParameter ( ParameterMetric  parameterMetric) [virtual]

Clear a parameter so it appears the parameter is not set. Calls to getParameter will fail.


Member Data Documentation

unsigned short DtArticulatedPart::myAttachedToPartIndex [protected]
unsigned int DtArticulatedPart::myParameterMask [protected]
std::vector<Parameter> DtArticulatedPart::myParameters [protected]
unsigned int DtArticulatedPart::myPartType [protected]

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

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)