KFbxAnimCurveBase Class Reference

#include <kfbxanimcurvebase.h>
Inheritance diagram for KFbxAnimCurveBase:
Inheritance graph
[legend]

List of all members.


Detailed Description

This is the base class for implementing animation curves.

It is a pure virtual class that defines the general interface to animation key management and manipulation.

See KFbxAnimCurve and KFbxAnimCurveKFCurve for full implemented class.

Definition at line 93 of file kfbxanimcurvebase.h.


Extrapolation

Extrapolation defines the function curve value before and after the keys.

Pre-extrapolation defines the function curve value before first key. Post-extrapolation defines the function curve value after last key.

  • CONSTANT means a constant value matching the first/last key
  • REPETITION means the entire function curve is looped
  • MIRROR_REPETITION means the entire function curve is looped once backward, once forward and so on
  • KEEP_SLOPE means a linear function with a slope matching the first/last key


enum   EExtrapolationType {
   eCONSTANT = 1,
   eREPETITION = 2,
   eMIRROR_REPETITION = 3,
   eKEEP_SLOPE = 4
}
void  SetPreExtrapolation (EExtrapolationType pExtrapolation)
  Set pre-extrapolation mode.
EExtrapolationType  GetPreExtrapolation () const
  Get pre-extrapolation mode.
void  SetPreExtrapolationCount (unsigned long pCount)
  Set pre-extrapolation count.
unsigned long  GetPreExtrapolationCount () const
  Get pre-extrapolation count.
void  SetPostExtrapolation (EExtrapolationType pExtrapolation)
  Set post-extrapolation mode.
EExtrapolationType  GetPostExtrapolation () const
  Get post-extrapolation mode.
void  SetPostExtrapolationCount (unsigned long pCount)
  Set post-extrapolation count.
unsigned long  GetPostExtrapolationCount () const
  Get post-extrapolation count.

Key management.

virtual void  KeyClear ()=0
  Remove all the keys and free buffer memory.
virtual int  KeyGetCount () const =0
  Get the number of keys.
virtual int  KeyAdd (KTime pTime, KFbxAnimCurveKeyBase &pKey, int *pLast=NULL)=0
  Add a key at given time.
virtual bool  KeySet (int pIndex, KFbxAnimCurveKeyBase &pKey)=0
  Set key at given index.
virtual bool  KeyRemove (int pIndex)=0
  Remove key at given index.

Key Time Manipulation

virtual KTime  KeyGetTime (int pKeyIndex) const
  Get key time.
virtual void  KeySetTime (int pKeyIndex, KTime pTime)=0
  Set key time.

Evaluation and Analysis

virtual float  Evaluate (KTime pTime, int *pLast=NULL)=0
  Evaluate curve value at a given time.
virtual float  EvaluateIndex (double pIndex)=0
  Evaluate curve value at the given key index.

Utility functions.

virtual bool  GetTimeInterval (KTime &pStart, KTime &pStop)
  Find out start and end time of the animation curve.

Protected Member Functions

  KFbxAnimCurveBase (KFbxSdkManager &pManager, char const *pName)

Member Enumeration Documentation

Enumerator:
eCONSTANT 
eREPETITION 
eMIRROR_REPETITION 
eKEEP_SLOPE 

Definition at line 166 of file kfbxanimcurvebase.h.


Constructor & Destructor Documentation

KFbxAnimCurveBase ( KFbxSdkManager pManager,
char const *  pName  
) [protected]

Member Function Documentation

virtual void KeyClear (  )  [pure virtual]

Remove all the keys and free buffer memory.

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

virtual int KeyGetCount (  )  const [pure virtual]

Get the number of keys.

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

virtual int KeyAdd ( KTime  pTime,
KFbxAnimCurveKeyBase pKey,
int pLast = NULL  
) [pure virtual]

Add a key at given time.

Parameters:
pTime  Time to add the key.
pKey  Key to add.
pLast  Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call.
Returns:
Index of the key at given time, no matter if it was added or already present.

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

virtual bool KeySet ( int  pIndex,
KFbxAnimCurveKeyBase pKey  
) [pure virtual]

