diff --git a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h index f99434a40c1..5823a864829 100644 --- a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h +++ b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h @@ -63,7 +63,7 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt, // (=^ inside convex hull of neighbors) //out: the result of the coordinate computation //vor_vertices: the vertices of the power cell of p (to avoid recomputation) - CGAL_precondition(rt.dimension()==2); + CGAL_precondition(rt.dimension() == 2); typedef typename Rt::Geom_traits Traits; typedef typename Traits::FT Coord_type; @@ -88,13 +88,14 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt, return make_triple(out, Coord_type(1), true); } - std::vector vor(3); + std::vector vor(3); Coord_type area_sum(0); //determine the last vertex of the hole: EdgeIterator hit = hole_end; --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) Vertex_handle prev = hit->first->vertex(rt.cw(hit->second)); hit = hole_begin; @@ -103,17 +104,17 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt, Coord_type area(0); Vertex_handle current = hit->first->vertex(rt.cw(hit->second)); - //a first Voronoi vertex of the cell of p: - vor[0] = rt.geom_traits().construct_weighted_circumcenter_2_object() - (current->point(), - hit->first->vertex(rt.ccw(hit->second))->point(), p); + // a first Voronoi vertex of the cell of p: + vor[0] = rt.geom_traits().construct_weighted_circumcenter_2_object()( + current->point(), hit->first->vertex(rt.ccw(hit->second))->point(), p); *vor_vertices++= vor[0]; - //triangulation of the Voronoi subcell: - //a second vertex as base + // triangulation of the Voronoi subcell: + // a second vertex as base Face_circulator fc = rt.incident_faces(current, hit->first); ++fc; vor[1] = rt.dual(fc); + // iteration over all other "old" Voronoi vertices while(!fc->has_vertex(prev)) { @@ -125,26 +126,24 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt, } //the second Voronoi vertex of the cell of p: - vor[2] = - rt.geom_traits().construct_weighted_circumcenter_2_object() - (prev->point(),current->point(),p); - *vor_vertices++= vor[2]; + vor[2] = rt.geom_traits().construct_weighted_circumcenter_2_object()( + prev->point(),current->point(), p); + *vor_vertices++ = vor[2]; area += polygon_area_2(vor.begin(), vor.end(), rt.geom_traits()); - *out++= std::make_pair(current,area); + *out++= std::make_pair(current, area); area_sum += area; //update prev and hit: - prev= current; + prev = current; ++hit; } - //get coordinate for hidden vertices - // <=> the area of their Voronoi cell. - //decomposition of the cell into triangles - // vor1: dual of first triangle - // vor2, vor 3: duals of two consecutive triangles + // get coordinate for hidden vertices <=> the area of their Voronoi cell. + // decomposition of the cell into triangles + // vor1: dual of first triangle + // vor2, vor 3: duals of two consecutive triangles Face_circulator fc, fc_begin; for(; hidden_vertices_begin != hidden_vertices_end; ++hidden_vertices_begin) { @@ -164,7 +163,7 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt, ++fc; } - *out++= std::make_pair((*hidden_vertices_begin),area); + *out++ = std::make_pair((*hidden_vertices_begin), area); area_sum += area; } @@ -215,26 +214,24 @@ regular_neighbor_coordinates_vertex_2(const Rt& rt, int li; 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 - || (lt == Rt::EDGE - && (rt.is_infinite(fh) || rt.is_infinite(fh->neighbor(li))))) + || (lt == Rt::EDGE && (rt.is_infinite(fh) || rt.is_infinite(fh->neighbor(li))))) return make_triple(out, Coord_type(1), false); - if (lt == Rt::VERTEX) + if(lt == Rt::VERTEX) { //the point must be in conflict: CGAL_precondition(rt.power_test(fh->vertex(li)->point(), p) != ON_NEGATIVE_SIDE); - if (rt.power_test(fh->vertex(li)->point(), p) ==ON_ORIENTED_BOUNDARY) + if (rt.power_test(fh->vertex(li)->point(), p) == ON_ORIENTED_BOUNDARY) { - *out++= std::make_pair(fh->vertex(li),Coord_type(1)); + *out++ = std::make_pair(fh->vertex(li), Coord_type(1)); return make_triple(out, Coord_type(1), true); } } std::list hole; std::list hidden_vertices; - rt.get_boundary_of_conflicts_and_hidden_vertices(p, std::back_inserter(hole), std::back_inserter(hidden_vertices), diff --git a/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h b/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h index d37105eede0..4a5b3eb1ae9 100644 --- a/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h +++ b/Interpolation/include/CGAL/surface_neighbor_coordinates_3.h @@ -308,7 +308,8 @@ surface_neighbor_coordinates_3(const Dt& dt, dt.vertices_on_conflict_zone_boundary(p, c, std::back_inserter(conflict_vertices)); for (typename std::list< Vertex_handle >::iterator it = conflict_vertices.begin(); - it != conflict_vertices.end();){ + it != conflict_vertices.end();) + { if(dt.is_infinite(*it)){ typename std::list< Vertex_handle >::iterator itp = it; it++;