00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkHETriangleMesh_h
00012 #define __mitkHETriangleMesh_h
00013
00014 #include "mitkHEMesh.h"
00015
00016 class mitkTriangleMesh;
00017
00025 class MITK_COMMON_API mitkHETriangleMesh : public mitkHEMesh
00026 {
00027 public:
00028 MITK_TYPE(mitkHETriangleMesh, mitkHEMesh)
00029
00030 virtual void PrintSelf(ostream &os);
00031
00035 mitkHETriangleMesh();
00036
00044 bool CreateFrom(mitkTriangleMesh *mesh);
00045
00059 bool CreateFrom(size_type vertNum, Vertex3f const *verts,
00060 size_type faceNum, TriangleFace const *faces,
00061 float const *boundingBox = NULL);
00062
00067 virtual int GetDataObjectType() {return MITK_HE_TRIANGLE_MESH;};
00068
00072 virtual void Initialize();
00073
00078
00079
00089 FaceHandle AddFace(VertexHandle v0, VertexHandle v1, VertexHandle v2)
00090 {
00091 VertexHandle v[3];
00092 v[0] = v0; v[1] = v1; v[2] = v2;
00093 return mitkHEMesh::AddFace(3, v);
00094 }
00095
00105 FaceHandle AddFace(VertexHandle vertices[3])
00106 { return mitkHEMesh::AddFace(3, vertices); }
00107
00114 bool IsCollapseOk(HalfEdgeHandle he);
00115
00121 VertexHandle Collapse(HalfEdgeHandle he);
00122
00133 HalfEdgeHandle VertexSplit(VertexHandle v0, VertexHandle v1, VertexHandle vL, VertexHandle vR);
00134
00143 HalfEdgeHandle VertexSplit(Vertex &vert, VertexHandle v1, VertexHandle vL, VertexHandle vR)
00144 { return VertexSplit(AddVertex(vert),v1,vL,vR); }
00145
00151 bool IsFlipOk(EdgeHandle edge) const;
00152
00157 void Flip(EdgeHandle edge);
00158
00159 protected:
00160 virtual ~mitkHETriangleMesh();
00161
00162
00163 void _removeEdge(HalfEdgeHandle he);
00164 void _removeLoop(HalfEdgeHandle he);
00165
00166
00167 HalfEdgeHandle _insertLoop(HalfEdgeHandle he);
00168 HalfEdgeHandle _insertEdge(VertexHandle v, HalfEdgeHandle h0, HalfEdgeHandle h1);
00169
00170
00171
00172
00173
00174 private:
00175 mitkHETriangleMesh(const mitkHETriangleMesh&);
00176 void operator = (const mitkHETriangleMesh&);
00177
00178 };
00179
00180
00181 #endif
00182