KFbxAnimCurveKFCurveKey Class Reference

Search for all occurrences

Detailed Description

This class implements the interface KFbxAnimCurveKeyImpl for FBX animation curve keys.

Remarks:
Users should not use this class directly, but always use KFbxAnimCurveKey. This class encapsulates the legacy KFCurveKey structure for backward compatibility.

Definition at line 32 of file kfbxanimcurvekfcurve.h.

#include <kfbxanimcurvekfcurve.h>

Inheritance diagram for KFbxAnimCurveKFCurveKey:
Inheritance graph
[legend]

List of all members.

Constructors, Destructors, Copy Constructors, and other base functions.

static KFbxAnimCurveKeyImpl AllocatorFct ()
  Get a new instance of KFbxAnimCurveKFCurveKey.
static KFbxAnimCurveKeyImpl CopyAllocatorFct (KFbxAnimCurveKeyImpl *pImpl)
  Get a new instance of KFbxAnimCurveKFCurveKey, copied from the given instance.
static void  DeallocatorFct (KFbxAnimCurveKeyImpl *pImpl)
  Delete a KFbxAnimCurveKFCurveKey.
  KFbxAnimCurveKFCurveKey ()
  Default Constructor.
virtual  ~KFbxAnimCurveKFCurveKey ()
  Destructor.
  KFbxAnimCurveKFCurveKey (KTime pTime)
  Constructor with time.
  KFbxAnimCurveKFCurveKey (KTime pTime, float pVal)
  Constructor with time and value.
  KFbxAnimCurveKFCurveKey (KFbxAnimCurveKFCurveKey const &pFKey)
  Copy constructor.
  KFbxAnimCurveKFCurveKey (KFCurveKey const &pFKey)
  Constructor from KFCurveKey.
KFbxAnimCurveKeyImpl operator= (const KFbxAnimCurveKeyImpl &pFKey)
  Assignment operator.
KFbxAnimCurveKFCurveKey operator= (const KFbxAnimCurveKFCurveKey &pFKey)
  Assignment operator.
  operator KFCurveKey & ()
  Cast operator to convert this to its base class instance.
KFCurveKey GetKFCurveKey ()
  Get base class pointer.

virtual KTime  GetTime () const
  Get time value of the key.
virtual void  SetTime (const KTime &pTime)
  Set time of key.
void  Set (KTime pTime, float pValue)
  Set time and value of key.
void  SetTCB (KTime pTime, float pValue, float pData0=0.0f, float pData1=0.0f, float pData2=0.0f)
  Set a key with cubic interpolation, TCB tangent mode.
float  GetValue () const
  Get key value.
void  SetValue (float pValue)
  Set key value.
KFbxAnimCurveDef::EInterpolationType  GetInterpolation () const
  Get key's interpolation type.
void  SetInterpolation (KFbxAnimCurveDef::EInterpolationType pInterpolation)
  Set key's interpolation type.
KFbxAnimCurveDef::ETangentMode  GetTangentMode (bool pIncludeOverrides=false) const
  Get key's tangent mode.
void  SetTangentMode (KFbxAnimCurveDef::ETangentMode pTangentMode)
  Set key's tangent mode.
KFbxAnimCurveDef::EWeightedMode  GetTangentWeightMode () const
  Get key's tangent weight mode.
void  SetTangentWeightMode (KFbxAnimCurveDef::EWeightedMode pTangentWeightMode, KFbxAnimCurveDef::EWeightedMode pMask=KFbxAnimCurveDef::eWEIGHTED_ALL)
  Set key's tangent weight mode as double value (cubic interpolation, non TCB tangent mode).
KFbxAnimCurveDef::EVelocityMode  GetTangentVelocityMode () const
  Get key's tangent velocity mode.
void  SetTangentVelocityMode (KFbxAnimCurveDef::EVelocityMode pTangentVelocityMode, KFbxAnimCurveDef::EVelocityMode pMask=KFbxAnimCurveDef::eVELOCITY_ALL)
  Set key's tangent velocity mode as double value (cubic interpolation, non TCB tangent mode).
KFbxAnimCurveDef::EConstantMode  GetConstantMode () const
  Get key's constant mode.
