KFCurveKey Class Reference

#include <kfcurve.h>

List of all members.


Detailed Description

Defines a key within a function curve.
Remarks:
Implementation was made for performance. Keep in mind that there is no check for consistency and memory management ever made throughout the methods' code. This class must be used with a good understanding of its interface. Default constructor is used, which does not initialize data member. If an instance has to be initialized, use function KFCurveKey::Set().

Definition at line 405 of file kfcurve.h.


Public Member Functions

KFBX_FCURVE_INLINE void  Set (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.
KFBX_FCURVE_INLINE void  SetTCB (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.
KFBX_FCURVE_INLINE void  Set (KFCurveKey &pSource)
  Key assignment.
KFBX_FCURVE_INLINE
kFCurveInterpolation 
GetInterpolation ()
  Get key interpolation type.
KFBX_FCURVE_INLINE void  SetInterpolation (kFCurveInterpolation pInterpolation)
  Set key interpolation type.
KFBX_FCURVE_INLINE
kFCurveConstantMode 
GetConstantMode ()
  Get key constant mode.
KFBX_FCURVE_INLINE
kFCurveTangeantMode 
GetTangeantMode (bool pIncludeOverrides=false)
  Get key tangent mode.
KFBX_FCURVE_INLINE
kFCurveTangeantWeightMode 
GetTangeantWeightMode ()
  Get key tangent weight mode.
KFBX_FCURVE_INLINE
kFCurveTangeantVelocityMode 
GetTangeantVelocityMode ()
  Get key tangent velocity mode.
KFBX_FCURVE_INLINE void  SetConstantMode (kFCurveConstantMode pMode)
  Set key constant mode.
KFBX_FCURVE_INLINE void  SetTangeantMode (kFCurveTangeantMode pTangent)
  Set key tangent mode.
KFBX_FCURVE_INLINE void  SetTangeantWeightMode (kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask=KFCURVE_WEIGHTED_ALL)
  Set key tangent weight mode as double value (cubic interpolation, non TCB tangent mode).
KFBX_FCURVE_INLINE void  SetTangeantVelocityMode (kFCurveTangeantVelocityMode pTangentVelocityMode, kFCurveTangeantVelocityMode pMask=KFCURVE_VELOCITY_ALL)
  Set key tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).
KFBX_FCURVE_INLINE void  SetTangentWeightAndAdjustTangent (EKFCurveDataIndex pIndex, kFCurveDouble pWeight)
  Adjust the actual tangent of the key so that the tangent control point (tangent extremity) stays closer to where it should be.
KFBX_FCURVE_INLINE kFCurveDouble  GetDataDouble (EKFCurveDataIndex pIndex)
  Get key data as double value (cubic interpolation, non TCB tangent mode).
KFBX_FCURVE_INLINE void  SetDataDouble (EKFCurveDataIndex pIndex, kFCurveDouble pValue)
  Set data as double value (cubic interpolation, non TCB tangent mode).
KFBX_FCURVE_INLINE float  GetDataFloat (EKFCurveDataIndex pIndex)
  Get key data as float value (cubic interpolation, TCB tangent mode).
KFBX_FCURVE_INLINE void  SetDataFloat (EKFCurveDataIndex pIndex, float pValue)
  Set data as float value (cubic interpolation, TCB tangent mode).
KFBX_FCURVE_INLINE float *  GetDataPtr ()
  Get key data as a pointer Warning: not supported in 'double' mode.
KFBX_FCURVE_INLINE kFCurveDouble  GetValue ()
  Get key value.
KFBX_FCURVE_INLINE void  SetValue (kFCurveDouble pValue)
  Set key value.
KFBX_FCURVE_INLINE void  IncValue (kFCurveDouble pValue)
  Increment key value.
KFBX_FCURVE_INLINE void  MultValue (kFCurveDouble pValue)
  Multiply key value.
KFBX_FCURVE_INLINE void  MultTangeant (kFCurveDouble pValue)
  Multiply key tangents.
KFBX_FCURVE_INLINE KTime  GetTime ()
  Get key time.
KFBX_FCURVE_INLINE void  SetTime (KTime pTime)
  Set key time.
KFBX_FCURVE_INLINE void  IncTime (KTime pTime)
  Increment key time.
KFBX_FCURVE_INLINE void  SetSelected (bool pSelected)
  Set if key is currently selected.
KFBX_FCURVE_INLINE bool  GetSelected ()
  Return if key is currently selected.
KFBX_FCURVE_INLINE void  SetMarkedForManipulation (bool pMark)
  Set if key is currently marked for manipulation.
KFBX_FCURVE_INLINE bool  GetMarkedForManipulation ()
  Return if key is currently marked for manipulation.
KFBX_FCURVE_INLINE void  SetTangeantVisibility (kFCurveTangeantVisibility pVisibility)
  Set tangent visibility mode.
KFBX_FCURVE_INLINE
kFCurveTangeantVisibility 
GetTangeantVisibility ()
  Return tangent visibility mode.
KFBX_FCURVE_INLINE void  SetBreak (bool pVal)
  Set/Unset Break tangent Only valid for User and Auto keys.
KFBX_FCURVE_INLINE bool  GetBreak ()
  Get if tangent is break Only valid for User and Auto keys.

Member Function Documentation

KFBX_FCURVE_INLINE void Set ( 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.

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.

Definition at line 2232 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetTCB ( 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.

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

Definition at line 2266 of file kfcurve.h.

References SetDataFloat(), SetInterpolation(), SetTangeantMode(), SetTangeantVisibility(), SetTime(), and SetValue().

KFBX_FCURVE_INLINE void Set ( KFCurveKey pSource  ) 

Key assignment.

Parameters:
pSource  Source key to be copied.

Definition at line 2279 of file kfcurve.h.

KFBX_FCURVE_INLINE kFCurveInterpolation GetInterpolation (  ) 

Get key interpolation type.

Interpolation types are: KFCURVE_INTERPOLATION_CONSTANT, KFCURVE_INTERPOLATION_LINEAR, KFCURVE_INTERPOLATION_CUBIC

Definition at line 2298 of file kfcurve.h.

Referenced by GetBreak(), MultTangeant(), SetBreak(), SetConstantMode(), and SetTangeantMode().

KFBX_FCURVE_INLINE void SetInterpolation ( kFCurveInterpolation  pInterpolation  ) 

Set key interpolation type.

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

Definition at line 2304 of file kfcurve.h.

References SetDataDouble(), SetTangeantVelocityMode(), and SetTangeantWeightMode().

Referenced by SetTCB().

KFBX_FCURVE_INLINE kFCurveConstantMode GetConstantMode (  ) 

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.

Definition at line 2326 of file kfcurve.h.

KFBX_FCURVE_INLINE kFCurveTangeantMode GetTangeantMode ( bool  pIncludeOverrides = false  ) 

Get key tangent mode.

Parameters:
pIncludeOverrides  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.

Definition at line 2331 of file kfcurve.h.

Referenced by GetBreak(), MultTangeant(), and SetBreak().

KFBX_FCURVE_INLINE kFCurveTangeantWeightMode GetTangeantWeightMode (  ) 

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

Definition at line 2361 of file kfcurve.h.

KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode GetTangeantVelocityMode (  ) 

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

Definition at line 2373 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetConstantMode ( kFCurveConstantMode  pMode  ) 

Set key constant mode.

Warning: This method is meaningful for constant interpolation only.

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

Definition at line 2343 of file kfcurve.h.

References GetInterpolation().

KFBX_FCURVE_INLINE void SetTangeantMode ( kFCurveTangeantMode  pTangent  ) 

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

Definition at line 2352 of file kfcurve.h.

References GetInterpolation().

Referenced by SetTCB().

KFBX_FCURVE_INLINE void SetTangeantWeightMode ( kFCurveTangeantWeightMode  pTangentWeightMode,
kFCurveTangeantWeightMode  pMask = KFCURVE_WEIGHTED_ALL  
)

Set key tangent 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

Definition at line 2366 of file kfcurve.h.

Referenced by SetInterpolation().

KFBX_FCURVE_INLINE void SetTangeantVelocityMode ( kFCurveTangeantVelocityMode  pTangentVelocityMode,
kFCurveTangeantVelocityMode  pMask = KFCURVE_VELOCITY_ALL  
)

Set key tangent 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

Definition at line 2378 of file kfcurve.h.

Referenced by SetInterpolation().

KFBX_FCURVE_INLINE void SetTangentWeightAndAdjustTangent ( EKFCurveDataIndex  pIndex,
kFCurveDouble  pWeight  
)

Adjust the actual tangent of the key so that the tangent control point (tangent extremity) stays closer to where it should be.

This is required because the weight value gets imprecise when it is small (it is stored as a fixed point value). This method must be called when setting the weight coming from a source where the precision is the same. It must be called after the tangent value has been set. Warning: Do not use this call repetitively (from an interactive editor for example) because this function will create imprecision on the tangent value.

Parameters:
pIndex  FCurveDataIndex KFCURVEKEY_RIGHT_SLOPE KFCURVEKEY_NEXT_LEFT_SLOPE KFCURVEKEY_WEIGHTS KFCURVEKEY_RIGHT_WEIGHT KFCURVEKEY_NEXT_LEFT_WEIGHT KFCURVEKEY_VELOCITY KFCURVEKEY_RIGHT_VELOCITY KFCURVEKEY_NEXT_LEFT_VELOCITY KFCURVEKEY_TCB_TENSION KFCURVEKEY_TCB_CONTINUITY KFCURVEKEY_TCB_BIAS KFCURVEKEY_RIGHT_AUTO KFCURVEKEY_NEXT_LEFT_AUTO
pWeight  New tangent weight value.

Definition at line 2384 of file kfcurve.h.

KFBX_FCURVE_INLINE kFCurveDouble GetDataDouble ( EKFCurveDataIndex  pIndex  ) 

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

Definition at line 2436 of file kfcurve.h.

Referenced by MultTangeant().

KFBX_FCURVE_INLINE void SetDataDouble ( EKFCurveDataIndex  pIndex,
kFCurveDouble  pValue  
)

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 tangent mode key will result in unpredictable 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).

Definition at line 2453 of file kfcurve.h.

Referenced by MultTangeant(), and SetInterpolation().

KFBX_FCURVE_INLINE float GetDataFloat ( EKFCurveDataIndex  pIndex  ) 

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.

Definition at line 2479 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetDataFloat ( EKFCurveDataIndex  pIndex,
float  pValue  
)

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.

Definition at line 2485 of file kfcurve.h.

Referenced by SetTCB().

KFBX_FCURVE_INLINE float * GetDataPtr (  ) 

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

Definition at line 2490 of file kfcurve.h.

KFBX_FCURVE_INLINE kFCurveDouble GetValue (  ) 

Get key value.

Definition at line 2496 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetValue ( kFCurveDouble  pValue  ) 

Set key value.

Parameters:
pValue  Key value to set.

Definition at line 2502 of file kfcurve.h.

Referenced by SetTCB().

KFBX_FCURVE_INLINE void IncValue ( kFCurveDouble  pValue  ) 

Increment key value.

Parameters:
pValue  Value by which key value is incremented.

Definition at line 2508 of file kfcurve.h.

KFBX_FCURVE_INLINE void MultValue ( kFCurveDouble  pValue  ) 

Multiply key value.

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

Definition at line 2513 of file kfcurve.h.

KFBX_FCURVE_INLINE void MultTangeant ( kFCurveDouble  pValue  ) 

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.

Definition at line 2518 of file kfcurve.h.

References GetDataDouble(), GetInterpolation(), GetTangeantMode(), and SetDataDouble().

KFBX_FCURVE_INLINE KTime GetTime (  ) 

Get key time.

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

Definition at line 2540 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetTime ( KTime  pTime  ) 

Set key time.

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

Definition at line 2546 of file kfcurve.h.

Referenced by SetTCB().

KFBX_FCURVE_INLINE void IncTime ( KTime  pTime  ) 

Increment key time.

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

Definition at line 2554 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetSelected ( bool  pSelected  ) 

Set if key is currently selected.

Parameters:
pSelected  Selection flag.

Definition at line 2560 of file kfcurve.h.

KFBX_FCURVE_INLINE bool GetSelected (  ) 

Return if key is currently selected.

Returns:
Selection flag.

Definition at line 2566 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetMarkedForManipulation ( bool  pMark  ) 

Set if key is currently marked for manipulation.

Parameters:
pMark  Mark flag.

Definition at line 2572 of file kfcurve.h.

KFBX_FCURVE_INLINE bool GetMarkedForManipulation (  ) 

Return if key is currently marked for manipulation.

Returns:
Mark flag.

Definition at line 2578 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetTangeantVisibility ( kFCurveTangeantVisibility  pVisibility  ) 

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

Definition at line 2419 of file kfcurve.h.

Referenced by SetTCB().

KFBX_FCURVE_INLINE kFCurveTangeantVisibility GetTangeantVisibility (  ) 

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

Definition at line 2430 of file kfcurve.h.

KFBX_FCURVE_INLINE void SetBreak ( bool  pVal  ) 

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

Parameters:
pVal  The break flag.

Definition at line 2592 of file kfcurve.h.

References GetInterpolation(), and GetTangeantMode().

KFBX_FCURVE_INLINE bool GetBreak (  ) 

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

Definition at line 2607 of file kfcurve.h.

References GetInterpolation(), and GetTangeantMode().

KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey
KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey KFCurveKey