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))
219 VertexHandle _vl, VertexHandle _vr)
220 {
return PolyMesh::vertex_split(this->
add_vertex(_v0_point), _v1, _vl, _vr); }
263 VertexHandle _vl, VertexHandle _vr)
264 {
return PolyMesh::vertex_split(_v0, _v1, _vl, _vr); }
302 inline void split(EdgeHandle _eh, VertexHandle _vh)
305 Kernel::split(_eh, _vh);
318 Kernel::split_copy(_eh, _vh);
353 HalfedgeHandle he0 = this->halfedge_handle(_fh);
354 HalfedgeHandle he1 = this->next_halfedge_handle(he0);
355 HalfedgeHandle he2 = this->next_halfedge_handle(he1);
357 EdgeHandle eh0 = this->edge_handle(he0);
358 EdgeHandle eh1 = this->edge_handle(he1);
359 EdgeHandle eh2 = this->edge_handle(he2);
362 VertexHandle p0 = this->to_vertex_handle(he0);
363 VertexHandle p1 = this->to_vertex_handle(he1);
364 VertexHandle p2 = this->to_vertex_handle(he2);
376 const bool split0 = !this->is_boundary(eh0);
377 const bool split1 = !this->is_boundary(eh1);
378 const bool split2 = !this->is_boundary(eh2);
381 this->delete_face(_fh);
397 this->add_face(v0 , p0, v1);
398 this->add_face(p2, v0 , v2);
399 this->add_face(v2,v1,p1);
400 this->add_face(v2 , v0, v1);
410 inline void split(FaceHandle _fh, VertexHandle _vh)
421 { PolyMesh::split_copy(_fh, _vh); }
429 const HalfedgeHandle heh = this->halfedge_handle(_fh);
447 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_TRIMESH_C) 448 #define OPENMESH_TRIMESH_TEMPLATES 449 #include "TriMeshT_impl.hh" 452 #endif // OPENMESH_TRIMESH_HH defined void split(FaceHandle _fh)
Face split (= 1-to-4) split, splits edges at midpoints and adds 4 new faces in the interior)...
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Kernel::Edge Edge
Edge type.
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
SmartVertexHandle split_copy(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Kernel::Color Color
Color type.
Connectivity tag indicating that the tagged mesh has polygon connectivity.
Kernel::FaceEdgeIter FaceEdgeIter
Circulator.
Kernel::Normal Normal
Normal type.
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Kernel::Vertex Vertex
Vertex type.
TriMeshT()
Default constructor.
Kernel::Point Point
Coordinate type.
HalfedgeHandle vertex_split(VertexHandle _v0, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
SmartVertexHandle split_copy(FaceHandle _fh, const Point &_p)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
SmartVertexHandle split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
void split(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
static constexpr bool is_trimesh()
Determine whether this is a PolyMeshT or TriMeshT (This function does not check the per face vertex c...
Kernel::Face Face
Face type.
HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
Vertex Split: inverse operation to collapse().
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
void split_copy(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
virtual ~TriMeshT()
Destructor.
Normal calc_face_normal(FaceHandle _fh) const
Scalar calc_sector_area(HalfedgeHandle _in_heh) const
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Scalar calc_face_area(FaceHandle _fh) const
Calculates the area of a face.
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
SmartVertexHandle add_vertex(const Point &_p)
SmartVertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Connectivity tag indicating that the tagged mesh has triangle connectivity.
Kernel::Scalar Scalar
Scalar type.
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
void split(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
Smart version of VertexHandle contains a pointer to the corresponding mesh and allows easier access t...
static constexpr bool is_polymesh()
Determine whether this is a PolyMeshT or TriMeshT (This function does not check the per face vertex c...
Kernel::Halfedge Halfedge
Halfedge type.
void split_copy(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.