void  SetConstantMode (KFbxAnimCurveDef::EConstantMode pMode)
  Set key's constant mode.
float  GetDataFloat (KFbxAnimCurveDef::EKFbxAnimCurveDataIndex pIndex) const
  Get key data.
void  SetDataFloat (KFbxAnimCurveDef::EKFbxAnimCurveDataIndex pIndex, float pValue)
  Set key data.
void  SetTangentVisibility (KFbxAnimCurveDef::ETangentVisibility pVisibility)
  Set tangent visibility mode.
KFbxAnimCurveDef::ETangentVisibility  GetTangentVisibility () const
  Return tangent visibility mode.
void  SetBreak (bool pVal)
  Set or unset the tangent break.
bool  GetBreak () const
  Get if the tangent has a break.

Constructor & Destructor Documentation

Default Constructor.

Definition at line 71 of file kfbxanimcurvekfcurve.h.

                              : KFbxAnimCurveKeyImpl()
    {
        KTime lTime = GetTime();
        SetTime(lTime);
        mKey.Set(lTime, 0.0);
    };
virtual ~KFbxAnimCurveKFCurveKey ( ) [inline, virtual]

Destructor.

Definition at line 80 of file kfbxanimcurvekfcurve.h.

    {
        // nothing specific to do!
    }
KFbxAnimCurveKFCurveKey ( KTime  pTime ) [inline]

Constructor with time.

Value will be set to 0.0.

Parameters:
pTime Time of the key.

Definition at line 88 of file kfbxanimcurvekfcurve.h.

                                         : KFbxAnimCurveKeyImpl()
    {
        SetTime(pTime);
        mKey.Set(pTime, 0.0);
    }
KFbxAnimCurveKFCurveKey ( KTime  pTime,
float  pVal 
) [inline]

Constructor with time and value.

Parameters:
pTime Time of the key.
pVal Value of the key.

Definition at line 98 of file kfbxanimcurvekfcurve.h.

                                                     : KFbxAnimCurveKeyImpl()
    {
        SetTime(pTime);
        mKey.Set(pTime, pVal);

    }
KFbxAnimCurveKFCurveKey ( KFbxAnimCurveKFCurveKey const &  pFKey ) [inline]

Copy constructor.

Parameters:
pFKey Key instance (of type KFbxAnimCurveKFCurveKey) to be copied.

Definition at line 108 of file kfbxanimcurvekfcurve.h.

                                                                  : KFbxAnimCurveKeyImpl()
    {
        mKey = pFKey.mKey;
        SetTime(mKey.GetTime());
    };
KFbxAnimCurveKFCurveKey ( KFCurveKey const &  pFKey ) [inline]

Constructor from KFCurveKey.

Parameters:
pFKey Key instance (of type KFCurveKey) to be copied.

Definition at line 117 of file kfbxanimcurvekfcurve.h.

                                                     : KFbxAnimCurveKeyImpl()
    {
        mKey = pFKey;
        SetTime(mKey.GetTime());
    };

Member Function Documentation

static KFbxAnimCurveKeyImpl* AllocatorFct ( ) [inline, static]

Get a new instance of KFbxAnimCurveKFCurveKey.

Returns:
Pointer to new instance of KFbxAnimCurveKFCurveKey.

Definition at line 47 of file kfbxanimcurvekfcurve.h.

    {
        return FbxSdkNew<KFbxAnimCurveKFCurveKey>();
    }
static KFbxAnimCurveKeyImpl* CopyAllocatorFct ( KFbxAnimCurveKeyImpl pImpl ) [inline, static]

Get a new instance of KFbxAnimCurveKFCurveKey, copied from the given instance.

Parameters:
pImpl Key to copy.
Returns:
Pointer to new instance of KFbxAnimCurveKFCurveKey.

Definition at line 56 of file kfbxanimcurvekfcurve.h.

    {
        return FbxSdkNew<KFbxAnimCurveKFCurveKey>(*((KFbxAnimCurveKFCurveKey*)pImpl));
    }
static void DeallocatorFct ( KFbxAnimCurveKeyImpl pImpl ) [inline, static]

Delete a KFbxAnimCurveKFCurveKey.

Parameters:
pImpl Key to delete.

