FCDAnimated Class Reference
[COLLADA Document Object Model.]

An animated element. More...

#include <FCDAnimated.h>

Inheritance diagram for FCDAnimated:

FCDObject FUTracker FUParameterizable FUTrackable FUObject FCDAnimatedCustom List of all members.

Public Member Functions

 DeclareFlag (RelativeAnimation, 0)
 Flag to indicate that the animation should be applied relative to the default value.
 DeclareFlagCount (1)
 The FCDAnimated class declares one flag.
 FCDAnimated (FCDObject *object, size_t valueCount, const char **qualifiers, float **values)
 Constructor.
 FCDAnimated (FCDocument *document, size_t valueCount, const char **qualifiers, float **values)
 Constructor.
virtual ~FCDAnimated ()
 Destructor.
size_t GetValueCount () const
 Retrieves the number of values contained within this animated element.
size_t GetCurveCount (size_t index) const
 Retrieves the number of animation curves affecting one value of an animated element.
FCDAnimationCurveGetCurve (size_t index, size_t curveIndex=0)
 Retrieves the animation curve affecting the value of an animated element.
const FCDAnimationCurveGetCurve (size_t index, size_t curveIndex=0) const
 See above.
FCDAnimationCurveListListGetCurves ()
 Retrieves the list of the curves affecting the values of an animated element.
const FCDAnimationCurveListListGetCurves () const
 See above.
bool AddCurve (size_t index, FCDAnimationCurve *curve)
 Assigns a curve to a value of the animated element.
bool AddCurve (size_t index, FCDAnimationCurveList &curve)
 See above.
bool RemoveCurve (size_t index)
 Removes the curves 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.
void SetValue (size_t index, float *value)
 [INTERNAL] Overwrites the value pointer of an animated element.
const fm::stringGetQualifier (size_t index) const
 Retrieves the qualifier of the value of an animated element.
StringListGetQualifiers ()
 [INTERNAL] Retrieve the qualifier list directly.
float * FindValue (const fm::string &qualifier)
 Retrieves an animated value given a valid qualifier.
const float * FindValue (const fm::string &qualifier) const
 See above.
FCDAnimationCurveFindCurve (const char *qualifier)
 Retrieves an animation curve given a valid qualifier.
FCDAnimationCurveFindCurve (const fm::string &qualifier)
 See above.
const FCDAnimationCurveFindCurve (const char *qualifier) const
 See above.
const FCDAnimationCurveFindCurve (const fm::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 fm::string &qualifier) const
 See above.
size_t FindValue (const float *value) const
 Retrieves the value index for a given value pointer.
void SetTargetObject (FCDObject *_target)
 Sets the FCDObject this animated value will notify when making changes.
FCDObjectGetTargetObject ()
 Returns the FCDObject this animated value will notify when making changes.
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) const
 Clones an animated element.
FCDAnimatedClone (FCDAnimated *clone) const
 Clones an animated element.
virtual void OnObjectReleased (FUTrackable *object)
 [INTERNAL] See FUTracker On object deletion, remove ourselves as we no longer have any values to animate

Static Public Member Functions

static FCDAnimationMultiCurveCreateMultiCurve (const FCDAnimatedList &toMerge)
 Creates one multi-dimensional animation curve from a list of animated element.

Protected Attributes

FloatPtrList values
 The list of value pointers.
StringList qualifiers
 The list of target qualifiers.
FCDAnimationCurveListList curves
 The list of animation curves.
FCDObjecttarget
 The target object who contain the float values.
int32 arrayElement
 The array index for animated element that belong to a list of animated elements.

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 FCDObject object,
size_t  valueCount,
const char **  qualifiers,
float **  values
 

Constructor.

Parameters:
object The FCollada object that owns this animated element.
valueCount The number of values inside the animated element.
qualifiers A constant array of UTF8 string defining the qualifier for each value. You should check out the arrays in FUDaeAccessor for examples.
values A constant array containing the value pointers.

FCDAnimated::FCDAnimated FCDocument document,
size_t  valueCount,
const char **  qualifiers,
float **  values
 

Constructor.

Parameters:
document The COLLADA document that owns this animated element.
valueCount The number of values inside the animated element.
qualifiers A constant array of UTF8 string defining the qualifier for each value. You should check out the arrays in FUDaeAccessor for examples.
values A constant array containing the value pointers.


Member Function Documentation

bool FCDAnimated::AddCurve 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(s) 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.

FCDAnimated* FCDAnimated::Clone FCDAnimated clone  )  const
 

Clones an animated element.

Parameters:
clone An animated element to be the clone of this element.
Returns:
The clone.

FCDAnimated* FCDAnimated::Clone FCDocument document  )  const
 

Clones an animated element.

Parameters:
document The COLLADA document that owns 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 if 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 fm::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,
size_t  curveIndex = 0
[inline]
 

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

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

size_t FCDAnimated::GetCurveCount size_t  index  )  const [inline]
 

Retrieves the number of animation curves affecting one value of an animated element.

Parameters:
index The value index.
Returns:
The number of curves affecting this value.

FCDAnimationCurveListList& 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 fm::string& FCDAnimated::GetQualifier size_t  index  )  const
 

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.

StringList& FCDAnimated::GetQualifiers  )  [inline]
 

[INTERNAL] Retrieve the qualifier list directly.

Returns:
The reference to the qualifier list.

FCDObject* FCDAnimated::GetTargetObject  )  [inline]
 

Returns the FCDObject this animated value will notify when making changes.

Returns:
Pointer to the FCDObject we notify

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::RemoveCurve size_t  index  ) 
 

Removes the curves 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.

void FCDAnimated::SetTargetObject FCDObject _target  ) 
 

Sets the FCDObject this animated value will notify when making changes.

Parameters:
_target Pointer to the FCDObject we will notify

void FCDAnimated::SetValue size_t  index,
float *  value
[inline]
 

[INTERNAL] Overwrites the value pointer of an animated element.

Used when changing the list size within FCDParameterAnimatableList.

Parameters:
index The value index.
value The new value pointer for this index.


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.

FCDAnimationCurveListList 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 Thu Feb 14 16:58:37 2008 for FCollada by  doxygen 1.4.6-NO