FCDAnimated Class Reference
[COLLADA Document Object Model.]

An animated element. More...

#include <FCDAnimated.h>

Inheritance diagram for FCDAnimated:

FCDObject FUObject FCDAnimatedAngle FCDAnimatedAngleAxis FCDAnimatedColor FCDAnimatedCustom FCDAnimatedFloat FCDAnimatedMatrix FCDAnimatedPoint3 List of all members.

Public Member Functions

 FCDAnimated (FCDocument *document, size_t valueCount)
 Constructor.
virtual ~FCDAnimated ()
 Destructor.
size_t GetValueCount () const
 Retrieves the number of values contained within this animated element.
FCDAnimationCurveGetCurve (size_t index)
 Retrieves the animation curve affecting the value of an animated element.
const FCDAnimationCurveGetCurve (size_t index) const
 See above.
FCDAnimationCurveListGetCurves ()
 Retrieves the list of the curves affecting the values of an animated element.
const FCDAnimationCurveListGetCurves () const
 See above.
bool SetCurve (size_t index, FCDAnimationCurve *curve)
 Assigns a curve to a value of the animated element.
bool RemoveCurve (size_t index)
 Removes the curve affecting a value of the animated element.
float * GetValue (size_t index)
 Retrieves the value of an animated element.
const float * GetValue (size_t index) const
 See above.
const string & GetQualifier (size_t index) const
 Retrieves the qualifier of the value of an animated element.
float * FindValue (const string &qualifier)
 Retrieves an animated value given a valid qualifier.
const float * FindValue (const string &qualifier) const
 See above.
FCDAnimationCurveFindCurve (const char *qualifier)
 Retrieves an animation curve given a valid qualifier.
FCDAnimationCurveFindCurve (const string &qualifier)
 See above.
const FCDAnimationCurveFindCurve (const char *qualifier) const
 See above.
const FCDAnimationCurveFindCurve (const string &qualifier) const
 See above.
FCDAnimationCurveFindCurve (const float *value)
 Retrieves an animation curve given a value pointer.
const FCDAnimationCurveFindCurve (const float *value) const
 See above.
size_t FindQualifier (const char *qualifier) const
 Retrieves the value index for a given qualifier.
size_t FindQualifier (const string &qualifier) const
 See above.
size_t FindValue (const float *value) const
 Retrieves the value index for a given value pointer.
int32 GetArrayElement () const
 Retrieves the array index for an animated element.
void SetArrayElement (int32 index)
 Sets the array index for an animated element.
bool HasCurve () const
 Retrieves whether this animated element has any animation curves affecting its values.
FCDAnimationMultiCurveCreateMultiCurve () const
 Creates one multi-dimensional animation curve from this animated element.
void Evaluate (float time)
 Evaluates the animated element at a given time.
FCDAnimatedClone (FCDocument *document)
 [INTERNAL] Clones an animated element.
const string & GetTargetPointer () const
 [INTERNAL] Retrieves the target pointer that prefixes the fully-qualified target for the element.
bool Link (xmlNode *node)
 [INTERNAL] Links this animated element with a given XML tree node.
bool ProcessChannels (FCDAnimationChannelList &channels)
 [INTERNAL] Links the animated element with the imported animation curves.

Static Public Member Functions

static FCDAnimationMultiCurveCreateMultiCurve (const FCDAnimatedList &toMerge)
 Creates one multi-dimensional animation curve from a list of animated element.
static FCDAnimatedClone (FCDocument *document, const float *animatedValue, FloatPtrList &newAnimatedValues)
 [INTERNAL] Clones an animated element.

Protected Attributes

FloatPtrList values
 The list of value pointers.
StringList qualifiers
 The list of target qualifiers.
FCDAnimationCurveList curves
 The list of animation curves.
int32 arrayElement
 The array index for animated element that belong to a list of animated elements.
string pointer
 [INTERNAL] The target pointer prefix.

