Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef HALFEDGEMESH_H_
00009 #define HALFEDGEMESH_H_
00010
00011 #ifdef _MSC_VER
00012 #include <hash_map>
00013 using stdext::hash_map;
00014 #else
00015 #include <ext/hash_map>
00016 using __gnu_cxx::hash_map;
00017 #endif
00018
00019 #include <vector>
00020 #include <stack>
00021 #include <set>
00022 #include <list>
00023
00024 using namespace std;
00025
00026 #include "Vertex.hpp"
00027 #include "Normal.hpp"
00028 #include "BaseMesh.hpp"
00029
00030 #include "HalfEdgeVertex.hpp"
00031 #include "HalfEdge.hpp"
00032 #include "HalfEdgeFace.hpp"
00033
00034
00035
00036 namespace lssr
00037 {
00038
00039 template<typename VertexT, typename NormalT>
00040 class HalfEdgeVertex;
00041
00042 template<typename VertexT, typename NormalT>
00043 class HalfEdgeFace;
00044
00048 template<typename VertexT, typename NormalT>
00049 class HalfEdgeMesh : public BaseMesh<VertexT, NormalT>
00050 {
00051 public:
00052 typedef HalfEdgeFace<VertexT, NormalT> HFace;
00053 typedef HalfEdgeVertex<VertexT, NormalT> HVertex;
00054 typedef HalfEdge<HVertex, HFace> HEdge;
00055
00059 HalfEdgeMesh();
00060
00064 virtual ~HalfEdgeMesh() {};
00065
00073 virtual void addVertex(VertexT v);
00074
00083 virtual void addNormal(NormalT n);
00084
00092 virtual void addTriangle(uint a, uint b, uint c);
00093
00098 virtual void finalize();
00099
00100
00101 private:
00102
00104 vector<HalfEdgeFace<VertexT, NormalT>*> m_faces;
00105
00107 vector<HalfEdgeVertex<VertexT, NormalT>*> m_vertices;
00108
00110 int m_globalIndex;
00111
00112 void printStats();
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 private:
00151
00161 HEdge* halfEdgeToVertex(HVertex* v, HVertex* next);
00162
00163
00164
00165
00166
00167
00168
00169
00170 };
00171
00172 }
00173
00174
00175 #include "HalfEdgeMesh.tcc"
00176
00177 #endif