57 #ifndef OPENMESH_TRIMESH_HH 58 #define OPENMESH_TRIMESH_HH 64 #include <OpenMesh/Core/System/config.h> 65 #include <OpenMesh/Core/Mesh/PolyMeshT.hh> 94 template <
class Kernel>
106 enum { IsPolyMesh = 0 };
108 enum { IsTriMesh = 1 };
131 typedef typename PolyMesh::HalfedgeHandle HalfedgeHandle;
132 typedef typename PolyMesh::EdgeHandle EdgeHandle;
133 typedef typename PolyMesh::FaceHandle FaceHandle;
138 typedef typename PolyMesh::VertexIter VertexIter;
139 typedef typename PolyMesh::ConstVertexIter ConstVertexIter;
140 typedef typename PolyMesh::EdgeIter EdgeIter;
141 typedef typename PolyMesh::ConstEdgeIter ConstEdgeIter;
142 typedef typename PolyMesh::FaceIter FaceIter;
143 typedef typename PolyMesh::ConstFaceIter ConstFaceIter;
172 explicit TriMeshT(PolyMesh rhs) : PolyMesh((rhs.triangulate(), rhs))
218 VertexHandle _vl, VertexHandle _vr)
219 {
return PolyMesh::vertex_split(this->
add_vertex(_v0_point), _v1, _vl, _vr); }
258 VertexHandle _vl, VertexHandle _vr)
259 {
return PolyMesh::vertex_split(_v0, _v1, _vl, _vr); }
270 inline VertexHandle
split(EdgeHandle _eh,
const Point& _p)
273 const VertexHandle vh = this->
add_vertex(_p); Kernel::split(_eh, vh);
return vh;
284 inline VertexHandle
split_copy(EdgeHandle _eh,
const Point& _p)
287 const VertexHandle vh = this->
add_vertex(_p); Kernel::split_copy(_eh, vh);
return vh;
297 inline void split(EdgeHandle _eh, VertexHandle _vh)
300 Kernel::split(_eh, _vh);
313 Kernel::split_copy(_eh, _vh);
325 inline VertexHandle
split(FaceHandle _fh,
const Point& _p)
337 inline VertexHandle
split_copy(FaceHandle _fh,
const Point& _p)
338 {
const VertexHandle vh = this->
add_vertex(_p); PolyMesh::split_copy(_fh, vh);
return vh; }
348 HalfedgeHandle he0 = this->halfedge_handle(_fh);
349 HalfedgeHandle he1 = this->next_halfedge_handle(he0);
350 HalfedgeHandle he2 = this->next_halfedge_handle(he1);
352 EdgeHandle eh0 = this->edge_handle(he0);
353 EdgeHandle eh1 = this->edge_handle(he1);
354 EdgeHandle eh2 = this->edge_handle(he2);
357 VertexHandle p0 = this->to_vertex_handle(he0);
358 VertexHandle p1 = this->to_vertex_handle(he1);
359 VertexHandle p2 = this->to_vertex_handle(he2);
371 const bool split0 = !this->is_boundary(eh0);
372 const bool split1 = !this->is_boundary(eh1);
373 const bool split2 = !this->is_boundary(eh2);
376 this->delete_face(_fh);
392 this->add_face(v0 , p0, v1);
393 this->add_face(p2, v0 , v2);
394 this->add_face(v2,v1,p1);
395 this->add_face(v2 , v0, v1);
405 inline void split(FaceHandle _fh, VertexHandle _vh)
416 { PolyMesh::split_copy(_fh, _vh); }
432 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_TRIMESH_C) 433 #define OPENMESH_TRIMESH_TEMPLATES 434 #include "TriMeshT.cc" 437 #endif // OPENMESH_TRIMESH_HH defined Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:178
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:139
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Definition: PolyMeshT.hh:180
Kernel::Color Color
Color type.
Definition: PolyMeshT.hh:119
static bool is_polymesh()
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex ...
Definition: TriMeshT.hh:109
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Definition: PolyMeshT.hh:179
Base type for a triangle mesh.
Definition: TriMeshT.hh:95
void split(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:297
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Definition: PolyMeshT.hh:165
Kernel::Vertex Vertex
Vertex type.
Definition: PolyMeshT.hh:127
void split_copy(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Definition: TriMeshT.hh:415
void split_copy(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:310
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:115
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
Definition: PolyMeshT.hh:183
TriMeshT()
Default constructor.
Definition: TriMeshT.hh:171
static bool is_trimesh()
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex ...
Definition: TriMeshT.hh:110
VertexHandle split_copy(FaceHandle _fh, const Point &_p)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Definition: TriMeshT.hh:337
HalfedgeHandle vertex_split(VertexHandle _v0, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
Definition: TriMeshT.hh:257
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
void split(FaceHandle _fh)
Face split (= 1-to-4) split, splits edges at midpoints and adds 4 new faces in the interior)...
Definition: TriMeshT.hh:345
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
Definition: PolyMeshT.hh:175
virtual ~TriMeshT()
Destructor.
Definition: TriMeshT.hh:177
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:113
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition: PolyMeshT.hh:125
Base type for a polygonal mesh.
Definition: PolyMeshT.hh:94
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Definition: PolyMeshT.hh:173
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:171
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:176
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition: PolyMeshT.hh:123
VertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:270
VertexHandle split_copy(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Definition: TriMeshT.hh:284
void split(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Definition: TriMeshT.hh:405
Kernel::Edge Edge
Edge type.
Definition: PolyMeshT.hh:131
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:166
Kernel::Halfedge Halfedge
Halfedge type.
Definition: PolyMeshT.hh:129
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:182
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Definition: PolyMeshT.hh:169
Helper class providing information about a vector type.
Definition: vector_traits.hh:93
Kernel::FaceEdgeIter FaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:172
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:177
Kernel::Normal Normal
Normal type.
Definition: PolyMeshT.hh:117
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition: PolyMeshT.hh:170
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:181
HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
Definition: TriMeshT.hh:217
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Definition: PolyMeshT.hh:238
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:167
Kernel::Face Face
Face type.
Definition: PolyMeshT.hh:133
Normal calc_face_normal(FaceHandle _fh) const
Calculate normal vector for face _fh (specialized for TriMesh).
Definition: TriMeshT.cc:79
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:168
VertexHandle split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Definition: TriMeshT.hh:325
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition: PolyMeshT.hh:121
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition: PolyMeshT.hh:563