FBX SDK Reference Guide: kfcurve.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_COMPONENTS_KFCURVE_KFCURVE_H
00005 #define FBXFILESDK_COMPONENTS_KFCURVE_KFCURVE_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 #include <fbxfilesdk/components/kfcurve/kfcurve_h.h>
00042 
00043 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00044 #include <fbxfilesdk/components/kbaselib/klib/ktime.h>
00045 #include <fbxfilesdk/components/kbaselib/object/e/keventbase.h>
00046 #include <fbxfilesdk/components/kbaselib/klib/kdebug.h>
00047 
00048 
00049 #ifndef KFBX_PLUGIN
00050     #include <fbxfilesdk/components/kbaselib/object/i/iobject.h>
00051     #include <fbxfilesdk/components/kbaselib/object/i/ifbobjectholder.h>
00052 #endif
00053 
00054 #ifndef KFBX_PLUGIN
00055     #include <fbxfilesdk/components/kbaselib/klib/kdebug.h>
00056 #endif
00057 
00058 #include <fbxfilesdk/components/kbaselib/kbaselib_forward.h>
00059 
00060 #undef  KFBX_FCURVE_INLINE
00061 #define KFBX_FCURVE_INLINE inline
00062 
00063 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00064 
00065     #define KFCURVE_FLOAT
00066     #ifdef KFCURVE_FLOAT
00067         typedef float kFCurveDouble;
00068     #else
00069         typedef double kFCurveDouble;
00070     #endif
00071 
00072 
00073     KFBX_FORWARD(KFCurve);
00074 
00075     #define IKFCurveID 43763635
00076 
00077     typedef HKFCurve HIKFCurve;
00078     typedef class KFBX_DLL KArrayTemplate< KFCurve * > KArrayKFCurve;
00079 
00080     // Recording memory functions declaration
00081     KFBX_DLL kULong GetRecordingMemory();
00082     KFBX_DLL void WatchFree(void* pPtr, kULong pSize);
00083     KFBX_DLL void* WatchMalloc(kULong pSize);
00084 
00086     enum
00087     {
00088         KFCURVE_INTERPOLATION_CONSTANT    = 0x00000002,     
00089         KFCURVE_INTERPOLATION_LINEAR      = 0x00000004,     
00090         KFCURVE_INTERPOLATION_CUBIC       = 0x00000008,     
00091         KFCURVE_INTERPOLATION_ALL         = KFCURVE_INTERPOLATION_CONSTANT|KFCURVE_INTERPOLATION_LINEAR|KFCURVE_INTERPOLATION_CUBIC,
00092         KFCURVE_INTERPOLATION_COUNT       = 3
00093     };                                                
00094 
00096     enum
00097     {
00098         KFCURVE_CONSTANT_STANDARD         = 0x00000000,
00099         KFCURVE_CONSTANT_NEXT             = 0x00000100,
00100         KFCURVE_CONSTANT_ALL              = KFCURVE_CONSTANT_STANDARD | KFCURVE_CONSTANT_NEXT,
00101         KFCURVE_CONSTANT_COUNT            = 2
00102     };
00103 
00105     enum
00106     {
00107         KFCURVE_TANGEANT_AUTO             = 0x00000100,     
00108         KFCURVE_TANGEANT_TCB              = 0x00000200,     
00109         KFCURVE_TANGEANT_USER             = 0x00000400,     
00110         KFCURVE_GENERIC_BREAK             = 0x00000800,     
00111     KFCURVE_GENERIC_CLAMP             = 0x00001000,     
00112         KFCURVE_TANGEANT_BREAK            = KFCURVE_TANGEANT_USER|KFCURVE_GENERIC_BREAK,
00113         KFCURVE_TANGEANT_AUTO_BREAK   = KFCURVE_TANGEANT_AUTO|KFCURVE_GENERIC_BREAK,
00114     KFCURVE_TANGEANT_ALL              = KFCURVE_TANGEANT_AUTO|KFCURVE_TANGEANT_TCB|KFCURVE_TANGEANT_USER|KFCURVE_GENERIC_BREAK|KFCURVE_GENERIC_CLAMP,
00115     KFCURVE_TANGEANT_TYPE_MASK        = KFCURVE_TANGEANT_AUTO|KFCURVE_TANGEANT_TCB|KFCURVE_TANGEANT_USER|KFCURVE_TANGEANT_BREAK, // Break is part of the modes for historic reasons, should be part of overrides
00116     KFCURVE_TANGEANT_OVERRIDES_MASK   = KFCURVE_GENERIC_CLAMP
00117     // KFCURVE_TANGEANT_COUNT             = 4
00118     };
00119 
00121     enum 
00122     {
00123         KFCURVE_SELECT_POINT              = 0x00010000, 
00124         KFCURVE_SELECT_LEFT               = 0x00020000, 
00125         KFCURVE_SELECT_RIGHT              = 0x00040000, 
00126         KFCURVE_SELECT_ALL                = KFCURVE_SELECT_POINT|KFCURVE_SELECT_LEFT|KFCURVE_SELECT_RIGHT
00127     };
00128 
00130     enum
00131     {
00132         KFCURVE_MARKED_FOR_MANIP          = 0x00080000,
00133         KFCURVE_MARKED_ALL                = KFCURVE_MARKED_FOR_MANIP
00134     };
00135 
00137     enum 
00138     {
00139         KFCURVE_TANGEANT_SHOW_NONE        = 0x00000000, 
00140         KFCURVE_TANGEANT_SHOW_LEFT        = 0x00100000, 
00141         KFCURVE_TANGEANT_SHOW_RIGHT       = 0x00200000, 
00142         KFCURVE_TANGEANT_SHOW_BOTH        = KFCURVE_TANGEANT_SHOW_LEFT|KFCURVE_TANGEANT_SHOW_RIGHT
00143     };
00144 
00146 enum
00147 {
00148     KFCURVE_CONTINUITY                = 0x00000000,
00149     KFCURVE_CONTINUITY_FLAT           = 0x00100000,
00150     KFCURVE_CONTINUITY_BREAK          = 0x00200000,
00151     KFCURVE_CONTINUITY_INSERT         = 0x00400000   // Used to prevent the curve shape from changing when inserting a key
00152 };
00153 
00155     enum 
00156     {
00157         KFCURVE_WEIGHTED_NONE             = 0x00000000, 
00158         KFCURVE_WEIGHTED_RIGHT            = 0x01000000, 
00159         KFCURVE_WEIGHTED_NEXT_LEFT        = 0x02000000, 
00160         KFCURVE_WEIGHTED_ALL              = KFCURVE_WEIGHTED_RIGHT|KFCURVE_WEIGHTED_NEXT_LEFT
00161     };
00162 
00163     // !Velocity mode
00164     enum
00165     {
00166         KFCURVE_VELOCITY_NONE             = 0x00000000,
00167         KFCURVE_VELOCITY_RIGHT            = 0x10000000,
00168         KFCURVE_VELOCITY_NEXT_LEFT        = 0x20000000,
00169         KFCURVE_VELOCITY_ALL              = KFCURVE_VELOCITY_RIGHT | KFCURVE_VELOCITY_NEXT_LEFT
00170     };
00171 
00172 
00173     #ifndef DOXYGEN_SHOULD_SKIP_THIS
00174 
00175     #define KFCURVE_WEIGHT_DIVIDER       9999       // precise enough and can be divided by 3 without error
00176     #define KFCURVE_DEFAULT_WEIGHT       ((kFCurveDouble)(1.0/3.0))
00177     #define KFCURVE_MIN_WEIGHT           ((kFCurveDouble)(1.0/KFCURVE_WEIGHT_DIVIDER))
00178     #define KFCURVE_MAX_WEIGHT           ((kFCurveDouble)0.99)
00179     #define KFCURVE_DEFAULT_VELOCITY     0.0 
00180 
00181     #endif // DOXYGEN_SHOULD_SKIP_THIS
00182 
00183 
00185     enum EKFCurveDataIndex
00186     {
00187         // User and Break tangent mode (data are doubles).
00188         KFCURVEKEY_RIGHT_SLOPE          = 0, 
00189         KFCURVEKEY_NEXT_LEFT_SLOPE      = 1, 
00190 
00191         // User and Break tangent break mode (data are kInt16 thken from mwight and converted to doubles).
00192         KFCURVEKEY_WEIGHTS              = 2, 
00193         KFCURVEKEY_RIGHT_WEIGHT         = 2, 
00194         KFCURVEKEY_NEXT_LEFT_WEIGHT     = 3, 
00195 
00196         // Velocity mode
00197         KFCURVEKEY_VELOCITY             = 4,
00198         KFCURVEKEY_RIGHT_VELOCITY       = 4,
00199         KFCURVEKEY_NEXT_LEFT_VELOCITY   = 5, 
00200 
00201         // TCB tangent mode (data are floats).
00202         KFCURVEKEY_TCB_TENSION          = 0, 
00203         KFCURVEKEY_TCB_CONTINUITY       = 1, 
00204         KFCURVEKEY_TCB_BIAS             = 2,
00205 
00206         KFCURVEKEY_RIGHT_AUTO           = 0,
00207         KFCURVEKEY_NEXT_LEFT_AUTO       = 1
00208     };
00209 
00211     enum 
00212     {
00213         KFCURVE_EXTRAPOLATION_CONST             = 1, 
00214         KFCURVE_EXTRAPOLATION_REPETITION        = 2, 
00215         KFCURVE_EXTRAPOLATION_MIRROR_REPETITION = 3, 
00216         KFCURVE_EXTRAPOLATION_KEEP_SLOPE        = 4
00217     };
00218 
00219     enum 
00220     {
00221         KFCURVE_BEZIER  = 0, 
00222         KFCURVE_SAMPLE  = 1, 
00223         KFCURVE_ISO     = 2
00224     };
00225 
00226     typedef kUInt kFCurveInterpolation;
00227     typedef kUInt kFCurveConstantMode;
00228     typedef kUInt kFCurveTangeantMode;
00229     typedef kUInt kFCurveTangeantWeightMode;
00230     typedef kUInt kFCurveTangeantVelocityMode;
00231     typedef kUInt kFCurveExtrapolationMode;
00232     typedef kUInt kFCurveTangeantVisibility;
00233     typedef int kFCurveIndex;
00234 
00235     enum 
00236     {
00237         KFCURVEEVENT_NONE       =0, // default event value
00238         KFCURVEEVENT_CANDIDATE  =1 << 0, // curve value (not candidate) changed
00239         KFCURVEEVENT_UNUSED1    =1 << 1,
00240         KFCURVEEVENT_UNUSED2    =1 << 2,
00241         KFCURVEEVENT_UNUSED3    =1 << 3,
00242         KFCURVEEVENT_KEY        =1 << 4, // key changed (add, removed, edited); see bits 11-15 for precisions
00243         KFCURVEEVENT_DEPRECATED5 =1 << 5,
00244         KFCURVEEVENT_UNUSED6    =1 << 6,
00245         KFCURVEEVENT_UNUSED7    =1 << 7,
00246         KFCURVEEVENT_SELECTION  =1 << 8, // key selection changed
00247         KFCURVEEVENT_DESTROY    =1 << 9, // fcurve destruction
00248         KFCURVEEVENT_DEPRECATED10 =1 << 10,
00249         KFCURVEEVENT_KEYADD     =1 << 11,
00250         KFCURVEEVENT_KEYREMOVE  =1 << 12,
00251         KFCURVEEVENT_EDITVALUE  =1 << 13,
00252         KFCURVEEVENT_EDITTIME   =1 << 14,
00253         KFCURVEEVENT_EDITOTHER  =1 << 15,
00254     };
00255 
00256 
00257     // Curve event class.
00258     class KFBX_DLL KFCurveEvent : public KEventBase
00259     {
00260     public:
00261         // Curve event type, the enum stated above allow composition of type (bitfield). 
00262         // Stored in mType
00263 
00264         // Start key index.
00265         int mKeyIndexStart; 
00266 
00267         //  Stop key index.
00268         int mKeyIndexStop; 
00269 
00270         // Count of events.
00271         int mEventCount;
00272 
00273         // Clear curve event.
00274         KFBX_FCURVE_INLINE void Clear (); 
00275         
00276         // Add a curve event of type pWhat to a curve event object.
00277         KFBX_FCURVE_INLINE void Add (int pWhat, int pIndex);
00278     };
00279 
00280     typedef void (*kFCurveCallback) (KFCurve *pFCurve, KFCurveEvent *FCurveEvent, void* pObject);
00281 
00286     class KFBX_DLL KFCurveTangeantInfo 
00287     {
00288     public:
00289         KFBX_FCURVE_INLINE KFCurveTangeantInfo();
00290 
00291         kFCurveDouble mDerivative;
00292         kFCurveDouble mWeight;
00293         bool         mWeighted;
00294         kFCurveDouble mVelocity;
00295         bool          mHasVelocity;
00296         kFCurveDouble mAuto;  // The auto parameter!
00297     };
00298 
00308     class KFBX_DLL KFCurveKey 
00309     {
00310     public:
00311         KFCurveKey()
00312         {
00313             Init();
00314         }
00315 
00316     public:
00317         
00343         KFBX_FCURVE_INLINE void Set 
00344         (
00345             KTime pTime, 
00346             kFCurveDouble pValue, 
00347             kFCurveInterpolation pInterpolation = KFCURVE_INTERPOLATION_CUBIC, 
00348             kFCurveTangeantMode pTangentMode = KFCURVE_TANGEANT_AUTO, 
00349             kFCurveDouble pData0 = 0.0,
00350             kFCurveDouble pData1 = 0.0,
00351             kFCurveTangeantWeightMode pTangentWeightMode = KFCURVE_WEIGHTED_NONE, 
00352             kFCurveDouble pWeight0                             = KFCURVE_DEFAULT_WEIGHT,
00353             kFCurveDouble pWeight1                             = KFCURVE_DEFAULT_WEIGHT,
00354             kFCurveDouble pVelocity0 = KFCURVE_DEFAULT_VELOCITY,
00355             kFCurveDouble pVelocity1 = KFCURVE_DEFAULT_VELOCITY
00356         );
00357         
00365         KFBX_FCURVE_INLINE void SetTCB 
00366         (
00367             KTime pTime, 
00368             kFCurveDouble pValue, 
00369             float pData0 = 0.0f, 
00370             float pData1 = 0.0f, 
00371             float pData2 = 0.0f
00372         );
00373         
00377         KFBX_FCURVE_INLINE void Set(KFCurveKey& pSource);
00378         
00384         KFBX_FCURVE_INLINE kFCurveInterpolation GetInterpolation();
00385         
00392         KFBX_FCURVE_INLINE void SetInterpolation(kFCurveInterpolation pInterpolation);
00393 
00401         KFBX_FCURVE_INLINE kFCurveConstantMode GetConstantMode();
00402 
00414     KFBX_FCURVE_INLINE kFCurveTangeantMode GetTangeantMode( bool pIncludeOverrides = false );
00415 
00423         KFBX_FCURVE_INLINE kFCurveTangeantWeightMode GetTangeantWeightMode();
00424 
00432         KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode GetTangeantVelocityMode();
00433 
00440         KFBX_FCURVE_INLINE void SetConstantMode(kFCurveConstantMode pMode);
00441 
00451         KFBX_FCURVE_INLINE void SetTangeantMode(kFCurveTangeantMode pTangent);
00452             
00466         KFBX_FCURVE_INLINE void SetTangeantWeightMode(kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask = KFCURVE_WEIGHTED_ALL );
00467 
00481         KFBX_FCURVE_INLINE void SetTangeantVelocityMode(kFCurveTangeantVelocityMode pTangentVelocityMode, kFCurveTangeantVelocityMode pMask = KFCURVE_VELOCITY_ALL );
00482 
00483             
00498         KFBX_FCURVE_INLINE kFCurveDouble GetDataDouble(EKFCurveDataIndex pIndex);
00499         
00515         KFBX_FCURVE_INLINE void SetDataDouble(EKFCurveDataIndex pIndex, kFCurveDouble pValue);
00516         
00522         KFBX_FCURVE_INLINE float GetDataFloat(EKFCurveDataIndex pIndex);
00523 
00530         KFBX_FCURVE_INLINE void SetDataFloat(EKFCurveDataIndex pIndex, float pValue);
00531 
00535         KFBX_FCURVE_INLINE float* GetDataPtr();
00536 
00538         KFBX_FCURVE_INLINE kFCurveDouble GetValue();
00539 
00543         KFBX_FCURVE_INLINE void SetValue(kFCurveDouble pValue);
00544 
00548         KFBX_FCURVE_INLINE void IncValue(kFCurveDouble pValue);
00549 
00553         KFBX_FCURVE_INLINE void MultValue(kFCurveDouble pValue);
00554 
00560         KFBX_FCURVE_INLINE void MultTangeant(kFCurveDouble pValue);
00561 
00565         KFBX_FCURVE_INLINE KTime GetTime();
00566 
00570         KFBX_FCURVE_INLINE void SetTime(KTime pTime);
00571 
00575         KFBX_FCURVE_INLINE void IncTime(KTime pTime);
00576 
00580         KFBX_FCURVE_INLINE void SetSelected(bool pSelected);    
00581 
00585         KFBX_FCURVE_INLINE bool GetSelected();
00586 
00590         KFBX_FCURVE_INLINE void SetMarkedForManipulation(bool pMark);   
00591 
00595         KFBX_FCURVE_INLINE bool GetMarkedForManipulation();
00596 
00604         KFBX_FCURVE_INLINE void SetTangeantVisibility (kFCurveTangeantVisibility pVisibility);  
00605         
00613         KFBX_FCURVE_INLINE kFCurveTangeantVisibility GetTangeantVisibility ();
00614 
00619         KFBX_FCURVE_INLINE void SetBreak(bool pVal); 
00620 
00624         KFBX_FCURVE_INLINE bool GetBreak(); 
00625 
00626 
00627 
00628 
00630     //
00631     //  WARNING!
00632     //
00633     //  Anything beyond these lines may not be documented accurately and is 
00634     //  subject to change without notice.
00635     //
00637 
00638         KFBX_FCURVE_INLINE void Init();
00639 
00640     #ifndef DOXYGEN_SHOULD_SKIP_THIS
00641 
00642     private:
00643 
00644         kFCurveDouble mValue;       
00645         KTime mTime;    
00646         kUInt mFlags;
00647 
00648     #ifdef KFCURVE_FLOAT
00649         float  mData[4];
00650     #else 
00651         double  mData[2];
00652         kInt16  mWeight[2];
00653         kInt16  mVelocity[2];
00654     #endif  
00655 
00656     #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00657 
00658     };
00659 
00660 
00661     const int KEY_BLOCK_SIZE    = 1024;
00662     const int KEY_BLOCK_COUNT   = KEY_BLOCK_SIZE/sizeof (KFCurveKey);
00663 
00664     const int KEY_LIST_BLOCK_SIZE   = 256;
00665     const int KEY_LIST_BLOCK_COUNT  = KEY_LIST_BLOCK_SIZE/sizeof (KFCurveKey *);
00666 
00667 
00674     #ifdef KFBX_PLUGIN
00675     class KFBX_DLL KFCurve
00676     #else 
00677     class KFBX_DLL KFCurve : public IFBObjectHolder
00678     #endif
00679     {
00680 
00681     public:
00682 
00687 
00689         KFCurve();
00690 
00692         virtual ~KFCurve();
00693 
00694         #ifdef KFBX_PLUGIN
00695             void Destroy(int Local=0);
00696         #else
00697             KFBX_IObject_Declare(KFBX_Implementation)
00698         #endif
00699 
00701 
00705         float* GetColor();
00706         
00710         void SetColor(float *pColor);
00711 
00716         void SetValue(kFCurveDouble pValue);
00717 
00722         KFBX_FCURVE_INLINE kFCurveDouble GetValue() const;
00723 
00728 
00732         void ResizeKeyBuffer(int pKeyCount);
00733 
00738         void KeyModifyBegin ();
00739         
00743         void KeyModifyEnd ();
00744 
00746         int KeyGetCount ();
00747 
00749         int KeyGetSelectionCount ();
00750 
00752         void KeySelectAll ();
00753         
00755         void KeyUnselectAll ();
00756 
00762         KFCurveKey KeyGet(kFCurveIndex pIndex);
00763         
00765         void KeyClear ();
00766         
00768         void KeyShrink();
00769 
00778         bool    KeySet(kFCurveIndex pIndex, KFCurveKey& pKey);
00779 
00789         KFBX_FCURVE_INLINE bool KeySet(kFCurveIndex pIndex, KFCurve* pSourceCurve, int pSourceIndex);
00790         
00798         int KeyMove(kFCurveIndex pIndex, KTime pTime);
00799         
00807         bool KeyMoveOf (bool pSelectedOnly, KTime pDeltaTime, kFCurveDouble pDeltaValue);
00808         
00815         bool KeyMoveValueTo (bool pSelectedOnly, kFCurveDouble pValue);
00816         
00823         bool KeyScaleValue (bool pSelectedOnly, kFCurveDouble pMultValue);
00824 
00831         bool KeyScaleTangeant (bool pSelectedOnly, kFCurveDouble pMultValue);
00832 
00839         bool KeyScaleValueAndTangeant (bool pSelectedOnly, kFCurveDouble pMultValue);
00840 
00845         bool KeyRemove(kFCurveIndex pIndex);
00846 
00862         int KeyInsert ( KTime pTime, kFCurveIndex* pLast = NULL );
00863 
00880         int KeyAdd (KTime pTime, KFCurveKey& pKey, kFCurveIndex* pLast = NULL);
00881 
00899         int KeyAdd(KTime pTime, KFCurve* pSourceCurve, int pSourceIndex, kFCurveIndex* pLast = NULL);
00900         
00915         int KeyAdd (KTime pTime, kFCurveIndex* pLast = NULL);
00916 
00924         int KeyAppend(KTime pAtTime, KFCurve* pSourceCurve, int pSourceIndex);
00925 
00935         int KeyAppendFast( KTime pTime, kFCurveDouble pValue );
00936         
00947         double KeyFind (KTime pTime, kFCurveIndex* pLast = NULL);   
00948 
00950 
00951         /************************************************************************************************/
00952         /************************************************************************************************/
00953         /************************************************************************************************/
00954         /************************************************************************************************/
00955         /************************************************************************************************/
00956         /************************************************************************************************/
00957 
00958 
00963 
00990         KFBX_FCURVE_INLINE void KeySet 
00991         (
00992             kFCurveIndex pKeyIndex,
00993             KTime pTime, 
00994             kFCurveDouble pValue, 
00995             kFCurveInterpolation pInterpolation = KFCURVE_INTERPOLATION_CUBIC, 
00996             kFCurveTangeantMode pTangentMode = KFCURVE_TANGEANT_AUTO, 
00997             kFCurveDouble pData0 = 0.0,
00998             kFCurveDouble pData1 = 0.0,
00999             kFCurveTangeantWeightMode pTangentWeightMode = KFCURVE_WEIGHTED_NONE, 
01000             kFCurveDouble pWeight0                             = KFCURVE_DEFAULT_WEIGHT,
01001             kFCurveDouble pWeight1                             = KFCURVE_DEFAULT_WEIGHT,
01002             kFCurveDouble pVelocity0 = KFCURVE_DEFAULT_VELOCITY,
01003             kFCurveDouble pVelocity1 = KFCURVE_DEFAULT_VELOCITY
01004         );
01005         
01014         KFBX_FCURVE_INLINE void KeySetTCB 
01015         (
01016             kFCurveIndex pKeyIndex,
01017             KTime pTime, 
01018             kFCurveDouble pValue, 
01019             float pData0 = 0.0f, 
01020             float pData1 = 0.0f, 
01021             float pData2 = 0.0f
01022         );
01023             
01031         KFBX_FCURVE_INLINE kFCurveInterpolation KeyGetInterpolation(kFCurveIndex pKeyIndex);
01032         
01040         KFBX_FCURVE_INLINE void KeySetInterpolation(kFCurveIndex pKeyIndex, kFCurveInterpolation pInterpolation);
01041 
01050         KFBX_FCURVE_INLINE kFCurveConstantMode KeyGetConstantMode(kFCurveIndex pKeyIndex);
01051 
01064     KFBX_FCURVE_INLINE kFCurveTangeantMode KeyGetTangeantMode(kFCurveIndex pKeyIndex, bool pIncludeOverrides = false );
01065 
01074         KFBX_FCURVE_INLINE kFCurveTangeantWeightMode KeyGetTangeantWeightMode(kFCurveIndex pKeyIndex);
01075 
01084         KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode KeyGetTangeantVelocityMode(kFCurveIndex pKeyIndex);
01085 
01093         KFBX_FCURVE_INLINE void KeySetConstantMode(kFCurveIndex pKeyIndex, kFCurveConstantMode pMode);
01094 
01105         KFBX_FCURVE_INLINE void KeySetTangeantMode(kFCurveIndex pKeyIndex, kFCurveTangeantMode pTangent);
01106             
01121         KFBX_FCURVE_INLINE void KeySetTangeantWeightMode(kFCurveIndex pKeyIndex, kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask = KFCURVE_WEIGHTED_ALL );
01122 
01137         KFBX_FCURVE_INLINE void KeySetTangeantVelocityMode(kFCurveIndex pKeyIndex, kFCurveTangeantVelocityMode pTangentVelocityMode, kFCurveTangeantVelocityMode pMask = KFCURVE_VELOCITY_ALL );
01138 
01139             
01155         KFBX_FCURVE_INLINE kFCurveDouble KeyGetDataDouble(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex);
01156         
01173         KFBX_FCURVE_INLINE void KeySetDataDouble(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex, kFCurveDouble pValue);
01174         
01181         KFBX_FCURVE_INLINE float KeyGetDataFloat(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex);
01182 
01190         KFBX_FCURVE_INLINE void KeySetDataFloat(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex, float pValue);
01191 
01196         KFBX_FCURVE_INLINE const float* KeyGetDataPtr(kFCurveIndex pKeyIndex);
01197 
01201         KFBX_FCURVE_INLINE kFCurveDouble KeyGetValue(kFCurveIndex pKeyIndex);
01202 
01207         KFBX_FCURVE_INLINE void KeySetValue(kFCurveIndex pKeyIndex, kFCurveDouble pValue);
01208 
01213         KFBX_FCURVE_INLINE void KeyIncValue(kFCurveIndex pKeyIndex, kFCurveDouble pValue);
01214 
01219         KFBX_FCURVE_INLINE void KeyMultValue(kFCurveIndex pKeyIndex, kFCurveDouble pValue);
01220 
01227         KFBX_FCURVE_INLINE void KeyMultTangeant(kFCurveIndex pKeyIndex, kFCurveDouble pValue);
01228 
01233         KFBX_FCURVE_INLINE KTime KeyGetTime(kFCurveIndex pKeyIndex);
01234 
01239         KFBX_FCURVE_INLINE void KeySetTime(kFCurveIndex pKeyIndex, KTime pTime);
01240 
01245         KFBX_FCURVE_INLINE void KeyIncTime(kFCurveIndex pKeyIndex, KTime pTime);
01246 
01251         KFBX_FCURVE_INLINE void KeySetSelected(kFCurveIndex pKeyIndex, bool pSelected); 
01252 
01257         KFBX_FCURVE_INLINE bool KeyGetSelected(kFCurveIndex pKeyIndex);
01258 
01263         KFBX_FCURVE_INLINE void KeySetMarkedForManipulation(kFCurveIndex pKeyIndex, bool pMark);    
01264 
01269         KFBX_FCURVE_INLINE bool KeyGetMarkedForManipulation(kFCurveIndex pKeyIndex);
01270 
01279         KFBX_FCURVE_INLINE void KeySetTangeantVisibility (kFCurveIndex pKeyIndex, kFCurveTangeantVisibility pVisibility);   
01280         
01289         KFBX_FCURVE_INLINE kFCurveTangeantVisibility KeyGetTangeantVisibility (kFCurveIndex pKeyIndex);
01290 
01296         KFBX_FCURVE_INLINE void KeySetBreak(kFCurveIndex pKeyIndex, bool pVal); 
01297 
01302         KFBX_FCURVE_INLINE bool KeyGetBreak(kFCurveIndex pKeyIndex); 
01303 
01305 
01306         /************************************************************************************************/
01307         /************************************************************************************************/
01308         /************************************************************************************************/
01309         /************************************************************************************************/
01310         /************************************************************************************************/
01311         /************************************************************************************************/
01312 
01317 
01323         void KeyTangeantSetInterpolation(bool pSelectedOnly, kFCurveInterpolation pInterpolation);
01324         
01331         void KeyTangeantSetMode(bool pSelectedOnly, kFCurveTangeantMode pTangentMode);
01332         
01339         kFCurveDouble KeyGetLeftDerivative(kFCurveIndex pIndex);
01340         
01350         void KeySetLeftDerivative(kFCurveIndex pIndex, kFCurveDouble pValue);
01351 
01359     kFCurveDouble KeyGetLeftAuto(kFCurveIndex pIndex, bool pApplyOvershootProtection = false);
01360 
01370         void KeySetLeftAuto(kFCurveIndex pIndex, kFCurveDouble pValue); 
01371         
01378         KFCurveTangeantInfo KeyGetLeftDerivativeInfo(kFCurveIndex pIndex);
01379         
01391     void KeySetLeftDerivativeInfo(kFCurveIndex pIndex, KFCurveTangeantInfo pValue, bool pForceDerivative = false);
01392 
01393 
01403         void KeyIncLeftDerivative(kFCurveIndex pIndex, kFCurveDouble pInc);
01404         
01411         kFCurveDouble KeyGetRightDerivative(kFCurveIndex pIndex);
01412         
01422         void KeySetRightDerivative(kFCurveIndex pIndex, kFCurveDouble pValue);
01423 
01431     kFCurveDouble KeyGetRightAuto(kFCurveIndex pIndex, bool pApplyOvershootProtection = false);
01432         
01442         void KeySetRightAuto(kFCurveIndex pIndex, kFCurveDouble pValue);
01443         
01444         
01451         KFCurveTangeantInfo KeyGetRightDerivativeInfo(kFCurveIndex pIndex);
01452         
01463     void KeySetRightDerivativeInfo(kFCurveIndex pIndex, KFCurveTangeantInfo pValue, bool pForceDerivative = false);
01464 
01465 
01475         void KeyIncRightDerivative(kFCurveIndex pIndex, kFCurveDouble pInc);
01476         
01480         kFCurveDouble KeyGetRightBezierTangeant(kFCurveIndex pIndex);
01481         
01491         void KeySetLeftBezierTangeant(kFCurveIndex pIndex, kFCurveDouble pValue);
01492 
01496         kFCurveDouble KeyGetLeftBezierTangeant(kFCurveIndex pIndex);
01497         
01507         void KeySetRightBezierTangeant(kFCurveIndex pIndex, kFCurveDouble pValue);
01508 
01509 
01518         void KeyMultDerivative(kFCurveIndex pIndex, kFCurveDouble pMultValue);
01519 
01526         bool KeyIsLeftTangeantWeighted(kFCurveIndex pIndex);
01527 
01534         bool KeyIsRightTangeantWeighted(kFCurveIndex pIndex);
01535         
01543         void   KeySetLeftTangeantWeightedMode( kFCurveIndex pIndex, bool pWeighted );
01544 
01552         void   KeySetRightTangeantWeightedMode( kFCurveIndex pIndex, bool pWeighted );
01553 
01560         kFCurveDouble KeyGetLeftTangeantWeight(kFCurveIndex pIndex);
01561 
01568         kFCurveDouble KeyGetRightTangeantWeight(kFCurveIndex pIndex);
01569 
01578         void   KeySetLeftTangeantWeight( kFCurveIndex pIndex, kFCurveDouble pWeight );
01579 
01588         void   KeySetRightTangeantWeight( kFCurveIndex pIndex, kFCurveDouble pWeight );
01589 
01596         bool KeyIsLeftTangeantVelocity(kFCurveIndex pIndex);
01597 
01604         bool KeyIsRightTangeantVelocity(kFCurveIndex pIndex);
01605         
01613         void   KeySetLeftTangeantVelocityMode( kFCurveIndex pIndex, bool pVelocity );
01614 
01622         void   KeySetRightTangeantVelocityMode( kFCurveIndex pIndex, bool pVelocity);
01623 
01630         kFCurveDouble KeyGetLeftTangeantVelocity(kFCurveIndex pIndex);
01631 
01638         kFCurveDouble KeyGetRightTangeantVelocity(kFCurveIndex pIndex);
01639 
01648         void   KeySetLeftTangeantVelocity( kFCurveIndex pIndex, kFCurveDouble pVelocity );
01649 
01658         void   KeySetRightTangeantVelocity( kFCurveIndex pIndex, kFCurveDouble pVelocity );
01659         
01661 
01673 
01677         KFBX_FCURVE_INLINE void SetPreExtrapolation(kFCurveExtrapolationMode pExtrapolation);
01678             
01680         KFBX_FCURVE_INLINE kFCurveExtrapolationMode GetPreExtrapolation();
01681         
01686         KFBX_FCURVE_INLINE void SetPreExtrapolationCount(kULong pCount);
01687         
01692         KFBX_FCURVE_INLINE kULong GetPreExtrapolationCount();
01693         
01697         KFBX_FCURVE_INLINE void SetPostExtrapolation(kFCurveExtrapolationMode pExtrapolation);
01698         
01700         KFBX_FCURVE_INLINE kFCurveExtrapolationMode GetPostExtrapolation();
01701         
01706         KFBX_FCURVE_INLINE void SetPostExtrapolationCount(kULong pCount);
01707             
01712         KFBX_FCURVE_INLINE kULong GetPostExtrapolationCount();
01713 
01720         int KeyGetCountAll();
01721         
01733         double KeyFindAll(KTime pTime, kFCurveIndex* pLast = NULL);
01734 
01736 
01741         
01754         kFCurveDouble Evaluate (KTime pTime, kFCurveIndex* pLast = NULL);
01755 
01765         kFCurveDouble EvaluateIndex( double pIndex);
01766         
01775         kFCurveDouble EvaluateLeftDerivative (KTime pTime, kFCurveIndex* pLast = NULL);
01776         
01785         kFCurveDouble EvaluateRightDerivative (KTime pTime, kFCurveIndex* pLast = NULL);
01786 
01795         int FindPeaks(kFCurveIndex pLeftKeyIndex, KTime& pPeakTime1, KTime& pPeakTime2);
01796 
01805         int FindPeaks(kFCurveIndex pLeftKeyIndex, kFCurveDouble& pPeak1, kFCurveDouble& pPeak2);
01806 
01817         int FindPeaks(kFCurveIndex pLeftKeyIndex, KTime& pPeakTime1, kFCurveDouble& pPeak1, KTime& pPeakTime2, kFCurveDouble& pPeak2);
01818 
01824         void KeyGetPeriods(KTime& pAveragePeriod, KTime& pMinPeriod, KTime& pMaxPeriod);
01825         
01827 
01832 
01840         HKFCurve Copy(KTime pStart = KTIME_MINUS_INFINITE, KTime pStop = KTIME_INFINITE);
01841 
01848         void CopyFrom(KFCurve& pSource, bool pWithKeys = true);
01849 
01858     void Replace(HKFCurve pSource, KTime pStart = KTIME_MINUS_INFINITE, KTime pStop = KTIME_INFINITE, bool pUseExactGivenSpan = false, bool pKeyStartEndOnNoKey = true, KTime pTimeSpanOffset = KTIME_ZERO );
01859 
01872     void ReplaceForQuaternion(HKFCurve pSource, KTime pStart, KTime pStop, kFCurveDouble pScaleStart, kFCurveDouble pScaleStop, bool pUseExactGivenSpan = false, bool pKeyStartEndOnNoKey = true, KTime pTimeSpanOffset = KTIME_ZERO );
01873 
01892     void ReplaceForEulerXYZ(HKFCurve pSource, KTime pStart, KTime pStop, kFCurveDouble pAddFromStart, kFCurveDouble pAddAfterStop, bool pValueSubOffsetAfterStart, bool pValueSubOffsetAfterStop, bool pUseExactGivenSpan = false, bool pKeyStartEndOnNoKey = true, KTime pTimeSpanOffset = KTIME_ZERO );   
01893 
01906         void Insert(HKFCurve pSource, KTime pInsertTime, kFCurveDouble pFirstKeyLeftDerivative, bool pFirstKeyIsWeighted = false, kFCurveDouble pFirstKeyWeight = KFCURVE_DEFAULT_WEIGHT);
01907 
01917         void Insert(HKFCurve pSource, KTime pInsertTime, KFCurveTangeantInfo pFirstKeyLeftDerivative );
01918 
01928         bool Delete(kFCurveIndex pStartIndex , kFCurveIndex pStopIndex);                                    
01929         
01937         bool Delete (KTime pStart = KTIME_MINUS_INFINITE, KTime pStop = KTIME_INFINITE);
01938 
01943         bool IsKeyInterpolationPureCubicAuto(kFCurveIndex pKeyIndex);
01944 
01945     #ifndef KFBX_PLUGIN
01946 
01953         void ExtractKeysIndex( KArraykInt &pArray, int pMinIndex, int pMaxIndex, double pMinValue =  -K_DOUBLE_MAX, double pMaxValue =  K_DOUBLE_MAX);
01954     #endif
01955 
01957 
01959     //
01960     //  WARNING!
01961     //
01962     //  Anything beyond these lines may not be documented accurately and is 
01963     //  subject to change without notice.
01964     //
01966 
01967     #ifndef DOXYGEN_SHOULD_SKIP_THIS
01968 
01969         bool    FbxStore (KFbx* pFbx, bool pOnlyDefaults = false, bool pColor = true, bool pIsVersion5 = false );
01970         bool    FbxRetrieve (KFbx* pFbx, bool pOnlyDefaults = false, bool pColor = false );
01971         bool    FbxInternalRetrieve (KFbx* pFbx, bool pOnlyDefaults = false, bool pColor = false );
01972 
01973         double CandidateEvaluate (KTime pTime, kFCurveIndex* pLast = NULL);
01974         bool CandidateClear ();
01975         bool CandidateSet (KTime pTime, double pValue);
01976         bool IsCandidate ();
01977         double CandidateGet ();
01978         KTime CandidateGetTime ();
01979         
01980         bool CandidateKey
01981         (
01982             kFCurveIndex    *pLast              = NULL, 
01983             int pInterpolation = KFCURVE_INTERPOLATION_CUBIC, 
01984             int pTanMode = KFCURVE_TANGEANT_USER, 
01985         int pContinuity = KFCURVE_CONTINUITY,
01986             bool            pTangeantOverride   = true,
01987             KTime           pCandidateTime      = KTIME_INFINITE,
01988             double          pKeyIndexTolerance  = 0.0
01989         );
01990 
01991         bool NormalsSeemsToComeFromAPlot();
01992 
01993         void SetWasData (int pType);
01994         int GetWasData ();
01995         int GuessWasData (KTime* pStart = NULL, KTime* pStep = NULL);
01996 
01997         void KeyTangeantHide ();
01998 
01999         int GetUpdateId ();
02000         int GetValuesUpdateId ();
02001 
02002         void CallbackRegister (kFCurveCallback pCallback, void* pObject);
02003         void CallbackUnregister (kFCurveCallback pCallback, void* pObject);
02004         void CallbackEnable (bool pEnable);
02005         void CallbackClear ();
02006 
02007     private:
02008         void IncrementUpdateId(int pInc);
02009         void CallbackAddEvent (int pWhat, int pIndexStart);
02010 
02011         int MapIndexAll (int pIndex, int &pWhere);
02012         void InitBuffers (int pKeyCount);
02013 
02014         bool CheckCurve();
02015     void IsClamped( int pIndex, bool &pLeftClamped, bool &pRightClamped ); // Return true if the specified key is an auto clamp that is currently clamped
02016 
02017         float mColor[3];
02018 
02019         kFCurveDouble mValue;
02020 
02021         int mUpdateId;
02022         bool mCallbackEnable;
02023         bool mInternalCallbackEnable; // Internal use, to replace many callback by one
02024         int mKeyModifyGuard;
02025 
02026         KFCurveKey** mFCurveKeysList;
02027 
02028         int mFCurveKeyCount;    
02029         int mFCurveKeySize; 
02030         int mFCurveLastBlockIndex;  
02031 
02032 
02033         kUInt mPreExtrapolation;
02034         kULong mPreExtrapolationCount;
02035         kUInt mPostExtrapolation;
02036         kULong mPostExtrapolationCount;
02037 
02038         int mWasType;
02039 
02040         kFCurveIndex mLastSearchIndex;
02041 
02042         KTime mCandidateTime;
02043         kFCurveDouble mCandidateValue;
02044 
02045         KFCurveEvent mEvent;
02046         KArrayUL mCallbackFunctions;   // no delete on object must use array ul
02047         KArrayUL mCallbackObjects;     // no delete on object must use array ul
02048 
02049         // FBObjectHolder for FBSDK reference
02050         #ifndef KFBX_PLUGIN
02051             KFBObjectHolder mFBObjectHolder;
02052             KFBX_FCURVE_INLINE KFBObjectHolder& GetFBHolder ();
02053         #endif
02054 
02055         KFBX_FCURVE_INLINE KFCurveKey* InternalKeyGetPtr(kFCurveIndex pIndex);
02056 
02057     #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
02058 
02059     };
02060 
02061 
02062     KFBX_FCURVE_INLINE void KFCurveEvent::Clear () 
02063     {
02064         mType = KFCURVEEVENT_NONE;
02065         mKeyIndexStart = mKeyIndexStop=-1; 
02066         mEventCount = 0; 
02067     }
02068 
02069 
02070     KFBX_FCURVE_INLINE void KFCurveEvent::Add (int pWhat, int pIndex) 
02071     {       
02072         mType |= pWhat;
02073         mEventCount++;
02074         if ( (pIndex<mKeyIndexStart) || (mKeyIndexStart==-1)) 
02075         {
02076             mKeyIndexStart = pIndex;
02077         }
02078         if (pIndex>mKeyIndexStop) 
02079         {
02080             mKeyIndexStop = pIndex;
02081         }
02082     }
02083 
02084     //
02085     //  class KFCurveKey
02086     //
02087     KFBX_FCURVE_INLINE KFCurveTangeantInfo::KFCurveTangeantInfo()
02088     {
02089         mDerivative = 0.0;
02090         mWeight     = KFCURVE_DEFAULT_WEIGHT;
02091         mWeighted   = false;
02092         mVelocity   = KFCURVE_DEFAULT_VELOCITY;
02093         mHasVelocity= false;
02094         mAuto       = 0.0;
02095     }
02096 
02097     //
02098     //  class KFCurveKey
02099     //
02100 
02101     KFBX_FCURVE_INLINE void KFCurveKey::Set 
02102         (
02103         KTime pTime, 
02104         kFCurveDouble pValue, 
02105         kFCurveInterpolation pInterpolation /* = KFCURVE_INTERPOLATION_CUBIC*/, 
02106         kFCurveTangeantMode pTangeantMode /*= KFCURVE_TANGEANT_AUTO*/, 
02107         kFCurveDouble pData0 /*= 0*/, 
02108         kFCurveDouble pData1 /*= 0*/,
02109         kFCurveTangeantWeightMode pTangeantWeightMode /*= KFCURVE_WEIGHT_NONE*/, 
02110         kFCurveDouble pWeight0 /* = KFCURVE_DEFAULT_WEIGHT */,
02111         kFCurveDouble pWeight1 /* = KFCURVE_DEFAULT_WEIGHT */,
02112         kFCurveDouble pVelocity0 /* = KFCURVE_DEFAULT_VELOCITY */,
02113         kFCurveDouble pVelocity1 /* = KFCURVE_DEFAULT_VELOCITY */
02114         )
02115     {
02116         K_ASSERT (pInterpolation != KFCURVE_INTERPOLATION_CUBIC || pTangeantMode != KFCURVE_TANGEANT_TCB);
02117 
02118         SetTime (pTime);
02119         SetValue (pValue);
02120         SetInterpolation (pInterpolation);
02121         SetTangeantMode (pTangeantMode);
02122         SetDataDouble (KFCURVEKEY_RIGHT_SLOPE, pData0);
02123         SetDataDouble (KFCURVEKEY_NEXT_LEFT_SLOPE, pData1);
02124 
02125         SetTangeantWeightMode (pTangeantWeightMode);
02126         SetDataDouble (KFCURVEKEY_RIGHT_WEIGHT, pWeight0);
02127         SetDataDouble (KFCURVEKEY_NEXT_LEFT_WEIGHT, pWeight1);
02128 
02129         SetDataDouble (KFCURVEKEY_RIGHT_VELOCITY, pVelocity0);
02130         SetDataDouble (KFCURVEKEY_NEXT_LEFT_VELOCITY, pVelocity1);
02131 
02132         SetTangeantVisibility (KFCURVE_TANGEANT_SHOW_NONE);
02133     }
02134 
02135 
02136     KFBX_FCURVE_INLINE void KFCurveKey::SetTCB (KTime pTime, kFCurveDouble pValue, float pData1/*=0.0f*/, float pData2/*=0.0f*/, float pData3/*=0.0f*/)
02137     {
02138         SetTime (pTime);
02139         SetValue (pValue);
02140         SetInterpolation (KFCURVE_INTERPOLATION_CUBIC);
02141         SetTangeantMode (KFCURVE_TANGEANT_TCB);
02142         SetDataFloat (KFCURVEKEY_TCB_TENSION, pData1);
02143         SetDataFloat (KFCURVEKEY_TCB_CONTINUITY, pData2);
02144         SetDataFloat (KFCURVEKEY_TCB_BIAS, pData3);
02145         SetTangeantVisibility (KFCURVE_TANGEANT_SHOW_NONE);
02146     }
02147 
02148 
02149     KFBX_FCURVE_INLINE void KFCurveKey::Set (KFCurveKey& iSource)
02150     {
02151         mValue = iSource.mValue;
02152         mTime = iSource.mTime;
02153         mFlags = iSource.mFlags;
02154         mData[0] = iSource.mData[0];
02155         mData[1] = iSource.mData[1];
02156         #ifdef KFCURVE_FLOAT
02157             mData[2] = iSource.mData[2];
02158             mData[3] = iSource.mData[3];
02159         #else 
02160             mWeight[0] = iSource.mWeight[0];
02161             mWeight[1] = iSource.mWeight[1];
02162             mVelocity[0] = iSource.mVelocity[0];
02163             mVelocity[1] = iSource.mVelocity[1];
02164         #endif
02165     }
02166 
02167 
02168     KFBX_FCURVE_INLINE kFCurveInterpolation KFCurveKey::GetInterpolation () 
02169     {
02170         return mFlags & KFCURVE_INTERPOLATION_ALL;
02171     }
02172 
02173 
02174     KFBX_FCURVE_INLINE void KFCurveKey::SetInterpolation (kFCurveInterpolation pInterpolation)  
02175     {
02176         K_ASSERT_MSG(   (pInterpolation == KFCURVE_INTERPOLATION_CUBIC) || 
02177             (pInterpolation == KFCURVE_INTERPOLATION_LINEAR) ||
02178             (pInterpolation == KFCURVE_INTERPOLATION_CONSTANT) ,"Wrong interpolation type." );
02179 
02180         if( (((mFlags & KFCURVE_INTERPOLATION_ALL)!=KFCURVE_INTERPOLATION_CUBIC)) && pInterpolation == KFCURVE_INTERPOLATION_CUBIC )
02181         {
02182             // Clear weighting information
02183             SetTangeantWeightMode( KFCURVE_WEIGHTED_NONE);
02184             SetDataDouble (KFCURVEKEY_RIGHT_WEIGHT, KFCURVE_DEFAULT_WEIGHT);
02185             SetDataDouble (KFCURVEKEY_NEXT_LEFT_WEIGHT, KFCURVE_DEFAULT_WEIGHT);
02186 
02187             SetTangeantVelocityMode(KFCURVE_VELOCITY_NONE);
02188             SetDataDouble( KFCURVEKEY_RIGHT_VELOCITY, KFCURVE_DEFAULT_VELOCITY);
02189             SetDataDouble( KFCURVEKEY_NEXT_LEFT_VELOCITY, KFCURVE_DEFAULT_VELOCITY);
02190         }
02191 
02192         mFlags = (mFlags & ~KFCURVE_INTERPOLATION_ALL) | (pInterpolation & KFCURVE_INTERPOLATION_ALL); 
02193     }
02194 
02195 
02196     KFBX_FCURVE_INLINE kFCurveConstantMode KFCurveKey::GetConstantMode() 
02197     {
02198         return mFlags & KFCURVE_CONSTANT_ALL;
02199     }
02200 
02201     KFBX_FCURVE_INLINE kFCurveTangeantMode KFCurveKey::GetTangeantMode( bool pIncludeOverrides ) 
02202     {
02203         if( pIncludeOverrides )
02204         {
02205             return mFlags & KFCURVE_TANGEANT_ALL;
02206         }
02207         else
02208         {
02209             return mFlags & KFCURVE_TANGEANT_TYPE_MASK;
02210         }
02211     }
02212 
02213     KFBX_FCURVE_INLINE void KFCurveKey::SetConstantMode (kFCurveConstantMode pMode)         
02214     {
02215         K_ASSERT_MSG(   (GetInterpolation() != KFCURVE_INTERPOLATION_CONSTANT) ||
02216             (pMode == KFCURVE_CONSTANT_STANDARD) ||
02217             (pMode == KFCURVE_CONSTANT_NEXT),"Wrong constant mode.");
02218 
02219         mFlags = (mFlags & ~KFCURVE_CONSTANT_ALL) | (pMode & KFCURVE_CONSTANT_ALL); 
02220     }
02221 
02222     KFBX_FCURVE_INLINE void KFCurveKey::SetTangeantMode (kFCurveTangeantMode pTangeant)         
02223     {
02224 
02225         K_ASSERT_MSG( (GetInterpolation() != KFCURVE_INTERPOLATION_CUBIC) || !(pTangeant & ~KFCURVE_TANGEANT_ALL), "Wrong tangeant mode." );
02226         K_ASSERT_MSG( (GetInterpolation() != KFCURVE_INTERPOLATION_CONSTANT) || !(pTangeant & ~KFCURVE_CONSTANT_ALL), "Wrong tangeant mode." );
02227 
02228         mFlags = (mFlags & ~(KFCURVE_TANGEANT_ALL|KFCURVE_CONSTANT_ALL)) | (pTangeant & (KFCURVE_TANGEANT_ALL|KFCURVE_CONSTANT_ALL) ); 
02229     }
02230 
02231     KFBX_FCURVE_INLINE kFCurveTangeantWeightMode KFCurveKey::GetTangeantWeightMode()
02232     {
02233         return mFlags & KFCURVE_WEIGHTED_ALL;
02234     }
02235 
02236     KFBX_FCURVE_INLINE void KFCurveKey::SetTangeantWeightMode(kFCurveTangeantWeightMode pTangent, kFCurveTangeantWeightMode pMask /* KFCURVE_WEIGHTED_ALL */ )
02237     {
02238 
02239         pMask &= KFCURVE_WEIGHTED_ALL;
02240         mFlags = (mFlags & ~pMask) | (pTangent & pMask); 
02241     }
02242 
02243     KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode KFCurveKey::GetTangeantVelocityMode()
02244     {
02245         return mFlags & KFCURVE_VELOCITY_ALL;
02246     }
02247 
02248     KFBX_FCURVE_INLINE void KFCurveKey::SetTangeantVelocityMode(kFCurveTangeantVelocityMode pTangent, kFCurveTangeantVelocityMode pMask /* KFCURVE_VELOCITY_ALL */ )
02249     {
02250         pMask &= KFCURVE_VELOCITY_ALL;
02251         mFlags = (mFlags & ~pMask) | (pTangent & pMask); 
02252     }
02253 
02254 
02255     KFBX_FCURVE_INLINE void KFCurveKey::SetTangeantVisibility (kFCurveTangeantVisibility pVisibility)               
02256     {
02257         K_ASSERT_MSG(   (pVisibility == KFCURVE_TANGEANT_SHOW_NONE) || 
02258             (pVisibility == KFCURVE_TANGEANT_SHOW_LEFT) ||
02259             (pVisibility == KFCURVE_TANGEANT_SHOW_RIGHT) ||
02260             (pVisibility == KFCURVE_TANGEANT_SHOW_BOTH) ,"Wrong visibility type." );
02261 
02262         mFlags = (mFlags & ~KFCURVE_TANGEANT_SHOW_BOTH) | (pVisibility & KFCURVE_TANGEANT_SHOW_BOTH); 
02263     }
02264 
02265 
02266     KFBX_FCURVE_INLINE kFCurveTangeantVisibility KFCurveKey::GetTangeantVisibility () 
02267     {
02268         return mFlags & KFCURVE_TANGEANT_SHOW_BOTH;
02269     }
02270 
02271 
02272     KFBX_FCURVE_INLINE kFCurveDouble KFCurveKey::GetDataDouble (EKFCurveDataIndex pIndex) 
02273     {
02274         if( pIndex < KFCURVEKEY_WEIGHTS )
02275         {
02276             return mData[pIndex];
02277         }
02278         else
02279         {
02280             #ifdef KFCURVE_FLOAT
02281                 return (kFCurveDouble)(((kInt16*)(&mData[KFCURVEKEY_WEIGHTS]))[pIndex-KFCURVEKEY_WEIGHTS])/(kFCurveDouble)KFCURVE_WEIGHT_DIVIDER;
02282             #else       
02283                 return (kFCurveDouble)mWeight[pIndex-KFCURVEKEY_WEIGHTS]/(kFCurveDouble)KFCURVE_WEIGHT_DIVIDER;
02284             #endif
02285         }
02286     }
02287 
02288 
02289     KFBX_FCURVE_INLINE void KFCurveKey::SetDataDouble (EKFCurveDataIndex pIndex, kFCurveDouble pValue) 
02290     {
02291         if( pIndex < KFCURVEKEY_RIGHT_WEIGHT )
02292         {
02293             mData[pIndex] = pValue;
02294         }
02295         else
02296         {
02297             if( (pIndex == KFCURVEKEY_RIGHT_WEIGHT || pIndex == KFCURVEKEY_NEXT_LEFT_WEIGHT ) && pValue > KFCURVE_MAX_WEIGHT )
02298             {
02299                 pValue = KFCURVE_MAX_WEIGHT;
02300             }
02301             else if( (pIndex == KFCURVEKEY_RIGHT_WEIGHT || pIndex == KFCURVEKEY_NEXT_LEFT_WEIGHT ) && pValue < KFCURVE_MIN_WEIGHT )
02302             {
02303                 pValue = KFCURVE_MIN_WEIGHT;
02304             }
02305 
02306             #ifdef KFCURVE_FLOAT
02307                 (((kInt16*)(&mData[KFCURVEKEY_WEIGHTS]))[pIndex-KFCURVEKEY_WEIGHTS]) = (kInt16)(pValue*KFCURVE_WEIGHT_DIVIDER);
02308             #else       
02309                 mWeight[pIndex-KFCURVEKEY_WEIGHTS] = pValue*KFCURVE_WEIGHT_DIVIDER;
02310             #endif
02311         }
02312     }
02313 
02314 
02315     KFBX_FCURVE_INLINE float KFCurveKey::GetDataFloat (EKFCurveDataIndex pIndex) 
02316     {
02317         return ( (float *)&mData[0])[pIndex];
02318     }
02319 
02320 
02321     KFBX_FCURVE_INLINE void KFCurveKey::SetDataFloat (EKFCurveDataIndex pIndex, float pValue) 
02322     {
02323         ((float *)&mData[0])[pIndex] = pValue;
02324     }
02325 
02326     KFBX_FCURVE_INLINE float* KFCurveKey::GetDataPtr()
02327     {
02328         return (float*)mData;
02329     }
02330 
02331 
02332     KFBX_FCURVE_INLINE kFCurveDouble KFCurveKey::GetValue () 
02333     {
02334         return mValue;
02335     }
02336 
02337 
02338     KFBX_FCURVE_INLINE void KFCurveKey::SetValue (kFCurveDouble pValue) 
02339     {
02340         mValue=pValue;
02341     }
02342 
02343 
02344     KFBX_FCURVE_INLINE void KFCurveKey::IncValue (kFCurveDouble pValue) 
02345     {
02346         mValue+=pValue;
02347     }
02348 
02349     KFBX_FCURVE_INLINE void KFCurveKey::MultValue (kFCurveDouble pValue) 
02350     {
02351         mValue*=pValue;
02352     }
02353 
02354     KFBX_FCURVE_INLINE void KFCurveKey::MultTangeant (kFCurveDouble pValue) 
02355     {
02356         if (GetInterpolation() == KFCURVE_INTERPOLATION_CUBIC)
02357         {
02358             switch (GetTangeantMode())
02359             {                   
02360             case KFCURVE_TANGEANT_USER:
02361             case KFCURVE_TANGEANT_BREAK:
02362                 SetDataDouble(KFCURVEKEY_RIGHT_SLOPE, GetDataDouble(KFCURVEKEY_RIGHT_SLOPE) * pValue);
02363                 SetDataDouble(KFCURVEKEY_NEXT_LEFT_SLOPE, GetDataDouble(KFCURVEKEY_NEXT_LEFT_SLOPE) * pValue);
02364                 break;
02365             case KFCURVE_TANGEANT_TCB:
02366                 // dunno how to handle this
02367             case KFCURVE_TANGEANT_AUTO:
02368             case KFCURVE_TANGEANT_AUTO_BREAK:
02369             default:
02370                 // nothing to do
02371                 break;
02372             }
02373         }
02374     }
02375 
02376     KFBX_FCURVE_INLINE KTime KFCurveKey::GetTime () 
02377     {
02378         return mTime;
02379     }
02380 
02381 
02382     KFBX_FCURVE_INLINE void KFCurveKey::SetTime (KTime pTime) 
02383     {
02384         K_ASSERT_MSG( pTime != KTIME_MINUS_INFINITE && 
02385             pTime != KTIME_INFINITE, "Key at infinite!" );
02386 
02387         mTime=pTime;
02388     }
02389 
02390     KFBX_FCURVE_INLINE void KFCurveKey::IncTime (KTime pTime) 
02391     {
02392         mTime+=pTime;
02393     }
02394 
02395 
02396     KFBX_FCURVE_INLINE void KFCurveKey::SetSelected (bool pSelected) 
02397     {
02398         mFlags = pSelected ? (mFlags & ~KFCURVE_SELECT_ALL) | KFCURVE_SELECT_POINT : (mFlags & ~KFCURVE_SELECT_ALL);
02399     }
02400 
02401 
02402     KFBX_FCURVE_INLINE bool KFCurveKey::GetSelected () 
02403     {
02404         return (mFlags & KFCURVE_SELECT_POINT) ? true : false;
02405     }
02406 
02407 
02408     KFBX_FCURVE_INLINE void KFCurveKey::SetMarkedForManipulation (bool pSelected) 
02409     {
02410         mFlags = pSelected ? (mFlags & ~KFCURVE_MARKED_ALL) | KFCURVE_MARKED_FOR_MANIP : (mFlags & ~KFCURVE_MARKED_ALL);
02411     }
02412 
02413 
02414     KFBX_FCURVE_INLINE bool KFCurveKey::GetMarkedForManipulation () 
02415     {
02416         return (mFlags & KFCURVE_MARKED_FOR_MANIP) ? true : false;
02417     }
02418 
02419 
02420     KFBX_FCURVE_INLINE void KFCurveKey::Init()
02421     {
02422         mValue = 0.0;
02423         mTime = KTIME_ZERO;
02424         mFlags = 0;
02425     }
02426 
02427 
02428     KFBX_FCURVE_INLINE void KFCurveKey::SetBreak(bool pVal)
02429     {
02430         K_ASSERT_MSG(   (GetInterpolation() != KFCURVE_INTERPOLATION_CUBIC) ||                  
02431             (GetTangeantMode() == KFCURVE_TANGEANT_BREAK) ||
02432             (GetTangeantMode() == KFCURVE_TANGEANT_AUTO)  ||
02433             (GetTangeantMode() == KFCURVE_TANGEANT_AUTO_BREAK)  ||
02434             (GetTangeantMode() == KFCURVE_TANGEANT_USER) ,"Wrong tangeant mode." );
02435 
02436         if(pVal)
02437             mFlags = mFlags |  KFCURVE_GENERIC_BREAK ;
02438         else
02439             mFlags = mFlags & ~KFCURVE_GENERIC_BREAK ;  
02440 
02441     } 
02442 
02443     KFBX_FCURVE_INLINE bool KFCurveKey::GetBreak()
02444     {
02445         K_ASSERT_MSG(   (GetInterpolation() != KFCURVE_INTERPOLATION_CUBIC) ||                  
02446             (GetTangeantMode() == KFCURVE_TANGEANT_BREAK) ||
02447             (GetTangeantMode() == KFCURVE_TANGEANT_AUTO)  ||
02448             (GetTangeantMode() == KFCURVE_TANGEANT_AUTO_BREAK)  ||
02449             (GetTangeantMode() == KFCURVE_TANGEANT_USER)  ,"Wrong tangeant mode." );
02450 
02451         if( ((mFlags & KFCURVE_GENERIC_BREAK ) == KFCURVE_GENERIC_BREAK))
02452             return true;
02453         else
02454             return false; 
02455 
02456     }
02457 
02458 
02459     //****************************************************************************************
02460     // class KFCurve
02461     //****************************************************************************************
02462 
02463     KFBX_FCURVE_INLINE kFCurveDouble KFCurve::GetValue () const 
02464     {
02465         return mValue;
02466     }
02467 
02468 #ifndef DOXYGEN_SHOULD_SKIP_THIS
02469     KFBX_FCURVE_INLINE void KFCurve::SetPreExtrapolation (kUInt pExtrapolation) 
02470     {
02471         K_ASSERT_MSG(   (pExtrapolation == KFCURVE_EXTRAPOLATION_CONST) || 
02472             (pExtrapolation == KFCURVE_EXTRAPOLATION_REPETITION) ||
02473             (pExtrapolation == KFCURVE_EXTRAPOLATION_MIRROR_REPETITION) ||
02474             (pExtrapolation == KFCURVE_EXTRAPOLATION_KEEP_SLOPE) ,"Wrong extrapolation type." );
02475 
02476         mPreExtrapolation = pExtrapolation; 
02477         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, -1);
02478     }
02479 #endif
02480 
02481     KFBX_FCURVE_INLINE kUInt KFCurve::GetPreExtrapolation () 
02482     {
02483         return mPreExtrapolation;
02484     }
02485 
02486 
02487     KFBX_FCURVE_INLINE void KFCurve::SetPreExtrapolationCount (kULong pCount) 
02488     {
02489         mPreExtrapolationCount = pCount; 
02490         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, -1);
02491     }
02492 
02493 
02494     KFBX_FCURVE_INLINE kULong KFCurve::GetPreExtrapolationCount () 
02495     {
02496         return mPreExtrapolationCount;
02497     }
02498 
02499 #ifndef DOXYGEN_SHOULD_SKIP_THIS
02500 
02501     KFBX_FCURVE_INLINE void KFCurve::SetPostExtrapolation (kUInt pExtrapolation) 
02502     {
02503         K_ASSERT_MSG(   (pExtrapolation == KFCURVE_EXTRAPOLATION_CONST) || 
02504             (pExtrapolation == KFCURVE_EXTRAPOLATION_REPETITION) ||
02505             (pExtrapolation == KFCURVE_EXTRAPOLATION_MIRROR_REPETITION) ||
02506             (pExtrapolation == KFCURVE_EXTRAPOLATION_KEEP_SLOPE) ,"Wrong extrapolation type." );
02507 
02508         mPostExtrapolation = pExtrapolation; 
02509         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, -1);
02510     }
02511 
02512 #endif
02513 
02514     KFBX_FCURVE_INLINE kUInt KFCurve::GetPostExtrapolation () 
02515     {
02516         return mPostExtrapolation;
02517     }
02518 
02519 
02520     KFBX_FCURVE_INLINE void KFCurve::SetPostExtrapolationCount (kULong pCount) 
02521     {
02522         mPostExtrapolationCount = pCount; 
02523         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, -1);
02524     }
02525 
02526 
02527     KFBX_FCURVE_INLINE kULong KFCurve::GetPostExtrapolationCount () 
02528     {
02529         return mPostExtrapolationCount;
02530     }
02531 
02532     #ifndef DOXYGEN_SHOULD_SKIP_THIS
02533     KFBX_FCURVE_INLINE KFCurveKey* KFCurve::InternalKeyGetPtr (int pIndex) 
02534     {
02535         K_ASSERT_MSG( pIndex >= 0, "Negative indexes are not recommended." );
02536         K_ASSERT_MSG( mFCurveKeysList && mFCurveKeysList[pIndex / KEY_BLOCK_COUNT], "Accessing unallocated buffer." );
02537 
02538         return mFCurveKeysList[pIndex / KEY_BLOCK_COUNT] + (pIndex % KEY_BLOCK_COUNT);
02539     }
02540     
02541     #ifndef KFBX_PLUGIN
02542         KFBX_FCURVE_INLINE KFBObjectHolder& KFCurve::GetFBHolder () 
02543         {
02544             return mFBObjectHolder;
02545         }
02546     #endif
02547     #endif
02548  
02549     /*********************************************************************************************/
02550     /*********************************************************************************************/
02551     /*********************************************************************************************/
02552     /*********************************************************************************************/
02553     KFBX_FCURVE_INLINE bool KFCurve::KeySet(kFCurveIndex pIndex, KFCurve* pSourceCurve, int pSourceIndex)
02554     {
02555         KFCurveKey* lKey = pSourceCurve->InternalKeyGetPtr(pSourceIndex);
02556         return KeySet(pIndex, *lKey);
02557     }
02558 
02559 
02560     KFBX_FCURVE_INLINE int KFCurve::KeyAdd(KTime pTime, KFCurve* pSourceCurve, int pSourceIndex, kFCurveIndex* pLast)
02561     {
02562         K_ASSERT(pSourceIndex >= 0);
02563         K_ASSERT(pSourceIndex < pSourceCurve->KeyGetCount());
02564 
02565         KFCurveKey* lKey = pSourceCurve->InternalKeyGetPtr(pSourceIndex);
02566         return KeyAdd(pTime, *lKey, pLast);
02567     }
02568 
02569 
02570     KFBX_FCURVE_INLINE void KFCurve::KeySet 
02571         (
02572         kFCurveIndex pKeyIndex,
02573         KTime pTime, 
02574         kFCurveDouble pValue, 
02575         kFCurveInterpolation pInterpolation, 
02576         kFCurveTangeantMode pTangentMode, 
02577         kFCurveDouble pData0, 
02578         kFCurveDouble pData1, 
02579         kFCurveTangeantWeightMode pTangentWeightMode, 
02580         kFCurveDouble pWeight0, 
02581         kFCurveDouble pWeight1, 
02582         kFCurveDouble pVelocity0, 
02583         kFCurveDouble pVelocity1
02584         )
02585     {
02586         InternalKeyGetPtr(pKeyIndex)->Set(pTime, pValue, pInterpolation, pTangentMode, pData0, pData1, pTangentWeightMode, pWeight0, pWeight1, pVelocity0, pVelocity1);
02587 
02588         if (pKeyIndex >= mFCurveKeyCount)
02589         {
02590             int lOldCount = mFCurveKeyCount;
02591             mFCurveKeyCount = pKeyIndex + 1;
02592 
02593             CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_KEYADD, lOldCount);
02594             CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_KEYADD, pKeyIndex);
02595         }
02596         else
02597         {
02598             CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITVALUE | KFCURVEEVENT_EDITTIME | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02599         }
02600     }
02601 
02602     KFBX_FCURVE_INLINE void KFCurve::KeySetTCB 
02603         (
02604         kFCurveIndex pKeyIndex,
02605         KTime pTime, 
02606         kFCurveDouble pValue, 
02607         float pData0, 
02608         float pData1, 
02609         float pData2
02610         )
02611     {
02612         InternalKeyGetPtr(pKeyIndex)->SetTCB(pTime, pValue, pData0, pData1, pData2);
02613 
02614         if (pKeyIndex >= mFCurveKeyCount)
02615         {
02616             int lOldCount = mFCurveKeyCount;
02617             mFCurveKeyCount = pKeyIndex + 1;
02618 
02619             CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_KEYADD, lOldCount);
02620             CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_KEYADD, pKeyIndex);
02621         }
02622         else
02623         {
02624             CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITVALUE | KFCURVEEVENT_EDITTIME | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02625         }
02626     }
02627 
02628     KFBX_FCURVE_INLINE kFCurveInterpolation KFCurve::KeyGetInterpolation(kFCurveIndex pKeyIndex)
02629     {
02630         K_ASSERT(pKeyIndex >= 0);
02631         K_ASSERT(pKeyIndex < KeyGetCount());
02632 
02633         return InternalKeyGetPtr(pKeyIndex)->GetInterpolation();
02634     }
02635 
02636     KFBX_FCURVE_INLINE void KFCurve::KeySetInterpolation(kFCurveIndex pKeyIndex, kFCurveInterpolation pInterpolation)
02637     {
02638         K_ASSERT(pKeyIndex >= 0);
02639         K_ASSERT(pKeyIndex < KeyGetCount());
02640 
02641         InternalKeyGetPtr(pKeyIndex)->SetInterpolation(pInterpolation);
02642         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02643     }
02644 
02645     KFBX_FCURVE_INLINE kFCurveConstantMode KFCurve::KeyGetConstantMode(kFCurveIndex pKeyIndex)
02646     {
02647         K_ASSERT(pKeyIndex >= 0);
02648         K_ASSERT(pKeyIndex < KeyGetCount());
02649 
02650         return InternalKeyGetPtr(pKeyIndex)->GetConstantMode();
02651     }
02652 
02653     KFBX_FCURVE_INLINE kFCurveTangeantMode KFCurve::KeyGetTangeantMode(kFCurveIndex pKeyIndex, bool pIncludeOverrides )
02654     {
02655         K_ASSERT(pKeyIndex >= 0);
02656         K_ASSERT(pKeyIndex < KeyGetCount());
02657 
02658         return InternalKeyGetPtr(pKeyIndex)->GetTangeantMode( pIncludeOverrides );
02659     }
02660 
02661     KFBX_FCURVE_INLINE kFCurveTangeantWeightMode KFCurve::KeyGetTangeantWeightMode(kFCurveIndex pKeyIndex)
02662     {
02663         K_ASSERT(pKeyIndex >= 0);
02664         K_ASSERT(pKeyIndex < KeyGetCount());
02665 
02666         return InternalKeyGetPtr(pKeyIndex)->GetTangeantWeightMode();
02667     }
02668 
02669     KFBX_FCURVE_INLINE kFCurveTangeantVelocityMode KFCurve::KeyGetTangeantVelocityMode(kFCurveIndex pKeyIndex)
02670     {
02671         K_ASSERT(pKeyIndex >= 0);
02672         K_ASSERT(pKeyIndex < KeyGetCount());
02673 
02674         return InternalKeyGetPtr(pKeyIndex)->GetTangeantVelocityMode();
02675     }
02676 
02677     KFBX_FCURVE_INLINE void KFCurve::KeySetConstantMode(kFCurveIndex pKeyIndex, kFCurveConstantMode pMode)
02678     {
02679         K_ASSERT(pKeyIndex >= 0);
02680         K_ASSERT(pKeyIndex < KeyGetCount());
02681 
02682         InternalKeyGetPtr(pKeyIndex)->SetConstantMode(pMode);
02683         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02684     }
02685 
02686     KFBX_FCURVE_INLINE void KFCurve::KeySetTangeantMode(kFCurveIndex pKeyIndex, kFCurveTangeantMode pTangent)
02687     {
02688         K_ASSERT(pKeyIndex >= 0);
02689         K_ASSERT(pKeyIndex < KeyGetCount());
02690 
02691         InternalKeyGetPtr(pKeyIndex)->SetTangeantMode(pTangent);
02692         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02693     }
02694 
02695     KFBX_FCURVE_INLINE void KFCurve::KeySetTangeantWeightMode(kFCurveIndex pKeyIndex, kFCurveTangeantWeightMode pTangentWeightMode, kFCurveTangeantWeightMode pMask)
02696     {
02697         K_ASSERT(pKeyIndex >= 0);
02698         K_ASSERT(pKeyIndex < KeyGetCount());
02699 
02700         InternalKeyGetPtr(pKeyIndex)->SetTangeantWeightMode(pTangentWeightMode, pMask);
02701         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02702     }
02703 
02704     KFBX_FCURVE_INLINE void KFCurve::KeySetTangeantVelocityMode(kFCurveIndex pKeyIndex, kFCurveTangeantVelocityMode pTangentVelocityMode, kFCurveTangeantVelocityMode pMask)
02705     {
02706         K_ASSERT(pKeyIndex >= 0);
02707         K_ASSERT(pKeyIndex < KeyGetCount());
02708 
02709         InternalKeyGetPtr(pKeyIndex)->SetTangeantVelocityMode(pTangentVelocityMode, pMask);
02710         CallbackAddEvent (KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02711     }
02712 
02713     KFBX_FCURVE_INLINE kFCurveDouble KFCurve::KeyGetDataDouble(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex)
02714     {
02715         K_ASSERT(pKeyIndex >= 0);
02716         K_ASSERT(pKeyIndex < KeyGetCount());
02717 
02718         return InternalKeyGetPtr(pKeyIndex)->GetDataDouble(pIndex);
02719     }
02720 
02721     KFBX_FCURVE_INLINE void KFCurve::KeySetDataDouble(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex, kFCurveDouble pValue)
02722     {
02723         K_ASSERT(pKeyIndex >= 0);
02724         K_ASSERT(pKeyIndex < KeyGetCount());
02725 
02726         InternalKeyGetPtr(pKeyIndex)->SetDataDouble(pIndex, pValue);
02727         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02728     }
02729 
02730     KFBX_FCURVE_INLINE float KFCurve::KeyGetDataFloat(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex)
02731     {
02732         K_ASSERT(pKeyIndex >= 0);
02733         K_ASSERT(pKeyIndex < KeyGetCount());
02734 
02735         return InternalKeyGetPtr(pKeyIndex)->GetDataFloat(pIndex);
02736     }
02737 
02738     KFBX_FCURVE_INLINE void KFCurve::KeySetDataFloat(kFCurveIndex pKeyIndex, EKFCurveDataIndex pIndex, float pValue)
02739     {
02740         K_ASSERT(pKeyIndex >= 0);
02741         K_ASSERT(pKeyIndex < KeyGetCount());
02742 
02743         InternalKeyGetPtr(pKeyIndex)->SetDataFloat(pIndex, pValue);
02744         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02745     }
02746 
02747     KFBX_FCURVE_INLINE const float* KFCurve::KeyGetDataPtr(kFCurveIndex pKeyIndex)
02748     {
02749         K_ASSERT(pKeyIndex >= 0);
02750         K_ASSERT(pKeyIndex < KeyGetCount());
02751 
02752         return InternalKeyGetPtr(pKeyIndex)->GetDataPtr();
02753     }
02754 
02755     KFBX_FCURVE_INLINE kFCurveDouble KFCurve::KeyGetValue(kFCurveIndex pKeyIndex)
02756     {
02757         K_ASSERT(pKeyIndex >= 0);
02758         K_ASSERT(pKeyIndex < KeyGetCount());
02759 
02760         return InternalKeyGetPtr(pKeyIndex)->GetValue();
02761     }
02762 
02763     KFBX_FCURVE_INLINE void KFCurve::KeySetValue(kFCurveIndex pKeyIndex, kFCurveDouble pValue)
02764     {
02765         InternalKeyGetPtr(pKeyIndex)->SetValue(pValue);
02766         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITVALUE, pKeyIndex);
02767     }
02768 
02769     KFBX_FCURVE_INLINE void KFCurve::KeyIncValue(kFCurveIndex pKeyIndex, kFCurveDouble pValue)
02770     {
02771         K_ASSERT(pKeyIndex >= 0);
02772         K_ASSERT(pKeyIndex < KeyGetCount());
02773 
02774         InternalKeyGetPtr(pKeyIndex)->IncValue(pValue);
02775         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITVALUE, pKeyIndex);
02776     }
02777 
02778     KFBX_FCURVE_INLINE void KFCurve::KeyMultValue(kFCurveIndex pKeyIndex, kFCurveDouble pValue)
02779     {
02780         K_ASSERT(pKeyIndex >= 0);
02781         K_ASSERT(pKeyIndex < KeyGetCount());
02782 
02783         InternalKeyGetPtr(pKeyIndex)->MultValue(pValue);
02784         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITVALUE, pKeyIndex);
02785     }
02786 
02787     KFBX_FCURVE_INLINE void KFCurve::KeyMultTangeant(kFCurveIndex pKeyIndex, kFCurveDouble pValue)
02788     {
02789         K_ASSERT(pKeyIndex >= 0);
02790         K_ASSERT(pKeyIndex < KeyGetCount());
02791 
02792         InternalKeyGetPtr(pKeyIndex)->MultTangeant(pValue);
02793         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02794     }
02795 
02796     KFBX_FCURVE_INLINE KTime KFCurve::KeyGetTime(kFCurveIndex pKeyIndex)
02797     {
02798         K_ASSERT(pKeyIndex >= 0);
02799         K_ASSERT(pKeyIndex < KeyGetCount());
02800 
02801         return InternalKeyGetPtr(pKeyIndex)->GetTime();
02802     }
02803 
02804     KFBX_FCURVE_INLINE void KFCurve::KeySetTime(kFCurveIndex pKeyIndex, KTime pTime)
02805     {
02806         K_ASSERT(pKeyIndex >= 0);
02807         K_ASSERT(pKeyIndex < KeyGetCount());
02808 
02809         InternalKeyGetPtr(pKeyIndex)->SetTime(pTime);
02810         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITTIME, pKeyIndex);
02811     }
02812 
02813     KFBX_FCURVE_INLINE void KFCurve::KeyIncTime(kFCurveIndex pKeyIndex, KTime pTime)
02814     {
02815         K_ASSERT(pKeyIndex >= 0);
02816         K_ASSERT(pKeyIndex < KeyGetCount());
02817 
02818         InternalKeyGetPtr(pKeyIndex)->IncTime(pTime);
02819         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITTIME, pKeyIndex);
02820     }
02821 
02822     KFBX_FCURVE_INLINE void KFCurve::KeySetSelected(kFCurveIndex pKeyIndex, bool pSelected)
02823     {
02824         K_ASSERT(pKeyIndex >= 0);
02825         K_ASSERT(pKeyIndex < KeyGetCount());
02826 
02827         InternalKeyGetPtr(pKeyIndex)->SetSelected(pSelected);
02828         CallbackAddEvent(KFCURVEEVENT_SELECTION, pKeyIndex);
02829     }
02830 
02831     KFBX_FCURVE_INLINE bool KFCurve::KeyGetSelected(kFCurveIndex pKeyIndex)
02832     {
02833         K_ASSERT(pKeyIndex >= 0);
02834         K_ASSERT(pKeyIndex < KeyGetCount());
02835 
02836         return InternalKeyGetPtr(pKeyIndex)->GetSelected();
02837     }
02838 
02839     KFBX_FCURVE_INLINE void KFCurve::KeySetMarkedForManipulation(kFCurveIndex pKeyIndex, bool pMarked)
02840     {
02841         K_ASSERT(pKeyIndex >= 0);
02842         K_ASSERT(pKeyIndex < KeyGetCount());
02843 
02844         InternalKeyGetPtr(pKeyIndex)->SetMarkedForManipulation(pMarked);
02845     }
02846 
02847     KFBX_FCURVE_INLINE bool KFCurve::KeyGetMarkedForManipulation(kFCurveIndex pKeyIndex)
02848     {
02849         K_ASSERT(pKeyIndex >= 0);
02850         K_ASSERT(pKeyIndex < KeyGetCount());
02851 
02852         return InternalKeyGetPtr(pKeyIndex)->GetMarkedForManipulation();
02853     }
02854 
02855     KFBX_FCURVE_INLINE void KFCurve::KeySetTangeantVisibility (kFCurveIndex pKeyIndex, kFCurveTangeantVisibility pVisibility)
02856     {
02857         K_ASSERT(pKeyIndex >= 0);
02858         K_ASSERT(pKeyIndex < KeyGetCount());
02859 
02860         InternalKeyGetPtr(pKeyIndex)->SetTangeantVisibility(pVisibility);
02861         CallbackAddEvent(KFCURVEEVENT_SELECTION, pKeyIndex);
02862     }
02863 
02864     KFBX_FCURVE_INLINE kFCurveTangeantVisibility KFCurve::KeyGetTangeantVisibility (kFCurveIndex pKeyIndex)
02865     {
02866         K_ASSERT(pKeyIndex >= 0);
02867         K_ASSERT(pKeyIndex < KeyGetCount());
02868 
02869         return InternalKeyGetPtr(pKeyIndex)->GetTangeantVisibility();
02870     }
02871 
02872     KFBX_FCURVE_INLINE void KFCurve::KeySetBreak(kFCurveIndex pKeyIndex, bool pVal)
02873     {
02874         K_ASSERT(pKeyIndex >= 0);
02875         K_ASSERT(pKeyIndex < KeyGetCount());
02876 
02877         InternalKeyGetPtr(pKeyIndex)->SetBreak(pVal);
02878         CallbackAddEvent(KFCURVEEVENT_KEY | KFCURVEEVENT_EDITOTHER, pKeyIndex);
02879     }
02880 
02881     KFBX_FCURVE_INLINE bool KFCurve::KeyGetBreak(kFCurveIndex pKeyIndex)
02882     {
02883         K_ASSERT(pKeyIndex >= 0);
02884         K_ASSERT(pKeyIndex < KeyGetCount());
02885 
02886         return InternalKeyGetPtr(pKeyIndex)->GetBreak();
02887     }
02888 
02889 
02890 
02893     KFBX_DLL HKFCurve KFCurveCreate();
02894 
02895     // Create a function curve, FBX SDK internal use only.
02896     KFBX_DLL HKFCurve KFCurveCreate(KFbx* pFbx, bool pOnlyDefaults = false, bool pColor = false);
02897 
02898     // Create a function curve, FBX SDK internal use only.
02899     KFBX_DLL HKFCurve KFCurveCreate(KFbx* pFbx, HKFCurve pCurve, bool pOnlyDefaults = false, bool pColor = false);
02900 
02901 #include <fbxfilesdk/fbxfilesdk_nsend.h>
02902 
02903 
02904 #endif // FBXFILESDK_COMPONENTS_KFCURVE_KFCURVE_H
02905