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());
114 if (
status(edge_handle(v0v1)).deleted() )
132 h1 = next_halfedge_handle(v0v1);
133 h2 = next_halfedge_handle(h1);
135 vl = to_vertex_handle(h1);
149 h1 = next_halfedge_handle(v1v0);
150 h2 = next_halfedge_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)
210 vlv1 = prev_halfedge_handle(halfedge_handle(v1));
212 vrv1 = prev_halfedge_handle(halfedge_handle(v1));
239 set_next_halfedge_handle(prev_halfedge_handle(h0), o1);
240 set_next_halfedge_handle(o1, next_halfedge_handle(h0));
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);
284 set_next_halfedge_handle(v0v1, next_halfedge_handle(_h0));
285 set_next_halfedge_handle(_h0, v0v1);
286 set_next_halfedge_handle(v1v0, next_halfedge_handle(_h1));
287 set_next_halfedge_handle(_h1, v1v0);
292 set_vertex_handle(*vih_it, v0);
296 set_face_handle(v0v1, face_handle(_h0));
297 set_face_handle(v1v0, face_handle(_h1));
301 if (face_handle(v0v1).is_valid())
302 set_halfedge_handle(face_handle(v0v1), v0v1);
303 if (face_handle(v1v0).is_valid())
304 set_halfedge_handle(face_handle(v1v0), v1v0);
329 VertexHandle ah = to_vertex_handle(next_halfedge_handle(hh));
330 VertexHandle bh = to_vertex_handle(next_halfedge_handle(oh));
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);
386 if (halfedge_handle(va0) == b0)
387 set_halfedge_handle(va0, a1);
388 if (halfedge_handle(vb0) == a0)
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);
443 set_next_halfedge_handle(prev_halfedge_handle(h0), t1);
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);
481 set_next_halfedge_handle(e1, next_halfedge_handle(o0));
482 set_next_halfedge_handle(o0, e1);
483 set_halfedge_handle(_vh, e1);
486 if (halfedge_handle(v2) == h0)
487 set_halfedge_handle(v2, t1);
494 const VertexHandle v0 = to_vertex_handle(halfedge_handle(_eh, 0));
495 const VertexHandle v1 = to_vertex_handle(halfedge_handle(_eh, 1));
497 const int nf = n_faces();
507 for (
auto vh : {v0, v1})
514 FaceHandle fh1 = face_handle(opposite_halfedge_handle(prev_halfedge_handle(h)));
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.
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)
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.
bool is_valid() const
The handle is valid iff the index is not negative.
SmartFaceHandle add_face(const VertexHandle *_vhandles, size_t _vhs_size)
Add a face with arbitrary valence to the triangle mesh.
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.
HalfedgeHandle find_halfedge(VertexHandle _start_vh, VertexHandle _end_vh) const
Find halfedge from _vh0 to _vh1. Returns invalid handle if not found.
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