Set key at given index.

Parameters:
pIndex  Index of where the key should be set
pKey  the key to set
Returns:
true if key time is superior to previous key and inferior to next key.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

virtual bool KeyRemove ( int  pIndex  )  [pure virtual]

Remove key at given index.

Parameters:
pIndex  Index of key to remove.
Returns:
true on success.

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

virtual KTime KeyGetTime ( int  pKeyIndex  )  const [inline, virtual]

Get key time.

Parameters:
pKeyIndex  Key index
Returns:
Key time (time at which this key is occurring).

Reimplemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

Definition at line 145 of file kfbxanimcurvebase.h.

References KTIME_INFINITE.

virtual void KeySetTime ( int  pKeyIndex,
KTime  pTime  
) [pure virtual]

Set key time.

Parameters:
pKeyIndex  Key index
pTime  Key time (time at which this key is occurring).

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

void SetPreExtrapolation ( EExtrapolationType  pExtrapolation  )  [inline]

Set pre-extrapolation mode.

Parameters:
pExtrapolation  The pre-extrapolation mode to set.

Definition at line 176 of file kfbxanimcurvebase.h.

EExtrapolationType GetPreExtrapolation (  )  const [inline]

Get pre-extrapolation mode.

Returns:
The current pre-extrapolation mode.

Definition at line 181 of file kfbxanimcurvebase.h.

void SetPreExtrapolationCount ( unsigned long  pCount  )  [inline]

Set pre-extrapolation count.

Parameters:
pCount  Number of repetitions if pre-extrapolation mode is REPETITION or MIRROR_REPETITION.

Definition at line 187 of file kfbxanimcurvebase.h.

unsigned long GetPreExtrapolationCount (  )  const [inline]

Get pre-extrapolation count.

Returns:
Number of repetitions if pre-extrapolation mode is REPETITION or MIRROR_REPETITION.

Definition at line 193 of file kfbxanimcurvebase.h.

void SetPostExtrapolation ( EExtrapolationType  pExtrapolation  )  [inline]

Set post-extrapolation mode.

Parameters:
pExtrapolation  The post-extrapolation mode to set.

Definition at line 198 of file kfbxanimcurvebase.h.

EExtrapolationType GetPostExtrapolation (  )  const [inline]

Get post-extrapolation mode.

Returns:
The current post-extrapolation mode.

Definition at line 203 of file kfbxanimcurvebase.h.

void SetPostExtrapolationCount ( unsigned long  pCount  )  [inline]

Set post-extrapolation count.

Parameters:
pCount  Number of repetitions if post-extrapolation mode is REPETITION or MIRROR_REPETITION.

Definition at line 209 of file kfbxanimcurvebase.h.

unsigned long GetPostExtrapolationCount (  )  const [inline]

Get post-extrapolation count.

Returns:
Number of repetitions if post-extrapolation mode is REPETITION or MIRROR_REPETITION.

Definition at line 215 of file kfbxanimcurvebase.h.

virtual float Evaluate ( KTime  pTime,
int pLast = NULL  
) [pure virtual]

Evaluate curve value at a given time.

Parameters:
pTime  Time of evaluation.
pLast  Index of the last processed key. If this function is called in a loop, initialize this value to 0 and let it be updated by each call.
Returns:
Evaluated curve value.
Remarks:
This function should take extrapolation into account.

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

virtual float EvaluateIndex ( double  pIndex  )  [pure virtual]

Evaluate curve value at the given key index.

Parameters:
pIndex  Any value between 0 and KFCurve::KeyGetCount() - 1. If this index falls between keys, the curve value must should be interpolated based on the surrounding keys
Returns:
Evaluated curve value.

Implemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

virtual bool GetTimeInterval ( KTime pStart,
KTime pStop  
) [virtual]

Find out start and end time of the animation curve.

This function retrieves the Curve's time span.

Parameters:
pStart  Reference to receive start time.
pStop  Reference to receive end time.
Returns:
true on success, false otherwise.

Reimplemented in KFbxAnimCurve, and KFbxAnimCurveKFCurve.

KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase
KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase KFbxAnimCurveBase