00001
00002
00003
00004
00005
00011 #ifndef _FCD_GEOMETRY_SOURCE_H_
00012 #define _FCD_GEOMETRY_SOURCE_H_
00013
00014
00015 #include "FCDocument/FCDObject.h"
00016 #include "FUtils/FUDaeEnum.h"
00017
00018 class FCDAnimated;
00019
00021 typedef vector<FCDAnimated*> FCDAnimatedList;
00022
00037 class FCOLLADA_EXPORT FCDGeometrySource : public FCDObjectWithId
00038 {
00039 private:
00040 DeclareObjectType
00041 fstring name;
00042 FloatList sourceData;
00043 uint32 sourceStride;
00044 xmlNode* sourceNode;
00045 FUDaeGeometryInput::Semantic sourceType;
00046
00047
00048 FCDAnimatedList animatedValues;
00049
00050 public:
00054 FCDGeometrySource(FCDocument* document);
00055
00058 virtual ~FCDGeometrySource();
00059
00063 const fstring& GetName() const { return name; }
00064
00068 FloatList& GetSourceData() { return sourceData; }
00069 const FloatList& GetSourceData() const { return sourceData; }
00077 uint32 GetSourceStride() const { return sourceStride; }
00078
00082 const string& GetSourceId() const { return GetDaeId(); }
00083
00086 FCDAnimatedList& GetAnimatedValues() { return animatedValues; }
00087 const FCDAnimatedList& GetAnimatedValues() const { return animatedValues; }
00094 xmlNode* GetSourceNode() { return sourceNode; }
00095
00101 FUDaeGeometryInput::Semantic GetSourceType() const { return sourceType; }
00102
00106 void SetName(const fstring& _name) { name = _name; }
00107
00115 void SetSourceData(const FloatList& _sourceData, uint32 _sourceStride, size_t offset=0, size_t count=0);
00116
00120 void SetSourceNode(xmlNode* _sourceNode) { sourceNode = _sourceNode; }
00121
00124 void SetSourceType(FUDaeGeometryInput::Semantic type);
00125
00128 FCDGeometrySource* Clone() const;
00129
00134 FUStatus LoadFromXML(xmlNode* sourceNode);
00135
00139 xmlNode* WriteToXML(xmlNode* parentNode) const;
00140 };
00141
00142 #endif // _FCD_GEOMETRY_SOURCE_H_