FCDocument/FCDMorphController.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_MORPH_CONTROLLER_H_
00021 #define _FCD_MORPH_CONTROLLER_H_
00022 
00023 #ifndef _FU_DAE_ENUM_H_
00024 #include "FUtils/FUDaeEnum.h"
00025 #endif // _FU_DAE_ENUM_H_
00026 #ifndef __FCD_OBJECT_H_
00027 #include "FCDocument/FCDObject.h"
00028 #endif // __FCD_OBJECT_H_
00029 #ifndef _FCD_PARAMETER_ANIMATABLE_H_
00030 #include "FCDocument/FCDParameterAnimatable.h"
00031 #endif // _FCD_PARAMETER_ANIMATABLE_H_
00032 
00033 class FCDocument;
00034 class FCDAnimated;
00035 class FCDController;
00036 class FCDGeometry;
00037 class FCDMorphController;
00038 
00044 class FCOLLADA_EXPORT FCDMorphTarget : public FCDObject
00045 {
00046 private:
00047     DeclareObjectType(FCDObject);
00048     FCDMorphController* parent;
00049     DeclareParameterPtr(FCDGeometry, geometry, FC("Mesh"))
00050     DeclareParameterAnimatable(float, FUParameterQualifiers::SIMPLE, weight, FC("Weight"));
00051 
00052 public:
00057     FCDMorphTarget(FCDocument* document, FCDMorphController* parent);
00058 
00060     virtual ~FCDMorphTarget();
00061 
00064     FCDMorphController* GetParent() { return parent; }
00065     const FCDMorphController* GetParent() const { return parent; } 
00071     FCDGeometry* GetGeometry() { return geometry; }
00072     const FCDGeometry* GetGeometry() const { return geometry; } 
00080     void SetGeometry(FCDGeometry* geometry);
00081 
00084     FCDParameterAnimatableFloat& GetWeight() { return weight; }
00085     const FCDParameterAnimatableFloat& GetWeight() const { return weight; } 
00090     void SetWeight(float _weight) { weight = _weight; SetDirtyFlag(); }
00091 
00094     DEPRECATED(3.05A, GetWeight().IsAnimated()) bool IsAnimated() const;
00095 
00099     DEPRECATED(3.05A, GetWeight().GetAnimated()) FCDAnimated* GetAnimatedWeight(); 
00100     DEPRECATED(3.05A, GetWeight().GetAnimated()) const FCDAnimated* GetAnimatedWeight() const; 
00101 };
00102 
00119 class FCOLLADA_EXPORT FCDMorphController : public FCDObject
00120 {
00121 private:
00122     DeclareObjectType(FCDObject);
00123     FCDController* parent;
00124 
00125     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, method, FC("Method")); // FUDaeMorphMethod::Method
00126     DeclareParameterPtr(FCDEntity, baseTarget, FC("Base Mesh"));
00127     DeclareParameterContainer(FCDMorphTarget, morphTargets, FC("Morph Targets"));
00128 
00129 public:
00134     FCDMorphController(FCDocument* document, FCDController* parent);
00135 
00137     virtual ~FCDMorphController();
00138 
00141     FCDController* GetParent() { return parent; }
00142     const FCDController* GetParent() const { return parent; } 
00147     FCDEntity* GetBaseTarget() { return baseTarget; }
00148     const FCDEntity* GetBaseTarget() const { return baseTarget; } 
00155     void SetBaseTarget(FCDEntity* entity);
00156 
00160     DEPRECATED(3.05A, GetTargetCount and GetTarget(index)) void GetTargets() const {}
00161 
00164     size_t GetTargetCount() const { return morphTargets.size(); }
00165 
00169     FCDMorphTarget* GetTarget(size_t index) { FUAssert(index < GetTargetCount(), return NULL); return morphTargets.at(index); }
00170     const FCDMorphTarget* GetTarget(size_t index) const { FUAssert(index < GetTargetCount(), return NULL); return morphTargets.at(index); } 
00176     FCDMorphTarget* AddTarget(FCDGeometry* geometry = NULL, float weight = 0.0f);
00177 
00180     FUDaeMorphMethod::Method GetMethod() const { return (FUDaeMorphMethod::Method) *method; }
00181 
00184     void SetMethod(FUDaeMorphMethod::Method _method) { method = _method; }
00185 
00190     bool IsSimilar(FCDEntity* entity);
00191 };
00192 
00193 #endif // _FCD_MORPH_CONTROLLER_H_
00194 

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