KFCurve Class Reference

#include <kfcurve.h>

List of all members.


Detailed Description

Function curve class.

A function curve is basically a collection of keys (see class KFCurveKey) sorted in time order. Since it is a function, only one key per time is allowed.

Definition at line 678 of file kfcurve.h.

Constructor and Destructor

 KFCurve ()
 Constructor.
virtual ~KFCurve ()
 Destructor.
 IObject_Declare (Implementation) float *GetColor()
 Get function curve color.
void SetColor (float *pColor)
 Set function curve color.
void SetValue (kFCurveDouble pValue)
 Set default value.
kFCurveDouble GetValue () const
 Get default value.

Key Management

void ResizeKeyBuffer (int pKeyCount)
 Resize fcurve buffer to hold a certain number of key.
void KeyModifyBegin ()
 Call this function prior to modify the keys of a function curve.
void KeyModifyEnd ()
 Call this function after modification of the keys of a function curve.
K_DEPRECATED void KeyModifyBegin (int pKeyCount)
 Call this function prior to modify the keys of a function curve (DEPRECATED).
K_DEPRECATED void KeyModifyEnd (int pKeyCount)
 Call this function after modification of the keys of a function curve (DEPRECATED).
int KeyGetCount ()
 Get the number of keys.
int KeyGetSelectionCount ()
 Get the number of selected keys.
void KeySelectAll ()
 Resize fcurve buffer to hold a certain number of key.
void KeyUnselectAll ()
 Resize fcurve buffer to hold a certain number of key.
KFCurveKey KeyGet (kFCurveIndex pIndex)
 Get key at given index.
K_DEPRECATED KFCurveKeyKeyGetRaw (kFCurveIndex pIndex)
 Get reference to key at given index (DEPRECATED).
K_DEPRECATED KFCurveKeyKeyGetPtr (kFCurveIndex pIndex)
 Get pointer to key at given index (DEPRECATED).
void KeyClear ()
 Remove all the keys and free buffer memory.
void KeyShrink ()
 Minimize use of buffer memory.
bool KeySet (kFCurveIndex pIndex, KFCurveKey &pKey)
 Set key at given index.
bool KeySet (kFCurveIndex pIndex, KFCurve *pSourceCurve, int pSourceIndex)
 Resize fcurve buffer to hold a certain number of key.
int KeyMove (kFCurveIndex pIndex, KTime pTime)
 Change time of key found at given index.
bool KeyMoveOf (bool pSelectedOnly, KTime pDeltaTime, kFCurveDouble pDeltaValue)
 Add time and value offsets to keys, all or selected only.
bool KeyMoveValueTo (bool pSelectedOnly, kFCurveDouble pValue)
 Set value of keys, all or selected only.
bool KeyScaleValue (bool pSelectedOnly, kFCurveDouble pMultValue)
 Scale value of keys, all or selected only.
bool KeyScaleTangeant (bool pSelectedOnly, kFCurveDouble pMultValue)
 Scale tangent of keys, all or selected only.
bool KeyScaleValueAndTangeant (bool pSelectedOnly, kFCurveDouble pMultValue)
 Scale value and tangent of keys, all or selected only.
bool KeyRemove (kFCurveIndex pIndex)
 Remove key at given index.
int KeyInsert (KTime pTime, kFCurveIndex *pLast=NULL)
 Insert a key at given time.
int KeyAdd (KTime pTime, KFCurveKey &pKey, kFCurveIndex *pLast=NULL)
 Add a key at given time.
int KeyAdd (KTime pTime, KFCurve *pSourceCurve, int pSourceIndex, kFCurveIndex *pLast=NULL)
 Resize fcurve buffer to hold a certain number of key.
int KeyAdd (KTime pTime, kFCurveIndex *pLast=NULL)
 Add a key at given time.
int KeyAppend (KTime pAtTime, KFCurve *pSourceCurve, int pSourceIndex)
 Append a key at the end of the function curve.
int KeyAppendFast (KTime pTime, kFCurveDouble pValue)
 Append a key at the end of the function curve.
double KeyFind (KTime pTime, kFCurveIndex *pLast=NULL)
 Find key index for a given time.

Key Manipulation

void KeySet (kFCurveIndex pKeyIndex, KTime pTime, kFCurveDouble pValue, kFCurveInterpolation pInterpolation=KFCURVE_INTERPOLATION_CUBIC, kFCurveTangeantMode pTangentMode=KFCURVE_TANGEANT_AUTO, kFCurveDouble pData0=0.0, kFCurveDouble pData1=0.0, kFCurveTangeantWeightMode pTangentWeightMode=KFCURVE_WEIGHTED_NONE, kFCurveDouble pWeight0=KFCURVE_DEFAULT_WEIGHT, kFCurveDouble pWeight1=KFCURVE_DEFAULT_WEIGHT, kFCurveDouble pVelocity0=KFCURVE_DEFAULT_VELOCITY, kFCurveDouble pVelocity1=KFCURVE_DEFAULT_VELOCITY)
 Set a key.
void KeySetTCB (kFCurveIndex pKeyIndex, KTime pTime, kFCurveDouble pValue, float pData0=0.0f, float pData1=0.0f, float pData2=0.0f)
 Set a key with cubic interpolation, TCB tangent mode.
kFCurveInterpolation KeyGetInterpolation (kFCurveIndex pKeyIndex)
 Get key interpolation type.
void KeySetInterpolation (kFCurveIndex pKeyIndex, kFCurveInterpolation pInterpolation)
 Set key interpolation type.
kFCurveConstantMode KeyGetConstantMode (kFCurveIndex pKeyIndex)
 Get key constant mode.
kFCurveTangeantMode KeyGetTangeantMode (kFCurveIndex pKeyIndex, bool pIncludeOverrides=false)
 Get key tangent mode.
kFCurveTangeantWeightMode KeyGetTangeantWeightMode (kFCurveIndex pKeyIndex)
 Get key tangent weight mode.
kFCurveTangeantVelocityMode KeyGetTangeantVelocityMode (kFCurveIndex pKeyIndex)
 Get key tangent velocity mode.
void KeySetConstantMode (kFCurveIndex pKeyIndex, kFCurveConstantMode pMode)
 Set key constant mode.
void KeySetTangeantMode (kFCurveIndex pKeyIndex, kFCurveTangeantMode pTangent)
 Set key tangent mode.
void KeySetTangeantWeightMode (kFCurveIndex pKeyIndex, kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask=KFCURVE_WEIGHTED_ALL)
 Set key tengent weight mode as double value (cubic interpolation, non TCB tangent mode).
void KeySetTangeantVelocityMode (kFCurveIndex pKeyIndex, kFCurveTangeantVelocityMode pTangentVelocityMode, kFCurveTangeantVelocityMode pMask=KFCURVE_VELOCITY_ALL)
 Set key tengent velocity mode as double value (cubic interpolation, non TCB tangent mode).
kFCurveDouble KeyGetDataDouble (kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex)
 Get key data as double value (cubic interpolation, non TCB tangent mode).
void KeySetDataDouble (kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex, kFCurveDouble pValue)
 Set data as double value (cubic interpolation, non TCB tangent mode).
float KeyGetDataFloat (kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex)
 Get key data as float value (cubic interpolation, TCB tangent mode).
void KeySetDataFloat (kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex, float pValue)
 Set data as float value (cubic interpolation, TCB tangent mode).
const float * KeyGetDataPtr (kFCurveIndex pKeyIndex)
 Get key data as a pointer Warning: not supported in 'double' mode.
kFCurveDouble KeyGetValue (kFCurveIndex pKeyIndex)
 Get key value.
void KeySetValue (kFCurveIndex pKeyIndex, kFCurveDouble pValue)
 Set key value.
void KeyIncValue (kFCurveIndex pKeyIndex, kFCurveDouble pValue)
 Increment key value.
void KeyMultValue (kFCurveIndex pKeyIndex, kFCurveDouble pValue)
 Multiply key value.
void KeyMultTangeant (kFCurveIndex pKeyIndex, kFCurveDouble pValue)
 Multiply key tangents.
