FBX SDK Reference Guide: kfcurveutils.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_KFCURVE_UTILS_H_
00005 #define _FBXSDK_KFCURVE_UTILS_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 <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             // Interpolation & tangent methods
00231             eNoKey,
00232             eMultiple,
00233 
00234             // Curve sync methods
00235             eMultipleKeyCount,
00236             eUnsynchedKeys,
00237 
00238             // Filtering methods
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     //  WARNING!
00258     //
00259     //  Anything beyond these lines may not be documented accurately and is
00260     //  subject to change without notice.
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