Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkHETriangleMesh.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
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     //virtual void DeepCopy(mitkDataObject *src);
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     // Helper for halfedge collapse.
00163     void _removeEdge(HalfEdgeHandle he);
00164     void _removeLoop(HalfEdgeHandle he);
00165 
00166     // Helper for vertex split.
00167     HalfEdgeHandle _insertLoop(HalfEdgeHandle he);
00168     HalfEdgeHandle _insertEdge(VertexHandle v, HalfEdgeHandle h0, HalfEdgeHandle h1);
00169 
00170     // for compatible with mitkTriangleMesh which is used frequently
00171     //Vertex3f *m_VertArray;
00172     //TriangleFace *m_FaceArray;
00173 
00174 private:
00175     mitkHETriangleMesh(const mitkHETriangleMesh&);
00176     void operator = (const mitkHETriangleMesh&);
00177 
00178 };
00179 
00180 
00181 #endif
00182 

Generated on Tue Feb 25 15:00:37 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3