00001 /* 00002 Copyright (C) 2005-2006 Feeling Software Inc. 00003 MIT License: http://www.opensource.org/licenses/mit-license.php 00004 */ 00005 00012 #ifndef _FCD_GEOMETRY_H_ 00013 #define _FCD_GEOMETRY_H_ 00014 00015 #include "FCDocument/FCDEntity.h" 00016 #include "FUtils/FUDaeEnum.h" 00017 00018 class FCDocument; 00019 class FCDGeometryMesh; 00020 class FCDGeometrySpline; 00021 00039 class FCOLLADA_EXPORT FCDGeometry : public FCDEntity 00040 { 00041 private: 00042 DeclareObjectType; 00043 00044 // Contains only one of the following, in order of importance. 00045 FCDGeometryMesh* mesh; 00046 FCDGeometrySpline* spline; 00047 00048 public: 00052 FCDGeometry(FCDocument* document); 00053 00057 virtual ~FCDGeometry(); 00058 00062 virtual Type GetType() const { return GEOMETRY; } 00063 00066 bool IsMesh() const { return mesh != NULL; } 00067 00071 FCDGeometryMesh* GetMesh() { return mesh; } 00072 const FCDGeometryMesh* GetMesh() const { return mesh; } 00077 FCDGeometryMesh* CreateMesh(); 00078 00081 bool IsSpline() const { return spline != NULL; } 00082 00086 FCDGeometrySpline* GetSpline() { return spline; } 00087 const FCDGeometrySpline* GetSpline() const { return spline; } 00092 FCDGeometrySpline* CreateSpline(); 00093 00108 FCDGeometry* Clone(FloatList& newPositions, uint32 newPositionsStride, FloatList& newNormals, uint32 newNormalsStride); 00109 00114 virtual FUStatus LoadFromXML(xmlNode* node); 00115 00119 virtual xmlNode* WriteToXML(xmlNode* parentNode) const; 00120 }; 00121 00122 #endif // _FCD_GEOMETRY_H_