FBX SDK Reference Guide: kfcurveutils.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEUTILS_H
00005 #define FBXFILESDK_COMPONENTS_KFCURVE_KFCURVEUTILS_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2008 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 
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             // Interpolation & tangent methods
00245             eNoKey,
00246             eMultiple,
00247 
00248             // Curve sync methods
00249             eMultipleKeyCount,
00250             eUnsynchedKeys,
00251 
00252             // Filtering methods
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     //  WARNING!
00272     //
00273     //  Anything beyond these lines may not be documented accurately and is
00274     //  subject to change without notice.
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