kfbxanimcurvebase.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002 
00003 Copyright (C) 2010 Autodesk, Inc.
00004 All rights reserved.
00005 
00006 Use of this software is subject to the terms of the Autodesk license agreement
00007 provided at the time of installation or download, or which otherwise accompanies
00008 this software in either electronic or hard copy form.
00009 
00010 ****************************************************************************************/
00011 
00015 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXANIMCURVEBASE_H
00016 #define FBXFILESDK_KFBXPLUGINS_KFBXANIMCURVEBASE_H
00017 
00018 #include <fbxfilesdk/fbxfilesdk_def.h>
00019 #include <fbxfilesdk/kfbxplugins/kfbxobject.h>
00020 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00021 
00027 class KFBX_DLL KFbxAnimCurveKeyBase
00028 {
00029 public:
00032     KTime mTime;
00033 
00036     KFbxAnimCurveKeyBase()
00037     {
00038         mTime = KTIME_ZERO;
00039     }
00040 
00043     virtual ~KFbxAnimCurveKeyBase() {};
00044 
00048     virtual KTime GetTime() const
00049     {
00050         return mTime;
00051     }
00052 
00056     virtual void  SetTime(const KTime& pTime) {
00057         mTime = pTime;
00058     }
00059 };
00060 
00068 class KFBX_DLL KFbxAnimCurveBase : public KFbxObject
00069 {
00070     KFBXOBJECT_DECLARE_ABSTRACT(KFbxAnimCurveBase, KFbxObject);
00071 
00072 public:
00078 
00079         virtual void KeyClear () = 0;
00080         
00082         virtual int KeyGetCount () const = 0;
00083 
00093         virtual int KeyAdd (KTime pTime, KFbxAnimCurveKeyBase& pKey, int* pLast = NULL) = 0;
00094 
00103         virtual bool KeySet(int pIndex, KFbxAnimCurveKeyBase& pKey) = 0;
00104 
00109         virtual bool KeyRemove(int pIndex) = 0;
00110 
00116         virtual bool KeyRemove(int pStartIndex, int pEndIndex) = 0;
00117 
00119 
00128         virtual KTime KeyGetTime(int pKeyIndex) const { return KTIME_INFINITE; }
00129 
00134         virtual void KeySetTime(int pKeyIndex, KTime pTime) = 0;
00135 
00137 
00149         typedef enum {
00150             eCONSTANT          = 1,
00151             eREPETITION        = 2,
00152             eMIRROR_REPETITION = 3,
00153             eKEEP_SLOPE        = 4
00154         } EExtrapolationType;
00155 
00159         void SetPreExtrapolation(EExtrapolationType pExtrapolation) { mPreExtrapolation = pExtrapolation; }
00160             
00164         EExtrapolationType GetPreExtrapolation() const { return mPreExtrapolation; }
00165         
00170         void SetPreExtrapolationCount(unsigned long pCount) { mPreExtrapolationCount = pCount; }
00171         
00176         unsigned long GetPreExtrapolationCount() const { return mPreExtrapolationCount; }
00177         
00181         void SetPostExtrapolation(EExtrapolationType pExtrapolation) { mPostExtrapolation = pExtrapolation; }
00182         
00186         EExtrapolationType GetPostExtrapolation() const { return mPostExtrapolation; }
00187         
00192         void SetPostExtrapolationCount(unsigned long pCount) { mPostExtrapolationCount = pCount; }
00193             
00198         unsigned long GetPostExtrapolationCount() const { return mPostExtrapolationCount; }
00200 
00213           virtual float Evaluate (KTime pTime, int* pLast = NULL) = 0;
00214 
00221         virtual float EvaluateIndex( double pIndex) = 0;
00223 
00236         virtual bool GetTimeInterval(KTime& pStart, KTime& pStop);
00237 
00243         virtual bool GetTimeInterval(KTimeSpan& pTimeInterval);
00245 
00246 protected:
00247     KFbxAnimCurveBase(KFbxSdkManager& pManager, char const* pName);
00248 
00249 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00250 
00251     //  WARNING!
00252     //    Anything beyond these lines may not be documented accurately and is 
00253     //     subject to change without notice.
00255 public:
00256     virtual bool Store(KFbx* pFileObject) = 0;
00257     virtual bool Retrieve(KFbx* pFileObject) = 0;
00258 
00259 private:
00260     EExtrapolationType mPreExtrapolation;
00261     unsigned long      mPreExtrapolationCount;
00262     EExtrapolationType mPostExtrapolation;
00263     unsigned long      mPostExtrapolationCount;
00264 
00265     friend class KFbxObject;
00266 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00267 };
00268 
00269 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00270 
00271 #endif // FBXFILESDK_KFBXPLUGINS_KFBXANIMCURVEBASE_H