KTime KeyGetTime (kFCurveIndex pKeyIndex)
 Get key time.
void KeySetTime (kFCurveIndex pKeyIndex, KTime pTime)
 Set key time.
void KeyIncTime (kFCurveIndex pKeyIndex, KTime pTime)
 Increment key time.
void KeySetSelected (kFCurveIndex pKeyIndex, bool pSelected)
 Set if key is currently selected.
bool KeyGetSelected (kFCurveIndex pKeyIndex)
 Return if key is currently selected.
void KeySetMarkedForManipulation (kFCurveIndex pKeyIndex, bool pMark)
 Set if key is currently marked for manipulation.
bool KeyGetMarkedForManipulation (kFCurveIndex pKeyIndex)
 Return if key is currently marked for manipulation.
void KeySetTangeantVisibility (kFCurveIndex pKeyIndex, kFCurveTangeantVisibility pVisibility)
 Set tangent visibility mode.
kFCurveTangeantVisibility KeyGetTangeantVisibility (kFCurveIndex pKeyIndex)
 Return tangent visibility mode.
void KeySetBreak (kFCurveIndex pKeyIndex, bool pVal)
 Set/Unset Break tangeant Only valid for User and Auto keys.
bool KeyGetBreak (kFCurveIndex pKeyIndex)
 Get if tangeant is break Only valid for User and Auto keys.

Key Tangent Management

void KeyTangeantSetInterpolation (bool pSelectedOnly, kFCurveInterpolation pInterpolation)
 Set interpolation type on keys, all or selected only.
void KeyTangeantSetMode (bool pSelectedOnly, kFCurveTangeantMode pTangentMode)
 Set tangent mode on keys, all or selected only.
kFCurveDouble KeyGetLeftDerivative (kFCurveIndex pIndex)
 Get the left derivative of a key.
void KeySetLeftDerivative (kFCurveIndex pIndex, kFCurveDouble pValue)
 Set the left derivative of a key.
kFCurveDouble KeyGetLeftAuto (kFCurveIndex pIndex, bool pApplyOvershootProtection=false)
 Get the left auto parametric of a key.
void KeySetLeftAuto (kFCurveIndex pIndex, kFCurveDouble pValue)
 Set the left auto parametric of a key.
KFCurveTangeantInfo KeyGetLeftDerivativeInfo (kFCurveIndex pIndex)
 Get the left derivative info of a key.
void KeySetLeftDerivativeInfo (kFCurveIndex pIndex, KFCurveTangeantInfo pValue, bool pForceDerivative=false)
 Set the left derivative info of a key.
void KeyIncLeftDerivative (kFCurveIndex pIndex, kFCurveDouble pInc)
 Increment the left derivative of a key.
kFCurveDouble KeyGetRightDerivative (kFCurveIndex pIndex)
 Get the right derivative of a key.
void KeySetRightDerivative (kFCurveIndex pIndex, kFCurveDouble pValue)
 Set the right derivative of a key.
kFCurveDouble KeyGetRightAuto (kFCurveIndex pIndex, bool pApplyOvershootProtection=false)
 Get the right auto parametric of a key.
void KeySetRightAuto (kFCurveIndex pIndex, kFCurveDouble pValue)
 Set the right auto parametric of a key.
KFCurveTangeantInfo KeyGetRightDerivativeInfo (kFCurveIndex pIndex)
 Get the right derivative info of a key.
void KeySetRightDerivativeInfo (kFCurveIndex pIndex, KFCurveTangeantInfo pValue, bool pForceDerivative=false)
 Set the right derivative info of a key.
void KeyIncRightDerivative (kFCurveIndex pIndex, kFCurveDouble pInc)
 Increment the right derivative of a key.
kFCurveDouble KeyGetRightBezierTangeant (kFCurveIndex pIndex)
 This function is disabled and always return 0.
void KeySetLeftBezierTangeant (kFCurveIndex pIndex, kFCurveDouble pValue)
 Set the left derivative of a key as a Bezier tangent.
kFCurveDouble KeyGetLeftBezierTangeant (kFCurveIndex pIndex)
 This function is disabled and always returns 0.
void KeySetRightBezierTangeant (kFCurveIndex pIndex, kFCurveDouble pValue)
 Set the right derivative of a key as a Bezier tangent.
void KeyMultDerivative (kFCurveIndex pIndex, kFCurveDouble pMultValue)
 Multiply the Derivative of a key.
bool KeyIsLeftTangeantWeighted (kFCurveIndex pIndex)
 Get the left tangent weight mode of a key.
bool KeyIsRightTangeantWeighted (kFCurveIndex pIndex)
 Get the right tangent weight mode of a key.
void KeySetLeftTangeantWeightedMode (kFCurveIndex pIndex, bool pWeighted)
 Set the left tangent weight mode of a key.
void KeySetRightTangeantWeightedMode (kFCurveIndex pIndex, bool pWeighted)
 Set the right tangent weight mode of a key.
kFCurveDouble KeyGetLeftTangeantWeight (kFCurveIndex pIndex)
 Get the weight value component of the left tangent of a key.
kFCurveDouble KeyGetRightTangeantWeight (kFCurveIndex pIndex)
 Get the weight value component of the right tangent of a key.
void KeySetLeftTangeantWeight (kFCurveIndex pIndex, kFCurveDouble pWeight)
 Set the left tangent weight of a key.
void KeySetRightTangeantWeight (kFCurveIndex pIndex, kFCurveDouble pWeight)
 Set the right tangent weight of a key.
bool KeyIsLeftTangeantVelocity (kFCurveIndex pIndex)
 Get the left tangent velocity mode of a key.
bool KeyIsRightTangeantVelocity (kFCurveIndex pIndex)
 Get the right tangent velocity mode of a key.
void KeySetLeftTangeantVelocityMode (kFCurveIndex pIndex, bool pVelocity)
 Set the left tangent velocity mode of a key.
void KeySetRightTangeantVelocityMode (kFCurveIndex pIndex, bool pVelocity)
 Set the right tangent velocity mode of a key.
kFCurveDouble KeyGetLeftTangeantVelocity (kFCurveIndex pIndex)
 Get the velocity value component of the left tangent of a key.
kFCurveDouble KeyGetRightTangeantVelocity (kFCurveIndex pIndex)
 Get the velocity value component of the right tangent of a key.
void KeySetLeftTangeantVelocity (kFCurveIndex pIndex, kFCurveDouble pVelocity)
 Set the left tangent velocity of a key.
void KeySetRightTangeantVelocity (kFCurveIndex pIndex, kFCurveDouble pVelocity)
 Set the right tangent velocity of a key.

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.

  • KFCURVE_EXTRAPOLATION_CONST means a constant value matching the first/last key
  • KFCURVE_EXTRAPOLATION_REPETITION means the entire function curve is looped
  • KFCURVE_EXTRAPOLATION_MIRROR_REPETITION means the entire function curve is looped once backward, once forward and so on
  • KFCURVE_EXTRAPOLATION_KEEP_SLOPE means a linear function with a slope matching the first/last key


void SetPreExtrapolation (kFCurveExtrapolationMode pExtrapolation)
 Set pre-extrapolation mode.
kFCurveExtrapolationMode GetPreExtrapolation ()
 Get pre-extrapolation mode.
void SetPreExtrapolationCount (kULong pCount)
 Set pre-extrapolation count.
kULong GetPreExtrapolationCount ()
 Get pre-extrapolation count.
void SetPostExtrapolation (kFCurveExtrapolationMode pExtrapolation)
 Set post-extrapolation mode.
kFCurveExtrapolationMode GetPostExtrapolation ()
 Get post-extrapolation mode.
void SetPostExtrapolationCount (kULong pCount)
 Set post-extrapolation count.
kULong GetPostExtrapolationCount ()
 Get post-extrapolation count.
int KeyGetCountAll ()
 Get total number of keys taking extrapolation into account.
double KeyFindAll (KTime pTime, kFCurveIndex *pLast=NULL)
 Find key index for a given time taking extrapolation into account.
