kfcurveglobal.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEGLOBAL_H
00005 #define FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEGLOBAL_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00044 #include <fbxfilesdk/components/kbaselib/klib/ktime.h>
00045 
00046 #include <fbxfilesdk/components/kfcurve/kfcurve.h>
00047 
00048 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00049 
00050     class KSet;
00051 
00052     KFBX_FORWARD_HI(KFCurve);
00053     KFBX_FORWARD_HI(KFCurveNode);
00054 
00055     #define KFCURVE_INTEPOLATION_INFINITE 1000
00056     #define KFCURVE_OVERSHOOT_INTERPOLATION 500.0 
00057 
00060     KFBX_FORWARD(KSmartPlotOptions)
00061 
00062     class KFBX_DLL KSmartPlotOptions
00063     {
00064 
00065     public: 
00066 
00068         bool    mUseSmartPlot;
00069 
00071         bool    mUseBreakTangent;
00072         double  mBreakTangentThreshold;
00073         KTime   mEpsilonTime;
00074 
00076         bool    mUseIncreaseFidelity;
00077         double  mFidelityTolerance;
00078         bool    mFidelityUseBreakTangent;
00079         int     mFidelitySegmentCount;
00080         bool    mFidelitySyncAddedKeys;
00081 
00083         bool    mShowReferenceCurve;
00084 
00086         KSmartPlotOptions();
00087     };
00088 
00091     KFBX_FORWARD(KMergeLayerOptions)
00092 
00093     class KFBX_DLL KMergeLayerOptions
00094     {
00095 
00096     public: 
00097 
00099         KTime mStart;
00100 
00102         KTime mStop;
00103         
00105         KTime mPlotPeriod;
00106 
00108         KSmartPlotOptions mSmartPlotOptions;
00109 
00111         KMergeLayerOptions();
00112     };
00113 
00114     // TimeWarp Utility
00115 
00117     KFBX_DLL void KFCurve_SetTWSet (KSet* pSet);
00118 
00120     KFBX_DLL HKFCurveNode KFCurve_FindTWFromNickNumber (int pNickNumber);
00121 
00123     KFBX_DLL bool KFCurve_FindNickNumberFromTW (int& pNickNumber, HKFCurveNode pTWNode);
00124 
00125     // ControlCurve Utility
00126 
00127     enum 
00128     {   
00129     //  eKFCURVE_PLOT_SourceCurvesKeep                  = 1<<0 ,
00130         eKFCURVE_PLOT_SourceCurvesDestroy               = 1<<1 ,
00131         eKFCURVE_PLOT_SourceCurvesZeroDuringPlotTime    = 1<<2 ,
00132         eKFCURVE_PLOT_DestinationCurveMergeWithResult   = 1<<3 ,
00133         eKFCURVE_PLOT_DestinationCurveReplaceByResult   = 1<<4 ,
00134         eKFCURVE_PLOT_ForCache                          = 1<<5 ,
00135     };
00136 
00154     KFBX_DLL void KFCurve_PlotInLayers 
00155     (   
00156         HKFCurveNode pParentNode, 
00157         KArrayTemplate<int> *pSourceLayers, // if pointer is NULL, all layers are considered
00158         int pDestLayer,
00159         kUInt pOptions, 
00160         KTime pStart, 
00161         KTime pStop, 
00162         KTime pPlotPeriod,
00163         HKFCurveNode pDestinationNode,
00164         HKFCurveNode pTotalNode,    // If this node is set, function calculates layer to 
00165         bool pUseTimeWarp,
00166         HKSmartPlotOptions pSmartPlotOptions = NULL
00167     );
00168 
00169     /******************************************************************/
00170     //
00171     //  Helpers
00172     //
00173     /******************************************************************/
00174 
00175     // Vectorial conversions tools
00176 
00184     KFBX_DLL bool AxisAlignmentInEulerAngle(double pAB[3], double pA[3], double pB[3], double pAngles[3]);
00185 
00186     // bob 23-05-2001 - old call found in kmodelutility are forwarded to those one
00187     KFBX_DLL KTime  KFCURVE_GetPlotPeriod();
00188     KFBX_DLL void   KFCURVE_SetPlotPeriod(KTime pPlotPeriod);
00189 
00190     //
00191     //  For plotting to be on frame or free... i.e. start at the beginning of the take or on frame.
00192     //
00193     KFBX_DLL bool   KFCURVE_GetPlotOnFrame();
00194     KFBX_DLL void   KFCURVE_SetPlotOnFrame( bool pPlotOnFrame );
00195 
00196     //
00197     // bob 23-05-2001 - the rotation correction filter that should be applied after a plot
00198     //
00199     enum { KFCurveApplyNone = 0, KFCurveApplyGimbleKiller, KFCurveApplyUnroll };
00200 
00201     KFBX_DLL int        KFCURVE_GetRotationFilterToApply();
00202     KFBX_DLL void   KFCURVE_SetRotationFilterToApply(int pRotationFilterToApply);
00203     KFBX_DLL void   KFCURVE_ApplyRotationFilter( HKFCurveNode pCurveNode, KTime pStart  = KTIME_MINUS_INFINITE, KTime pStop = KTIME_INFINITE );
00204 
00205     KFBX_DLL double KFCURVE_GetRotationFilterUnrollQuality();
00206     KFBX_DLL void   KFCURVE_SetRotationFilterUnrollQuality( double pQuality );
00207 
00208     KFBX_DLL bool   KFCURVE_GetRotationFilterUnrollTestForPath();
00209     KFBX_DLL void   KFCURVE_SetRotationFilterUnrollTestForPath( bool pTestForPath );
00210 
00211     KFBX_DLL double KFCURVE_GetButterworthFilterInternalRate();
00212     KFBX_DLL void   KFCURVE_SetButterworthFilterInternalRate( double pButterworthFilterInternalRate );
00213 
00214     //
00215     // the constant key reducer to be applied on Plot
00216     //
00217     KFBX_DLL bool   KFCURVE_GetUseConstantKeyReducer();
00218     KFBX_DLL void   KFCURVE_SetUseConstantKeyReducer( bool pUseConstantKeyReducer );
00219     KFBX_DLL void   KFCURVE_ApplyConstantKeyReducer( HKFCurveNode pCurveNode, KTime pStart  = KTIME_MINUS_INFINITE, KTime pStop = KTIME_INFINITE );
00220     //
00221     // keep at least one key after applying the filter (else, there will only be a candidate on the curve)
00222     //
00223     KFBX_DLL bool   KFCURVE_GetConstantKeyReducerKeepOneKey();
00224     KFBX_DLL void   KFCURVE_SetConstantKeyReducerKeepOneKey( bool pConstantKeyReducerKeepOneKey );
00225 
00226     //
00227     // the constant key reducer to be applied on Device record
00228     //
00229     KFBX_DLL bool   KFCURVE_GetUseConstantKeyReducerOnDevices();
00230     KFBX_DLL void   KFCURVE_SetUseConstantKeyReducerOnDevices( bool pUseConstantKeyReducerOnDevices );
00231 
00232     //
00233     KFBX_DLL double KFCURVE_GetUseConstantKeyReducerTranslationThreshold();
00234     KFBX_DLL void   KFCURVE_SetUseConstantKeyReducerTranslationThreshold( double pConstantKeyReducerTranslationThreshold );
00235 
00236     //
00237     KFBX_DLL double KFCURVE_GetUseConstantKeyReducerRotationThreshold();
00238     KFBX_DLL void   KFCURVE_SetUseConstantKeyReducerRotationThreshold( double pConstantKeyReducerRotationThreshold );
00239 
00240     //
00241     KFBX_DLL double KFCURVE_GetUseConstantKeyReducerScalingThreshold();
00242     KFBX_DLL void   KFCURVE_SetUseConstantKeyReducerScalingThreshold( double pConstantKeyReducerScalingThreshold );
00243 
00244     //
00245     KFBX_DLL double KFCURVE_GetUseConstantKeyReducerDefaultThreshold();
00246     KFBX_DLL void   KFCURVE_SetUseConstantKeyReducerDefaultThreshold( double pConstantKeyReducerDefaultThreshold );
00247 
00248     //
00249     // tell if we should "Plot Translation On Root Only" or not (Antoine 2003-05-02)
00250     //
00251     KFBX_DLL bool   KFCURVE_GetPlotTranslationOnRootOnly();
00252     KFBX_DLL void   KFCURVE_SetPlotTranslationOnRootOnly( bool pPlotTranslationOnRootOnly );
00253 
00254     //
00255     KFBX_DLL bool KFCURVE_GetPreciseTimeDiscontinuities();
00256     KFBX_DLL void KFCURVE_SetPreciseTimeDiscontinuities( bool pPreciseTimeDiscontinuities );
00257 
00258     //
00259     KFBX_DLL bool KFCURVE_GetTCB4051EvalMode();
00260     KFBX_DLL void KFCURVE_SetTCB4051EvalMode( bool pTCB4051EvalMode );
00261 
00262     // Functions to convert bezier tan to the new automatic parametrisation
00263     KFBX_DLL void KFCURVE_ComputeAutoFromBezier(double &pLeftParam, double &pRightParam, double &pLeftTan,   double &pRightTan,   double &pToLeftKey, double &pToRightKey);
00264     KFBX_DLL void KFCURVE_ComputeBezierFromAuto(double &pLeftTan,   double &pRightTan,   double &pLeftParam, double &pRightParam, double &pToLeftKey, double &pToRightKey);
00265 
00266     KFBX_DLL void KFCURVE_ComputeLeftAutoFromBezier(double &pLeftParam, double &pLeftTan,   double &pToLeftKey, double &pToRightKey);
00267     KFBX_DLL void KFCURVE_ComputeLeftBezierFromAuto(double &pLeftTan,   double &pLeftParam, double &pToLeftKey, double &pToRightKey);
00268 
00269     KFBX_DLL void KFCURVE_ComputeRightAutoFromBezier(double &pRightParam, double &pRightTan,   double &pToLeftKey, double &pToRightKey);
00270     KFBX_DLL void KFCURVE_ComputeRightBezierFromAuto(double &pRightTan,   double &pRightParam, double &pToLeftKey, double &pToRightKey);
00271 
00272     KFBX_DLL void KFCURVE_ComputeAutoFromBezierForKey(double &pLeftParam, double &pRightParam, double &pLeftTan,   double &pRightTan,   HKFCurve pCurve, int pIndex);
00273     KFBX_DLL void KFCURVE_ComputeBezierFromAutoForKey(double &pLeftTan,   double &pRightTan  , double &pLeftParam, double &pRightParam, HKFCurve pCurve, int pIndex);
00274 
00275     KFBX_DLL void KFCURVE_ComputeLeftAutoFromBezierForKey(double &pLeftParam, double &pLeftTan,   HKFCurve pCurve, int pIndex);
00276     KFBX_DLL void KFCURVE_ComputeLeftBezierFromAutoForKey(double &pLeftTan,   double &pLeftParam, HKFCurve pCurve, int pIndex);
00277 
00278     KFBX_DLL void KFCURVE_ComputeRightAutoFromBezierForKey(double &pRightParam, double &pRightTan,   HKFCurve pCurve, int pIndex);
00279     KFBX_DLL void KFCURVE_ComputeRightBezierFromAutoForKey(double &pRightTan  , double &pRightParam, HKFCurve pCurve, int pIndex);
00280 
00281     KFBX_DLL void KFCURVE_ComputeToLeftAndToRight(double &pToLeft, double &pToRight, HKFCurve pCurve , int pIndex);
00282 
00289     KFBX_DLL void KFCURVE_BreakTangents( HKFCurveNode pFCurveNode, HKFCurveNode pReferenceFCurveNode, KTime pEpsilonTime, double pTangentThreshold );
00290 
00291 KFBX_DLL void KFCURVE_ComputeTCBFromBezierForKey( double &pT, double &pC ,double &pB , double pLTan, double pRTan, HKFCurve pCurve, int pIndex );
00292 
00305     KFBX_DLL void KFCURVE_IncreaseFidelity( HKFCurveNode pFCurveNode, HKFCurveNode pReferenceFCurveNode, double pFidelityThreshold, int pSegmentCount, bool pBreakTangents, KTime pEpsilonTime, double pTangentThreshold, bool pSyncAddedKeys = false, KArrayTemplate<HKFCurve>* pSyncWithFCurves = NULL, KArrayTemplate<HKFCurve>* pSyncWithReferenceFCurves = NULL );
00306 
00307 
00314     KFBX_DLL bool KFCURVE_IsAllSameInterpolation( HKFCurveNode pFCurveNode, kFCurveInterpolation pInterpolation, bool pAllLayer);
00315 
00323     KFBX_DLL void KFCURVE_ConstantCurveMerge(HKFCurveNode pDstNode,HKFCurveNode pSrcNode, KTime pStart, KTime pStop);
00324 
00325 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00326 
00327 #endif // FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEGLOBAL_H
00328