47 #include <OpenMesh/Core/Mesh/TriConnectivity.hh> 52 TriConnectivity::FaceHandle
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());
106 if (
status(edge_handle(v0v1)).deleted() )
124 h1 = next_halfedge_handle(v0v1);
125 h2 = next_halfedge_handle(h1);
127 vl = to_vertex_handle(h1);
141 h1 = next_halfedge_handle(v1v0);
142 h2 = next_halfedge_handle(h1);
144 vr = to_vertex_handle(h1);
152 if (vl == vr)
return false;
157 for (vv_it =
vv_iter(v0); vv_it.is_valid(); ++vv_it)
160 for (vv_it =
vv_iter(v1); vv_it.is_valid(); ++vv_it)
163 for (vv_it =
vv_iter(v0); vv_it.is_valid(); ++vv_it)
164 if (
status(*vv_it).
tagged() && *vv_it != vl && *vv_it != vr)
202 vlv1 = prev_halfedge_handle(halfedge_handle(v1));
204 vrv1 = prev_halfedge_handle(halfedge_handle(v1));
231 set_next_halfedge_handle(prev_halfedge_handle(h0), o1);
232 set_next_halfedge_handle(o1, next_halfedge_handle(h0));
233 set_next_halfedge_handle(h1, h0);
234 set_next_halfedge_handle(h0, h1);
237 set_face_handle(o1, f0);
238 set_face_handle(h0, f1);
239 set_face_handle(h1, f1);
242 set_halfedge_handle(f1, h0);
244 set_halfedge_handle(f0, o1);
263 assert( v1 == to_vertex_handle(_h1));
271 set_halfedge_handle(v0, v0v1);
272 set_halfedge_handle(v1, v1v0);
276 set_next_halfedge_handle(v0v1, next_halfedge_handle(_h0));
277 set_next_halfedge_handle(_h0, v0v1);
278 set_next_halfedge_handle(v1v0, next_halfedge_handle(_h1));
279 set_next_halfedge_handle(_h1, v1v0);
284 set_vertex_handle(*vih_it, v0);
288 set_face_handle(v0v1, face_handle(_h0));
289 set_face_handle(v1v0, face_handle(_h1));
293 if (face_handle(v0v1).is_valid())
294 set_halfedge_handle(face_handle(v0v1), v0v1);
295 if (face_handle(v1v0).is_valid())
296 set_halfedge_handle(face_handle(v1v0), v1v0);
321 VertexHandle ah = to_vertex_handle(next_halfedge_handle(hh));
322 VertexHandle bh = to_vertex_handle(next_halfedge_handle(oh));
361 set_vertex_handle(a0, va1);
362 set_vertex_handle(b0, vb1);
364 set_next_halfedge_handle(a0, a2);
365 set_next_halfedge_handle(a2, b1);
366 set_next_halfedge_handle(b1, a0);
368 set_next_halfedge_handle(b0, b2);
369 set_next_halfedge_handle(b2, a1);
370 set_next_halfedge_handle(a1, b0);
372 set_face_handle(a1, fb);
373 set_face_handle(b1, fa);
375 set_halfedge_handle(fa, a0);
376 set_halfedge_handle(fb, b0);
378 if (halfedge_handle(va0) == b0)
379 set_halfedge_handle(va0, a1);
380 if (halfedge_handle(vb0) == a0)
381 set_halfedge_handle(vb0, b1);
400 set_halfedge_handle(_vh, h0);
401 set_vertex_handle(o0, _vh);
414 set_halfedge_handle(f0, h0);
415 set_halfedge_handle(f1, h2);
417 set_face_handle(h1, f0);
418 set_face_handle(t0, f0);
419 set_face_handle(h0, f0);
421 set_face_handle(h2, f1);
422 set_face_handle(t1, f1);
423 set_face_handle(e0, f1);
425 set_next_halfedge_handle(h0, h1);
426 set_next_halfedge_handle(h1, t0);
427 set_next_halfedge_handle(t0, h0);
429 set_next_halfedge_handle(e0, h2);
430 set_next_halfedge_handle(h2, t1);
431 set_next_halfedge_handle(t1, e0);
435 set_next_halfedge_handle(prev_halfedge_handle(h0), t1);
436 set_next_halfedge_handle(t1, h0);
452 set_halfedge_handle(f2, o1);
453 set_halfedge_handle(f3, o0);
455 set_face_handle(o1, f2);
456 set_face_handle(t2, f2);
457 set_face_handle(e1, f2);
459 set_face_handle(o2, f3);
460 set_face_handle(o0, f3);
461 set_face_handle(e2, f3);
463 set_next_halfedge_handle(e1, o1);
464 set_next_halfedge_handle(o1, t2);
465 set_next_halfedge_handle(t2, e1);
467 set_next_halfedge_handle(o0, e2);
468 set_next_halfedge_handle(e2, o2);
469 set_next_halfedge_handle(o2, o0);
473 set_next_halfedge_handle(e1, next_halfedge_handle(o0));
474 set_next_halfedge_handle(o0, e1);
475 set_halfedge_handle(_vh, e1);
478 if (halfedge_handle(v2) == h0)
479 set_halfedge_handle(v2, t1);
486 const VertexHandle v0 = to_vertex_handle(halfedge_handle(_eh, 0));
487 const VertexHandle v1 = to_vertex_handle(halfedge_handle(_eh, 1));
489 const int nf = n_faces();
499 for (
auto vh : {v0, v1})
506 FaceHandle fh1 = face_handle(opposite_halfedge_handle(prev_halfedge_handle(h)));
FaceHandle add_face(const VertexHandle *_vhandles, size_t _vhs_size)
Add a face with arbitrary valence to the triangle mesh.
void set_tagged(bool _b)
set tagged
bool is_flip_ok(EdgeHandle _eh) const
Check whether flipping _eh is topologically correct.
bool is_collapse_ok(HalfedgeHandle _heh)
Handle for a vertex entity.
bool is_boundary(HalfedgeHandle _heh) const
Check if the halfedge is at the boundary.
static const FaceHandle InvalidFaceHandle
Invalid handle.
void adjust_outgoing_halfedge(VertexHandle _vh)
void split(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
HalfedgeHandle find_halfedge(VertexHandle _start_vh, VertexHandle _end_vh) const
Find halfedge from _vh0 to _vh1. Returns invalid handle if not found.
Handle for a halfedge entity.
const StatusInfo & status(VertexHandle _vh) const
Status Query API.
void split_copy(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
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)
void flip(EdgeHandle _eh)
Handle for a face entity.
VertexVertexIter vv_iter(VertexHandle _vh)
vertex - vertex circulator
VertexIHalfedgeIter vih_iter(VertexHandle _vh)
vertex - incoming halfedge circulator
VertexEdgeIter ve_iter(VertexHandle _vh)
vertex - edge circulator
HalfedgeHandle vertex_split(VertexHandle v0, VertexHandle v1, VertexHandle vl, VertexHandle vr)
Vertex Split: inverse operation to collapse().
Handle for a edge entity.
int idx() const
Get the underlying index of this handle.
bool is_valid() const
The handle is valid iff the index is not negative.
bool tagged() const
is tagged ?
HalfedgeHandle insert_loop(HalfedgeHandle _hh)
Helper for vertex split.
FaceHandle add_face(const std::vector< VertexHandle > &_vhandles)
Add and connect a new face.