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

GenericVertex.h

Go to the documentation of this file.
00001 
00002 //                            GenericVertex.h                                 //
00004 
00005 #ifndef GENERICVERTEX_H
00006 #define GENERICVERTEX_H
00007 
00008 #include "MeshTypes.h"
00009 
00010 #include <vector>
00011 
00012 namespace X3DTK {
00013 namespace Mesh {
00014 
00015 template<class A, class B, class C> class GenericEdge;
00016 template<class A, class B, class C> class GenericFace;
00017 
00019 
00020 template<class VData, class EData, class FData>
00021 class GenericVertex
00022 {
00023   template<class A, class B, class C, class D> friend class TemplateMesh;
00024 public:
00026   GenericVertex(unsigned int i)
00027   : _index(i) {};
00029   ~GenericVertex() {};
00030 
00032   inline unsigned int getIndex() const {return _index;};
00034   const MGenericEdge<EData, FData, VData> &getREdges() 
00035   {
00036     for (MGenericEdge<EData, FData, VData>::iterator it = _rEdges.begin(); it != _rEdges.end(); ++it)
00037     {
00038       if ((*it)->getAVertex() != this)
00039         (*it)->inverseDirection();
00040     }
00041     
00042     return _rEdges;
00043   };
00045   inline const MGenericFace<FData, VData, EData> &getRFaces() const {return _rFaces;};
00047   inline VData &data() {return _data;};
00049   inline const VData &data() const {return _data;};
00050   
00051 private:
00052   const unsigned int _index;
00053   MGenericEdge<EData, FData, VData> _rEdges;
00054   MGenericFace<FData, VData, EData> _rFaces;
00055   VData _data;
00056 
00058   void addREdge(GenericEdge<EData, FData, VData> *E) {_rEdges.back() = E; _rEdges.push_back((GenericEdge<EData, FData, VData> *)(0x1));};
00060   void addRFace(GenericFace<FData, VData, EData> *F) {_rFaces.back() = F; _rFaces.push_back((GenericFace<FData, VData, EData> *)(0x1));};
00062   inline const MGenericEdge<EData, FData, VData> &getREdgesConst() const {return _rEdges;};
00063 };
00064 
00065 }
00066 }
00067 
00068 #endif

Generated on Wed Jun 18 14:06:20 2003 for X3DToolKit by doxygen1.3