K_DEPRECATED KFCurveKeyKeyGetRawAll (kFCurveIndex pIndex)
 Get reference to key at given index taking extrapolation into account.
K_DEPRECATED KTime KeyGetTimeAll (kFCurveIndex pIndex)
 Get time of key at given index taking extrapolation into account.

Evaluation and Analysis

kFCurveDouble Evaluate (KTime pTime, kFCurveIndex *pLast=NULL)
 Evaluate function curve value at a given time.
kFCurveDouble EvaluateIndex (double pIndex)
 Evaluate function curve value at a given key index.
kFCurveDouble EvaluateLeftDerivative (KTime pTime, kFCurveIndex *pLast=NULL)
 Evaluate function left derivative at given time.
kFCurveDouble EvaluateRightDerivative (KTime pTime, kFCurveIndex *pLast=NULL)
 Evaluate function right derivative at given time.
int FindPeaks (kFCurveIndex pLeftKeyIndex, KTime &pPeakTime1, KTime &pPeakTime2)
 Find the peaks time between 2 keys (a local minimum and/or maximum).
int FindPeaks (kFCurveIndex pLeftKeyIndex, kFCurveDouble &pPeak1, kFCurveDouble &pPeak2)
 Find the peaks value between 2 keys (a local minimum and/or maximum).
int FindPeaks (kFCurveIndex pLeftKeyIndex, KTime &pPeakTime1, kFCurveDouble &pPeak1, KTime &pPeakTime2, kFCurveDouble &pPeak2)
 Find the peaks time and value between 2 keys (a local minimum and/or maximum).
K_DEPRECATED KTime KeyGetAverageRate (bool *pIsIso=NULL, KTime *pIsoPeriod=NULL, KTime *pMaxPeriod=NULL)
 Get average period between keys.
void KeyGetPeriods (KTime &pAveragePeriod, KTime &pMinPeriod, KTime &pMaxPeriod)
 Get key period statistics.

Copy, Insert, Replace and Delete Functions

HKFCurve Copy (KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE)
 Create a new function curve and copy keys found between a given time range.
void CopyFrom (KFCurve &pSource, bool pWithKeys=true)
 Copy a function curve content into current function curve.
void Replace (HKFCurve pSource, KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE, bool pUseExactGivenSpan=false, bool pKeyStartEndOnNoKey=true, KTime pTimeSpanOffset=KTIME_ZERO)
 Replace keys within a range in current function curve with keys found in a source function curve.
void ReplaceForQuaternion (HKFCurve pSource, KTime pStart, KTime pStop, kFCurveDouble pScaleStart, kFCurveDouble pScaleStop, bool pUseExactGivenSpan=false, bool pKeyStartEndOnNoKey=true, KTime pTimeSpanOffset=KTIME_ZERO)
 Replace keys within a range in current function curve with keys found in a source function curve.
void ReplaceForEulerXYZ (HKFCurve pSource, KTime pStart, KTime pStop, kFCurveDouble pAddFromStart, kFCurveDouble pAddAfterStop, bool pValueSubOffsetAfterStart, bool pValueSubOffsetAfterStop, bool pUseExactGivenSpan=false, bool pKeyStartEndOnNoKey=true, KTime pTimeSpanOffset=KTIME_ZERO)
 Replace keys within a range in current function curve with keys found in a source function curve.
void Insert (HKFCurve pSource, KTime pInsertTime, kFCurveDouble pFirstKeyLeftDerivative, bool pFirstKeyIsWeighted=false, kFCurveDouble pFirstKeyWeight=KFCURVE_DEFAULT_WEIGHT)
 Insert all keys found in a source function curve in current function curve.
void Insert (HKFCurve pSource, KTime pInsertTime, KFCurveTangeantInfo pFirstKeyLeftDerivative)
 Insert all keys found in a source function curve in current function curve.
bool Delete (kFCurveIndex pStartIndex, kFCurveIndex pStopIndex)
 Delete keys within an index range.
bool Delete (KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE)
 Delete keys within a time range.
bool IsKeyInterpolationPureCubicAuto (kFCurveIndex pKeyIndex)
 Get if interpolation is cubic and that the tangents and weightings are untouched.
void ExtractKeysIndex (KArraykInt &pArray, int pMinIndex, int pMaxIndex, double pMinValue=-K_DOUBLE_MAX, double pMaxValue=K_DOUBLE_MAX)
 Extract All Keys in the Given Selection Span.


Constructor & Destructor Documentation

KFCurve (  ) 

Constructor.

virtual ~KFCurve (  )  [virtual]

Destructor.


Member Function Documentation

IObject_Declare ( Implementation   ) 

Get function curve color.

Returns:
Pointer to an array of 3 elements: RGB values on a scale from 0 to 1.

void SetColor ( float *  pColor  ) 

Set function curve color.

Parameters:
pColor Pointer to an array of 3 elements: RGB values on a scale from 0 to 1.

void SetValue ( kFCurveDouble  pValue  ) 

Set default value.

Default value is used when there is no key in the function curve.

Parameters:
pValue Default value.

kFCurveDouble GetValue (  )  const [inline]

Get default value.

Default value is used when there is no key in the function curve.

Returns:
Default value.

void ResizeKeyBuffer ( int  pKeyCount  ) 

Resize fcurve buffer to hold a certain number of key.

Parameters:
pKeyCount Number of key the function curve will eventually hold.

void KeyModifyBegin (  ) 

Call this function prior to modify the keys of a function curve.

Call function KFCurve::KeyModifyEnd() after modification of the keys are completed.

void KeyModifyEnd (  ) 

Call this function after modification of the keys of a function curve.

Call function KFCurve::KeyModifyBegin() prior to modify the keys.

K_DEPRECATED void KeyModifyBegin ( int  pKeyCount  ) 

Call this function prior to modify the keys of a function curve (DEPRECATED).

Call function KFCurve::KeyModifyEnd(int pKeyCount) after modification of the keys are completed.

Parameters:
pKeyCount Number of keys to pre-allocate in the function curve. This parameter specifies the total number of keys in the function curve key buffers.
Deprecated; use ResizeKeyBuffer(pKeyCount); KeyModifyBegin(); instead.

K_DEPRECATED void KeyModifyEnd ( int  pKeyCount  ) 

Call this function after modification of the keys of a function curve (DEPRECATED).

Call function KFCurve::KeyModifyBegin(int pKeyCount) prior to modify the keys.

Parameters:
pKeyCount Number of valid keys set in the function curve key buffers.
Deprecated; use KeyModifyEnd(); instead.

int KeyGetCount (  ) 

Get the number of keys.

int KeyGetSelectionCount (  ) 

Get the number of selected keys.

void KeySelectAll (  ) 

Resize fcurve buffer to hold a certain number of key.

Parameters:
pKeyCount Number of key the function curve will eventually hold.

void KeyUnselectAll (  ) 

Resize fcurve buffer to hold a certain number of key.

Parameters:
pKeyCount Number of key the function curve will eventually hold.

KFCurveKey KeyGet ( kFCurveIndex  pIndex  ) 

Get key at given index.

Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

K_DEPRECATED KFCurveKey& KeyGetRaw ( kFCurveIndex  pIndex  )  [inline]

Get reference to key at given index (DEPRECATED).

Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

This function is deprecated. Use KFCurve functionnality to access or modify key data.

K_DEPRECATED KFCurveKey* KeyGetPtr ( kFCurveIndex  pIndex  )  [inline]

Get pointer to key at given index (DEPRECATED).

Remarks:
Result is undetermined if function curve has no key or index is out of bounds. The keys are not necessarily stored in a continuous buffer so incrementing or decrementing the returned pointer may not lead to another key.

This function is deprecated. Use KFCurve functionnality to access or modify key data.

void KeyClear (  ) 

Remove all the keys and free buffer memory.

void KeyShrink (  ) 

Minimize use of buffer memory.

bool KeySet ( kFCurveIndex  pIndex,
KFCurveKey pKey 
)

Set key at given index.

Remarks:
Result is undetermined if function curve has no key or index is out of bounds.
Returns:
true if key time is superior to previous key and inferior to next key.

