Curve utilities.
This class groups methods allowing to test and convert a KFCurve into another KFCurve data set. Easier to use for some applications.
Definition at line 64 of file kfcurveutils.h.
#include <kfcurveutils.h>
Public Types |
|
enum | EInterpolationAndTangeant
{ eCONSTANT, eLINEAR, eCUBIC_AUTO, eCUBIC_AUTO_BREAK, eCUBIC_USER, eCUBIC_BREAK, eCUBIC_TCB, eINTERPOLATION_AND_TANGEANT_COUNT } |
Enum useful for method KFCurveUtils::GetInterpolationAndTangeantCount(). More... |
|
Static Public Member Functions |
|
static bool | CompareCurve (KFCurve *pCurveA, KFCurve *pCurveB) |
Compare two curves. |
|
static bool | GetGlobalInterpolation (kFCurveInterpolation &pGlobalInterpolation, KFCurve &pCurve) |
Check if all keys of a curve are of the same
interpolation type. |
|
static bool | GetGlobalTangeant (kFCurveTangeantMode &pGlobalTangent, KFCurve &pCurve) |
Check if all keys of a curve are of the same
tangent mode. |
|
static bool | GetInterpolationAndTangeantCount (KFCurve &pCurve, int pArray[eINTERPOLATION_AND_TANGEANT_COUNT]) |
Get the number of keys in each category of
interpolation type and tangent mode. |
|
static KFCurveNode & | ConvertCurveInterpolationRecursive (kFCurveInterpolation pTargetGlobalInterpolation, kFCurveTangeantMode pTargetGlobalTangent, KFCurveNode &pCurveNode) |
Convert all curve keys contained in the
current
KFCurveNode and its children to the tangent mode and
interpolation specified. |
|
static KFCurve & | ConvertCurve (KFCurve &pSourceCurve, KFCurve &pTargetCurve, kFCurveInterpolation pTargetGlobalInterpolation, kFCurveTangeantMode pTargetGlobalTangent, KTime pFramePeriod) |
Convert curve keys so they are of a single
interpolation type and a single tangent mode. |
|
static void | Resample (KFCurve &pSourceCurve, KFCurve &pTargetCurve, KTime &pStart, KTime &pStop, KTime &pPeriod, kFCurveInterpolation pInterpolation, kFCurveTangeantMode pTangentMode, bool pAddStopKey=false) |
Resample a curve. |
|
static void | Resample (KFCurve &pSourceCurve, KFCurve &pTargetCurve, KTime &pStart, KTime &pStop, KTime &pPeriod, bool pAddStopKey=false) |
Resample a curve. |
|
static void | Resample (KFCurve &pCurve, KTime pPeriod, KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE, bool pKeysOnFrame=false) |
Resample a curve. |
|
static void | Merge (KFCurve &pCurveIn, KFCurve &pCurveMerge, KFCurve &pCurveOut) |
Merge pCurveIn and
pCurveMerge into pCurveOut . |
|
static KTime | FindTimeOffsetBefore (KFCurve pCurve, KTime &pTime) |
Compute time difference between the first
key of a curve and a given time. |
|
static KTime | FindTimeOffsetAfter (KFCurve pCurve, KTime &pTime) |
Compute time difference between the last key
of a curve and a given time. |
|
Protected Member Functions |
|
KFCurveUtils () | |
No instance of this class needs to be
created. |
|
Static Protected Attributes |
|
static KError | smError |
Error Management |
|
enum | EError
{ eNoKey, eMultiple, eMultipleKeyCount, eUnsyncedKeys, eLeftUnchanged, eErrorCount } |
Status codes. More... |
|
static KError & | GetError () |
Retrieve error object. |
|
static EError | GetLastErrorID () |
Get last error code. |
|
static const char * | GetLastErrorString () |
Get last error code. |
Enum useful for method KFCurveUtils::GetInterpolationAndTangeantCount().
eCONSTANT | |
eLINEAR | |
eCUBIC_AUTO | |
eCUBIC_AUTO_BREAK | |
eCUBIC_USER | |
eCUBIC_BREAK | |
eCUBIC_TCB | |
eINTERPOLATION_AND_TANGEANT_COUNT |
Definition at line 95 of file kfcurveutils.h.
enum EError |
Status codes.
Definition at line 241 of file kfcurveutils.h.
{ // Interpolation & tangent methods eNoKey, eMultiple, // Curve sync methods eMultipleKeyCount, eUnsyncedKeys, // Filtering methods eLeftUnchanged, eErrorCount };
KFCurveUtils | ( | ) | [protected] |
No instance of this class needs to be created.
static bool GetGlobalInterpolation | ( | kFCurveInterpolation & | pGlobalInterpolation, |
KFCurve & | pCurve | ||
) | [static] |
Check if all keys of a curve are of the same interpolation type.
pGlobalInterpolation | Receives interpolation type of all keys if function returns
true , undetermined otherwise. |
pCurve | Curve to scan. |
true
if there is at least one key and all keys are
of the same interpolation type, false
otherwise.static bool GetGlobalTangeant | ( | kFCurveTangeantMode & | pGlobalTangent, |
KFCurve & | pCurve | ||
) | [static] |
Check if all keys of a curve are of the same tangent mode.
pGlobalTangent | Receives tangent mode of all keys if function returns
true , undetermined otherwise. |
pCurve | Curve to scan. |
true
if there is at least one key and all keys are
of the same tangent mode, false
otherwise.static bool GetInterpolationAndTangeantCount | ( | KFCurve & | pCurve, |
int | pArray[eINTERPOLATION_AND_TANGEANT_COUNT] | ||
) | [static] |
Get the number of keys in each category of interpolation type and tangent mode.
pCurve | Curve to scan. |
pArray | Array to keep the number of keys in each category of interpolation type and tangent mode. |
True
.static KFCurveNode& ConvertCurveInterpolationRecursive | ( | kFCurveInterpolation | pTargetGlobalInterpolation, |
kFCurveTangeantMode | pTargetGlobalTangent, | ||
KFCurveNode & | pCurveNode | ||
) | [static] |
Convert all curve keys contained in the current KFCurveNode and its children to the tangent mode and interpolation specified.
pTargetGlobalInterpolation | Interpolation type given to all keys. |
pTargetGlobalTangent | Tangent mode given to all keys if interpolation type is cubic. |
pCurveNode | Curve node to be modified. |
static KFCurve& ConvertCurve | ( | KFCurve & | pSourceCurve, |
KFCurve & | pTargetCurve, | ||
kFCurveInterpolation | pTargetGlobalInterpolation, | ||
kFCurveTangeantMode | pTargetGlobalTangent, | ||
KTime | pFramePeriod | ||
) | [static] |
Convert curve keys so they are of a single interpolation type and a single tangent mode.
As opposed to function KFCurveUtils::ConvertCurve(), this function preserves the curve shape between the keys. Part of the curve is resampled if needed.
pSourceCurve | Source curve. |
pTargetCurve | Curve to be modified. |
pTargetGlobalInterpolation | Interpolation type given to all keys. |
pTargetGlobalTangent | Tangent mode given to all keys if interpolation type is cubic. |
pFramePeriod | Resampling period in segments to resample. |
static void Resample | ( | KFCurve & | pSourceCurve, |
KFCurve & | pTargetCurve, | ||
KTime & | pStart, | ||
KTime & | pStop, | ||
KTime & | pPeriod, | ||
kFCurveInterpolation | pInterpolation, | ||
kFCurveTangeantMode | pTangentMode, | ||
bool | pAddStopKey =
false |
||
) | [static] |
Resample a curve.
Interpolation type of each created curve key is set equal to
parameter pInterpolation
. Tangent mode of each created
curve key is set equal to pTangentMode
.
pSourceCurve | Source curve. |
pTargetCurve | Curve to be modified. |
pStart | Start time of resampling. |
pStop | Stop time of resampling. |
pPeriod | Resampling period. |
pInterpolation | Interpolation type given to all keys. |
pTangentMode | Tangent mode given to all keys if interpolation type is cubic. |
pAddStopKey | Set to true to make sure a key is added exactly at
time pStop. |
static void Resample | ( | KFCurve & | pSourceCurve, |
KFCurve & | pTargetCurve, | ||
KTime & | pStart, | ||
KTime & | pStop, | ||
KTime & | pPeriod, | ||
bool | pAddStopKey =
false |
||
) | [static] |
Resample a curve.
Interpolation type of each created curve key is set equal to the interpolation type of the closest curve key encountered. Tangent mode of each created curve key is set equal to the tangent mode of the closest curve key encountered.
pSourceCurve | Source curve. |
pTargetCurve | Curve to be modified. |
pStart | Start time of resampling. |
pStop | Stop time of resampling. |
pPeriod | Resampling period. |
pAddStopKey | Set to true to make sure a key is added exactly at
time pStop. |
static void Resample | ( | KFCurve & | pCurve, |
KTime | pPeriod, | ||
KTime | pStart =
KTIME_MINUS_INFINITE , |
||
KTime | pStop =
KTIME_INFINITE , |
||
bool | pKeysOnFrame =
false |
||
) | [static] |
Resample a curve.
Interpolation type of each created curve key is set to KFCURVE_INTERPOLATION_CUBIC. Tangent mode of each created curve key is set to KFCURVE_TANGEANT_AUTO.
pCurve | Curve to be modified. |
pPeriod | Resampling period. |
pStart | Start time of resampling. Set to KTIME_MINUS_INFINITE for whole curve. |
pStop | Stop time of resampling. Set to KTIME_INFINITE for whole curve. |
pKeysOnFrame | Set to true if keys are to be added on
frames. |
Merge pCurveIn
and pCurveMerge
into
pCurveOut
.
Copy pCurveIn
in pCurveOut
and then
overwrite keys in the time span covered by
pCurveMerge
.
pCurveIn | Source curve. |
pCurveMerge | Curve containing keys to merge in source curve. |
pCurveOut | Destination for source curve and keys to merge. |
Compute time difference between the first key of a curve and a given time.
pCurve | |
pTime | The given time. |
Compute time difference between the last key of a curve and a given time.
pCurve | |
pTime | The given time. |
static KError& GetError | ( | ) | [static] |
Retrieve error object.
static EError GetLastErrorID | ( | ) | [static] |
Get last error code.
static const char* GetLastErrorString | ( | ) | [static] |
Get last error code.
Definition at line 284 of file kfcurveutils.h.