Readability changes

This commit is contained in:
Mael Rouxel-Labbé 2018-01-15 14:25:45 +01:00
parent ae8b5bfaa4
commit dc14d129a4
2 changed files with 27 additions and 29 deletions

View File

@ -94,6 +94,7 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt,
//determine the last vertex of the hole: //determine the last vertex of the hole:
EdgeIterator hit = hole_end; EdgeIterator hit = hole_end;
--hit; --hit;
// to start: prev is the "last" vertex of the hole // to start: prev is the "last" vertex of the hole
// later: prev is the last vertex processed (previously) // later: prev is the last vertex processed (previously)
Vertex_handle prev = hit->first->vertex(rt.cw(hit->second)); Vertex_handle prev = hit->first->vertex(rt.cw(hit->second));
@ -104,9 +105,8 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt,
Vertex_handle current = hit->first->vertex(rt.cw(hit->second)); Vertex_handle current = hit->first->vertex(rt.cw(hit->second));
// a first Voronoi vertex of the cell of p: // a first Voronoi vertex of the cell of p:
vor[0] = rt.geom_traits().construct_weighted_circumcenter_2_object() vor[0] = rt.geom_traits().construct_weighted_circumcenter_2_object()(
(current->point(), current->point(), hit->first->vertex(rt.ccw(hit->second))->point(), p);
hit->first->vertex(rt.ccw(hit->second))->point(), p);
*vor_vertices++= vor[0]; *vor_vertices++= vor[0];
// triangulation of the Voronoi subcell: // triangulation of the Voronoi subcell:
@ -114,6 +114,7 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt,
Face_circulator fc = rt.incident_faces(current, hit->first); Face_circulator fc = rt.incident_faces(current, hit->first);
++fc; ++fc;
vor[1] = rt.dual(fc); vor[1] = rt.dual(fc);
// iteration over all other "old" Voronoi vertices // iteration over all other "old" Voronoi vertices
while(!fc->has_vertex(prev)) while(!fc->has_vertex(prev))
{ {
@ -125,9 +126,8 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt,
} }
//the second Voronoi vertex of the cell of p: //the second Voronoi vertex of the cell of p:
vor[2] = vor[2] = rt.geom_traits().construct_weighted_circumcenter_2_object()(
rt.geom_traits().construct_weighted_circumcenter_2_object() prev->point(),current->point(), p);
(prev->point(),current->point(),p);
*vor_vertices++ = vor[2]; *vor_vertices++ = vor[2];
area += polygon_area_2(vor.begin(), vor.end(), rt.geom_traits()); area += polygon_area_2(vor.begin(), vor.end(), rt.geom_traits());
@ -140,8 +140,7 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt,
++hit; ++hit;
} }
//get coordinate for hidden vertices // get coordinate for hidden vertices <=> the area of their Voronoi cell.
// <=> the area of their Voronoi cell.
// decomposition of the cell into triangles // decomposition of the cell into triangles
// vor1: dual of first triangle // vor1: dual of first triangle
// vor2, vor 3: duals of two consecutive triangles // vor2, vor 3: duals of two consecutive triangles
@ -215,10 +214,9 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt,
int li; int li;
Face_handle fh = rt.locate(p, lt, li, start); Face_handle fh = rt.locate(p, lt, li, start);
// the point must lie inside the convex hull otherwisereturn false: // the point must lie inside the convex hull, otherwise return false:
if(lt == Rt::OUTSIDE_AFFINE_HULL || lt == Rt::OUTSIDE_CONVEX_HULL if(lt == Rt::OUTSIDE_AFFINE_HULL || lt == Rt::OUTSIDE_CONVEX_HULL
|| (lt == Rt::EDGE || (lt == Rt::EDGE && (rt.is_infinite(fh) || rt.is_infinite(fh->neighbor(li)))))
&& (rt.is_infinite(fh) || rt.is_infinite(fh->neighbor(li)))))
return make_triple(out, Coord_type(1), false); return make_triple(out, Coord_type(1), false);
if(lt == Rt::VERTEX) if(lt == Rt::VERTEX)
@ -234,7 +232,6 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt,
std::list<Edge> hole; std::list<Edge> hole;
std::list<Vertex_handle> hidden_vertices; std::list<Vertex_handle> hidden_vertices;
rt.get_boundary_of_conflicts_and_hidden_vertices(p, rt.get_boundary_of_conflicts_and_hidden_vertices(p,
std::back_inserter(hole), std::back_inserter(hole),
std::back_inserter(hidden_vertices), std::back_inserter(hidden_vertices),

View File

@ -308,7 +308,8 @@ surface_neighbor_coordinates_3(const Dt& dt,
dt.vertices_on_conflict_zone_boundary(p, c, std::back_inserter(conflict_vertices)); dt.vertices_on_conflict_zone_boundary(p, c, std::back_inserter(conflict_vertices));
for (typename std::list< Vertex_handle >::iterator it = conflict_vertices.begin(); for (typename std::list< Vertex_handle >::iterator it = conflict_vertices.begin();
it != conflict_vertices.end();){ it != conflict_vertices.end();)
{
if(dt.is_infinite(*it)){ if(dt.is_infinite(*it)){
typename std::list< Vertex_handle >::iterator itp = it; typename std::list< Vertex_handle >::iterator itp = it;
it++; it++;