bool KeySet ( kFCurveIndex  pIndex,
KFCurve pSourceCurve,
int  pSourceIndex 
) [inline]

Resize fcurve buffer to hold a certain number of key.

Parameters:
pKeyCount Number of key the function curve will eventually hold.

int KeyMove ( kFCurveIndex  pIndex,
KTime  pTime 
)

Change time of key found at given index.

Parameters:
pIndex Index of key to move.
pTime Destination time.
Returns:
New index of moved key.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

bool KeyMoveOf ( bool  pSelectedOnly,
KTime  pDeltaTime,
kFCurveDouble  pDeltaValue 
)

Add time and value offsets to keys, all or selected only.

Parameters:
pSelectedOnly If set to true, only selected keys are affected. Otherwise, all keys are affected.
pDeltaTime Time offset added to keys.
pDeltaValue Value offset added to keys.
Returns:
true on success.

bool KeyMoveValueTo ( bool  pSelectedOnly,
kFCurveDouble  pValue 
)

Set value of keys, all or selected only.

Parameters:
pSelectedOnly If set to true, only selected keys are affected. Otherwise, all keys are affected.
pValue Value set to keys.
Returns:
true on success.

bool KeyScaleValue ( bool  pSelectedOnly,
kFCurveDouble  pMultValue 
)

Scale value of keys, all or selected only.

Parameters:
pSelectedOnly If set to true, only selected keys are affected. Otherwise, all keys are affected.
pMultValue Scale applied on key values.
Returns:
true on success.

bool KeyScaleTangeant ( bool  pSelectedOnly,
kFCurveDouble  pMultValue 
)

Scale tangent of keys, all or selected only.

Parameters:
pSelectedOnly If set to true, only selected keys are affected. Otherwise, all keys are affected.
pMultValue Scale applied on key tangents.
Returns:
true on success.

bool KeyScaleValueAndTangeant ( bool  pSelectedOnly,
kFCurveDouble  pMultValue 
)

Scale value and tangent of keys, all or selected only.

Parameters:
pSelectedOnly If set to true, only selected keys are affected. Otherwise, all keys are affected.
pMultValue Scale applied on key values and tangents.
Returns:
true on success.

bool KeyRemove ( kFCurveIndex  pIndex  ) 

Remove key at given index.

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

int KeyInsert ( KTime  pTime,
kFCurveIndex pLast = NULL 
)

Insert a key at given time.

This function SHOULD be used instead of KFCurve::KeyAdd() if the key is to be added in the curve and not at the end. It inserts the key in respect to the interpolation type and tangents of the neighboring keys. If there is already a key a the given time, the key is modified and no new key is added.

Parameters:
pTime Time to insert the key.
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 inserted or already present.
Remarks:
Key value must be set explicitly afterwards. The interpolation type and tangent mode are copied from the previous key.

int KeyAdd ( KTime  pTime,
KFCurveKey pKey,
kFCurveIndex pLast = NULL 
)

Add a key at given time.

Function KFCurve::KeyInsert() SHOULD be used instead if the key is to be added in the curve and not at the end. This function does not respect the interpolation type and tangents of the neighboring keys. If there is already a key at the given time, the key is modified and no new key is added.

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.
Remarks:
Key value, interpolation type and tangent mode must be set explicitly afterwards.

int KeyAdd ( KTime  pTime,
KFCurve pSourceCurve,
int  pSourceIndex,
kFCurveIndex pLast = NULL 
)

Resize fcurve buffer to hold a certain number of key.

Parameters:
pKeyCount Number of key the function curve will eventually hold.

int KeyAdd ( KTime  pTime,
kFCurveIndex pLast = NULL 
)

Add a key at given time.

Function KFCurve::KeyInsert() SHOULD be used instead if the key is to be added in the curve and not at the end. This function does not respect of the interpolation type and tangents of the neighboring keys. If there is already a key a the given time, no key is added.

Parameters:
pTime Time to add the key.
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.
Remarks:
Key value, interpolation type and tangent mode must be set explicitely afterwards.

int KeyAppend ( KTime  pAtTime,
KFCurve pSourceCurve,
int  pSourceIndex 
)

Append a key at the end of the function curve.

Parameters:
pTime Time of appended key, must be superior to the last key time.
pSourceCurve Source curve.
pSourceIndex Index of the source key in the source curve.
Returns:
Index of appended key.

int KeyAppendFast ( KTime  pTime,
kFCurveDouble  pValue 
)

Append a key at the end of the function curve.

Parameters:
pTime Time of appended key, must be superior to the last key time.
pValue Value of appended key.
Returns:
Index of appended key.
Remarks:
Interpolation type of the appended key is set to KFCURVE_INTERPOLATION_CUBIC and tangent mode is set to KFCURVE_TANGEANT_AUTO.

double KeyFind ( KTime  pTime,
kFCurveIndex pLast = NULL 
)

Find key index for a given time.

Parameters:
pTime Time of the key looked for.
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:
Key index. The integer part of the key index gives the index of the closest key with a smaller time. The decimals give the relative position of given time compared to previous and next key times. Returns -1 if function curve has no key.

void KeySet ( kFCurveIndex  pKeyIndex,
KTime  pTime,
kFCurveDouble  pValue,
kFCurveInterpolation  pInterpolation = KFCURVE_INTERPOLATION_CUBIC,
kFCurveTangeantMode  pTangentMode = KFCURVE_TANGEANT_AUTO,
kFCurveDouble  pData0 = 0.0,
kFCurveDouble  pData1 = 0.0,
kFCurveTangeantWeightMode  pTangentWeightMode = KFCURVE_WEIGHTED_NONE,
kFCurveDouble  pWeight0 = KFCURVE_DEFAULT_WEIGHT,
kFCurveDouble  pWeight1 = KFCURVE_DEFAULT_WEIGHT,
kFCurveDouble  pVelocity0 = KFCURVE_DEFAULT_VELOCITY,
kFCurveDouble  pVelocity1 = KFCURVE_DEFAULT_VELOCITY 
) [inline]

Set a key.

Use SetTCB() to set a key with cubic interpolation and TCB tangent type.

Parameters:
pTime Key time.
pValue Key value.
pInterpolation Key interpolation type. Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC
pTangentMode Key tangent mode (meaningful for cubic interpolation only). Tangent modes are: KFCURVE_TANGEANT_AUTO, KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK
pData0 Right slope.
pData1 Next left slope.
pTangentWeightMode Weight mode if used KFCURVE_WEIGHTED_NONE KFCURVE_WEIGHTED_RIGHT KFCURVE_WEIGHTED_NEXT_LEFT KFCURVE_WEIGHTED_ALL
pWeight0 Right slope weight.
pWeight1 Next left slope weight.
pVelocity0 Right velocity.
pVelocity1 Next left velocity.

void KeySetTCB ( kFCurveIndex  pKeyIndex,
KTime  pTime,
kFCurveDouble  pValue,
float  pData0 = 0.0f,
float  pData1 = 0.0f,
float  pData2 = 0.0f 
) [inline]

Set a key with cubic interpolation, TCB tangent mode.

Parameters:
pTime Key time.
pValue Key value.
pData0 Tension.
pData1 Continuity.
pData2 Bias.

kFCurveInterpolation KeyGetInterpolation ( kFCurveIndex  pKeyIndex  )  [inline]

Get key interpolation type.

Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC

void KeySetInterpolation ( kFCurveIndex  pKeyIndex,
kFCurveInterpolation  pInterpolation 
) [inline]

Set key interpolation type.

Parameters:
pInterpolation Key interpolation type. Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC

kFCurveConstantMode KeyGetConstantMode ( kFCurveIndex  pKeyIndex  )  [inline]

Get key constant mode.

Warning: This method is meaningful for constant interpolation only. Using this method for non constant interpolated key will return unpredicted value. Constant modes are: KFCURVE_CONSTANT_STANDARD KFCURVE_CONSTANT_NEXT

Returns:
Key constant mode.

kFCurveTangeantMode KeyGetTangeantMode ( kFCurveIndex  pKeyIndex,
bool  pIncludeOverrides = false 
) [inline]

