FCDocument/FCDAnimationMultiCurve.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005-2007 Feeling Software Inc.
00003     Portions of the code are:
00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
00005     
00006     MIT License: http://www.opensource.org/licenses/mit-license.php
00007 */
00008 /*
00009     Based on the FS Import classes:
00010     Copyright (C) 2005-2006 Feeling Software Inc
00011     Copyright (C) 2005-2006 Autodesk Media Entertainment
00012     MIT License: http://www.opensource.org/licenses/mit-license.php
00013 */
00014 
00020 #ifndef _FCD_ANIMATION_MULTI_CURVE_H_
00021 #define _FCD_ANIMATION_MULTI_CURVE_H_
00022 
00023 #ifndef __FCD_OBJECT_H_
00024 #include "FCDocument/FCDObject.h"
00025 #endif // __FCD_OBJECT_H_
00026 #ifndef _FU_DAE_ENUM_H_
00027 #include "FUtils/FUDaeEnum.h"
00028 #endif // _FU_DAE_ENUM_H_
00029 
00030 class FCDocument;
00031 class FCDAnimationMKey;
00032 
00033 typedef fm::pvector<FCDAnimationMKey> FCDAnimationMKeyList; 
00047 class FCOLLADA_EXPORT FCDAnimationMultiCurve : public FCDObject
00048 {
00049 private:
00050     DeclareObjectType(FCDObject);
00051 
00052     // The number of merged curves
00053     uint32 dimension;
00054 
00055     // Target information
00056     int32 targetElement;
00057 
00058     // Input information
00059     FCDAnimationMKeyList keys;
00060     FUDaeInfinity::Infinity preInfinity, postInfinity;
00061 
00062     //What sort of evaluation we do, 1D or 2D
00063     static bool is2DEvaluation;
00064 
00065 public:
00071     FCDAnimationMultiCurve(FCDocument* document, uint32 dimension);
00072 
00074     virtual ~FCDAnimationMultiCurve();
00075 
00078     inline uint32 GetDimension() const { return dimension; }
00079 
00082     inline FCDAnimationMKey** GetKeys() { return keys.begin(); }
00083     inline const FCDAnimationMKey** GetKeys() const { return keys.begin(); } 
00087     inline size_t GetKeyCount() const { return keys.size(); }
00088 
00093     void SetKeyCount(size_t count, FUDaeInterpolation::Interpolation interpolation);
00094 
00098     inline FCDAnimationMKey* GetKey(size_t index) { FUAssert(index < keys.size(), return NULL); return keys.at(index); }
00099     inline const FCDAnimationMKey* GetKey(size_t index) const { FUAssert(index < keys.size(), return NULL); return keys.at(index); } 
00104     FCDAnimationMKey* AddKey(FUDaeInterpolation::Interpolation interpolation);
00105 
00110     inline FUDaeInfinity::Infinity GetPreInfinity() const { return preInfinity; }
00111 
00116     inline void SetPreInfinity(FUDaeInfinity::Infinity infinity) { preInfinity = infinity; SetDirtyFlag(); }
00117 
00122     inline FUDaeInfinity::Infinity GetPostInfinity() const { return postInfinity; }
00123 
00128     inline void SetPostInfinity(FUDaeInfinity::Infinity infinity) { postInfinity = infinity; SetDirtyFlag(); }
00129 
00133     void Evaluate(float input, float* output) const;
00134 
00139     inline int32 GetTargetElement() const { return targetElement; }
00140 
00144     inline void SetTargetElement(int32 e) { targetElement = e; SetDirtyFlag(); }
00145     inline int32 GetTargetElement() { return targetElement; }
00146 
00151     //inline void SetTargetQualifier(size_t index, const fm::string& qualifier) { FUAssert(index < dimension, return); targetQualifiers[index] = qualifier; }
00152     //inline fm::string& GetTargetQualifier(size_t index) { FUAssert(index < dimension,); return targetQualifiers[index]; }
00153 
00156     inline void Set2DCurveEvaluation(bool flag) { is2DEvaluation = flag; }
00157 
00160     inline bool Is2DCurveEvaluation() {return is2DEvaluation; }
00161 };
00162 
00163 #endif // _FCD_ANIMATION_MULTI_CURVE_H_

Generated on Thu Feb 14 16:58:33 2008 for FCollada by  doxygen 1.4.6-NO