47 #include <OpenMesh/Core/Mesh/TriConnectivity.hh> 68 vhandles[0] = _vertex_handles[0];
76 vhandles[1] = _vertex_handles[i];
77 vhandles[2] = _vertex_handles[++i];
89 return add_face(&_vhandles.front(), _vhandles.size());
96 std::vector<VertexHandle> vhandles(_vhandles.begin(), _vhandles.end());
97 return add_face(&vhandles.front(), vhandles.size());
135 vl = to_vertex_handle(h1);
152 vr = to_vertex_handle(h1);
160 if (vl == vr)
return false;
165 for (vv_it =
vv_iter(v0); vv_it.is_valid(); ++vv_it)
168 for (vv_it =
vv_iter(v1); vv_it.is_valid(); ++vv_it)
171 for (vv_it =
vv_iter(v0); vv_it.is_valid(); ++vv_it)
172 if (
status(*vv_it).
tagged() && *vv_it != vl && *vv_it != vr)
241 set_next_halfedge_handle(h1, h0);
242 set_next_halfedge_handle(h0, h1);
245 set_face_handle(o1, f0);
246 set_face_handle(h0, f1);
247 set_face_handle(h1, f1);
250 set_halfedge_handle(f1, h0);
252 set_halfedge_handle(f0, o1);
271 assert( v1 == to_vertex_handle(_h1));
279 set_halfedge_handle(v0, v0v1);
280 set_halfedge_handle(v1, v1v0);
285 set_next_halfedge_handle(_h0, v0v1);
287 set_next_halfedge_handle(_h1, v1v0);
292 set_vertex_handle(*vih_it, v0);
369 set_vertex_handle(a0, va1);
370 set_vertex_handle(b0, vb1);
372 set_next_halfedge_handle(a0, a2);
373 set_next_halfedge_handle(a2, b1);
374 set_next_halfedge_handle(b1, a0);
376 set_next_halfedge_handle(b0, b2);
377 set_next_halfedge_handle(b2, a1);
378 set_next_halfedge_handle(a1, b0);
380 set_face_handle(a1, fb);
381 set_face_handle(b1, fa);
383 set_halfedge_handle(fa, a0);
384 set_halfedge_handle(fb, b0);
387 set_halfedge_handle(va0, a1);
389 set_halfedge_handle(vb0, b1);
408 set_halfedge_handle(_vh, h0);
409 set_vertex_handle(o0, _vh);
422 set_halfedge_handle(f0, h0);
423 set_halfedge_handle(f1, h2);
425 set_face_handle(h1, f0);
426 set_face_handle(t0, f0);
427 set_face_handle(h0, f0);
429 set_face_handle(h2, f1);
430 set_face_handle(t1, f1);
431 set_face_handle(e0, f1);
433 set_next_halfedge_handle(h0, h1);
434 set_next_halfedge_handle(h1, t0);
435 set_next_halfedge_handle(t0, h0);
437 set_next_halfedge_handle(e0, h2);
438 set_next_halfedge_handle(h2, t1);
439 set_next_halfedge_handle(t1, e0);
444 set_next_halfedge_handle(t1, h0);
460 set_halfedge_handle(f2, o1);
461 set_halfedge_handle(f3, o0);
463 set_face_handle(o1, f2);
464 set_face_handle(t2, f2);
465 set_face_handle(e1, f2);
467 set_face_handle(o2, f3);
468 set_face_handle(o0, f3);
469 set_face_handle(e2, f3);
471 set_next_halfedge_handle(e1, o1);
472 set_next_halfedge_handle(o1, t2);
473 set_next_halfedge_handle(t2, e1);
475 set_next_halfedge_handle(o0, e2);
476 set_next_halfedge_handle(e2, o2);
477 set_next_halfedge_handle(o2, o0);
482 set_next_halfedge_handle(o0, e1);
483 set_halfedge_handle(_vh, e1);
487 set_halfedge_handle(v2, t1);
497 const size_t nf = n_faces();
507 for (
auto vh : {v0, v1})
515 if (static_cast<size_t>(fh0.
idx()) >= nf)
void split(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Handle for a edge entity.
Handle for a face entity.
bool tagged() const
is tagged ?
bool is_collapse_ok(HalfedgeHandle _heh)
bool is_flip_ok(EdgeHandle _eh) const
Check whether flipping _eh is topologically correct.
SmartHalfedgeHandle next_halfedge_handle(SmartHalfedgeHandle _heh) const
returns the face handle of the opposite halfedge
HalfedgeHandle vertex_split(VertexHandle v0, VertexHandle v1, VertexHandle vl, VertexHandle vr)
Vertex Split: inverse operation to collapse().
void set_tagged(bool _b)
set tagged
void adjust_outgoing_halfedge(VertexHandle _vh)
SmartHalfedgeHandle prev_halfedge_handle(SmartHalfedgeHandle _heh) const
returns the face handle of the opposite halfedge
Handle for a halfedge entity.
int idx() const
Get the underlying index of this handle.
VertexVertexIter vv_iter(VertexHandle _vh)
vertex - vertex circulator
VertexIHalfedgeIter vih_iter(VertexHandle _vh)
vertex - incoming halfedge circulator
Handle for a vertex entity.
const StatusInfo & status(VertexHandle _vh) const
Status Query API.
SmartEdgeHandle edge_handle(SmartHalfedgeHandle _heh) const
returns the face handle of the opposite halfedge
bool is_valid() const
The handle is valid iff the index is not negative.
SmartHalfedgeHandle opposite_halfedge_handle(SmartHalfedgeHandle _heh) const
returns the face handle of the opposite halfedge
SmartFaceHandle add_face(const VertexHandle *_vhandles, size_t _vhs_size)
Add a face with arbitrary valence to the triangle mesh.
SmartHalfedgeHandle find_halfedge(VertexHandle _start_vh, VertexHandle _end_vh) const
Find halfedge from _vh0 to _vh1. Returns invalid handle if not found.
SmartVertexHandle make_smart(VertexHandle _vh, const PolyConnectivity *_mesh)
Creats a SmartVertexHandle from a VertexHandle and a Mesh.
HalfedgeHandle insert_loop(HalfedgeHandle _hh)
Helper for vertex split.
void flip(EdgeHandle _eh)
bool is_boundary(HalfedgeHandle _heh) const
Check if the halfedge is at the boundary.
SmartFaceHandle face_handle(SmartHalfedgeHandle _heh) const
returns the face handle of the opposite halfedge
SmartFaceHandle add_face(const std::vector< VertexHandle > &_vhandles)
Add and connect a new face.
HalfedgeHandle insert_edge(VertexHandle _vh, HalfedgeHandle _h0, HalfedgeHandle _h1)
Helper for vertex split.
void copy_all_properties(VertexHandle _vh_from, VertexHandle _vh_to, bool _copyBuildIn=false)
static const FaceHandle InvalidFaceHandle
Invalid handle.
void split_copy(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
VertexEdgeIter ve_iter(VertexHandle _vh)
vertex - edge circulator
SmartHalfedgeHandle halfedge_handle(SmartEdgeHandle _eh, unsigned int _i) const
returns the face handle of the opposite halfedge