Detailed Description

An animated element.

An animated element encapsulates a set of floating-point values that are marked as animated.

For this purpose, an animated element holds a list of floating-point values, their animation curves and their COLLADA qualifiers for the generation of COLLADA targets. For animated list elements, an animated element holds an array index.

There are many classes built on top of this class. They represent the different element types that may be animated, such as 3D points, colors and matrices.


Constructor & Destructor Documentation

FCDAnimated::FCDAnimated FCDocument document,
size_t  valueCount
 

Constructor.

In most cases, it is preferable to create objects of the up-classes.

Parameters:
document The COLLADA document that owns this animated element.
valueCount The number of values inside the animated element.


Member Function Documentation

FCDAnimated* FCDAnimated::Clone FCDocument document  ) 
 

[INTERNAL] Clones an animated element.

Parameters:
document The COLLADA document that owns the cloned animated element.
Returns:
The cloned animated element.

static FCDAnimated* FCDAnimated::Clone FCDocument document,
const float *  animatedValue,
FloatPtrList newAnimatedValues
[static]
 

[INTERNAL] Clones an animated element.

Parameters:
document The COLLADA document that owns the cloned animated element.
animatedValue One animated value contained within the original animated element.
newAnimatedValues The list of value pointers to be contained by the cloned animated element.
Returns:
The cloned animated element.

static FCDAnimationMultiCurve* FCDAnimated::CreateMultiCurve const FCDAnimatedList toMerge  )  [static]
 

Creates one multi-dimensional animation curve from a list of animated element.

This function is useful is your application does not handle animations per-values. For example, we use this function is ColladaMax for animated scale values, where one scale value is two rotations for the scale rotation pivot and one 3D point for the scale factors.

Parameters:
toMerge The list of animated elements to merge
Returns:
The multi-dimensional animation curve.

FCDAnimationMultiCurve* FCDAnimated::CreateMultiCurve  )  const
 

Creates one multi-dimensional animation curve from this animated element.

This function is useful is your application does not handle animations per-values, but instead needs one animation per-element.

Returns:
The multi-dimensional animation curve.

void FCDAnimated::Evaluate float  time  ) 
 

Evaluates the animated element at a given time.

This function directly and permanently modifies the values of the animated element according to the curves affecting them.

Parameters:
time The evaluation time.

FCDAnimationCurve* FCDAnimated::FindCurve const float *  value  )  [inline]
 

Retrieves an animation curve given a value pointer.

Parameters:
value A value pointer contained within the animated element.
Returns:
The animation curve for this qualifier. This pointer will be NULL if the value pointer is not contained by this animated element or if the value is not animated.

FCDAnimationCurve* FCDAnimated::FindCurve const char *  qualifier  )  [inline]
 

Retrieves an animation curve given a valid qualifier.

Parameters:
qualifier A valid qualifier.
Returns:
The animation curve for this qualifier. This pointer will be NULL if the given qualifier is not used within this animated element or if the value for the given qualifier is not animated.

size_t FCDAnimated::FindQualifier const char *  qualifier  )  const
 

Retrieves the value index for a given qualifier.

Parameters:
qualifier A valid qualifier.
Returns:
The value index. This value will be -1 to indicate that the qualifier does not belong to this animated element.

size_t FCDAnimated::FindValue const float *  value  )  const
 

Retrieves the value index for a given value pointer.

Parameters:
value A value pointer contained within the animated element.
Returns:
The value index. This value will be -1 to indicate that the value pointer is not contained by this animated element.

float* FCDAnimated::FindValue const string &  qualifier  ) 
 

Retrieves an animated value given a valid qualifier.

Parameters:
qualifier A valid qualifier.
Returns:
The animated value for this qualifier. This pointer will be NULL if the given qualifier is not used within this animated element.

int32 FCDAnimated::GetArrayElement  )  const [inline]
 

Retrieves the array index for an animated element.