Get key tangent mode.

Warning: This method is meaningful for cubic interpolation only. Using this method for non cubic interpolated key will return unpredicted value. Tangent modes are: KFCURVE_TANGEANT_AUTO, KFCURVE_TANGEANT_AUTO_BREAK KFCURVE_TANGEANT_TCB, KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK

Returns:
Key tangent mode.

kFCurveTangeantWeightMode KeyGetTangeantWeightMode ( kFCurveIndex  pKeyIndex  )  [inline]

Get key tangent weight mode.

Warning: This method is meaningful for cubic interpolation only. Tangent weight modes are: KFCURVE_WEIGHTED_NONE, KFCURVE_WEIGHTED_RIGHT, KFCURVE_WEIGHTED_NEXT_LEFT, KFCURVE_WEIGHTED_ALL

kFCurveTangeantVelocityMode KeyGetTangeantVelocityMode ( kFCurveIndex  pKeyIndex  )  [inline]

Get key tangent velocity mode.

Warning: This method is meaningful for cubic interpolation only. Tangent weight modes are: KFCURVE_VELOCITY_NONE, KFCURVE_VELOCITY_RIGHT, KFCURVE_VELOCITY_NEXT_LEFT, KFCURVE_VELOCITY_ALL

void KeySetConstantMode ( kFCurveIndex  pKeyIndex,
kFCurveConstantMode  pMode 
) [inline]

Set key constant mode.

Warning: This method is meaningful for constant interpolation only.

Parameters:
pMode Key consant mode. Constant modes are: KFCURVE_CONSTANT_STANDARD KFCURVE_CONSTANT_NEXT

void KeySetTangeantMode ( kFCurveIndex  pKeyIndex,
kFCurveTangeantMode  pTangent 
) [inline]

Set key tangent mode.

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pTangent Key tangent mode. Tangent modes are: KFCURVE_TANGEANT_AUTO, KFCURVE_TANGEANT_AUTO_BREAK KFCURVE_TANGEANT_TCB, KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK

void KeySetTangeantWeightMode ( kFCurveIndex  pKeyIndex,
kFCurveTangeantWeightMode  pTangentWeightMode,
kFCurveTangeantWeightMode  pMask = KFCURVE_WEIGHTED_ALL 
) [inline]

Set key tengent weight mode as double value (cubic interpolation, non TCB tangent mode).

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pTangentWeightMode Weight mode KFCURVE_WEIGHTED_NONE KFCURVE_WEIGHTED_RIGHT KFCURVE_WEIGHTED_NEXT_LEFT KFCURVE_WEIGHTED_ALL
pMask Used to select the affected tangents KFCURVE_WEIGHTED_RIGHT KFCURVE_WEIGHTED_NEXT_LEFT KFCURVE_WEIGHTED_ALL

void KeySetTangeantVelocityMode ( kFCurveIndex  pKeyIndex,
kFCurveTangeantVelocityMode  pTangentVelocityMode,
kFCurveTangeantVelocityMode  pMask = KFCURVE_VELOCITY_ALL 
) [inline]

Set key tengent velocity mode as double value (cubic interpolation, non TCB tangent mode).

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pTangentVelocityMode Weight mode KFCURVE_VELOCITY_NONE KFCURVE_VELOCITY_RIGHT KFCURVE_VELOCITY_NEXT_LEFT KFCURVE_VELOCITY_ALL
pMask Used to select the affected tangents KFCURVE_VELOCITY_RIGHT KFCURVE_VELOCITY_NEXT_LEFT KFCURVE_VELOCITY_ALL

kFCurveDouble KeyGetDataDouble ( kFCurveIndex  pKeyIndex,
EKFCurveDataIndex  pIndex 
) [inline]

Get key data as double value (cubic interpolation, non TCB tangent mode).

Warning: Using this method for other than cubic interpolated key (linear, constant) will return unpredicted values. Warning: Slope data is inconsistent for automatic tangent mode. Use KFCurve::EvaluateLeftDerivative() and KFCurve::EvaluateRightDerivative() to find slope values. Warning: Using this method for TCB tangent mode key will return unpredicted values. Use KFCurve::GetDataFloat() instead.

Parameters:
pIndex Data index, either KFCURVEKEY_RIGHT_SLOPE, KFCURVEKEY_NEXT_LEFT_SLOPE. KFCURVEKEY_NEXT_RIGHT_WEIGHT. KFCURVEKEY_NEXT_LEFT_WEIGHT

void KeySetDataDouble ( kFCurveIndex  pKeyIndex,
EKFCurveDataIndex  pIndex,
kFCurveDouble  pValue 
) [inline]

Set data as double value (cubic interpolation, non TCB tangent mode).

Warning: Using this method for other than cubic interpolated key (linear, constant) is irrelevant. Warning: Slope data is inconsistent for automatic tangent mode. Therefore, it is irrelevant to use this method on automatic tangent mode keys. Warning: Using this method for a TCB tangeant mode key will result in unpredicted curve behavior for this key. Use KFCurve::SetDataFloat() instead.

Parameters:
pIndex Data index, either KFCURVEKEY_RIGHT_SLOPE, KFCURVEKEY_NEXT_LEFT_SLOPE. KFCURVEKEY_NEXT_RIGHT_WEIGHT. KFCURVEKEY_NEXT_LEFT_WEIGHT
pValue The data value to set (a slope or a weight).

float KeyGetDataFloat ( kFCurveIndex  pKeyIndex,
EKFCurveDataIndex  pIndex 
) [inline]

Get key data as float value (cubic interpolation, TCB tangent mode).

Warning: Using this method for any key but a cubic interpolated, in TCB tangent mode, will return unpredicted values.

Parameters:
pIndex Data index, either KFCURVEKEY_TCB_TENSION, KFCURVEKEY_TCB_CONTINUITY or KFCURVEKEY_TCB_BIAS.

void KeySetDataFloat ( kFCurveIndex  pKeyIndex,
EKFCurveDataIndex  pIndex,
float  pValue 
) [inline]

Set data as float value (cubic interpolation, TCB tangent mode).

Warning: Using this method for any key but a cubic interpolated, in TCB tangent mode, will return unpredicted values.

Parameters:
pIndex Data index, either KFCURVEKEY_TCB_TENSION, KFCURVEKEY_TCB_CONTINUITY or KFCURVEKEY_TCB_BIAS.
pValue The data value to set.

const float* KeyGetDataPtr ( kFCurveIndex  pKeyIndex  )  [inline]

Get key data as a pointer Warning: not supported in 'double' mode.

kFCurveDouble KeyGetValue ( kFCurveIndex  pKeyIndex  )  [inline]

Get key value.

void KeySetValue ( kFCurveIndex  pKeyIndex,
kFCurveDouble  pValue 
) [inline]

Set key value.

void KeyIncValue ( kFCurveIndex  pKeyIndex,
kFCurveDouble  pValue 
) [inline]

Increment key value.

Parameters:
pValue Value by which key value is incremented.

void KeyMultValue ( kFCurveIndex  pKeyIndex,
kFCurveDouble  pValue 
) [inline]

Multiply key value.

Parameters:
pValue Value by which the key value is multiplied.

void KeyMultTangeant ( kFCurveIndex  pKeyIndex,
kFCurveDouble  pValue 
) [inline]

Multiply key tangents.

Note: When multiplying a key value, tangents must be multiplied to conserve the same topology.

Parameters:
pValue Value by which key tangents are multiplied.

KTime KeyGetTime ( kFCurveIndex  pKeyIndex  )  [inline]

Get key time.

Returns:
Key time (time at which this key is occuring).

void KeySetTime ( kFCurveIndex  pKeyIndex,
KTime  pTime 
) [inline]

Set key time.

Parameters:
pTime Key time (time at which this key is occuring).

void KeyIncTime ( kFCurveIndex  pKeyIndex,
KTime  pTime 
) [inline]

Increment key time.

Parameters:
pTime Time value by which the key time is incremented.

void KeySetSelected ( kFCurveIndex  pKeyIndex,
bool  pSelected 
) [inline]

Set if key is currently selected.

