00001
00004 #ifndef _FBXSDK_KFCURVE_UTILS_H_
00005 #define _FBXSDK_KFCURVE_UTILS_H_
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include <kfcurve/kfcurve_h.h>
00043
00044 #include <kfcurve/kfcurve.h>
00045 #include <klib/kerror.h>
00046
00047 #include <kfcurve/kfcurve_nsbegin.h>
00048
00049 class KFCurveNode;
00050
00065 class KFCURVE_DLL KFCurveUtils
00066 {
00067
00068 public:
00069
00073 static bool CompareCurve(KFCurve* pCurveA, KFCurve* pCurveB);
00074
00082 static bool GetGlobalInterpolation(kFCurveInterpolation& pGlobalInterpolation, KFCurve& pCurve);
00083
00091 static bool GetGlobalTangeant(kFCurveTangeantMode& pGlobalTangent, KFCurve& pCurve);
00092
00094 enum EInterpolationAndTangeant
00095 {
00096 eCONSTANT,
00097 eLINEAR,
00098 eCUBIC_AUTO,
00099 eCUBIC_AUTO_BREAK,
00100 eCUBIC_USER,
00101 eCUBIC_BREAK,
00102 eCUBIC_TCB,
00103 eINTERPOLATION_AND_TANGEANT_COUNT
00104 };
00105
00107 static bool GetInterpolationAndTangeantCount(KFCurve& pCurve, int pArray[eINTERPOLATION_AND_TANGEANT_COUNT]);
00108
00116 static KFCurveNode& ConvertCurveInterpolationRecursive
00117 (
00118 kFCurveInterpolation pTargetGlobalInterpolation,
00119 kFCurveTangeantMode pTargetGlobalTangent,
00120 KFCurveNode& pCurveNode
00121 );
00122
00133 static KFCurve& ConvertCurve
00134 (
00135 KFCurve& pSourceCurve,
00136 KFCurve& pTargetCurve,
00137 kFCurveInterpolation pTargetGlobalInterpolation,
00138 kFCurveTangeantMode pTargetGlobalTangent,
00139 KTime pFramePeriod
00140 );
00141
00155 static void Resample
00156 (
00157 KFCurve &pSourceCurve,
00158 KFCurve &pTargetCurve,
00159 KTime &pStart,
00160 KTime &pStop,
00161 KTime &pPeriod,
00162 kFCurveInterpolation pInterpolation,
00163 kFCurveTangeantMode pTangentMode,
00164 bool pAddStopKey = false
00165 );
00166
00179 static void Resample
00180 (
00181 KFCurve &pSourceCurve,
00182 KFCurve &pTargetCurve,
00183 KTime &pStart,
00184 KTime &pStop,
00185 KTime &pPeriod,
00186 bool pAddStopKey = false
00187 );
00188
00198 static void Resample
00199 (
00200 KFCurve &pCurve,
00201 KTime pPeriod,
00202 KTime pStart = KTIME_MINUS_INFINITE,
00203 KTime pStop = KTIME_INFINITE,
00204 bool pKeysOnFrame = false
00205 );
00206
00214 static void Merge(KFCurve &pCurveIn, KFCurve &pCurveMerge, KFCurve &pCurveOut);
00215
00217 static KTime FindTimeOffsetBefore(KFCurve pCurve, KTime& pTime);
00218
00220 static KTime FindTimeOffsetAfter(KFCurve pCurve, KTime& pTime);
00221
00226
00228 enum EError
00229 {
00230
00231 eNoKey,
00232 eMultiple,
00233
00234
00235 eMultipleKeyCount,
00236 eUnsynchedKeys,
00237
00238
00239 eLeftUnchanged,
00240
00241 eErrorCount
00242 };
00243
00245 static KError& GetError();
00246
00248 static EError GetLastErrorID();
00249
00251 static const char* GetLastErrorString();
00252
00254
00256
00257
00258
00259
00260
00261
00263
00264 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00265
00266 protected:
00267
00269 KFCurveUtils();
00270
00271 static KError smError;
00272
00273 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00274
00275 };
00276
00277 #include <kfcurve/kfcurve_nsend.h>
00278
00279 #endif // #ifndef _FBXSDK_KFCURVE_UTILS_H_
00280
00281
00282