Definition at line 64 of file kfbxanimcurvekfcurve.h.

    {
        FbxSdkDelete<KFbxAnimCurveKFCurveKey>((KFbxAnimCurveKFCurveKey*)pImpl);
    }
KFbxAnimCurveKeyImpl& operator= ( const KFbxAnimCurveKeyImpl pFKey ) [inline, virtual]

Assignment operator.

Parameters:
pFKey Key (of type KFbxAnimCurveKeyImpl) to be copied.
Returns:
Modified key.

Implements KFbxAnimCurveKeyImpl.

Definition at line 127 of file kfbxanimcurvekfcurve.h.

    {
        *this = *((KFbxAnimCurveKFCurveKey*)&pFKey);
        return *this;
    }
KFbxAnimCurveKFCurveKey& operator= ( const KFbxAnimCurveKFCurveKey pFKey ) [inline]

Assignment operator.

Parameters:
pFKey Key (of type KFbxAnimCurveKFCurveKey) to be copied.
Returns:
Modified key.

Definition at line 137 of file kfbxanimcurvekfcurve.h.

    {
        SetTime(pFKey.GetTime());
        mKey = pFKey.mKey;
        return *this;
    }
operator KFCurveKey & ( ) [inline]

Cast operator to convert this to its base class instance.

Definition at line 146 of file kfbxanimcurvekfcurve.h.

    { 
        return mKey; 
    };
KFCurveKey* GetKFCurveKey ( ) [inline]

Get base class pointer.

Returns:
Key of base type KFCurveKey.

Definition at line 154 of file kfbxanimcurvekfcurve.h.

    {
        return &mKey;
    };
virtual KTime GetTime ( ) const [inline, virtual]

Get time value of the key.

Returns:
Time at which the key is occurring.

Definition at line 166 of file kfbxanimcurvekfcurve.h.

    {
        return mKey.GetTime();
    };
virtual void SetTime ( const KTime pTime ) [inline, virtual]

Set time of key.

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

Definition at line 174 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetTime(pTime);
    };
void Set ( KTime  pTime,
float  pValue 
) [inline, virtual]

Set time and value of key.

Parameters:
pTime New time for this key.
pValue New value for this key.

Implements KFbxAnimCurveKeyImpl.

Definition at line 183 of file kfbxanimcurvekfcurve.h.

    {
        mKey.Set(pTime, pValue);
    }
void SetTCB ( KTime  pTime,
float  pValue,
float  pData0 = 0.0f,
float  pData1 = 0.0f,
float  pData2 = 0.0f 
) [inline, virtual]

Set a key with cubic interpolation, TCB tangent mode.

The key is modified according to the other parameters. The TCB mode controls the tension, continuity, and bias of the curve.

Parameters:
pTime Key time.
pValue Key value.
pData0 Tension. Controls the amount of curvature in the animation curve. The higher the tension is, the more linear the curve looks. When the tension is low, the curve looks rounder or wider.
pData1 Continuity. Controls the smoothness or singularity of the curve on the key.
pData2 Bias. Controls if the effect of tension and continuity affect the curve before or after the key.

Implements KFbxAnimCurveKeyImpl.

Definition at line 199 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetTCB(pTime, pValue, pData0, pData1, pData2);
    }
float GetValue ( ) const [inline, virtual]

Get key value.

Returns:
Key value.

Implements KFbxAnimCurveKeyImpl.

Definition at line 207 of file kfbxanimcurvekfcurve.h.

    {
        return mKey.GetValue();
    }
void SetValue ( float  pValue ) [inline, virtual]

Set key value.

Parameters:
pValue The value to set.

Implements KFbxAnimCurveKeyImpl.

Definition at line 215 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetValue(pValue);
    }
KFbxAnimCurveDef::EInterpolationType GetInterpolation ( ) const [inline, virtual]

Get key's interpolation type.

Returns:
Interpolation type of the queried key.

Implements KFbxAnimCurveKeyImpl.

Definition at line 223 of file kfbxanimcurvekfcurve.h.

void SetInterpolation ( KFbxAnimCurveDef::EInterpolationType  pInterpolation ) [inline, virtual]

Set key's interpolation type.

Parameters:
pInterpolation Key interpolation type.

Implements KFbxAnimCurveKeyImpl.