Parameters:
pSelected Selection flag.

bool KeyGetSelected ( kFCurveIndex  pKeyIndex  )  [inline]

Return if key is currently selected.

Returns:
Selection flag.

void KeySetMarkedForManipulation ( kFCurveIndex  pKeyIndex,
bool  pMark 
) [inline]

Set if key is currently marked for manipulation.

Parameters:
pMark Mark flag.

bool KeyGetMarkedForManipulation ( kFCurveIndex  pKeyIndex  )  [inline]

Return if key is currently marked for manipulation.

Returns:
Mark flag.

void KeySetTangeantVisibility ( kFCurveIndex  pKeyIndex,
kFCurveTangeantVisibility  pVisibility 
) [inline]

Set tangent visibility mode.

Warning: This method is meaningful for cubic interpolation only.

Parameters:
pVisibility Tangent visibility mode. Tangent visibility modes are: KFCURVE_TANGEANT_SHOW_NONE KFCURVE_TANGEANT_SHOW_LEFT KFCURVE_TANGEANT_SHOW_RIGHT

kFCurveTangeantVisibility KeyGetTangeantVisibility ( kFCurveIndex  pKeyIndex  )  [inline]

Return tangent visibility mode.

Warning: This method is meaningful for cubic interpolation only.

Returns:
Tangent visibility mode. Tangent visibility modes are: KFCURVE_TANGEANT_SHOW_NONE KFCURVE_TANGEANT_SHOW_LEFT KFCURVE_TANGEANT_SHOW_RIGHT

void KeySetBreak ( kFCurveIndex  pKeyIndex,
bool  pVal 
) [inline]

Set/Unset Break tangeant Only valid for User and Auto keys.

bool KeyGetBreak ( kFCurveIndex  pKeyIndex  )  [inline]

Get if tangeant is break Only valid for User and Auto keys.

void KeyTangeantSetInterpolation ( bool  pSelectedOnly,
kFCurveInterpolation  pInterpolation 
)

Set interpolation type on keys, all or selected only.

Parameters:
pSelectedOnly If set to true, only selected keys are affected. Otherwise, all keys are affected.
pInterpolation Interpolation type.

void KeyTangeantSetMode ( bool  pSelectedOnly,
kFCurveTangeantMode  pTangentMode 
)

Set tangent mode on keys, all or selected only.

Parameters:
pSelectedOnly If set to true, only selected keys are affected. Otherwise, all keys are affected.
pTangentMode Tangent mode.
Remarks:
Tangent mode is only relevant on keys with a cubic interpolation type.

kFCurveDouble KeyGetLeftDerivative ( kFCurveIndex  pIndex  ) 

Get the left derivative of a key.

Parameters:
pIndex Index of key.
Returns:
Left derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetLeftDerivative ( kFCurveIndex  pIndex,
kFCurveDouble  pValue 
)

Set the left derivative of a key.

Parameters:
pIndex Index of key.
pValue Left derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK or KFCURVE_TANGEANT_AUTO.

kFCurveDouble KeyGetLeftAuto ( kFCurveIndex  pIndex,
bool  pApplyOvershootProtection = false 
)

Get the left auto parametric of a key.

Parameters:
pIndex Index of key.
pApplyOvershootProtection Clamp is taking into account.
Returns:
left auto parametric.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetLeftAuto ( kFCurveIndex  pIndex,
kFCurveDouble  pValue 
)

Set the left auto parametric of a key.

Parameters:
pIndex Index of key.
pValue Left auto parametric .
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK or KFCURVE_TANGEANT_AUTO.

KFCurveTangeantInfo KeyGetLeftDerivativeInfo ( kFCurveIndex  pIndex  ) 

Get the left derivative info of a key.

Parameters:
pIndex Index of key.
Returns:
Left derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetLeftDerivativeInfo ( kFCurveIndex  pIndex,
KFCurveTangeantInfo  pValue,
bool  pForceDerivative = false 
)

Set the left derivative info of a key.

Parameters:
pIndex Index of key.
pValue Left derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

void KeyIncLeftDerivative ( kFCurveIndex  pIndex,
kFCurveDouble  pInc 
)

Increment the left derivative of a key.

Parameters:
pIndex Index of key.
pInc Increment to left derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

kFCurveDouble KeyGetRightDerivative ( kFCurveIndex  pIndex  ) 

Get the right derivative of a key.

Parameters:
pIndex Index of key.
Returns:
Right derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetRightDerivative ( kFCurveIndex  pIndex,
kFCurveDouble  pValue 
)

Set the right derivative of a key.

Parameters:
pIndex Index of key.
pValue Right derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK or KFCURVE_TANGEANT_AUTO.

kFCurveDouble KeyGetRightAuto ( kFCurveIndex  pIndex,
bool  pApplyOvershootProtection = false 
)

Get the right auto parametric of a key.

Parameters:
pIndex Index of key.
pApplyOvershootProtection Clamp is taking into account.
Returns:
Right auto parametric.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetRightAuto ( kFCurveIndex  pIndex,
kFCurveDouble  pValue 
)

Set the right auto parametric of a key.

Parameters:
pIndex Index of key.
pValue Right auto parametric .
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER, KFCURVE_TANGEANT_BREAK or KFCURVE_TANGEANT_AUTO.

KFCurveTangeantInfo KeyGetRightDerivativeInfo ( kFCurveIndex  pIndex  ) 

Get the right derivative info of a key.

Parameters:
pIndex Index of key.
Returns:
Right derivative info.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetRightDerivativeInfo ( kFCurveIndex  pIndex,
KFCurveTangeantInfo  pValue,
bool  pForceDerivative = false 
)

Set the right derivative info of a key.

Parameters:
pIndex Index of key.
pValue Right derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

void KeyIncRightDerivative ( kFCurveIndex  pIndex,
kFCurveDouble  pInc 
)

Increment the right derivative of a key.

Parameters:
pIndex Index of key.
pInc Increment to right derivative.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

kFCurveDouble KeyGetRightBezierTangeant ( kFCurveIndex  pIndex  ) 

This function is disabled and always return 0.

void KeySetLeftBezierTangeant ( kFCurveIndex  pIndex,
kFCurveDouble  pValue 
)

Set the left derivative of a key as a Bezier tangent.

Parameters:
pIndex Index of key.
pValue Left derivative as a Bezier tangent.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

kFCurveDouble KeyGetLeftBezierTangeant ( kFCurveIndex  pIndex  ) 

This function is disabled and always returns 0.

void KeySetRightBezierTangeant ( kFCurveIndex  pIndex,
kFCurveDouble  pValue 
)

Set the right derivative of a key as a Bezier tangent.

Parameters:
pIndex Index of key.
pValue Right derivative as a Bezier tangent.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

void KeyMultDerivative ( kFCurveIndex  pIndex,
kFCurveDouble  pMultValue 
)

Multiply the Derivative of a key.

Parameters:
pIndex Index of key.
pMultValue Value that multiply Derivative
Remarks:
Result is undetermined if function curve has no key or index is out of bounds. This function is only relevant if key interpolation is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

bool KeyIsLeftTangeantWeighted ( kFCurveIndex  pIndex  ) 

Get the left tangent weight mode of a key.

Parameters:
pIndex Index of key.
Returns:
true if the key is weighted
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

bool KeyIsRightTangeantWeighted ( kFCurveIndex  pIndex  ) 

Get the right tangent weight mode of a key.

Parameters:
pIndex Index of key.
Returns:
true if the key is weighted
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetLeftTangeantWeightedMode ( kFCurveIndex  pIndex,
bool  pWeighted 
)

Set the left tangent weight mode of a key.

Parameters:
pIndex Index of key.
pWeighted Weighted state of the tangent This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

void KeySetRightTangeantWeightedMode ( kFCurveIndex  pIndex,
bool  pWeighted 
)

Set the right tangent weight mode of a key.

Parameters:
pIndex Index of key.
pWeighted Weighted state of the tangent This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

kFCurveDouble KeyGetLeftTangeantWeight ( kFCurveIndex  pIndex  ) 

Get the weight value component of the left tangent of a key.

