Line 83... |
Line 83... |
83 |
bool remove_face(FaceID fid);
|
83 |
bool remove_face(FaceID fid);
|
84 |
|
84 |
|
85 |
/** Remove an edge from the Manifold.
|
85 |
/** Remove an edge from the Manifold.
|
86 |
This function will remove the faces on either side and the edge itself in the process. Thus,
|
86 |
This function will remove the faces on either side and the edge itself in the process. Thus,
|
87 |
it is a simple application of remove_face. */
|
87 |
it is a simple application of remove_face. */
|
88 |
bool remove_edge(HalfEdgeID hid);
|
88 |
bool remove_edge(HalfEdgeID hid);
|
89 |
|
89 |
|
90 |
/** Remove a vertex from the Manifold.
|
90 |
/** Remove a vertex from the Manifold.
|
91 |
This function merges all faces around the vertex into one and then removes
|
91 |
This function merges all faces around the vertex into one and then removes
|
92 |
this resulting face. */
|
92 |
this resulting face. */
|
93 |
bool remove_vertex(VertexID vid);
|
93 |
bool remove_vertex(VertexID vid);
|
Line 399... |
Line 399... |
399 |
for(; !w.full_circle(); w = w.circulate_vertex_ccw()) f(w);
|
399 |
for(; !w.full_circle(); w = w.circulate_vertex_ccw()) f(w);
|
400 |
return w.no_steps();
|
400 |
return w.no_steps();
|
401 |
}
|
401 |
}
|
402 |
inline int circulate_vertex_ccw(const Manifold& m, VertexID v, std::function<void(VertexID)> f)
|
402 |
inline int circulate_vertex_ccw(const Manifold& m, VertexID v, std::function<void(VertexID)> f)
|
403 |
{
|
403 |
{
|
404 |
return circulate_vertex_ccw(m, v, [&](Walker& w){f(w.vertex());});
|
404 |
return circulate_vertex_ccw(m, v, (std::function<void(Walker&)>)[&](Walker& w){f(w.vertex());});
|
405 |
}
|
405 |
}
|
406 |
inline int circulate_vertex_ccw(const Manifold& m, VertexID v, std::function<void(FaceID)> f)
|
406 |
inline int circulate_vertex_ccw(const Manifold& m, VertexID v, std::function<void(FaceID)> f)
|
407 |
{
|
407 |
{
|
408 |
return circulate_vertex_ccw(m, v, [&](Walker& w){f(w.face());});
|
408 |
return circulate_vertex_ccw(m, v, (std::function<void(Walker&)>)[&](Walker& w){f(w.face());});
|
409 |
}
|
409 |
}
|
410 |
inline int circulate_vertex_ccw(const Manifold& m, VertexID v, std::function<void(HalfEdgeID)> f)
|
410 |
inline int circulate_vertex_ccw(const Manifold& m, VertexID v, std::function<void(HalfEdgeID)> f)
|
411 |
{
|
411 |
{
|
412 |
return circulate_vertex_ccw(m, v, [&](Walker& w){f(w.halfedge());});
|
412 |
return circulate_vertex_ccw(m, v, (std::function<void(Walker&)>)[&](Walker& w){f(w.halfedge());});
|
413 |
}
|
413 |
}
|
414 |
|
414 |
|
415 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(Walker&)> f)
|
415 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(Walker&)> f)
|
416 |
{
|
416 |
{
|
417 |
Walker w = m.walker(v);
|
417 |
Walker w = m.walker(v);
|
418 |
for(; !w.full_circle(); w = w.circulate_vertex_cw()) f(w);
|
418 |
for(; !w.full_circle(); w = w.circulate_vertex_cw()) f(w);
|
419 |
return w.no_steps();
|
419 |
return w.no_steps();
|
420 |
}
|
420 |
}
|
421 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(VertexID)> f)
|
421 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(VertexID)> f)
|
422 |
{
|
422 |
{
|
423 |
return circulate_vertex_cw(m, v, [&](Walker& w){f(w.vertex());});
|
423 |
return circulate_vertex_cw(m, v, (std::function<void(Walker&)>)[&](Walker& w){f(w.vertex());});
|
424 |
}
|
424 |
}
|
425 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(FaceID)> f)
|
425 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(FaceID)> f)
|
426 |
{
|
426 |
{
|
427 |
return circulate_vertex_cw(m, v, [&](Walker& w){f(w.face());});
|
427 |
return circulate_vertex_cw(m, v, (std::function<void(Walker&)>)[&](Walker& w){f(w.face());});
|
428 |
}
|
428 |
}
|
429 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(HalfEdgeID)> f)
|
429 |
inline int circulate_vertex_cw(const Manifold& m, VertexID v, std::function<void(HalfEdgeID)> f)
|
430 |
{
|
430 |
{
|
431 |
return circulate_vertex_cw(m, v, [&](Walker& w){f(w.halfedge());});
|
431 |
return circulate_vertex_cw(m, v, (std::function<void(Walker&)>)[&](Walker& w){f(w.halfedge());});
|
432 |
}
|
432 |
}
|
433 |
|
433 |
|
434 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(Walker&)> g)
|
434 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(Walker&)> g)
|
435 |
{
|
435 |
{
|
436 |
Walker w = m.walker(f);
|
436 |
Walker w = m.walker(f);
|
437 |
for(; !w.full_circle(); w = w.circulate_face_ccw()) g(w);
|
437 |
for(; !w.full_circle(); w = w.circulate_face_ccw()) g(w);
|
438 |
return w.no_steps();
|
438 |
return w.no_steps();
|
439 |
}
|
439 |
}
|
440 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(VertexID)> g)
|
440 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(VertexID)> g)
|
441 |
{
|
441 |
{
|
442 |
return circulate_face_ccw(m, f, [&](Walker& w){g(w.vertex());});
|
442 |
return circulate_face_ccw(m, f, (std::function<void(Walker&)>)[&](Walker& w){g(w.vertex());});
|
443 |
}
|
443 |
}
|
444 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(FaceID)> g)
|
444 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(FaceID)> g)
|
445 |
{
|
445 |
{
|
446 |
return circulate_face_ccw(m, f, [&](Walker& w){g(w.face());});
|
446 |
return circulate_face_ccw(m, f, (std::function<void(Walker&)>)[&](Walker& w){g(w.face());});
|
447 |
}
|
447 |
}
|
448 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(HalfEdgeID)> g)
|
448 |
inline int circulate_face_ccw(const Manifold& m, FaceID f, std::function<void(HalfEdgeID)> g)
|
449 |
{
|
449 |
{
|
450 |
return circulate_face_ccw(m, f, [&](Walker& w){g(w.halfedge());});
|
450 |
return circulate_face_ccw(m, f, (std::function<void(Walker&)>)[&](Walker& w){g(w.halfedge());});
|
451 |
}
|
451 |
}
|
452 |
|
452 |
|
453 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(Walker&)> g)
|
453 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(Walker&)> g)
|
454 |
{
|
454 |
{
|
455 |
Walker w = m.walker(f);
|
455 |
Walker w = m.walker(f);
|
456 |
for(; !w.full_circle(); w = w.circulate_face_cw()) g(w);
|
456 |
for(; !w.full_circle(); w = w.circulate_face_cw()) g(w);
|
457 |
return w.no_steps();
|
457 |
return w.no_steps();
|
458 |
}
|
458 |
}
|
459 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(VertexID)> g)
|
459 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(VertexID)> g)
|
460 |
{
|
460 |
{
|
461 |
return circulate_face_cw(m, f, [&](Walker& w){g(w.vertex());});
|
461 |
return circulate_face_cw(m, f, (std::function<void(Walker&)>)[&](Walker& w){g(w.vertex());});
|
462 |
}
|
462 |
}
|
463 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(FaceID)> g)
|
463 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(FaceID)> g)
|
464 |
{
|
464 |
{
|
465 |
return circulate_face_cw(m, f, [&](Walker& w){g(w.face());});
|
465 |
return circulate_face_cw(m, f, (std::function<void(Walker&)>)[&](Walker& w){g(w.face());});
|
466 |
}
|
466 |
}
|
467 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(HalfEdgeID)> g)
|
467 |
inline int circulate_face_cw(const Manifold& m, FaceID f, std::function<void(HalfEdgeID)> g)
|
468 |
{
|
468 |
{
|
469 |
return circulate_face_cw(m, f, [&](Walker& w){g(w.halfedge());});
|
469 |
return circulate_face_cw(m, f, (std::function<void(Walker&)>)[&](Walker& w){g(w.halfedge());});
|
470 |
}
|
470 |
}
|
471 |
|
471 |
|
472 |
|
472 |
|
473 |
}
|
473 |
}
|