From 97c00a797d90b24d8dd6a2ae454e6f7e5ff433c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 20 Jan 2015 19:44:05 +0100 Subject: [PATCH] report isolated vertices --- .../CGAL/boost/graph/split_graph_into_polylines.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h index 61d57625595..0cb3874e9a4 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -92,7 +92,6 @@ void split_graph_into_polylines(Graph& graph, BOOST_FOREACH(vertex_descriptor v, vertices(graph)){ typename boost::graph_traits::degree_size_type n = degree(v, graph); - CGAL_assertion( n == 0 || n == 1 || n == 2); } BOOST_FOREACH(edge_descriptor e, edges(graph)){ @@ -177,7 +176,14 @@ split_graph_into_polylines(const Graph& graph, std::set terminal; BOOST_FOREACH(vertex_descriptor v, vertices(g)){ - if (degree(v, g) == 1) terminal.insert(v); + int n = degree(v, g); + if ( n == 1 ) terminal.insert(v); + if ( n ==0 ){ + //isolated vertex + polyline_visitor.start_new_polyline(); + polyline_visitor.add_node(g[v]); + polyline_visitor.end_polyline(); + } } // go over all polylines and provide the description to the visitor