Parameters:
pIndex Index of key.
Returns:
right tangen weight This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC

kFCurveDouble KeyGetRightTangeantWeight ( kFCurveIndex  pIndex  ) 

Get the weight value component of the right tangent of a key.

Parameters:
pIndex Index of key.
Returns:
right tangen weight This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC

void KeySetLeftTangeantWeight ( kFCurveIndex  pIndex,
kFCurveDouble  pWeight 
)

Set the left tangent weight of a key.

Parameters:
pIndex Index of key.
pWeight Weight This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK. The tangent is automatically set in weighted mode.

void KeySetRightTangeantWeight ( kFCurveIndex  pIndex,
kFCurveDouble  pWeight 
)

Set the right tangent weight of a key.

Parameters:
pIndex Index of key.
pWeight Weight This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK. The tangent is automatically set in weighted mode.

bool KeyIsLeftTangeantVelocity ( kFCurveIndex  pIndex  ) 

Get the left tangent velocity mode of a key.

Parameters:
pIndex Index of key.
Returns:
true if the key has velocity
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

bool KeyIsRightTangeantVelocity ( kFCurveIndex  pIndex  ) 

Get the right tangent velocity mode of a key.

Parameters:
pIndex Index of key.
Returns:
true if the key has velocity
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

void KeySetLeftTangeantVelocityMode ( kFCurveIndex  pIndex,
bool  pVelocity 
)

Set the left tangent velocity mode of a key.

Parameters:
pIndex Index of key.
pVelocity Velocity state of the tangent This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

void KeySetRightTangeantVelocityMode ( kFCurveIndex  pIndex,
bool  pVelocity 
)

Set the right tangent velocity mode of a key.

Parameters:
pIndex Index of key.
pVelocity Velocity state of the tangent This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK.

kFCurveDouble KeyGetLeftTangeantVelocity ( kFCurveIndex  pIndex  ) 

Get the velocity value component of the left tangent of a key.

Parameters:
pIndex Index of key.
Returns:
right tangen velocity This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC

kFCurveDouble KeyGetRightTangeantVelocity ( kFCurveIndex  pIndex  ) 

Get the velocity value component of the right tangent of a key.

Parameters:
pIndex Index of key.
Returns:
right tangen velocity This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC

void KeySetLeftTangeantVelocity ( kFCurveIndex  pIndex,
kFCurveDouble  pVelocity 
)

Set the left tangent velocity of a key.

Parameters:
pIndex Index of key.
pVelocity Velocity This function is only relevant if previous key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK. The tangent is automatically set in velocity mode.

void KeySetRightTangeantVelocity ( kFCurveIndex  pIndex,
kFCurveDouble  pVelocity 
)

Set the right tangent velocity of a key.

Parameters:
pIndex Index of key.
pVelocity Velocity This function is only relevant if key interpolation type is KFCURVE_INTERPOLATION_CUBIC and tangent mode is KFCURVE_TANGEANT_USER or KFCURVE_TANGEANT_BREAK. The tangent is automatically set in velocity mode.

void SetPreExtrapolation ( kFCurveExtrapolationMode  pExtrapolation  )  [inline]

Set pre-extrapolation mode.

kFCurveExtrapolationMode GetPreExtrapolation (  )  [inline]

Get pre-extrapolation mode.

void SetPreExtrapolationCount ( kULong  pCount  )  [inline]

Set pre-extrapolation count.

Parameters:
pCount Number of repetitions if pre-extrapolation mode is KFCURVE_EXTRAPOLATION_REPETITION or KFCURVE_EXTRAPOLATION_MIRROR_REPETITION.

kULong GetPreExtrapolationCount (  )  [inline]

Get pre-extrapolation count.

Returns:
Number of repetitions if pre-extrapolation mode is KFCURVE_EXTRAPOLATION_REPETITION or KFCURVE_EXTRAPOLATION_MIRROR_REPETITION.

void SetPostExtrapolation ( kFCurveExtrapolationMode  pExtrapolation  )  [inline]

Set post-extrapolation mode.

kFCurveExtrapolationMode GetPostExtrapolation (  )  [inline]

Get post-extrapolation mode.

void SetPostExtrapolationCount ( kULong  pCount  )  [inline]

Set post-extrapolation count.

Parameters:
pCount Number of repetitions if post-extrapolation mode is KFCURVE_EXTRAPOLATION_REPETITION or KFCURVE_EXTRAPOLATION_MIRROR_REPETITION.

kULong GetPostExtrapolationCount (  )  [inline]

Get post-extrapolation count.

Returns:
Number of repetitions if post-extrapolation mode is KFCURVE_EXTRAPOLATION_REPETITION or KFCURVE_EXTRAPOLATION_MIRROR_REPETITION.

int KeyGetCountAll (  ) 

Get total number of keys taking extrapolation into account.

The total number of keys includes repetitions of the function curve if pre-extrapolation and/or post-extrapolation are of mode KFCURVE_EXTRAPOLATION_REPETITION or KFCURVE_EXTRAPOLATION_MIRROR_REPETITION.

Returns:
Total number of keys taking extrapolation into account.

double KeyFindAll ( KTime  pTime,
kFCurveIndex pLast = NULL 
)

Find key index for a given time taking extrapolation into account.

Parameters:
pTime Time of the key looked for.
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:
Key index between 0 and KFCurve::KeyGetCount() - 1.The integer part of the key index gives the index of the closest key with a smaller time. The decimals give the relative position of given time compared to previous and next key times. Return -1 if function curve has no key.

K_DEPRECATED KFCurveKey& KeyGetRawAll ( kFCurveIndex  pIndex  ) 

Get reference to key at given index taking extrapolation into account.

Parameters:
pIndex Index of key. Key index range is between 0 and KFCurve::KeyGetCountAll() - 1.
Returns:
Reference to a key.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

This function is deprecated. Use KFCurve functionnality to access or modify key data.

K_DEPRECATED KTime KeyGetTimeAll ( kFCurveIndex  pIndex  ) 

Get time of key at given index taking extrapolation into account.

Parameters:
pIndex Index of key. Key index range is between 0 and KFCurve::KeyGetCountAll() - 1.
Returns:
Time of key at given index.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

kFCurveDouble Evaluate ( KTime  pTime,
kFCurveIndex pLast = NULL 
)

Evaluate function curve value at a given time.

Parameters:
pTime Time of evaluation. If time falls between two keys, function curve value is interpolated according to previous key interpolation type and tangent mode if relevant.
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:
Function curve value or default value if function curve has no key.
Remarks:
This function takes extrapolation into account.

kFCurveDouble EvaluateIndex ( double  pIndex  ) 

Evaluate function curve value at a given key index.

Parameters:
pIndex Any value between 0 and KFCurve::KeyGetCount() - 1. If key index is not an integer value, function curve value is interpolated according to previous key interpolation type and tangent mode if relevant.
Returns:
Function curve value or default value if function curve has no key.
Remarks:
This function does not take extrapolation into account.

kFCurveDouble EvaluateLeftDerivative ( KTime  pTime,
kFCurveIndex pLast = NULL 
)

Evaluate function left derivative at given time.

Parameters:
pTime Time of evaluation.
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:
Left derivative at given time.
Remarks:
This function does not take extrapolation into account.

kFCurveDouble EvaluateRightDerivative ( KTime  pTime,
kFCurveIndex pLast = NULL 
)

Evaluate function right derivative at given time.

Parameters:
pTime Time of evaluation.
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:
Right derivative at given time.
Remarks:
This function does not take extrapolation into account.

int FindPeaks ( kFCurveIndex  pLeftKeyIndex,
KTime pPeakTime1,
KTime pPeakTime2 
)

Find the peaks time between 2 keys (a local minimum and/or maximum).

Parameters:
pLeftKeyIndex Left key index (there must be a right key).
pPeakTime1 First peak time.
pPeakTime2 Second peak time.
Returns:
Number of peaks found.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

int FindPeaks ( kFCurveIndex  pLeftKeyIndex,
kFCurveDouble pPeak1,
kFCurveDouble pPeak2 
)