This value is used only for animated elements that belong to a list of animated elements within the COLLADA document.

Returns:
The array index. This value will be -1 to indicate that the animated element does not belong to a list.

FCDAnimationCurve* FCDAnimated::GetCurve size_t  index  )  [inline]
 

Retrieves the animation curve affecting the value of an animated element.

Parameters:
index The value index.
Returns:
The curve affecting the value at the given index. This pointer will be NULL if the index is out-of-bounds or if the value is not animated.

FCDAnimationCurveList& FCDAnimated::GetCurves  )  [inline]
 

Retrieves the list of the curves affecting the values of an animated element.

This list may contain the NULL pointer, where a value is not animated.

Returns:
The list of animation curves.

const string& FCDAnimated::GetQualifier size_t  index  )  const [inline]
 

Retrieves the qualifier of the value of an animated element.

Parameters:
index The value index.
Returns:
The qualifier for the value. The value returned will be an empty string when the index is out-of-bounds.

const string& FCDAnimated::GetTargetPointer  )  const [inline]
 

[INTERNAL] Retrieves the target pointer that prefixes the fully-qualified target for the element.

Returns:
The target pointer prefix.

float* FCDAnimated::GetValue size_t  index  )  [inline]
 

Retrieves the value of an animated element.

Parameters:
index The value index.
Returns:
The value at the given index. This pointer will be NULL if the index is out-of-boudns.

size_t FCDAnimated::GetValueCount  )  const [inline]
 

Retrieves the number of values contained within this animated element.

Returns:
The number of values.

bool FCDAnimated::HasCurve  )  const
 

Retrieves whether this animated element has any animation curves affecting its values.

Returns:
Whether any curves affect this animated element.

bool FCDAnimated::Link xmlNode *  node  ) 
 

[INTERNAL] Links this animated element with a given XML tree node.

This function is solely used within the import of a COLLADA document. The floating-point values held within the XML tree node will be linked with the list of floating-point value pointers held by the animated entity.

Parameters:
node The XML tree node.
Returns:
Whether there was any linkage done.

bool FCDAnimated::ProcessChannels FCDAnimationChannelList channels  ) 
 

[INTERNAL] Links the animated element with the imported animation curves.

This compares the animation channel targets with the animated element target and qualifiers to assign curves unto the value pointers.

Parameters:
channels A list of animation channels with the correct target pointer.
Returns:
Whether any animation curves were assigned to the animation element.

bool FCDAnimated::RemoveCurve size_t  index  ) 
 

Removes the curve affecting a value of the animated element.

Parameters:
index The value index.
Returns:
Whether a curve was successfully removed. Will return false if there was no curve to release or the index is out-of-bounds.

void FCDAnimated::SetArrayElement int32  index  )  [inline]
 

Sets the array index for an animated element.

This value is used only for animated elements that belong to a list of animated elements within the COLLADA document.

Parameters:
index The array index. This value should be -1 to indicate that the animated element does not belong to a list.

bool FCDAnimated::SetCurve size_t  index,
FCDAnimationCurve curve
 

Assigns a curve to a value of the animated element.

The previously assigned curve will be deleted.

Parameters:
index The value index.
curve The new curve that will affect the value at the given index.
Returns:
Whether the curve was successfully assigned. Will return false if the index is out-of-bounds.


Member Data Documentation

int32 FCDAnimated::arrayElement [protected]
 

The array index for animated element that belong to a list of animated elements.

This value may be -1 to indicate that the element does not belong to a list. Otherwise, the index should always be unsigned.

FCDAnimationCurveList FCDAnimated::curves [protected]
 

The list of animation curves.

There is always one curve for one value pointer, although that curve may be the NULL pointer to indicate a non-animated value.

StringList FCDAnimated::qualifiers [protected]
 

The list of target qualifiers.

There is always one qualifier for one value pointer.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:40 2006 for FCollada by  doxygen 1.4.6-NO