52 #ifndef OPENMESH_TRIMESH_HH 53 #define OPENMESH_TRIMESH_HH 60 #include <OpenMesh/Core/Mesh/PolyMeshT.hh> 61 #include <OpenMesh/Core/Mesh/Tags.hh> 90 template <
class Kernel>
102 static constexpr
bool is_polymesh() {
return false; }
106 enum { IsPolyMesh = 0 };
107 enum { IsTriMesh = 1 };
128 typedef typename PolyMesh::HalfedgeHandle HalfedgeHandle;
129 typedef typename PolyMesh::EdgeHandle EdgeHandle;
130 typedef typename PolyMesh::FaceHandle FaceHandle;
135 typedef typename PolyMesh::VertexIter VertexIter;
136 typedef typename PolyMesh::ConstVertexIter ConstVertexIter;
137 typedef typename PolyMesh::EdgeIter EdgeIter;
138 typedef typename PolyMesh::ConstEdgeIter ConstEdgeIter;
139 typedef typename PolyMesh::FaceIter FaceIter;
140 typedef typename PolyMesh::ConstFaceIter ConstFaceIter;
169 explicit TriMeshT(PolyMesh rhs) : PolyMesh((rhs.triangulate(), rhs))
215 VertexHandle _vl, VertexHandle _vr)
216 {
return PolyMesh::vertex_split(this->
add_vertex(_v0_point), _v1, _vl, _vr); }
255 VertexHandle _vl, VertexHandle _vr)
256 {
return PolyMesh::vertex_split(_v0, _v1, _vl, _vr); }
267 inline VertexHandle
split(EdgeHandle _eh,
const Point& _p)
270 const VertexHandle vh = this->
add_vertex(_p); Kernel::split(_eh, vh);
return vh;
281 inline VertexHandle
split_copy(EdgeHandle _eh,
const Point& _p)
284 const VertexHandle vh = this->
add_vertex(_p); Kernel::split_copy(_eh, vh);
return vh;
294 inline void split(EdgeHandle _eh, VertexHandle _vh)
297 Kernel::split(_eh, _vh);
310 Kernel::split_copy(_eh, _vh);
322 inline VertexHandle
split(FaceHandle _fh,
const Point& _p)
334 inline VertexHandle
split_copy(FaceHandle _fh,
const Point& _p)
335 {
const VertexHandle vh = this->
add_vertex(_p); PolyMesh::split_copy(_fh, vh);
return vh; }
345 HalfedgeHandle he0 = this->halfedge_handle(_fh);
346 HalfedgeHandle he1 = this->next_halfedge_handle(he0);
347 HalfedgeHandle he2 = this->next_halfedge_handle(he1);
349 EdgeHandle eh0 = this->edge_handle(he0);
350 EdgeHandle eh1 = this->edge_handle(he1);
351 EdgeHandle eh2 = this->edge_handle(he2);
354 VertexHandle p0 = this->to_vertex_handle(he0);
355 VertexHandle p1 = this->to_vertex_handle(he1);
356 VertexHandle p2 = this->to_vertex_handle(he2);
368 const bool split0 = !this->is_boundary(eh0);
369 const bool split1 = !this->is_boundary(eh1);
370 const bool split2 = !this->is_boundary(eh2);
373 this->delete_face(_fh);
389 this->add_face(v0 , p0, v1);
390 this->add_face(p2, v0 , v2);
391 this->add_face(v2,v1,p1);
392 this->add_face(v2 , v0, v1);
402 inline void split(FaceHandle _fh, VertexHandle _vh)
413 { PolyMesh::split_copy(_fh, _vh); }
429 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_TRIMESH_C) 430 #define OPENMESH_TRIMESH_TEMPLATES 431 #include "TriMeshT_impl.hh" 434 #endif // OPENMESH_TRIMESH_HH defined Kernel::Halfedge Halfedge
Halfedge type.
HalfedgeHandle vertex_split(VertexHandle _v0, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
Connectivity tag indicating that the tagged mesh has triangle connectivity.
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Kernel::Point Point
Coordinate type.
Kernel::Color Color
Color type.
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
Kernel::Face Face
Face type.
Kernel::Scalar Scalar
Scalar type.
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
void split(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
VertexHandle split_copy(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
void split(FaceHandle _fh)
Face split (= 1-to-4) split, splits edges at midpoints and adds 4 new faces in the interior)...
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
static constexpr bool is_trimesh()
Determine whether this is a PolyMeshT or TriMeshT (This function does not check the per face vertex c...
void split(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
void split_copy(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Kernel::FaceEdgeIter FaceEdgeIter
Circulator.
Kernel::Normal Normal
Normal type.
TriMeshT()
Default constructor.
virtual ~TriMeshT()
Destructor.
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Connectivity tag indicating that the tagged mesh has polygon connectivity.
VertexHandle split_copy(FaceHandle _fh, const Point &_p)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
void split_copy(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Kernel::Vertex Vertex
Vertex type.
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
static constexpr bool is_polymesh()
Determine whether this is a PolyMeshT or TriMeshT (This function does not check the per face vertex c...
VertexHandle split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Kernel::Edge Edge
Edge type.
Normal calc_face_normal(FaceHandle _fh) const
VertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)