Find the peaks value between 2 keys (a local minimum and/or maximum).

Parameters:
pLeftKeyIndex Left key index (there must be a right key).
pPeak1 First peak value.
pPeak2 Second peak value.
Returns:
Number of peaks found.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

int FindPeaks ( kFCurveIndex  pLeftKeyIndex,
KTime pPeakTime1,
kFCurveDouble pPeak1,
KTime pPeakTime2,
kFCurveDouble pPeak2 
)

Find the peaks time and value between 2 keys (a local minimum and/or maximum).

Parameters:
pLeftKeyIndex Left key index (there must be a right key).
pPeakTime1 First peak time.
pPeak1 First peak value.
pPeakTime2 Second peak time.
pPeak2 Second peak value.
Returns:
Number of peaks found.
Remarks:
Result is undetermined if function curve has no key or index is out of bounds.

K_DEPRECATED KTime KeyGetAverageRate ( bool *  pIsIso = NULL,
KTime pIsoPeriod = NULL,
KTime pMaxPeriod = NULL 
)

Get average period between keys.

Parameters:
pIsIso Pointer to variable set to true by the function if all keys are separated by equal periods.
pIsoPeriod Pointer to variable set to sampling period if all keys are separated by equal periods.
pMaxPeriod Pointer to variable set to maximum period found.
Returns:
Average period between keys.
Deprecated. Use KeyGetPeriods instead.

void KeyGetPeriods ( KTime pAveragePeriod,
KTime pMinPeriod,
KTime pMaxPeriod 
)

Get key period statistics.

If pAveragePeriod == pMinPeriod, we have iso-sampled data.

Parameters:
pAveragePeriod Average key period.
pMinPeriod Minimum period found.
pMaxPeriod Maximum period found.

HKFCurve Copy ( KTime  pStart = KTIME_MINUS_INFINITE,
KTime  pStop = KTIME_INFINITE 
)

Create a new function curve and copy keys found between a given time range.

Time range is inclusive.

Parameters:
pStart Start of time range.
pStop End of time range.
Returns:
Created function curve.
Remarks:

void CopyFrom ( KFCurve pSource,
bool  pWithKeys = true 
)

Copy a function curve content into current function curve.

Parameters:
pSource Source function curve.
pWithKeys If true, clear keys in current function curve and copy keys from source function curve. If false, keys in current function curve are left as is.

void Replace ( HKFCurve  pSource,
KTime  pStart = KTIME_MINUS_INFINITE,
KTime  pStop = KTIME_INFINITE,
bool  pUseExactGivenSpan = false,
bool  pKeyStartEndOnNoKey = true,
KTime  pTimeSpanOffset = KTIME_ZERO 
)

Replace keys within a range in current function curve with keys found in a source function curve.

Parameters:
pSource Source function curve.
pStart Start of time range.
pStop End of time range.
pUseExactGivenSpan false = original behavior where time of first and last key was used
pKeyStartEndOnNoKey Inserts a key at the beginning and at the end of the range if there is no key to insert.

void ReplaceForQuaternion ( HKFCurve  pSource,
KTime  pStart,
KTime  pStop,
kFCurveDouble  pScaleStart,
kFCurveDouble  pScaleStop,
bool  pUseExactGivenSpan = false,
bool  pKeyStartEndOnNoKey = true,
KTime  pTimeSpanOffset = KTIME_ZERO 
)

Replace keys within a range in current function curve with keys found in a source function curve.

The copied keys have their value scaled with a factor varying linearly in time within the given time range.

Parameters:
pSource Source function curve.
pStart Start of time range.
pStop End of time range.
pScaleStart Scale factor applied at start of time range.
pScaleStop Scale factor applied at end of time range.
pUseExactGivenSpan false = original behavior where time of first and last key was used
pKeyStartEndOnNoKey Inserts a key at the beginning and at the end of the range if there is no key to insert.

void ReplaceForEulerXYZ ( HKFCurve  pSource,
KTime  pStart,
KTime  pStop,
kFCurveDouble  pAddFromStart,
kFCurveDouble  pAddAfterStop,
bool  pValueSubOffsetAfterStart,
bool  pValueSubOffsetAfterStop,
bool  pUseExactGivenSpan = false,
bool  pKeyStartEndOnNoKey = true,
KTime  pTimeSpanOffset = KTIME_ZERO 
)

Replace keys within a range in current function curve with keys found in a source function curve.

Parameters:
pSource Source function curve.
pStart Start of time range.
pStop End of time range.
pAddFromStart Offset applied to copied key values within the time range.
pAddAfterStop Offset applied to key values after the time range.
pValueSubOffsetAfterStart If true, copied key values within the time range are substracted from time offset specified by parameter pAddFromStart. If false, copied key values within the time range are added to time offset specified by parameter pAddFromStart.
pValueSubOffsetAfterStop If true, key values after the time range are substracted from time offset specified by parameter pAddAfterStop. If false, key values after the time range are added to time offset specified by parameter pAddAfterStop.
pUseExactGivenSpan false = original behavior where time of first and last key was used
pKeyStartEndOnNoKey Inserts a key at the beginning and at the end of the range if there is no key to insert

void Insert ( HKFCurve  pSource,
KTime  pInsertTime,
kFCurveDouble  pFirstKeyLeftDerivative,
bool  pFirstKeyIsWeighted = false,
kFCurveDouble  pFirstKeyWeight = KFCURVE_DEFAULT_WEIGHT 
)

Insert all keys found in a source function curve in current function curve.

A time offset is added to copied keys so that the first copied key occurs at the given insertion time. Keys from the source function curve are merged into the current function curve. In other words, no existing key in the current function curve is destroyed unless there is an overlap with a copied key.

Parameters:
pSource Source function curve.
pInsertTime Insert time of the first key found in the source function curve.
pFirstKeyLeftDerivative First key left derivative.
pFirstKeyIsWeighted First key left weighted state (true if weighted).
pFirstKeyWeight First key left weight

void Insert ( HKFCurve  pSource,
KTime  pInsertTime,
KFCurveTangeantInfo  pFirstKeyLeftDerivative 
)

Insert all keys found in a source function curve in current function curve.

A time offset is added to copied keys so that the first copied key occurs at the given insertion time. Keys from the source function curve are merged into the current function curve. In other words, no existing key in the current function curve is destroyed unless there is an overlap with a copied key.

Parameters:
pSource Source function curve.
pInsertTime Insert time of the first key found in the source function curve.
pFirstKeyLeftDerivative First key left derivative info.

bool Delete ( kFCurveIndex  pStartIndex,
kFCurveIndex  pStopIndex 
)

Delete keys within an index range.

Index range is inclusive. This function is much faster than multiple removes.

Parameters:
pStartIndex Index of first deleted key.
pStopIndex Index of last deleted key.
Returns:
true if the function curve contains keys, false otherwise.
Remarks:
Result is undetermined if function curve has keys but an index is out of bounds.

bool Delete ( KTime  pStart = KTIME_MINUS_INFINITE,
KTime  pStop = KTIME_INFINITE 
)

Delete keys within a time range.

Time range is inclusive. This function is much faster than multiple removes.

Parameters:
pStart Start of time range.
pStop End of time range.
Returns:
true if the function curve contains keys, false otherwise.

bool IsKeyInterpolationPureCubicAuto ( kFCurveIndex  pKeyIndex  ) 

Get if interpolation is cubic and that the tangents and weightings are untouched.

Parameters:
pKeyIndex Index of the key to test.
Returns:
Returns true if the interpolation is a pure cubic auto.

void ExtractKeysIndex ( KArraykInt &  pArray,
int  pMinIndex,
int  pMaxIndex,
double  pMinValue = -K_DOUBLE_MAX,
double  pMaxValue = K_DOUBLE_MAX 
)

Extract All Keys in the Given Selection Span.

Parameters:
pArray Array where to Stored Found Keys.
pMinIndex Index where to start the Search.
pMaxIndex Index where to stop the Search (the last index is the limit, the Key at this index is not tested).
pMinValue Minimal Value to Consider the Key.
pMaxValue Maximal Value to Consider the Key.