Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Mesh_Mesh.h

Go to the documentation of this file.
00001 
00002 //                            Mesh_Mesh.h                                     //
00004 
00005 #ifndef MESH_MESH_H
00006 #define MESH_MESH_H
00007 
00008 #include "MeshSceneGraphTypes.h"
00009 #include "Mesh_TemplateMesh.h"
00010 
00011 namespace X3DTK {
00012 namespace MESH {
00013 
00015 
00016 class VertexFData
00017 {
00018 public:
00020   VertexFData();
00021 
00023   void setNormal(const SFVec3f &normal);
00025   void setColor(const SFColorRGBA &color);
00027   void setTexCoord(const SFVec2f &texCoord);
00028 
00030   inline const SFVec3f &getNormal() const {return _normal;};
00032   inline const SFColorRGBA &getColor() const {return _color;};
00034   inline const SFVec2f &getTexCoord() const {return _texCoord;};  
00035   
00036 private:
00037   SFVec3f _normal;
00038   SFColorRGBA _color;
00039   SFVec2f _texCoord;         
00040 };
00041 
00043 
00044 class VertexData
00045 {
00046 public:
00048   VertexData();
00050   ~VertexData();
00051   
00053   void setPoint(const SFPoint3f &point);
00055   void addFaceData(void *face, VertexFData *vdata);
00056   
00058   inline const SFPoint3f &getPoint() const {return _point;};
00060   VertexFData *getFaceData(void *face) const; 
00061   
00062 private:
00063   SFPoint3f _point;
00064   std::list<std::pair<void *, VertexFData *> > _FDataList;
00065 };
00066 
00068 
00069 class EdgeData
00070 {
00071 public:
00073   EdgeData();
00074 };
00075 
00077 
00078 class FaceData
00079 {
00080 public:
00082   FaceData();
00083   
00085   void setNormal(const SFVec3f &normal);
00087   void setColor(const SFColorRGBA &color);
00088   
00090   inline const SFVec3f &getNormal() const {return _normal;};
00092   inline const SFColorRGBA &getColor() const {return _color;};
00093   
00094 private:
00095   SFVec3f _normal;
00096   SFColorRGBA _color;
00097 };
00098 
00100 
00101 class MeshData
00102 {
00103 public:
00105   MeshData();
00106   
00108   void setVertexNormal(bool vertexNormal);
00110   void setVertexColor(bool vertexColor);
00112   void setVertexTexCoord(bool vertexTexCoord);
00114   void setFaceNormal(bool faceNormal);
00116   void setFaceColor(bool faceColor);
00117   
00119   inline bool hasVertexNormal() const {return _vertexNormal;};
00121   inline bool hasVertexColor() const {return _vertexColor;};
00123   inline bool hasVertexTexCoord() const {return _vertexTexCoord;};
00125   inline bool hasFaceNormal() const {return _faceNormal;};
00127   inline bool hasFaceColor() const {return _faceColor;};
00128   
00129 private:
00130   bool _vertexNormal; 
00131   bool _vertexColor; 
00132   bool _vertexTexCoord;
00133   bool _faceNormal;
00134   bool _faceColor;
00135 };
00136 
00137 typedef TemplateMesh<MeshData, VertexData, EdgeData, FaceData> Mesh;
00138 
00140 
00141 template<> 
00142 Mesh::TemplateMesh()
00143 {
00144   defineTypeName("Mesh");
00145 };
00146 
00147 }
00148 }
00149 
00150 #endif

Generated on Tue Oct 7 14:22:18 2003 for X3DToolKit by doxygen1.2.18