FBX SDK Reference Guide: kfcurvenode.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_KFCURVE_NODE_H_
00005 #define _FBXSDK_KFCURVE_NODE_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 <klib/karrayul.h>
00045 #include <klib/kerror.h>
00046 #include <klib/kstring.h>
00047 #include <object/e/keventbase.h>
00048 
00049 #include <kfcurve/kfcurve.h>
00050 
00051 #ifndef K_PLUGIN
00052     #include <kfcurve/i/ifcurveeti.h>
00053     #include <object/i/iobject.h>
00054     #include <object/i/ifbobjectholder.h>
00055 #endif
00056 
00057 K_FORWARD (IConnector) 
00058 K_FORWARD (IData) 
00059 
00060 #ifndef MB_FBXSDK
00061 #include <kbaselib_nsuse.h>
00062 #endif
00063 #include <kbaselib_forward.h>
00064 
00065 #include <kfcurve/kfcurve_nsbegin.h>
00066 
00067     enum 
00068     {   
00069         KFCN_IN = 0, 
00070         KFCN_OUT = 1, 
00071         KFCN_INOUT_MASK = 1, 
00072 
00073         KFCN_HIDDEN = 0, 
00074         KFCN_SHOWN = 2, 
00075 
00076         KFCN_CONTAINER_NODE = 0, 
00077         KFCN_REFERENCER_NODE = 8, 
00078         KFCN_REFERENCER_MASK = 8, 
00079 
00080         KFCN_TAKE_NODE = 16, 
00081         KFCN_FIXED_NODE = 0, 
00082         KFCN_TAKE_MASK = 16,
00083 
00084         KFCN_EXPENDED_NODE = 32, 
00085         KFCN_NOTEXPENDED_NODE = 0, 
00086         KFCN_EXPENDED_MASK = 32,
00087 
00088         KFCN_MULTILAYER = 64,
00089         KFCN_MONOLAYER  = 0,
00090         KFCN_MULTILAYER_MASK = 64,
00091 
00092         KFCN_ALWAYS_CANDIDATE = 128,
00093         KFCN_ALWAYS_CANDIDATE_TESTED = 256
00094     };
00095 
00096     //
00097     // Picking Types define
00098     //
00099     enum 
00100     {
00101         KCP_KEY = 1, 
00102         KCP_LTANGENT, 
00103         KCP_RTANGENT
00104     };
00105 
00106     //
00107     //  Node/Layer info
00108     //
00109     enum
00110     {
00111         KFCL_NOLAYER,
00112         KFCL_ADD,       // For translation and standard others
00113         KFCL_EULER_XYZ, // For rotation
00114         KFCL_MULT,      // For scaling, mainly
00115         KFCL_QUAT       // For quaternion rotation
00116     };
00117 
00118     #define KFCURVENODE_TRANSFORM               "Transform"
00119         #define KFCURVENODE_T                       "T"
00120             #define KFCURVENODE_T_X                     "X"
00121             #define KFCURVENODE_T_Y                     "Y"
00122             #define KFCURVENODE_T_Z                     "Z"
00123         #define KFCURVENODE_R                       "R"
00124             #define KFCURVENODE_R_X                     "X"
00125             #define KFCURVENODE_R_Y                     "Y"
00126             #define KFCURVENODE_R_Z                     "Z"
00127             #define KFCURVENODE_R_W                     "W"
00128         #define KFCURVENODE_S                       "S"
00129             #define KFCURVENODE_S_X                     "X"
00130             #define KFCURVENODE_S_Y                     "Y"
00131             #define KFCURVENODE_S_Z                     "Z"
00132     #define KFCURVENODE_LCL_T                   "Lcl Translation"
00133     #define KFCURVENODE_LCL_R                   "Lcl Rotation"
00134     #define KFCURVENODE_LCL_S                   "Lcl Scaling"
00135     #define KFCURVENODE_VISIBILITY              "Visibility"
00136 
00137     // Addition for the optical marker node attribute.
00138     #define KFCURVENODE_OCCLUSION               "Occlusion"
00139 
00140     // Addition for the IK effector marker node attribute.
00141     #define KFCURVENODE_IK_REACH_TRANSLATION    "IK Reach Translation"
00142     #define KFCURVENODE_IK_REACH_ROTATION       "IK Reach Rotation"
00143 
00144     // Addition for the light node attribute.
00145     #define KFCURVENODE_LIGHT_CONEANGLE         "Cone angle"
00146     #define KFCURVENODE_LIGHT_FOG               "Fog"
00147     #define KFCURVENODE_LIGHT_INTENSITY         "Intensity"
00148     #define KFCURVENODE_COLOR                   "Color"
00149     #define KFCURVENODE_COLOR_RED                   "X"
00150     #define KFCURVENODE_COLOR_GREEN                 "Y"
00151     #define KFCURVENODE_COLOR_BLUE                  "Z"
00152 
00153     // Addition for the camera node attribute.
00154     #define KFCURVENODE_CAMERA_FIELDOFVIEW      "FieldOfView"
00155     #define KFCURVENODE_CAMERA_FIELDOFVIEWX     "FieldOfViewX"
00156     #define KFCURVENODE_CAMERA_FIELDOFVIEWY     "FieldOfViewY"
00157     #define KFCURVENODE_CAMERA_FOCALLENGTH      "FocalLength"
00158     #define KFCURVENODE_CAMERA_OPTICALCENTERX   "OpticalCenterX"
00159     #define KFCURVENODE_CAMERA_OPTICALCENTERY   "OpticalCenterY"
00160     #define KFCURVENODE_CAMERA_ROLL             "Roll"
00161     #define KFCURVENODE_CAMERA_TURNTABLE        "TurnTable"
00162     #define KFCURVENODE_BACKGROUND_COLOR        "BackgroundColor"
00163     #define KFCURVENODE_BACKGROUND_COLOR_RED        "X"
00164     #define KFCURVENODE_BACKGROUND_COLOR_GREEN      "Y"
00165     #define KFCURVENODE_BACKGROUND_COLOR_BLUE       "Z"
00166 
00167     // Addition for the camera switcher node attribute.
00168     #define KFCURVENODE_CAMERA_INDEX            "Camera Index"
00169 
00170     // Addition for the texture.
00171     #define KFCURVENODE_TEXTURE_TRANSLATION     "Translation"
00172     #define KFCURVENODE_TEXTURE_TRANSLATION_X   "X"
00173     #define KFCURVENODE_TEXTURE_TRANSLATION_Y   "Y"
00174     #define KFCURVENODE_TEXTURE_TRANSLATION_Z   "Z"
00175     #define KFCURVENODE_TEXTURE_ROTATION        "Rotation"
00176     #define KFCURVENODE_TEXTURE_ROTATION_X      "X"
00177     #define KFCURVENODE_TEXTURE_ROTATION_Y      "Y"
00178     #define KFCURVENODE_TEXTURE_ROTATION_Z      "Z"
00179     #define KFCURVENODE_TEXTURE_SCALING         "Scaling"
00180     #define KFCURVENODE_TEXTURE_SCALING_X       "X"
00181     #define KFCURVENODE_TEXTURE_SCALING_Y       "Y"
00182     #define KFCURVENODE_TEXTURE_SCALING_Z       "Z"
00183     #define KFCURVENODE_TEXTURE_ALPHA           "Alpha"
00184 
00185     // Addition for the material.
00186     #define KFCURVENODE_MATERIAL_EMISSIVE       "Emissive"
00187     #define KFCURVENODE_MATERIAL_EMISSIVE_R     "X"
00188     #define KFCURVENODE_MATERIAL_EMISSIVE_G     "Y"
00189     #define KFCURVENODE_MATERIAL_EMISSIVE_B     "Z"
00190     #define KFCURVENODE_MATERIAL_AMBIENT        "Ambient"
00191     #define KFCURVENODE_MATERIAL_AMBIENT_R      "X"
00192     #define KFCURVENODE_MATERIAL_AMBIENT_G      "Y"
00193     #define KFCURVENODE_MATERIAL_AMBIENT_B      "Z"
00194     #define KFCURVENODE_MATERIAL_DIFFUSE        "Diffuse"
00195     #define KFCURVENODE_MATERIAL_DIFFUSE_R      "X"
00196     #define KFCURVENODE_MATERIAL_DIFFUSE_G      "Y"
00197     #define KFCURVENODE_MATERIAL_DIFFUSE_B      "Z"
00198     #define KFCURVENODE_MATERIAL_SPECULAR       "Specular"
00199     #define KFCURVENODE_MATERIAL_SPECULAR_R     "X"
00200     #define KFCURVENODE_MATERIAL_SPECULAR_G     "Y"
00201     #define KFCURVENODE_MATERIAL_SPECULAR_B     "Z"
00202     #define KFCURVENODE_MATERIAL_OPACITY        "Opacity"
00203     #define KFCURVENODE_MATERIAL_REFLECTIVITY   "Reflectivity"
00204     #define KFCURVENODE_MATERIAL_SHININESS      "Shininess"
00205 
00206     // Addition for the generic vector property.
00207     #define KFCURVENODE_USER_PROPERTY_VECTOR_X  "X"
00208     #define KFCURVENODE_USER_PROPERTY_VECTOR_Y  "Y"
00209     #define KFCURVENODE_USER_PROPERTY_VECTOR_Z  "Z"
00210 
00211     // Addition for the generic color property.
00212     #define KFCURVENODE_USER_PROPERTY_COLOR_R  "X"
00213     #define KFCURVENODE_USER_PROPERTY_COLOR_G  "Y"
00214     #define KFCURVENODE_USER_PROPERTY_COLOR_B  "Z"
00215 
00216 
00217     // Addition of generic matrix
00218     #define KFCURVENODE_USER_PROPERTY_MATRIX "Matrix"
00219     #define KFCURVENODE_USER_PROPERTY_MATRIX_0 "0"
00220     #define KFCURVENODE_USER_PROPERTY_MATRIX_1 "1"
00221     #define KFCURVENODE_USER_PROPERTY_MATRIX_2 "2"
00222     #define KFCURVENODE_USER_PROPERTY_MATRIX_3 "3"
00223     #define KFCURVENODE_USER_PROPERTY_MATRIX_4 "4"
00224     #define KFCURVENODE_USER_PROPERTY_MATRIX_5 "5"
00225     #define KFCURVENODE_USER_PROPERTY_MATRIX_6 "6"
00226     #define KFCURVENODE_USER_PROPERTY_MATRIX_7 "7" 
00227     #define KFCURVENODE_USER_PROPERTY_MATRIX_8 "8"
00228     #define KFCURVENODE_USER_PROPERTY_MATRIX_9 "9"
00229     #define KFCURVENODE_USER_PROPERTY_MATRIX_A "A"
00230     #define KFCURVENODE_USER_PROPERTY_MATRIX_B "B"
00231     #define KFCURVENODE_USER_PROPERTY_MATRIX_C "C"
00232     #define KFCURVENODE_USER_PROPERTY_MATRIX_D "D"
00233     #define KFCURVENODE_USER_PROPERTY_MATRIX_E "E"
00234     #define KFCURVENODE_USER_PROPERTY_MATRIX_F "F"
00235 
00236     // Default array size for 1 minute of animation (30fps) 
00237     #define SELECTION_ARRAY_SIZE    30*60+1
00238     //#define SELECTION_ARRAY_SIZE 1024*1024
00239 
00240     #define KFCURVENODE_CANDIDATE_MAX_COUNT 4
00241 
00242 
00243     typedef int  kFCurveNodeType;
00244 
00245     K_FORWARD (KFCurveNode);
00246     typedef HKFCurveNode HIKFCurveNode;
00247     typedef KFCurveNode IKFCurveNode;
00248 
00249     #define IKFCurveNodeID 43763634
00250 
00251     enum EKFCurveNodeEventType
00252     {
00253         KFCURVENODEEVENT_NONE = 0, 
00254         KFCURVENODEEVENT_SELECTION = 1, 
00255         KFCURVENODEEVENT_DESTROY = 2, 
00256         KFCURVENODEEVENT_FCURVE = 4, 
00257         KFCURVENODEEVENT_TIMEWARP = 8, 
00258         KFCURVENODEEVENT_CTRLCURVE = 16, 
00259         KFCURVENODEEVENT_DATAUPDATED = 32
00260     };
00261 
00262     struct KExternalTimingInformation
00263     {
00264         KTime mLclOffset;
00265         KTime mDuration;
00266     };
00267 
00268 
00269     // Curve node event class.
00270     class KFCURVE_DLL KFCurveNodeEvent : public KEventBase
00271     {
00272     public:
00273         /* Nature (s) of this node event.
00274         *   It is a bit field.  Value defined in the enum stated before 
00275         *   the class can composited. 
00276         * stored in mType
00277         */
00278         // Event count.
00279         int mEventCount;
00280 
00281         // Data.
00282         void* mData;
00283 
00284         // Clear the curve node event object.
00285         inline void Clear () 
00286         {
00287             mType=KFCURVENODEEVENT_NONE; 
00288             mEventCount = 0; 
00289             mData = NULL; 
00290         }
00291 
00292         /* Add an event of type pWhat.
00293         *   \param pWhat    Use EKFCurveNodeEventType to identify what pWhat means.
00294         */
00295         inline void Add (int pWhat) 
00296         {
00297             mType |= pWhat;
00298             mEventCount++;
00299         }
00300 
00301         // Set the data contained by the node event.
00302         inline void SetData (void* pData) {mData = pData;}
00303     };
00304 
00305 
00306     struct KFCurveNodeCallback 
00307     {
00308         KFCurveNodeEvent mEvent;
00309         KArrayUL mCallbackFunctions;   // no delete on object must use array ul
00310         KArrayUL mCallbackObjects;     // no delete on object must use array ul
00311         bool mCallbackEnable;
00312     };
00313 
00314     typedef void (*kFCurveNodeCallback) (KFCurveNode* pFCurve, KFCurveNodeEvent* FCurveNodeEvent, void* pObject) ;
00315 
00316     typedef class KArrayTemplate< HKFCurveNode > KArrayTemplateFCurveNode;  
00317 
00318     // Return codes for function KFCurveNode::IsKey().
00319     enum 
00320     { 
00321         ISKEY_NONE,
00322         ISKEY_SOME, 
00323         ISKEY_ALL 
00324     };
00325 
00326 
00327     class KFCURVE_DLL KFCurveNodeCandidateState
00328     {
00329     public:
00330         KFCurveNodeCandidateState();
00331         ~KFCurveNodeCandidateState();
00332 
00333         void Dump(int pLevel = 0);
00334 
00335         void SetCandidateTotalTime      ( KTime &pCandidateTime ) { mCandidateTotalTime = pCandidateTime; };
00336         void SetCandidateSpecificTime   ( KTime &pCandidateTime ) { mCandidateSpecificTime = pCandidateTime; };
00337 
00338     protected:
00339         friend class KFCurveNode;
00340         
00341         int mSpecificCandidateMethod;
00342         int mTotalCandidateMethod;
00343 
00344         double mCandidateTotalValue[KFCURVENODE_CANDIDATE_MAX_COUNT];
00345         KTime   mCandidateTotalTime;
00346 
00347         double mCandidateSpecificValue;
00348         double mFCurveValue;
00349         KTime mCandidateSpecificTime;
00350 
00351         KFCurveNodeCandidateState *mSubStates[KFCURVENODE_CANDIDATE_MAX_COUNT];
00352         KFCurveNodeCandidateState *mLayerState;
00353         int                        mLayerID;
00354 
00355     };
00356 
00357 
00370     #ifdef K_PLUGIN
00371         class KFCURVE_DLL KFCurveNode
00372     #else 
00373         class KFCURVE_DLL KFCurveNode : public IFBObjectHolder
00374     #endif
00375     {
00376 
00377     public:
00378 
00383 
00392         KFCurveNode 
00393         (
00394             char* pNodeName, 
00395             char* pTimeWarpName, 
00396             HKDataType pDataType, 
00397             int  pLayerType = KFCL_NOLAYER,
00398             int  pLayerID = 0
00399         ) ;
00400 
00408         KFCurveNode(HKFCurveNode pTemplateCurveNode);
00409 
00411         virtual ~KFCurveNode () ;
00412 
00413         #ifdef K_PLUGIN
00414             void Destroy (int Local=0) ;
00415         #else
00416             IObject_Declare (Implementation) 
00417         #endif
00418 
00420 
00425 
00429         void CreateFCurve( );
00430 
00435         bool FCurveCreated( );
00436 
00438 
00443 
00454         HKFCurveNode Clone(bool pKeepAttached);
00455 
00469         HKFCurveNode CloneTemplate(bool pKeepAttached=false, bool pCloneFCurves=false, bool pCreateCurves=false, int pLayerID = -1);
00470 
00478         void CopyFrom(HKFCurveNode pSource, bool pTransferCurve = false);
00479 
00488         HKFCurveNode Copy(KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE);
00489 
00491 
00496 
00498         char* GetName () ;
00499 
00501         char* GetTimeWarpName() ;
00502 
00504         char* GetTypeName() ;
00505 
00507 
00512 
00516         HKFCurve FCurveGet();
00517 
00526         KFCurve* FCurveSet (KFCurve* pCurve, bool pDestroyOldCurve = false) ;
00527 
00534         void FCurveReplace (KFCurve* pCurve) ;
00535 
00544         bool GetTransformCurves (KFCurve* pT[3], KFCurve* pR[3], KFCurve* pS[3]) ;
00545 
00547 
00552 
00556         virtual void Clear () ;
00557 
00559         virtual int Add(HKFCurveNode pCurveNode);
00560         
00564         virtual void Remove (int pIndex) ;
00565         
00569         virtual void Delete (int pIndex) ;
00570         
00572         virtual int GetCount () ;
00573         
00578         virtual HKFCurveNode Get(int pIndex) ;
00579         
00586         virtual bool IsChild(KFCurveNode* pCurveNode, bool pRecursive = false) ;
00587 
00593         virtual int Find (char* pName) ;
00594 
00600         virtual int Find(HKFCurveNode pNode);
00601 
00606         HKFCurveNode FindRecursive(char* pName);
00607 
00614         HKFCurveNode FindOrCreate(char* pName, bool pFindOrCreateCurve = true) ;
00615         
00617         virtual void SetParent(HKFCurveNode pParent) {mParent = pParent;}
00618         
00622         virtual HKFCurveNode GetParent() {return mParent;}
00623 
00625 
00630 
00635         int KeyGetCount(bool pRecursiveInLayers = false);
00636 
00643         void KeyGetCount(int& pCurveCount, int& pTotalCount, int& pMinCount, int& pMaxCount);
00644 
00645         // Get the fcurve that has the earliest key. If many fcurves
00646         // has a key at the earliest time, returns one of the fcurves.
00647         void GetCurveWithFirstKey(KFCurve*& lCurveWithFirstKey, bool *pCurveMask /* = NULL */, bool pRecursiveInLayers);
00648         // Get the fcurve that has the latest key. If many fcurves has
00649         // a key at the latest time, returns one of the fcurves.
00650         void GetCurveWithLastKey(KFCurve*& lCurveWithLastKey, bool *pCurveMask /* = NULL */, bool pRecursiveInLayers);
00651 
00652         // Get the first key time in the children specified by the curve mask (NULL = all children)
00653         // If there is no key, return KTIME_MINUS_INFINITE.
00654         KTime GetFirstKeyTime(bool *pCurveMask = NULL, bool pRecursiveInLayers = false);
00655         // Get the last key time in the children specified by the curve mask (NULL = all children)
00656         // If there is no key, return KTIME_INFINITE.
00657         KTime GetLastKeyTime(bool *pCurveMask = NULL, bool pRecursiveInLayers = false);
00658 
00669         double* KeyAdd (KTime pTime, double* pValue) ;
00670 
00684         double* KeyAppend (KTime pTime, double* pValue, bool pCheckForContinuousRotation = false) ;
00685 
00696         bool GetAnimationInterval (KTime& pStart, KTime& pStop) ;
00697 
00702         void GetTimeSpan          (KTime& pStart, KTime& pStop) ;   
00703 
00719         int IsKey (KTime& pTime, int *pLast, bool* pCurveMask = NULL, double pKeyIndexTolerance = 0.0, double pMin = -K_DOUBLE_MAX,  double pMax = K_DOUBLE_MAX );
00720 
00730         bool DeleteKey (KTime& pTime, bool* pCurveMask = NULL, double pKeyIndexTolerance = 0.0 );
00731 
00742         KTime GetNextKeyTime (KTime pTime, bool* pCurveMask = NULL, bool pRecursiveInLayers = false);
00743 
00753         KTime GetPrevKeyTime (KTime pTime, bool* pCurveMask = NULL );
00754 
00769         double* Evaluate (double* pValue, KTime pTime, kFCurveIndex* pLast=NULL) ;
00770         
00781         double* GetValue (double* pValue) ;
00782         
00792         double* SetValue (double* pValue) ;
00793 
00800         void Delete(KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE);
00801 
00814     void Replace(HKFCurveNode pSource, KTime pStart = KTIME_MINUS_INFINITE, KTime pStop = KTIME_INFINITE, bool pUseGivenSpan = false, bool pKeyStartEndOnNoKey = true, KTime pTimeSpanOffset = KTIME_ZERO );
00815 
00817 
00819     //
00820     //  WARNING!
00821     //
00822     //  Anything beyond these lines may not be documented accurately and is 
00823     //  subject to change without notice.
00824     //
00826 
00827     #ifndef DOXYGEN_SHOULD_SKIP_THIS
00828 
00833 
00835         float* GetColor();
00836 
00838         void SetColor (float pColor[3]) ;
00839 
00841 
00846 
00848         inline int IncReferenceCount () {return ++mReferenceCount;}
00849 
00851         inline int DecReferenceCount () {mReferenceCount--; return mReferenceCount;}
00852 
00854         inline int GetReferenceCount () {return mReferenceCount;}
00855 
00857 
00862 
00864         int GetTakeType () ;
00865 
00867         void SetTakeType (int pType) ;
00868 
00870 
00875 
00877         bool GetVisibility () ;
00878 
00880         void SetVisibility (bool pVisible, bool pRecursive=false, bool pRecurseLayer = false, int lChildIndex = -1) ;
00881 
00883 
00888 
00893         void DataNodeSet (HKFCurveNode pDataNode, bool pRecursive=true) ;
00894 
00898         HKFCurveNode DataNodeGet () ;
00899 
00903         bool SetPreExtrapolation(kUInt pNewPreExtrapolation, bool pRespectUserLock=true );
00904         bool SetPreExtrapolationCount(kUInt pNewPreExtrapolationCount, bool pRespectUserLock=true);
00905         bool SetPostExtrapolation(kUInt pNewPreExtrapolation, bool pRespectUserLock=true);
00906         bool SetPostExtrapolationCount(kUInt pNewPreExtrapolationCount, bool pRespectUserLock=true);
00907 
00909 
00914 
00916         int GetContainerType () ;
00917 
00919         void SetContainerType (int pInOutType) ;
00920 
00922 
00927 
00929         int GetIOType () ;
00930 
00932         void SetIOType (int pInOutType) ;
00933 
00935 
00940 
00942         int IsExpended () ;
00943 
00945         void SetExpended (bool pExpended) ;
00946 
00948 
00953 
00955         int IsMultiLayer() ;
00956 
00958         void SetMultiLayer (bool pMultiLayer) ;
00959 
00961         HKFCurveNode GetLayerNode(int pLayerID);
00962 
00964     #ifndef K_PLUGIN
00965         void ExtractKeysIndex( KArraykInt &pArray, KTimeSpan pTimeSpan, double pMinValue =  -K_DOUBLE_MAX, double pMaxValue =  K_DOUBLE_MAX);
00966     #endif
00967 
00969 
00974 
00978         bool LookLikeSampledData(KTime pThresholdPeriod);
00979 
00981 
00986 
00988         int GetUpdateId () ;
00989 
00991         int GetValuesUpdateId ();
00992 
00994         int GetNodeUpdateId () ;
00995 
00996 
00998 
01003         
01005         bool CallbackEnable (bool pEnable) ;
01006         
01008         bool CallbackIsEnable () ;
01009         
01011         void CallbackClear () ;
01012         
01014         void CallbackAddEvent (int pWhat) ;
01015         
01017         void CallbackRegister (kFCurveNodeCallback, void* pObject) ;
01018         
01020         void CallbackUnregister (kFCurveNodeCallback, void* pObject) ;
01021 
01023 
01024     #ifndef K_PLUGIN
01025 
01029 
01031         void SetETI(IKFCurveETI * pFCurveETI);
01032         IKFCurveETI * GetETI() const;
01033 
01035         KTime ETINodeTime2GlobalTime(KTime const & pTime);
01036         KTime ETIGlobalTime2NodeTime(KTime const & pTime);
01037         KTime ETIGetDuration();
01038         KTime ETIGetTrimOffset();
01039         KTime ETIGetGlobalOffset();
01040         double ETIGetScaleFactor();
01041         bool ETIGetColor(KgeRGBVector & pColor);
01042         bool ETIIsGlobalTimeInSpan(KTime const & pTime, bool pIncludeStop = true);
01043         typedef KTime (IKFCurveETI::*TETITimeFetcher)();
01044         KTime ETIGetSpecifiedTime(TETITimeFetcher pFunc);
01045         bool ETIIsSelectedDuration();
01046     #endif
01047 
01049 
01050         bool    FbxStore (KFbx* pFbx, bool pOnlyDefaults = false, bool pReplaceLclTRSName = false, bool pSkipTimeWarpName = false, char* pFieldName = "Channel", bool pColor = true, bool pIsVersion5 = false ) ;
01051         bool    FbxRetrieve (KFbx* pFbx, bool pOnlyDefaults = false, bool pCreateIfNotFound = true,bool pColor = false);
01052         bool    FbxInternalRetrieve (KFbx* pFbx, bool pOnlyDefaults = false, bool pCreateIfNotFound = true,bool pColor = false) ;
01053         bool    FbxTimeWarpNameRetrieve(KFbx* pFbx);
01054         bool    FbxLayerAndTimeWarpRetrieve(KFbx* pFbx, bool pOnlyDefaults = false, bool pCreateIfNotFound = true,bool pColor = false) ;
01055 
01057 
01061         bool mUseQuaternion;
01062         inline bool GetUseQuaternion(){return mUseQuaternion;}; 
01063         void SetUseQuaternion(bool pVal); 
01064         private:
01065             void RotationNodeEvaluate(double* pValue, KTime pTime, kFCurveIndex* pLast,bool pEvaluateCandidate  );
01066 
01068 
01069     public:
01071 
01075         void GetCandidateState(KFCurveNodeCandidateState& pState);
01076         void SetCandidateState(const KFCurveNodeCandidateState& pState, bool pDestroyMissingLayers = false );
01077 
01078         int     GetCandidateSpecificMethod();
01079         int     GetCandidateTotalMethod();
01080         KTime   GetCandidateTotalTime();
01081         double* GetCandidateTotalValue();
01082         int     GetCandidateTotalValueSize();
01083 
01084         void    SetCandidateSpecificMethod(int pMethod);
01085         void    SetCandidateTotalMethod(int pMethod);
01086         void    SetCandidateTotalTime(KTime pTime);
01087         void    SetCandidateTotalValue(double* pValue);
01088 
01090 
01091     void GetQuaternionInterpolationBezierPoints(KTime pCurrentTime, KgeQuaternion &pQ0, KgeQuaternion &lQ1, KgeQuaternion &lQ2, KgeQuaternion &lQ3);
01092 
01093     protected:
01094         struct NameInfo 
01095         {
01096             KString     mName;
01097             KString     mTimeWarpName;
01098             HKDataType  mDataType;
01099             int     mRefCount;
01100         }*mNameInfo;
01101 
01102         void    SetNameInfo( NameInfo* pNameInfo );
01103 
01104         int mType;
01105 
01106         int mReferenceCount;
01107         KArrayTemplate<HKFCurveNode> mNodes;
01108 
01109         HIKFCurve    mFCurve;
01110         HKFCurveNode mTimeWarp;
01111         HKFCurveNode mLayer;        // Ctrl Curve (Animation layering) 
01112         HKFCurveNode mObjectLayer;  // Pointer to Layer 0
01113         HKFCurveNode mTemplate;
01114         HKFCurveNode mDataNode;
01115         HKFCurveNode mParent;
01116 
01117         int mLayerType;
01118         int mLayerID;
01119 
01120         int mUpdateId;
01121 
01122         public:
01123         int mMBRotationOrder;
01124         inline int GetRotationOrder(){return mMBRotationOrder;}; 
01125         void SetRotationOrder(int pRotationOrder);
01126 
01128         int GetLayerType() { return mLayerType; }
01129 
01130         protected:
01131         //
01132         //  Candidates in nodes (Max is KFCURVENODE_CANDIDATE_MAX_COUNT)
01133         //
01134         
01135         void FromTotalCandidateToSpecificCandidate(int pLayerID);
01136 
01137         enum {eUseFCurve = 1, eUseTotal = 2};
01138         int mSpecificCandidateMethod;  // Used as a bit field
01139         int mTotalCandidateMethod;     // Used as an enum
01140                                         // To my knowledge the possible state are       
01141                                         // No validcandidate                            mCandidateTotalTime == INFINITE and no FCurve candidate for the current time
01142                                         // Total candidate is valid and fcuve invalid   mTotalCandidateMethod ==  eUseTotal and mSpecificCandidateMethod == eUseTotal
01143                                         // FCurve is valid and Total invalid            mTotalCandidateMethod ==  eUseFCurve and mSpecificCandidateMethod == eUseFCurve
01144                                         // Total valid and FCurve computed              mTotalCandidateMethod ==  eUseTotal and mSpecificCandidateMethod == eUseTotal | eUseFCurve
01145 
01146                                         // FCurve valid and total computed              mTotalCandidateMethod ==  eUseTotal and mSpecificCandidateMethod == eUseFCurve
01147                                         // FCurve valid (and computed from total) and total computed    mTotalCandidateMethod ==  eUseTotal and mSpecificCandidateMethod == eUseTotal | eUseFCurve
01148                         
01149                     
01150                                         
01151 
01152         double mCandidateTotalValue[KFCURVENODE_CANDIDATE_MAX_COUNT];   // For all layers at once (only meaningful on ObjectLayer )
01153         KTime   mCandidateTotalTime;
01154 
01155         //
01156         //  Callbacks
01157         //
01158         
01159         KFCurveNodeCallback* mCallback;
01160         int mUserLock;
01161 
01162 
01163     #ifndef K_PLUGIN
01164         //
01165         //  External Timing Information (for transportation only: optional, not used internally, and not persisted).
01166         //
01167         IKFCurveETI * mETI;
01168     #endif
01169 
01170     private:
01171         void KeyGetCountRecursive(int& pCurveCount, int& pTotalCount, int& pMinCount, int& pMaxCount);
01172         bool GetAnimationIntervalRecursive (KTime& pStart, KTime& pStop) ;
01173         void IsKeyRecursive( KTime& pTime, int &pKeyCount, int &pKeyFound, int *pLast, bool *pCurveMask, double pKeyIndexTolerance = 0.0, double pMin = -K_DOUBLE_MAX,  double pMax = K_DOUBLE_MAX );
01174 
01175         friend KFCURVE_DLL HKFCurveNode KFCurveNodeCreate (KFbx* pFbx, HKFCurveNode pParent, bool pOnlyDefaults, bool pCreateIfNotFound, bool pColor );
01176 
01177     public:
01178     #ifndef K_FBXSDK_INTERFACE
01179             #include <kfcurve/kfcurvenodeinhouse.h>
01180     #endif  // K_FBXSDK_INTERFACE
01181 
01182     #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
01183 
01184     };
01185 
01186 
01196     KFCURVE_DLL HKFCurveNode KFCurveNodeCreate(char* pNodeName, char* pTimeWarpName, char* pTypeName, int pLayerType = KFCL_NOLAYER, int pLayerID = 0);
01197     KFCURVE_DLL HKFCurveNode KFCurveNodeCreate(char* pNodeName, HKDataType pDataType=NULL, int pLayerType = KFCL_NOLAYER, int pLayerID = 0);
01198 
01199 
01207     KFCURVE_DLL HKFCurveNode KFCurveNodeCreate(HKFCurveNode pTemplateCurveNode);
01208 
01209     // Create a curve node, FBX SDK internal use only.
01210     KFCURVE_DLL HKFCurveNode KFCurveNodeCreate(KFbx* pFbx, bool pOnlyDefaults = false, bool pColor = false);
01211 
01212     // Create a curve node, FBX SDK internal use only.
01213     KFCURVE_DLL HKFCurveNode KFCurveNodeCreate(KFbx* pFbx, HKFCurveNode pParent, bool pOnlyDefaults = false, bool pCreateIfNotFound = true, bool pColor = false);
01214 
01215     // Create a layer node, FBX SDK internal use only.
01216     KFCURVE_DLL HKFCurveNode KFCurveNodeLayerCreate (KFbx* pFbx,HKFCurveNode pParent, bool pOnlyDefaults = false );
01217 
01218     // Create a curve node from a datatype, FBX SDK internal use only.
01219     KFCURVE_DLL HKFCurveNode FCurveNodeCreateFromDataType( HKDataType pDataType,char* pNodeName);
01220 
01221 #include <kfcurve/kfcurve_nsend.h>
01222 
01223 #endif // #ifndef _FBXSDK_KFCURVE_NODE_H_
01224 
01225