From 3ba205339efd4e5f771f59f0fb0c42bd2131e483 Mon Sep 17 00:00:00 2001 From: Ophir Setter Date: Tue, 11 Sep 2007 07:50:27 +0000 Subject: [PATCH] Adding insertion function that receives visitor - was needed for Envelope_3 --- .../include/CGAL/Arr_spherical_arc_traits_2.h | 1 + .../include/CGAL/Arrangement_2.h | 3 +- .../Arrangement_on_surface_2_global.h | 40 +++++++++++++------ .../CGAL/graph_traits_Dual_Arrangement_2.h | 1 + 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_arc_traits_2.h index a194836d87f..450a7419049 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_arc_traits_2.h @@ -407,6 +407,7 @@ public: typedef Arr_extended_direction_3 Point_2; typedef Arr_spherical_arc_3 X_monotone_curve_2; typedef Arr_spherical_arc_3 Curve_2; + typedef unsigned int Multiplicity; public: /// \name Basic functor definitions diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h index 82d2c191927..8cc28a97703 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h @@ -54,12 +54,11 @@ private: typedef Default_planar_topology Default_topology; +public: typedef Arrangement_on_surface_2 Base; -public: - typedef GeomTraits_ Geometry_traits_2; typedef Dcel_ Dcel; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index f17ea52a312..a4e2f9e235d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -60,20 +60,21 @@ CGAL_BEGIN_NAMESPACE // const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, // mpl_::bool_< true>)' // -template +template void insert (Arrangement_on_surface_2& arr, const typename GeomTraits::Curve_2& c, - const PointLocation& pl, boost::is_same::type) + const PointLocation& pl, ZoneVisitor &visitor, + boost::is_same::type) { typedef Arrangement_on_surface_2 Arr; - typedef typename TopTraits::Zone_insertion_visitor Zone_visitor; + typedef ZoneVisitor Zone_visitor; // Obtain an arrangement accessor. Arr_accessor arr_access (arr); - // Define a zone-computation object an a visitor that performs the + // Initialize a zone-computation object an a visitor that performs the // incremental insertion. - Zone_visitor visitor; Arrangement_zone_2 arr_zone (arr, &visitor); // Break the input curve into x-monotone subcurves and isolated points. @@ -134,20 +135,21 @@ void insert (Arrangement_on_surface_2& arr, // mpl_::bool_< true>)' // // -template +template void insert(Arrangement_on_surface_2& arr, const typename GeomTraits::X_monotone_curve_2& c, - const PointLocation& pl, boost::is_same::type) + const PointLocation& pl, ZoneVisitor &visitor, + boost::is_same::type) { typedef Arrangement_on_surface_2 Arr; - typedef typename TopTraits::Zone_insertion_visitor Zone_visitor; + typedef ZoneVisitor Zone_visitor; // Obtain an arrangement accessor. Arr_accessor arr_access (arr); - // Define a zone-computation object an a visitor that performs the + // Initialize a zone-computation object an a visitor that performs the // incremental insertion. - Zone_visitor visitor; Arrangement_zone_2 arr_zone (arr, &visitor); // Initialize the zone-computation object with the given curve. @@ -167,16 +169,28 @@ void insert(Arrangement_on_surface_2& arr, //----------------------------------------------------------------------------- // Common interface for the insert of the Curve_2 and X_monotone_curve_2 -template +template void insert (Arrangement_on_surface_2& arr, - const Curve& c, const PointLocation& pl) + const Curve& c, const PointLocation& pl, ZoneVisitor &visitor) { typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2; typedef typename boost::is_same::type Is_x_monotone; - return insert(arr, c, pl, Is_x_monotone()); + return insert(arr, c, pl, visitor, Is_x_monotone()); +} + +template +void insert (Arrangement_on_surface_2& arr, + const Curve& c, const PointLocation& pl) +{ + typedef Arrangement_on_surface_2 Arr; + typedef typename TopTraits::Zone_insertion_visitor Zone_visitor; + + Zone_visitor visitor; + insert (arr, c, pl, visitor); } //----------------------------------------------------------------------------- diff --git a/Arrangement_on_surface_2/include/CGAL/graph_traits_Dual_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/graph_traits_Dual_Arrangement_2.h index 8a346957243..e0eef0f86ae 100644 --- a/Arrangement_on_surface_2/include/CGAL/graph_traits_Dual_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/graph_traits_Dual_Arrangement_2.h @@ -27,6 +27,7 @@ */ #include +#include CGAL_BEGIN_NAMESPACE