Definition at line 231 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetInterpolation(pInterpolation);
    }
KFbxAnimCurveDef::ETangentMode GetTangentMode ( bool  pIncludeOverrides = false ) const [inline, virtual]

Get key's tangent mode.

Parameters:
pIncludeOverrides Include override flags: Break, Clamp, Time-Independent. This method is meaningful for cubic interpolation only. Using this method for non cubic interpolated key will return unpredictable value.
Returns:
Key tangent mode.

Implements KFbxAnimCurveKeyImpl.

Definition at line 242 of file kfbxanimcurvekfcurve.h.

    {
        return KFbxAnimCurveDef::ETangentMode(mKey.GetTangeantMode(pIncludeOverrides));
    }
void SetTangentMode ( KFbxAnimCurveDef::ETangentMode  pTangentMode ) [inline, virtual]

Set key's tangent mode.

This method is meaningful for cubic interpolation only.

Parameters:
pTangentMode Key tangent mode.

Implements KFbxAnimCurveKeyImpl.

Definition at line 251 of file kfbxanimcurvekfcurve.h.

KFbxAnimCurveDef::EWeightedMode GetTangentWeightMode ( ) const [inline, virtual]

Get key's tangent weight mode.

This method is meaningful for cubic interpolation only.

Implements KFbxAnimCurveKeyImpl.

Definition at line 260 of file kfbxanimcurvekfcurve.h.

void SetTangentWeightMode ( KFbxAnimCurveDef::EWeightedMode  pTangentWeightMode,
KFbxAnimCurveDef::EWeightedMode  pMask = KFbxAnimCurveDef::eWEIGHTED_ALL 
) [inline, virtual]

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

This method is meaningful for cubic interpolation only.

Parameters:
pTangentWeightMode Weight mode.
pMask Used to select the affected tangents.

Implements KFbxAnimCurveKeyImpl.

Definition at line 270 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetTangeantWeightMode(pTangentWeightMode, pMask);
    }
KFbxAnimCurveDef::EVelocityMode GetTangentVelocityMode ( ) const [inline, virtual]

Get key's tangent velocity mode.

This method is meaningful for cubic interpolation only.

Implements KFbxAnimCurveKeyImpl.

Definition at line 279 of file kfbxanimcurvekfcurve.h.

void SetTangentVelocityMode ( KFbxAnimCurveDef::EVelocityMode  pTangentVelocityMode,
KFbxAnimCurveDef::EVelocityMode  pMask = KFbxAnimCurveDef::eVELOCITY_ALL 
) [inline, virtual]

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

This method is meaningful for cubic interpolation only.

Parameters:
pTangentVelocityMode Velocity mode.
pMask Used to select the affected tangents

Implements KFbxAnimCurveKeyImpl.

Definition at line 289 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetTangeantVelocityMode(pTangentVelocityMode, pMask);
    }
KFbxAnimCurveDef::EConstantMode GetConstantMode ( ) const [inline, virtual]

Get key's constant mode.

Note:
This method is only relevant if the key's interpolation type is constant (eINTERPOLATION_CONSTANT). Using this method on a key with an other interpolation type will return unpredictable value.
Returns:
Key constant mode.

Implements KFbxAnimCurveKeyImpl.

Definition at line 299 of file kfbxanimcurvekfcurve.h.

void SetConstantMode ( KFbxAnimCurveDef::EConstantMode  pMode ) [inline, virtual]

Set key's constant mode.

This method is meaningful for constant interpolation only.

Parameters:
pMode Constant mode to set.

Implements KFbxAnimCurveKeyImpl.

Definition at line 308 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetConstantMode(pMode);
    }
float GetDataFloat ( KFbxAnimCurveDef::EKFbxAnimCurveDataIndex  pIndex ) const [inline, virtual]

Get key data.

If this is a TCB key, the data can be Tension, Continuity or Bias. If the key is weighted, the data is the weights values. If the key has velocity, the data is the velocity values.

Parameters:
pIndex Data index, dependent on the key tangent mode.
Returns:
Data value.

Implements KFbxAnimCurveKeyImpl.

