diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h index cef1af9c55f..da7bf476941 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Constrained_triangulation_plus_2.h @@ -294,11 +294,19 @@ std::size_t insert_constraints(PointIterator points_first, PointIterator points_ /*! -splits into constraints the subconstraint graph g at vertices of degree greater than 2. +splits into polylines the graph `g` at vertices of degree greater than 2 +and at vertices for which `is_terminal(v)==true`. \warning all existing constraints will be discarded. + +\param is_terminal An optional function returning true if the vertex +`v` of degree 2 is a polyline endpoint and false otherwise. If no +function is provided, a default function is provided that returns true +for vertices whose degree is different from 2. + +\sa `split_graph_into_polylines()` */ -void split_subconstraint_graph_into_constraints(); +void split_subconstraint_graph_into_constraints(const std::function& is_terminal); /*! removes the constraint `cid`, without removing the points from the triangulation. diff --git a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt index 9451f88be77..fc94bccbf5e 100644 --- a/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt +++ b/Triangulation_2/doc/Triangulation_2/Triangulation_2.txt @@ -1124,6 +1124,21 @@ through the edge. \cgalExample{Triangulation_2/polylines_triangulation.cpp} +\subsection Triangulation_2ExampleBuildingFromSoup Example: Building a Triangulated Arrangement of Polylines from a Segment Soup + +The `Constrained_triangulation_plus_2` structure is initialized by a +set of polylines. As users may only be able to provide a disconnected +segment soup as input, a member function +[split_subconstraint_graph_into_constraints()](@ref Constrained_triangulation_plus_2::split_subconstraint_graph_into_constraints()) +is provided: this function identifies the polylines by connecting +segments until a vertex whose degree is different than 2 is reached. + +The following code shows how a "blind" insertion of disconnected +polylines can be processed into a set of well-defined polyline +constraints in a `Constrained_triangulation_plus_2`: + +\cgalExample{Triangulation_2/segment_soup_to_polylines.cpp} + \section Section_2D_Triangulations_Hierarchy The Triangulation Hierarchy The class `Triangulation_hierarchy_2` diff --git a/Triangulation_2/doc/Triangulation_2/dependencies b/Triangulation_2/doc/Triangulation_2/dependencies index 84dba85f07d..22ae69dcfef 100644 --- a/Triangulation_2/doc/Triangulation_2/dependencies +++ b/Triangulation_2/doc/Triangulation_2/dependencies @@ -4,6 +4,7 @@ STL_Extension Algebraic_foundations Circulator Stream_support +BGL TDS_2 Triangulation_3 Spatial_sorting