00001 #ifndef ENTITY_H 00002 #define ENTITY_H 00003 00011 #include <string> 00012 00013 #include "XMLWrapper.h" 00014 #include "TriangleSet.h" 00015 #include "TransformMatrix.h" 00016 00017 #ifndef BUILDING_DOX 00018 class TransformMatrix; 00019 class PatchSequenceEnumerator; 00020 class TriangleSetExt; 00021 #endif 00022 00026 class Entity 00027 { 00028 public: 00029 Entity(); 00030 virtual ~Entity(); 00031 00035 Entity(const Entity&); 00036 00040 Entity& operator=(const Entity&); 00041 00047 static Entity* create (XMLNode *from ); 00048 00055 void setTransformMatrix (TransformMatrix *matrix); 00056 00062 virtual void deserialize (XMLNode *from); 00063 00068 void divide (float size); 00069 00074 PatchSequenceEnumerator* createPatchSequenceEnumerator ( ); 00075 00080 TriangleSetExt* computeVertexColors(); 00081 00086 XMLNode serialize ( ); 00087 00093 void setName( XMLNode* from, const char* implicit="entity"); 00094 00099 void setName( std::string name ) { this->name_ = name; } 00100 00105 std::string& getName() { return this->name_; } 00106 00115 #ifndef NDEBUG 00116 static bool colorFromXMLNode( XMLNode* from, XMLCSTR attName, Color& to, int wlevel=2 ); 00117 #else 00118 static bool colorFromXMLNode( XMLNode* from, XMLCSTR attName, Color& to ); 00119 #endif 00120 00128 static void setColors( XMLNode* from, Color& em, Color& refl, Color& rad ); 00129 protected: 00134 void addTriangle(Triangle *triangle); 00135 00136 private: 00137 TransformMatrix transformMatrix_; 00138 TriangleSet triangleSet_; 00139 TriangleSet *patchSet_; 00140 std::string name_; 00141 }; 00142 00143 #endif // ENTITY_H
1.5.2