Definition at line 320 of file kfbxanimcurvekfcurve.h.

    {
        // VR: The way KFCurveKey::GetDataFloat() and GetDataDouble() are implemented are different.
        // GetDataDouble() works for cases USER, AUTO, BREAK, etc, which have 2 or 4 float values to store.
        // GetDataFloat() works for the TCB case which has 3 float values (Tension, Continuity and Bias).
        // It is not my purpose to modify KFCurveKey at this point, so we use GetDataDouble in general,
        // and GetDataFloat in the case of a TCB.

        if (GetTangentMode() == KFbxAnimCurveDef::eTANGENT_TCB)
        {
            return mKey.GetDataFloat(EKFCurveDataIndex(pIndex));
        }

        return (float)mKey.GetDataDouble(EKFCurveDataIndex(pIndex));
    }
void SetDataFloat ( KFbxAnimCurveDef::EKFbxAnimCurveDataIndex  pIndex,
float  pValue 
) [inline, virtual]

Set key data.

If this is a TCB key, the data can be Tension, Continuity or Bias. If the key is weighted, the data is the weights values. If the key has velocity, the data is the velocity values.

Parameters:
pIndex Data index, dependent on the key tangent mode.
pValue Data value to set.

Implements KFbxAnimCurveKeyImpl.

Definition at line 343 of file kfbxanimcurvekfcurve.h.

    {
        // VR: The way KFCurveKey::SetDataFloat() and SetDataDouble() are implemented are different.
        // SetDataDouble() works for cases USER, AUTO, BREAK, etc, which have 2 or 4 float values to store.
        // SetDataFloat() works for the TCB case which has 3 float values (Tension, Continuity and Bias).
        // It is not my purpose to modivy KFCurveKey at this point, so we use SetDataDouble in general,
        // and SetDataFloat in the case of a TCB.

        if (GetTangentMode() == KFbxAnimCurveDef::eTANGENT_TCB)
        {
            mKey.SetDataFloat(EKFCurveDataIndex(pIndex), pValue);
        }

        mKey.SetDataDouble(EKFCurveDataIndex(pIndex), (kFCurveDouble)pValue);
    }
void SetTangentVisibility ( KFbxAnimCurveDef::ETangentVisibility  pVisibility ) [inline, virtual]

Set tangent visibility mode.

This would indicate what part of the tangent is visible in a graphical interface. This method is relevant for cubic interpolation only.

Parameters:
pVisibility Tangent visibility mode.

Implements KFbxAnimCurveKeyImpl.

Definition at line 363 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetTangeantVisibility(pVisibility);
    }
KFbxAnimCurveDef::ETangentVisibility GetTangentVisibility ( ) const [inline, virtual]

Return tangent visibility mode.

This method is relevant for cubic interpolation only.

Returns:
Tangent visibility mode.

Implements KFbxAnimCurveKeyImpl.

Definition at line 372 of file kfbxanimcurvekfcurve.h.

void SetBreak ( bool  pVal ) [inline, virtual]

Set or unset the tangent break.

When this flag is set (KFbxAnimCurveDef::eTANGENT_BREAK), the key's left and right slopes are independent. When this flag is off, the key's left and right slope are equal. This method is relevant for User (KFbxAnimCurveDef::eTANGENT_USER) and Auto (KFbxAnimCurveDef::eTANGENT_AUTO) tangent modes only.

Parameters:
pVal Break flag (true or false).

Implements KFbxAnimCurveKeyImpl.

Definition at line 382 of file kfbxanimcurvekfcurve.h.

    {
        mKey.SetBreak(pVal);
    }
bool GetBreak ( ) const [inline, virtual]

Get if the tangent has a break.

When this flag is set (KFbxAnimCurveDef::eTANGENT_BREAK), the key's left and right slopes are independent. When this flag is off, the key's left and right slope are equal. This method is relevant for User (KFbxAnimCurveDef::eTANGENT_USER) and Auto (KFbxAnimCurveDef::eTANGENT_AUTO) tangent modes only.

Returns:
Break flag (true or false).

Implements KFbxAnimCurveKeyImpl.

Definition at line 392 of file kfbxanimcurvekfcurve.h.

    {
        return mKey.GetBreak();
    }

The documentation for this class was generated from the following file:

KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey
KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey KFbxAnimCurveKFCurveKey