12 #ifndef articulatedPart_H_
13 #define articulatedPart_H_
47 ParameterMetric_Position = 1,
48 ParameterMetric_PositionRate = 2,
49 ParameterMetric_Extension = 3,
50 ParameterMetric_ExtensionRate = 4,
51 ParameterMetric_X = 5,
52 ParameterMetric_XRate = 6,
53 ParameterMetric_Y = 7,
54 ParameterMetric_YRate = 8,
55 ParameterMetric_Z = 9,
56 ParameterMetric_ZRate = 10,
57 ParameterMetric_Azimuth = 11,
58 ParameterMetric_AzimuthRate = 12,
59 ParameterMetric_Elevation = 13,
60 ParameterMetric_ElevationRate = 14,
61 ParameterMetric_Rotation = 15,
62 ParameterMetric_RotationRate = 16
93 virtual unsigned int parameterCount()
const;
96 virtual int partTypeAttachedTo()
const;
102 virtual void setPartTypeAttachedTo(
int attachedTo);
105 virtual unsigned short attachedToPartIndex()
const;
112 virtual void setAttachedToPartIndex(
unsigned int index);
115 virtual unsigned int partType()
const;
118 virtual void setPartType(
unsigned int artPartType);
121 virtual void getParameterMetrics(std::vector<ParameterMetric>& metrics)
const;
136 bool setOnlyValue =
true);
147 parameter.
value = value;
148 return setParameter(parameterMetric,parameter);
155 virtual bool getParameter(ParameterMetric parameterMetric,Parameter& parameter)
const;
163 virtual float getParameterValue(ParameterMetric parameterMetric,
double time)
const;
170 return getParameterValue(parameterMetric,clock() ? clock()->simTime() : 0.0);
174 virtual void unsetParameter(ParameterMetric parameterMetric);
177 virtual void unsetAllParameters();
180 virtual void incrementChange(ParameterMetric parameterMetric);
183 virtual bool approximating()
const;
186 virtual void setApproximating(
bool deadreckoning);
191 virtual void setClock(
DtClock* clock);
203 inline bool isParameterSet(ParameterMetric parameterMetric)
const;
206 inline bool isParameterMetricValid(ParameterMetric parameterMetric)
const;
209 inline bool isParameterApproximated(ParameterMetric parameterMetric)
const;
216 inline unsigned int getParameterRateMetric(ParameterMetric parameterMetric)
const;
225 inline bool hasTranslation()
const;
228 inline DtVector translation()
const;
231 inline DtVector translation(
double time)
const;
234 inline bool getTranslation(
DtVector& vec)
const;
237 inline bool getTranslation(
DtVector& vec,
double time)
const;
240 inline void setTranslation(
const DtVector& trans);
243 inline bool hasTranslationRate()
const;
246 inline DtVector translationRate()
const;
249 inline bool getTranslationRate(
DtVector& vec)
const;
252 inline void setTranslationRate(
const DtVector& transRate);
255 inline bool hasOrientation()
const;
264 inline bool getOrientation(
DtTaitBryan& ori)
const;
267 inline bool getOrientation(
DtTaitBryan& ori,
double time)
const;
270 inline void setOrientation(
const DtTaitBryan& ori);
273 inline bool hasOrientationRate()
const;
276 inline DtVector orientationRate()
const;
279 inline bool getOrientationRate(
DtVector& oriRate)
const;
282 inline void setOrientationRate(
const DtVector& oriRate);
287 virtual void printDataToStream(std::ostream& str)
const;
292 static inline unsigned int decodeArtPartType(
unsigned int type);
295 static inline unsigned int decodeArtPartClass(
unsigned int type);
298 static inline unsigned char decodeArtPartParamMetric(
unsigned int type);
301 static inline unsigned int encodeArtPartParamType(
unsigned int partClass,
unsigned char paramMetric);
303 static bool approximatingEnabledFlag();
304 static void setApproximatingEnabledFlag(
bool enabled);
332 #define articulatedPart_inl_
333 #include "articulatedPart.inl"
334 #undef articulatedPart_inl_
bool setParameter(ParameterMetric parameterMetric, float value)
Set the parameter, set only the value.
Definition: articulatedPart.h:144
const bool operator==(const DtU128 &lhs, const DtU128 &rhs)
bool myApproximatingFlag
Definition: articulatedPart.h:321
float value
Definition: articulatedPart.h:36
unsigned int myPartType
Definition: articulatedPart.h:312
This file contains the declaration of DtClock and DtTime.
Used to set and maintain time in a simulation.
Definition: vlTime.h:25
DtClock * myClock
Definition: articulatedPart.h:324
DtTaitBryans are used to represent orientation of an object, using a set of three Euler angles...
Definition: vlTaitBryan.h:43
unsigned char change
Definition: articulatedPart.h:37
float getParameterValue(ParameterMetric parameterMetric) const
Get the parameter value using the internal clock.
Definition: articulatedPart.h:168
This file declares DtVector and DtVector32.
Definition: vlVector.h:224
unsigned char ParameterMetric
A Metric is only 5 bits, aka 0-31, only 1-16 are typically defined.
Definition: articulatedPart.h:66
This file declares DtTaitBryan.
unsigned int myParameterMask
Definition: articulatedPart.h:315
double time
Definition: articulatedPart.h:38
int myPartTypeAttachedTo
Definition: articulatedPart.h:309
#define DT_DLL_VLPROTIND
Definition: vlMachineTypes.h:110
const bool operator!=(const DtU128 &lhs, const DtU128 &rhs)
ParameterMetrics
Standard parameter metrics enumerations.
Definition: articulatedPart.h:45
A single articulated part which has a number of parameters.
Definition: articulatedPart.h:30
A parameter structure.
Definition: articulatedPart.h:34
std::vector< Parameter > myParameters
Definition: articulatedPart.h:318
unsigned short myAttachedToPartIndex
Definition: articulatedPart.h:310
static bool theApproximatingEnabledFlag
Definition: articulatedPart.h:329
This file contains typedefs for machine dependant types.