mirror of https://github.com/CGAL/cgal
Clean-up after review
This commit is contained in:
parent
957eb36667
commit
0b2436d062
|
|
@ -1021,21 +1021,21 @@ add_face_to_border(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
|
|||
*
|
||||
* \tparam Graph must be a model of `MutableFaceGraph`
|
||||
* Let `h` be the halfedge of `e`, and let `v0` and `v1` be the source and target vertices of `h`.
|
||||
* Let `ep` and `e'p` be respectively the edges of `prev(h,g)` and `prev(opposite(h, g), g)`.
|
||||
* Let `hp` and `e'p` be respectively the edges of `prev(h,g)` and `prev(opposite(h, g), g)`.
|
||||
* Let `en` and `e'n` be respectively the edges of `opposite(next(h,g))` and `opposite(next(opposite(h, g), g))`.
|
||||
*
|
||||
* After the collapse of edge `e` the following holds:
|
||||
* - The edge `e` is no longer in `g`.
|
||||
* - The faces incident to edge `v0v1` are no longer in `g`.
|
||||
* - The faces incident to edge `e` are no longer in `g`.
|
||||
* - `v0` is no longer in `g`.
|
||||
* - If `h` is not a border halfedge, `ep` is no longer in `g` and is replaced by `en`.
|
||||
* - If `h` is not a border halfedge, `hp` is no longer in `g` and is replaced by `en`.
|
||||
* - If the opposite of `h` is not a border halfedge, `e'p` is no longer in `g` and is replaced by `e'n`.
|
||||
* - The halfedges kept in `g` that had `v0` as target now have `v1` as target, and similarly for the source.
|
||||
* - The halfedges kept in `g` that had that had v0 as target (resp. source) now have v1 as target (resp. source).
|
||||
* - No other incidence information is changed in `g`.
|
||||
*
|
||||
* \returns vertex `v1`.
|
||||
* \pre g must be a triangulated graph
|
||||
* \pre `does_satisfy_link_condition(v0v1,g) == true`.
|
||||
* \pre `does_satisfy_link_condition(e,g) == true`.
|
||||
*/
|
||||
template<typename Graph>
|
||||
typename boost::graph_traits<Graph>::vertex_descriptor
|
||||
|
|
|
|||
|
|
@ -51,14 +51,14 @@ collapse_edge_test()
|
|||
|
||||
//case 1: General Case.
|
||||
{
|
||||
halfedge_descriptor e = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(e, test_mesh);
|
||||
halfedge_descriptor he = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(he, test_mesh);
|
||||
halfedge_descriptor eno = opposite(en, test_mesh);
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(e, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(e, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(e, test_mesh), test_mesh) == v1;
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(he, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
|
||||
assert(ok);
|
||||
char found = 0;
|
||||
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
|
||||
|
|
@ -75,19 +75,19 @@ collapse_edge_test()
|
|||
//case 2: collapsing edge is not itself a border, but is incident upon a border edge that is removed.
|
||||
{
|
||||
CGAL::copy_face_graph(m, test_mesh);
|
||||
halfedge_descriptor e = find_halfedge(0,0.5,
|
||||
-0.75,0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
halfedge_descriptor he = find_halfedge(0,0.5,
|
||||
-0.75,0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
|
||||
e = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(e, test_mesh);
|
||||
he = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(he, test_mesh);
|
||||
halfedge_descriptor eno = opposite(en, test_mesh);
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(e, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(e, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(e, test_mesh), test_mesh) == v1;
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(he, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
|
||||
assert(ok);
|
||||
char found = 0;
|
||||
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
|
||||
|
|
@ -103,19 +103,19 @@ collapse_edge_test()
|
|||
//case 3: collapsing edge is not itself a border, but is incident upon a border edge that is not removed
|
||||
{
|
||||
CGAL::copy_face_graph(m, test_mesh);
|
||||
halfedge_descriptor e = find_halfedge(1.5,0,
|
||||
0.75,0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
halfedge_descriptor he = find_halfedge(1.5,0,
|
||||
0.75,0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
|
||||
e = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(e, test_mesh);
|
||||
he = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(he, test_mesh);
|
||||
halfedge_descriptor eno = opposite(en, test_mesh);
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(e, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(e, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(e, test_mesh), test_mesh) == v1;
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(he, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
|
||||
assert(ok);
|
||||
char found = 0;
|
||||
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
|
||||
|
|
@ -131,29 +131,29 @@ collapse_edge_test()
|
|||
//case 4: collapsing edge is itself a border
|
||||
{
|
||||
CGAL::copy_face_graph(m, test_mesh);
|
||||
halfedge_descriptor e = find_halfedge(-0.5, 0,
|
||||
0, -0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
e = find_halfedge(0, -0.5,
|
||||
-0.5, 0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
e = find_halfedge(0, -0.5,
|
||||
0.75, -0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
halfedge_descriptor he = find_halfedge(-0.5, 0,
|
||||
0, -0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
he = find_halfedge(0, -0.5,
|
||||
-0.5, 0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
he = find_halfedge(0, -0.5,
|
||||
0.75, -0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
|
||||
|
||||
e = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(e, test_mesh);
|
||||
he = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
halfedge_descriptor en = next(he, test_mesh);
|
||||
halfedge_descriptor eno = opposite(en, test_mesh);
|
||||
halfedge_descriptor ep_prime = prev(opposite(e, test_mesh), test_mesh);
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(e, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(e, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(e, test_mesh), test_mesh) == v1;
|
||||
halfedge_descriptor ep_prime = prev(opposite(he, test_mesh), test_mesh);
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(he, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
|
||||
assert(ok);
|
||||
char found = 0;
|
||||
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
|
||||
|
|
@ -170,31 +170,31 @@ collapse_edge_test()
|
|||
//case 5 singular case.
|
||||
{
|
||||
CGAL::copy_face_graph(m, test_mesh);
|
||||
halfedge_descriptor e = find_halfedge(0.75,0.5,
|
||||
1.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
e = find_halfedge(0.75,-0.5,
|
||||
1.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
e = find_halfedge(0,0.5,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
e = find_halfedge(0.5,0,
|
||||
0,-0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
halfedge_descriptor he = find_halfedge(0.75,0.5,
|
||||
1.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
he = find_halfedge(0.75,-0.5,
|
||||
1.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
he = find_halfedge(0,0.5,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
he = find_halfedge(0.5,0,
|
||||
0,-0.5,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
|
||||
e = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(e, test_mesh);
|
||||
halfedge_descriptor ep = prev(e, test_mesh);
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(e, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(e, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(e, test_mesh), test_mesh) == v1;
|
||||
he = find_halfedge(-0.5,0,
|
||||
0.5,0,
|
||||
test_mesh);
|
||||
CGAL::Euler::remove_face(he, test_mesh);
|
||||
halfedge_descriptor ep = prev(he, test_mesh);
|
||||
halfedge_descriptor eno_prime = opposite(next(opposite(he, test_mesh), test_mesh), test_mesh);
|
||||
vertex_descriptor v1 = target(he, test_mesh);
|
||||
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
|
||||
assert(ok);
|
||||
char found = 0;
|
||||
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
|
||||
|
|
|
|||
|
|
@ -37,14 +37,14 @@ Release date: September 2018
|
|||
- `CGAL::Polygon_mesh_processing::transform()`
|
||||
|
||||
- Fix a bug in `isotropic_remeshing()` making constrained vertices missing in the output
|
||||
- Guarantee that constrained vertices are kept in the remeshed mesh,
|
||||
and not only constrained points like before.
|
||||
|
||||
### CGAL and the Boost Graph Library (BGL)
|
||||
|
||||
- Update the function `CGAL::Euler::collapse_edge` so that the target
|
||||
vertex of the edge collapsed is always kept after the collapse.
|
||||
- Improve the function `CGAL::Euler::collapse_edge` so that the target
|
||||
vertex of the collapsed edge is always kept after the collapse.
|
||||
|
||||
- Guarantee that constrained vertices are kept in the remeshed mesh,
|
||||
and not only constrained points like before.
|
||||
|
||||
Release 4.12
|
||||
------------
|
||||
|
|
|
|||
|
|
@ -778,14 +778,14 @@ namespace internal {
|
|||
set_halfedge(face(ep_p, mesh_), ep_p, mesh_);
|
||||
if (face(en_p, mesh_) != boost::graph_traits<PM>::null_face())
|
||||
set_halfedge(face(en_p, mesh_), en_p, mesh_);
|
||||
CGAL_assertion(mesh_.is_valid());
|
||||
CGAL_assertion(is_valid(mesh_));
|
||||
}
|
||||
}
|
||||
|
||||
//perform collapse
|
||||
CGAL_assertion(target(halfedge(e, mesh_), mesh_) == vb);
|
||||
vertex_descriptor vkept = CGAL::Euler::collapse_edge(e, mesh_);
|
||||
CGAL_assertion(mesh_.is_valid());
|
||||
CGAL_assertion(is_valid(mesh_));
|
||||
CGAL_assertion(vkept == vb);//is the constrained point still here
|
||||
++nb_collapses;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue