00001
00004 #ifndef FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEUTILS_H
00005 #define FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEUTILS_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 <fbxfilesdk/components/kfcurve/kfcurve_h.h>
00043
00044 #include <fbxfilesdk/components/kfcurve/kfcurve.h>
00045 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00046
00047 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00048
00049 class KFCurveNode;
00050
00065 class KFBX_DLL KFCurveUtils
00066 {
00067
00068 public:
00069
00075 static bool CompareCurve(KFCurve* pCurveA, KFCurve* pCurveB);
00076
00084 static bool GetGlobalInterpolation(kFCurveInterpolation& pGlobalInterpolation, KFCurve& pCurve);
00085
00093 static bool GetGlobalTangeant(kFCurveTangeantMode& pGlobalTangent, KFCurve& pCurve);
00094
00096 enum EInterpolationAndTangeant
00097 {
00098 eCONSTANT,
00099 eLINEAR,
00100 eCUBIC_AUTO,
00101 eCUBIC_AUTO_BREAK,
00102 eCUBIC_USER,
00103 eCUBIC_BREAK,
00104 eCUBIC_TCB,
00105 eINTERPOLATION_AND_TANGEANT_COUNT
00106 };
00107
00113 static bool GetInterpolationAndTangeantCount(KFCurve& pCurve, int pArray[eINTERPOLATION_AND_TANGEANT_COUNT]);
00114
00122 static KFCurveNode& ConvertCurveInterpolationRecursive
00123 (
00124 kFCurveInterpolation pTargetGlobalInterpolation,
00125 kFCurveTangeantMode pTargetGlobalTangent,
00126 KFCurveNode& pCurveNode
00127 );
00128
00139 static KFCurve& ConvertCurve
00140 (
00141 KFCurve& pSourceCurve,
00142 KFCurve& pTargetCurve,
00143 kFCurveInterpolation pTargetGlobalInterpolation,
00144 kFCurveTangeantMode pTargetGlobalTangent,
00145 KTime pFramePeriod
00146 );
00147
00161 static void Resample
00162 (
00163 KFCurve &pSourceCurve,
00164 KFCurve &pTargetCurve,
00165 KTime &pStart,
00166 KTime &pStop,
00167 KTime &pPeriod,
00168 kFCurveInterpolation pInterpolation,
00169 kFCurveTangeantMode pTangentMode,
00170 bool pAddStopKey = false
00171 );
00172
00185 static void Resample
00186 (
00187 KFCurve &pSourceCurve,
00188 KFCurve &pTargetCurve,
00189 KTime &pStart,
00190 KTime &pStop,
00191 KTime &pPeriod,
00192 bool pAddStopKey = false
00193 );
00194
00204 static void Resample
00205 (
00206 KFCurve &pCurve,
00207 KTime pPeriod,
00208 KTime pStart = KTIME_MINUS_INFINITE,
00209 KTime pStop = KTIME_INFINITE,
00210 bool pKeysOnFrame = false
00211 );
00212
00220 static void Merge(KFCurve &pCurveIn, KFCurve &pCurveMerge, KFCurve &pCurveOut);
00221
00227 static KTime FindTimeOffsetBefore(KFCurve pCurve, KTime& pTime);
00228
00234 static KTime FindTimeOffsetAfter(KFCurve pCurve, KTime& pTime);
00235
00240
00242 enum EError
00243 {
00244
00245 eNoKey,
00246 eMultiple,
00247
00248
00249 eMultipleKeyCount,
00250 eUnsynchedKeys,
00251
00252
00253 eLeftUnchanged,
00254
00255 eErrorCount
00256 };
00257
00259 static KError& GetError();
00260
00262 static EError GetLastErrorID();
00263
00265 static const char* GetLastErrorString();
00266
00268
00270
00271
00272
00273
00274
00275
00277
00278 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00279
00280 protected:
00281
00283 KFCurveUtils();
00284
00285 static KError smError;
00286
00287 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00288
00289 };
00290
00291 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00292
00293 #endif // FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEUTILS_H
00294