diff --git a/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h b/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h index 2533372d079..6df2dd06d0f 100644 --- a/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h +++ b/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationCostFunction.h @@ -26,11 +26,11 @@ public: /*! Given a vertex in constraint iterator `viq` computes `vip=std::prev(viq)` and `vir=std::next(vir)`, and the cost of removing vertex `*viq`, replacing edges `(*vip,*viq)` and `(*viq,*vir)` with edge `(*vip,*vir)`. -\param ct The underlying constrained Delaunay triangulation with constraint hierarchy which embeds the polyline constraints +\param ct The underlying constrained Delaunay triangulation which embeds the polyline constraints \param viq The vertex in constraint iterator of the vertex to remove \returns The cost for removing `*viq`. The value `boost::none` can be returned to indicate an infinite or uncomputable cost. -\tparam CDT must be `CGAL::Constrained_Delaunay_triangulation_2` with a vertex type that +\tparam CDT must be `CGAL::Constrained_triangulation_plus_2` with a vertex type that is model of `PolylineSimplificationVertexBase_2`. `CDT::Geom_traits` must be model of the concept `ConstrainedDelaunayTriangulationTraits_2`. diff --git a/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationStopPredicate.h b/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationStopPredicate.h index d2b84ec28ce..62e84c66f48 100644 --- a/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationStopPredicate.h +++ b/Polyline_simplification_2/doc/Polyline_simplification_2/Concepts/PolylineSimplificationStopPredicate.h @@ -16,13 +16,13 @@ public : /*! Indicates if the simplification must be stopped. This is called right before each vertex is about to be removed. - \param ct The underlying constrained Delaunay triangulation with constraint hierarchy which embeds the polyline constraints + \param ct The underlying constrained Delaunay triangulation which embeds the polyline constraints \param q The current vertex about to be removed \param cost The associated cost for removing the current vertex (as given by `PolylineSimplificationCostFunction`) \param initial_count The initial number of vertices in the entire polyline set (including intersection vertices not in any source polyline) \param current_count The current number of vertices \return `true` if the algorithm should stop, `false` if it should continue. -\tparam CDT must be `CGAL::Constrained_Delaunay_triangulation_2` with a vertex type that +\tparam CDT must be `CGAL::Constrained_triangulation_plus_2` with a vertex type that is model of `PolylineSimplificationVertexBase_2`. */ template diff --git a/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt b/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt index ca09e72818b..d27c7fd1bc6 100644 --- a/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt +++ b/Polyline_simplification_2/doc/Polyline_simplification_2/Polyline_simplification_2.txt @@ -86,7 +86,7 @@ The maximum squared distance is the maximum of the squared Euclidean distances between each point on the original polyline between `p` and `r` and the line segment `(p,r)`. Let \f$s_0,...,s_n\f$ be the points strictly between `p` and `r` on the original polyline. The cost of -removing vertex `q` is: \f$ v_1 = \max \{ squared\_distance((p,r), s_i) | +removing vertex `q` is: \f$ v_1 = \max \{ \mathrm{squared\_distance}((p,r), s_i) | i=0,..,n\} \f$ \cgalFigureBegin{figure_maxDist,maxDist.png} @@ -104,9 +104,11 @@ the candidate vertex `q` and all its adjacent vertices (except `p` and regions of the same polyline. Let \f$t_0,...,t_m\f$ be the points of the vertices adjacent to vertex -`q`, different from `p` and `r` and let \f$ v_2 = \min \{ squared\_distance((p,r), +`q`, different from `p` and `r` and let \f$ v_2 = \min \{ \mathrm{squared\_distance}((p,r), t_i) | i=0,..,n\}\f$. The cost of removing vertex `q` is -\f$v_1/v_2\f$. See also Figure \cgalFigureRef{figure_scaledAndHybrid}. +\f$v_1/v_2\f$, and it is +infinity when the set of points \f${t_1..t_m}\f$ +is empty (possible if the point `q` is on the convex hull). +See also Figure \cgalFigureRef{figure_scaledAndHybrid}. This distance measure gives lower priority to vertices with close neighboring polylines. diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index 9e33a2c5a80..3462b8404e5 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -307,7 +307,7 @@ operator()() Simplifies a single polygon. -\tparam Traits must be a model of `PolylineSimplificationTraits_2` +\tparam Traits must be a model of `ConstrainedDelaunayTriangulationTraits_2` \tparam CostFunction must be a model of `PolylineSimplificationCostFunction`. \tparam StopFunction must be a model of `PolylineSimplificationStopPredicate` @@ -409,9 +409,9 @@ Simplifies a single polyline in a triangulation with polylines as constraints. \param cid The constraint identifier of the polyline constraint to simplify \param cost The cost function \param stop The stop function -\param remove_points If `true` the function `ct.remove_points_without_corresponding_vertex()` is called. +\param remove_points If `true` the function \link CGAL::Constrained_triangulation_plus_2::remove_points_without_corresponding_vertex() `ct.remove_points_without_corresponding_vertex()` \endlink is called. \returns the number of removed vertices -\tparam CDT must be `CGAL::Constrained_Delaunay_triangulation_2` with a vertex type that +\tparam CDT must be `CGAL::Constrained_triangulation_plus_2` with a vertex type that is model of `PolylineSimplificationVertexBase_2`. \tparam CostFunction must be a model of `PolylineSimplificationCostFunction` \tparam StopFunction must be a model of `PolylineSimplificationStopPredicate` @@ -440,9 +440,9 @@ Simplifies all polylines in a triangulation with polylines as constraints. \param ct The underlying constrained Delaunay triangulation which embeds the polyline constraints \param cost The cost function \param stop The stop function -\param remove_points If `true` the function `ct.remove_points_without_corresponding_vertex()` is called. +\param remove_points If `true` the function \link CGAL::Constrained_triangulation_plus_2::remove_points_without_corresponding_vertex() `ct.remove_points_without_corresponding_vertex()`\endlink is called. \returns the number of removed vertices -\tparam CDT must be `CGAL::Constrained_Delaunay_triangulation_2` with a vertex type that +\tparam CDT must be `CGAL::Constrained_triangulation_plus_2` with a vertex type that is model of `PolylineSimplificationVertexBase_2`. \tparam CostFunction must be a model of `PolylineSimplificationCostFunction` \tparam StopFunction must be a model of `PolylineSimplificationStopPredicate`