- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxanimcurvefilters.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2013 Autodesk, Inc.
    00004    All rights reserved.
    00005
    00006    Use of this software is subject to the terms of the Autodesk license agreement
    00007    provided at the time of installation or download, or which otherwise accompanies
    00008    this software in either electronic or hard copy form.
    00009
    00010 ****************************************************************************************/
    00011
    00013 #ifndef _FBXSDK_SCENE_ANIMATION_CURVE_FILTERS_H_
    00014 #define _FBXSDK_SCENE_ANIMATION_CURVE_FILTERS_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/base/fbxtime.h>
    00019 #include <fbxsdk/core/base/fbxstatus.h>
    00020 #include <fbxsdk/scene/animation/fbxanimcurve.h>
    00021 #include <fbxsdk/fileio/fbxiosettings.h>
    00022
    00023 #include <fbxsdk/fbxsdk_nsbegin.h>
    00024
    00025 class FbxObject;
    00026 class FbxAnimStack;
    00027 class FbxRotationOrder;
    00028
    00074 class FBXSDK_DLL FbxAnimCurveFilter
    00075 {
    00076 public:
    00078     FbxAnimCurveFilter();
    00079
    00081     virtual ~FbxAnimCurveFilter() {};
    00082
    00090     virtual const char* GetName() const {return NULL;}
    00091
    00096     FbxTime& GetStartTime() {return mStart;}
    00097
    00102     void SetStartTime(FbxTime& pTime) { mStart = pTime; }
    00103
    00108     FbxTime& GetStopTime() {return mStop;}
    00109
    00114     void SetStopTime(FbxTime& pTime) { mStop = pTime; }
    00115
    00121     int GetStartKey(FbxAnimCurve& pCurve) const;
    00122
    00128     int GetStopKey(FbxAnimCurve& pCurve) const;
    00129
    00135     virtual bool NeedApply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL);
    00136
    00143     virtual bool NeedApply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL);
    00144
    00152     virtual bool NeedApply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL);
    00153
    00160     virtual bool NeedApply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    00161
    00167     virtual bool NeedApply(FbxAnimCurve& pCurve, FbxStatus* pStatus=NULL);
    00168
    00174     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus = NULL);
    00175
    00182     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus = NULL);
    00183
    00191     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus = NULL);
    00192
    00199     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus = NULL);
    00200
    00206     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus = NULL) = 0;
    00207
    00210     virtual void Reset()
    00211     {
    00212         mStart= FBXSDK_TIME_MINUS_INFINITE;
    00213         mStop = FBXSDK_TIME_INFINITE;
    00214     }
    00215
    00216 /*****************************************************************************************************************************
    00217 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00218 *****************************************************************************************************************************/
    00219 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00220     static bool GetContinuousOffset(FbxRotationOrder& pOrder, FbxVector4& pOffset, FbxVector4& pNew, FbxVector4& pOld);
    00221
    00222 protected:
    00223     void GetKFCurvesFromAnimCurve(FbxAnimCurve** pSrc, int pSrcCount, KFCurve** pDst, int& pDstCount);
    00224
    00225     // Called for progress bar update, indicating what portion of work is done.
    00226     virtual void UpdateProgressInformation(FbxTime /*pStart*/, FbxTime /*pStop*/) {};
    00227
    00228     // Time span for applying the filter.
    00229     FbxTime mStart, mStop;
    00230
    00231 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00232 };
    00233
    00234
    00241 class FBXSDK_DLL FbxAnimCurveFilterConstantKeyReducer : public FbxAnimCurveFilter
    00242 {
    00243 public:
    00245     FbxAnimCurveFilterConstantKeyReducer();
    00246
    00248     virtual ~FbxAnimCurveFilterConstantKeyReducer() {};
    00249
    00253     virtual const char* GetName() const;
    00254
    00259     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                   { return FbxAnimCurveFilter::Apply(pAnimStack, pStatus); }
    00260     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)  { return FbxAnimCurveFilter::Apply(pObj, pAnimStack, pStatus); }
    00261     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL)          { return FbxAnimCurveFilter::Apply(pCurve, pCount, pStatus); }
    00263
    00271     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL);
    00272
    00278     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus=NULL);
    00279
    00282     virtual void Reset();
    00283
    00287     double GetDerivativeTolerance() const;
    00288
    00292     void SetDerivativeTolerance(double pValue);
    00293
    00297     double GetValueTolerance() const;
    00298
    00302     void SetValueTolerance(double pValue);
    00303
    00307     bool GetKeepFirstAndLastKeys() const;
    00308
    00312     void SetKeepFirstAndLastKeys( bool pKeepFirstAndLastKeys );
    00313
    00319     bool GetKeepOneKey() const;
    00320
    00326     void SetKeepOneKey( bool pKeepOneKey );
    00327
    00331     void SetKeepNotPureAutoKeys(bool pKeep);
    00332
    00333 /*****************************************************************************************************************************
    00334 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00335 *****************************************************************************************************************************/
    00336 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00337     //
    00338     //  If ValueTolerance is default, we use the thresholds here, otherwise
    00339     //  it is the ValueTolerance that is used. (Mainly for backward compatibility)
    00340     //
    00341     void SetTranslationThreshold    ( double pTranslationThreshold );
    00342     void SetRotationThreshold       ( double pRotationThreshold );
    00343     void SetScalingThreshold        ( double pScalingThreshold );
    00344     void SetDefaultThreshold        ( double pDefaultThreshold );
    00345
    00346     void SetModes(bool pExporting, FbxIOSettings& pIOS);
    00347
    00348 private:
    00349     double  mDerTol;
    00350     double  mValTol;
    00351
    00352     double  mTranslationThreshold;
    00353     double  mRotationThreshold;
    00354     double  mScalingThreshold;
    00355     double  mDefaultThreshold;
    00356
    00357     bool   mKeepFirstAndLastKeys;
    00358     bool   mKeepOneKey;
    00359     bool   mKeepNotPureAutoKeys;
    00360
    00361     bool IsKeyConstant(FbxAnimCurve& pCurve, int pIndex, int pFirstIndex, int pLastIndex, double pMinValue, double pMaxValue, bool pOnlyCheckAutoKeys);
    00362 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00363 };
    00364
    00372 class FBXSDK_DLL FbxAnimCurveFilterScaleCompensate : public FbxAnimCurveFilter
    00373 {
    00374 public:
    00376     FbxAnimCurveFilterScaleCompensate();
    00378     virtual const char* GetName() const;
    00379
    00388     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxIOSettings& pIOS, FbxStatus* pStatus = NULL);
    00390     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus = NULL);
    00391 };
    00392
    00400 class FBXSDK_DLL FbxAnimCurveFilterGimbleKiller : public FbxAnimCurveFilter
    00401 {
    00402 public:
    00404     FbxAnimCurveFilterGimbleKiller();
    00405
    00407     virtual ~FbxAnimCurveFilterGimbleKiller();
    00408
    00412     virtual const char* GetName() const;
    00413
    00420     virtual bool NeedApply(FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    00421
    00429     virtual bool NeedApply(FbxObject* /*pObj*/, FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    00430
    00439     virtual bool NeedApply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL);
    00440
    00450     virtual bool NeedApply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    00451
    00456     virtual bool NeedApply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    00457
    00464     virtual bool Apply(FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    00465
    00473     virtual bool Apply(FbxObject* /*pObj*/, FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    00474
    00482     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus = NULL);
    00483
    00493     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus = NULL);
    00494
    00498     virtual bool Apply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus = NULL) { FBX_UNUSED(pStatus); return false; }
    00499
    00502     virtual void Reset();
    00503
    00505     bool GetApplyKeySyncFilter() const;
    00506
    00510     void SetApplyKeySyncFilter(bool pFlag);
    00511
    00512 /*****************************************************************************************************************************
    00513 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00514 *****************************************************************************************************************************/
    00515 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00516 private:
    00517     FbxRotationOrder*   mRotationOrder;
    00518     bool                mApplyKeySyncFilter;
    00519     int                 mRotationLayerType;
    00520 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00521 };
    00522
    00529 class FBXSDK_DLL FbxAnimCurveFilterKeyReducer : public FbxAnimCurveFilter
    00530 {
    00531 public:
    00533     FbxAnimCurveFilterKeyReducer();
    00534
    00536     virtual ~FbxAnimCurveFilterKeyReducer() {};
    00537
    00541     virtual const char* GetName() const;
    00542
    00547     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                   { return FbxAnimCurveFilter::Apply(pAnimStack, pStatus); }
    00548     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)  { return FbxAnimCurveFilter::Apply(pObj, pAnimStack, pStatus); }
    00549     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL)               { return FbxAnimCurveFilter::Apply(pCurveNode, pStatus); }
    00551
    00558     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    00559
    00565     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus=NULL);
    00566
    00569     virtual void Reset();
    00570
    00572     double GetPrecision() const;
    00573
    00577     void SetPrecision(double pPrecision);
    00578
    00580     bool GetKeySync() const;
    00581
    00585     void SetKeySync(bool pKeySync);
    00586
    00587 /*****************************************************************************************************************************
    00588 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00589 *****************************************************************************************************************************/
    00590 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00591 private:
    00592     bool  KeyReducer(FbxAnimCurve& pSCurve, FbxAnimCurve& pTCurve, FbxTime pStart, FbxTime pStop);
    00593     bool  Subdivise(FbxAnimCurve& pSCurve, FbxAnimCurve& pTCurve, int pLeft, int pRight);
    00594     double FindMaxError(FbxAnimCurve& pSCurve, FbxAnimCurve& pTCurve, int pLeft, int pRight, int& pSplit);
    00595
    00596     // User parameters.
    00597     double  mPrecision;
    00598     int    mProgressCurrentRecurseLevel;
    00599     bool   mKeySync;
    00600 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00601 };
    00602
    00603
    00608 class FBXSDK_DLL FbxAnimCurveFilterKeySync : public FbxAnimCurveFilter
    00609 {
    00610 public:
    00612     FbxAnimCurveFilterKeySync();
    00613
    00615     virtual ~FbxAnimCurveFilterKeySync() {};
    00616
    00620     virtual const char* GetName() const;
    00621
    00626     virtual bool NeedApply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                   { return FbxAnimCurveFilter::NeedApply(pAnimStack, pStatus); }
    00627     virtual bool NeedApply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)  { return FbxAnimCurveFilter::NeedApply(pObj, pAnimStack, pStatus); }
    00628     virtual bool NeedApply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL)               { return FbxAnimCurveFilter::NeedApply(pCurveNode, pStatus); }
    00629     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                       { return FbxAnimCurveFilter::Apply(pAnimStack, pStatus); }
    00630     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)      { return FbxAnimCurveFilter::Apply(pObj, pAnimStack, pStatus); }
    00631     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL)                   { return FbxAnimCurveFilter::Apply(pCurveNode, pStatus); }
    00633
    00640     virtual bool NeedApply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    00641
    00647     virtual bool NeedApply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    00648
    00655     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    00656
    00663     virtual bool Apply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return true; }
    00664 };
    00665
    00666
    00671 class FBXSDK_DLL FbxAnimCurveFilterResample : public FbxAnimCurveFilter
    00672 {
    00673 public:
    00675     FbxAnimCurveFilterResample();
    00676
    00678     virtual ~FbxAnimCurveFilterResample() {};
    00679
    00683     virtual const char* GetName() const;
    00684
    00689     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                       { return FbxAnimCurveFilter::Apply(pAnimStack, pStatus); }
    00690     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)      { return FbxAnimCurveFilter::Apply(pObj, pAnimStack, pStatus); }
    00691     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL)                   { return FbxAnimCurveFilter::Apply(pCurveNode, pStatus); }
    00692     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL)              { return FbxAnimCurveFilter::Apply(pCurve, pCount, pStatus); }
    00694
    00700     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus=NULL);
    00701
    00704     virtual void Reset();
    00705
    00709     void SetKeysOnFrame(bool pKeysOnFrame);
    00710
    00714     bool GetKeysOnFrame() const;
    00715
    00719     FbxTime GetPeriodTime() const;
    00720
    00724     void SetPeriodTime(FbxTime &pPeriod);
    00725
    00726
    00734     bool  GetIntelligentMode() const;
    00735
    00742     void  SetIntelligentMode( bool pIntelligent );
    00743
    00744 /*****************************************************************************************************************************
    00745 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00746 *****************************************************************************************************************************/
    00747 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00748 private:
    00749     bool    mKeysOnFrame;
    00750     FbxTime   mPeriod;
    00751     bool    mIntelligent;
    00752 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00753 };
    00754
    00755
    00760 class FBXSDK_DLL FbxAnimCurveFilterScale : public FbxAnimCurveFilter
    00761 {
    00762 public:
    00764     FbxAnimCurveFilterScale();
    00765
    00767     virtual ~FbxAnimCurveFilterScale() {};
    00768
    00772     virtual const char* GetName() const;
    00773
    00778     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                       { return FbxAnimCurveFilter::Apply(pAnimStack, pStatus); }
    00779     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)      { return FbxAnimCurveFilter::Apply(pObj, pAnimStack, pStatus); }
    00780     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL)              { return FbxAnimCurveFilter::Apply(pCurve, pCount, pStatus); }
    00782
    00790     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL);
    00791
    00797     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus=NULL);
    00798
    00801     virtual void Reset();
    00802
    00806     double GetScale() const;
    00807
    00811     void SetScale(double pScale);
    00812
    00813 /*****************************************************************************************************************************
    00814 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00815 *****************************************************************************************************************************/
    00816 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00817 private:
    00818     double mScale;
    00819 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00820 };
    00821
    00822
    00828 class FBXSDK_DLL FbxAnimCurveFilterScaleByCurve : public FbxAnimCurveFilter
    00829 {
    00830 public:
    00832     FbxAnimCurveFilterScaleByCurve();
    00833
    00835     virtual ~FbxAnimCurveFilterScaleByCurve() {};
    00836
    00840     virtual const char* GetName() const;
    00841
    00846     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                       { return FbxAnimCurveFilter::Apply(pAnimStack, pStatus); }
    00847     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)      { return FbxAnimCurveFilter::Apply(pObj, pAnimStack, pStatus); }
    00848     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL)              { return FbxAnimCurveFilter::Apply(pCurve, pCount, pStatus); }
    00850
    00858     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL);
    00859
    00865     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus=NULL);
    00866
    00869     virtual void Reset();
    00870
    00874     FbxAnimCurve* GetScale() const;
    00875
    00879     void SetScale(FbxAnimCurve* pScale);
    00880
    00881 /*****************************************************************************************************************************
    00882 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00883 *****************************************************************************************************************************/
    00884 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00885 private:
    00886     FbxAnimCurve* mScale;
    00887 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00888 };
    00889
    00894 class FBXSDK_DLL FbxAnimCurveFilterTSS : public FbxAnimCurveFilter
    00895 {
    00896 public:
    00898     FbxAnimCurveFilterTSS();
    00899
    00901     virtual ~FbxAnimCurveFilterTSS() {};
    00902
    00906     virtual const char* GetName() const;
    00907
    00912     virtual bool Apply(FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)                       { FBX_UNUSED(pStatus); return FbxAnimCurveFilter::Apply(pAnimStack); }
    00913     virtual bool Apply(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxStatus* pStatus=NULL)      { FBX_UNUSED(pStatus); return FbxAnimCurveFilter::Apply(pObj, pAnimStack); }
    00914     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL)                   { FBX_UNUSED(pStatus); return FbxAnimCurveFilter::Apply(pCurveNode); }
    00915     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL)              { FBX_UNUSED(pStatus); return FbxAnimCurveFilter::Apply(pCurve, pCount); }
    00917
    00923     virtual bool Apply(FbxAnimCurve& pCurve, FbxStatus* pStatus=NULL);
    00924
    00927     virtual void Reset();
    00928
    00932     FbxTime GetShift() const;
    00933
    00937     void SetShift(FbxTime& pShift);
    00938
    00942     double GetScale() const;
    00943
    00947     void SetScale(double pScale);
    00948
    00949 /*****************************************************************************************************************************
    00950 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00951 *****************************************************************************************************************************/
    00952 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00953 private:
    00954     FbxTime  mShift;
    00955     double  mScale;
    00956 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00957 };
    00958
    00974 class FBXSDK_DLL FbxAnimCurveFilterUnroll : public FbxAnimCurveFilter
    00975 {
    00976 public:
    00978     FbxAnimCurveFilterUnroll();
    00979
    00981     virtual ~FbxAnimCurveFilterUnroll() {};
    00982
    00986     virtual const char* GetName() const;
    00987
    00994     virtual bool NeedApply(FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; };
    00995
    01003     virtual bool NeedApply(FbxObject* /*pObj*/, FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01004
    01013     virtual bool NeedApply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL);
    01014
    01025     virtual bool NeedApply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    01026
    01030     virtual bool NeedApply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; };
    01031
    01038     virtual bool Apply(FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; };
    01039
    01047     virtual bool Apply(FbxObject* /*pObj*/, FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01048
    01055     virtual bool Apply(FbxAnimCurveNode& pCurveNode, FbxStatus* pStatus=NULL);
    01056
    01066     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    01067
    01071     virtual bool Apply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01072
    01075     virtual void Reset();
    01076
    01081     double GetQualityTolerance() const;
    01082
    01087     void SetQualityTolerance(double pQualityTolerance);
    01088
    01099     bool GetTestForPath() const;
    01100
    01111     void SetTestForPath(bool pTestForPath);
    01112
    01119     bool GetForceAutoTangents() const;
    01120
    01127     void SetForceAutoTangents(bool pForceAutoTangents);
    01128
    01129 /*****************************************************************************************************************************
    01130 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    01131 *****************************************************************************************************************************/
    01132 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01133     void SetRotationOrder(int pOrder);
    01134
    01135 private:
    01136     double  InterpolationQualityFactor(FbxVector4& lV1, FbxVector4& lV2);
    01137
    01138     double          mQualityTolerance;
    01139     bool            mTestForPath;
    01140     bool            mForceAutoTangents;
    01141     int             mRotationOrder;
    01142     int             mRotationLayerType;
    01143 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    01144 };
    01145
    01153 class FBXSDK_DLL FbxAnimCurveFilterMatrixConverter : public FbxAnimCurveFilter
    01154 {
    01155 public:
    01157     FbxAnimCurveFilterMatrixConverter();
    01158
    01160     virtual ~FbxAnimCurveFilterMatrixConverter();
    01161
    01165     virtual const char* GetName() const;
    01166
    01171     virtual bool NeedApply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL)          { return FbxAnimCurveFilter::NeedApply(pCurve, pCount,pStatus); }
    01173
    01180     virtual bool NeedApply(FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01181
    01189     virtual bool NeedApply(FbxObject* /*pObj*/, FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01190
    01200     virtual bool NeedApply(FbxAnimCurveNode* pCurveNode[3], FbxStatus* pStatus=NULL);
    01201
    01205     virtual bool NeedApply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01206
    01213     virtual bool Apply(FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01214
    01222     virtual bool Apply(FbxObject* /*pObj*/, FbxAnimStack* /*pAnimStack*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; }
    01223
    01232     virtual bool Apply(FbxAnimCurveNode* pCurveNode[3], FbxStatus* pStatus=NULL);
    01233
    01247     virtual bool Apply(FbxAnimCurve** pCurve, int pCount, FbxStatus* pStatus=NULL);
    01248
    01260     bool Apply(FbxAnimCurve** pCurve, double* pVals, FbxStatus* pStatus=NULL);
    01261
    01265     virtual bool Apply(FbxAnimCurve& /*pCurve*/, FbxStatus* pStatus=NULL) { FBX_UNUSED(pStatus); return false; };
    01266
    01269     virtual void Reset();
    01270
    01285     enum EMatrixIndex
    01286     {
    01287         ePreGlobal,
    01288         ePreTranslate,
    01289         ePostTranslate,
    01290         ePreRotate,
    01291         ePostRotate,
    01292         ePreScale,
    01293         ePostScale,
    01294         ePostGlobal,
    01295         eScaleOffset,
    01296         eInactivePre,
    01297         eInactivePost,
    01298         eRotationPivot,
    01299         eScalingPivot,
    01300         eMatrixIndexCount
    01301     };
    01302
    01307     void GetSourceMatrix(EMatrixIndex pIndex, FbxAMatrix& pMatrix) const;
    01308
    01313     void SetSourceMatrix(EMatrixIndex pIndex, FbxAMatrix& pMatrix);
    01314
    01319     void GetDestMatrix(EMatrixIndex pIndex, FbxAMatrix& pMatrix) const;
    01320
    01325     void SetDestMatrix(EMatrixIndex pIndex, FbxAMatrix& pMatrix);
    01326
    01330     FbxTime GetResamplingPeriod () const;
    01331
    01335     void SetResamplingPeriod (FbxTime& pResamplingPeriod);
    01336
    01341     bool GetGenerateLastKeyExactlyAtEndTime() const;
    01342
    01347     void SetGenerateLastKeyExactlyAtEndTime(bool pFlag);
    01348
    01352     bool GetResamplingOnFrameRateMultiple() const;
    01353
    01362     void SetResamplingOnFrameRateMultiple(bool pFlag);
    01363
    01369     bool GetApplyUnroll() const;
    01370
    01375     void SetApplyUnroll(bool pFlag);
    01376
    01380     bool GetApplyConstantKeyReducer() const;
    01381
    01386     void SetApplyConstantKeyReducer(bool pFlag);
    01387
    01393     bool GetResampleTranslation() const;
    01394
    01400     void SetResampleTranslation(bool pFlag);
    01401
    01405     void SetSrcRotateOrder(int pOrder);
    01406
    01410     void SetDestRotateOrder(int pOrder);
    01411
    01415     void SetForceApply(bool pVal);
    01416
    01420     bool GetForceApply() const;
    01421
    01422 /*****************************************************************************************************************************
    01423 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    01424 *****************************************************************************************************************************/
    01425 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    01426 private:
    01427     // Nicer than referring to 0, 1, 2...
    01428     enum EAxisIndex {eX, eY, eZ, eAxisCount};
    01429
    01430     // Convert parameter cell.
    01431     class Cell;
    01432
    01433     bool MatricesEquivalence(FbxAMatrix pMatArrayA [eMatrixIndexCount], FbxAMatrix pMatArrayB [eMatrixIndexCount]) const;
    01434
    01435     bool DoConvert(FbxAnimCurve** pCurve,
    01436                     double pT[eAxisCount],
    01437                     double pR[eAxisCount],
    01438                     double pS[eAxisCount]);
    01439
    01440     void FindTimeInterval
    01441     (
    01442         FbxTime& pStart,
    01443         FbxTime& pEnd,
    01444         FbxAnimCurve* pTFCurve [eAxisCount],
    01445         FbxAnimCurve* pRFCurve [eAxisCount],
    01446         FbxAnimCurve* pSFCurve [eAxisCount]
    01447     );
    01448
    01449     void ComputeTotalMatrix
    01450     (
    01451         FbxAMatrix& pGlobal,
    01452         Cell& pCell,
    01453         FbxAMatrix& pTranslate,
    01454         FbxAMatrix& pRotate,
    01455         FbxAMatrix& pScale
    01456     );
    01457
    01458     void ExtractTransforms
    01459     (
    01460         FbxVector4& pScaleVector,
    01461         FbxVector4& pRotateVector,
    01462         FbxVector4& pTranslateVector,
    01463         FbxAMatrix& pGlobal,
    01464         Cell& pDest
    01465     );
    01466
    01467     void SetDestFCurve(FbxAnimCurve* pCurve [eAxisCount],
    01468                        int pIndex,
    01469                        FbxTime pTime,
    01470                        FbxVector4 pVector,
    01471                        FbxAnimCurveDef::EInterpolationType pInterpMode[eAxisCount],
    01472                        FbxAnimCurveDef::ETangentMode pTangentMode[eAxisCount]);
    01473
    01474     void FillInterpAndTangeant(FbxTime& pTime,
    01475                                FbxAnimCurve* pSourceCurve[eAxisCount],
    01476                                FbxAnimCurveDef::EInterpolationType* pInterp,
    01477                                FbxAnimCurveDef::ETangentMode* pTangeant);
    01478
    01479     void SetDestFCurveTangeant(FbxAnimCurve* pCurve [eAxisCount],
    01480                                int pIndex,
    01481                                FbxAnimCurveDef::ETangentMode pTangentMode[eAxisCount],
    01482                                FbxVector4 pKeyValue,
    01483                                FbxVector4 pNextKeyValue);
    01484
    01485     Cell* mSource;
    01486     Cell* mDest;
    01487
    01488     FbxTime mResamplingPeriod;
    01489     bool mResamplingOnFrameRateMultiple;
    01490
    01491     bool mApplyUnroll;
    01492     bool mApplyConstantKeyReducer;
    01493
    01494     // PP : So that the concatenation of matrices takes into account the rotation order
    01495     FbxRotationOrder* mSrcRotationOrder;
    01496     FbxRotationOrder* mDestRotationOrder;
    01497
    01498     // Set last key exactly at end time or a frame period later.
    01499     bool mGenerateLastKeyExactlyAtEndTime;
    01500
    01501     // Translation re-sampling flag.
    01502     bool mResampleTranslation;
    01503
    01504     // Force Apply
    01505     bool mForceApply;
    01506
    01507     // internal usage
    01508     FbxAnimCurveNode* mRotationCurveNode;
    01509 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    01510 };
    01511
    01512 #include <fbxsdk/fbxsdk_nsend.h>
    01513
    01514 #endif /* _FBXSDK_SCENE_ANIMATION_CURVE_FILTERS_H_ */