Subject: CGAL users discussion list
List archive
- From: Efi Fogel <>
- To:
- Subject: Re: [cgal-discuss] use do_intersect() & zone() with Arrangement_with_history_2
- Date: Sun, 13 Jul 2014 10:31:49 +0300
There is a small typo in the CGAL 2D Arrangement code.
The next version of CGAL will include the fix.
If you want to fix it right away, you can apply the attached patch.
The next version of CGAL will include the fix.
If you want to fix it right away, you can apply the attached patch.
Thanks for the report!
Hi All,
I wonder if one could use do_intersect() & zone(), these two free
functions with an Arrangement_with_history_2 object. When I tried to
test do_intersect() with arr_with_hist I get this compile error:
error C2039: 'traits' : is not a member of
'CGAL::Arrangement_on_surface_2<GeomTraits_,TopTraits_>'
D:\codes\libs\CGAL-4.4\include\CGAL\Arrangement_2\Arrangement_on_surface_2_global.h
1522 1 curve_history
I simply added 3 lines of code to the
Arrangement_on_surface_2_example/curve_history.cpp file:
typedef CGAL::Arr_walk_along_line_point_location<Arr_with_hist_2> Walk_pl;
Walk_pl pl1(arr);
std::cout << "intersect? " << do_intersect(arr, Segment_2(Point_2(3,
2), Point_2(5, 3)), pl1) << std::endl;
This addition works with the incremental_insertion example. So my
guess is maybe it's not possible to use this function with
arr_with_hist? If I'm wrong, what is the right way to do it?
Thanks a lot!
Yajie.
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
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 50bda85..82f5440 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 @@ -14,7 +14,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Ron Wein <> // Baruch Zukerman <> @@ -55,21 +55,21 @@ namespace CGAL { // Insert a curve into the arrangement (incremental insertion). // The inserted curve may intersect the existing arrangement. // -// The last parameter is used to resolve ambiguity between this function and -// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and -// Curve_2 are the same class. -// The last parameter should be boost::false_type but we used a +// The last parameter is used to resolve ambiguity between this function and +// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and +// Curve_2 are the same class. +// The last parameter should be boost::false_type but we used a // workaround since it didn't compile in FC3_g++-3.4.4 with the error of: // -// error: no matching function for call to `do_intersect(Arrangement_2<>&, -// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, +// error: no matching function for call to `do_intersect(Arrangement_2<>&, +// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, // mpl_::bool_< true>)' // -template <class GeomTraits, class TopTraits, class PointLocation, +template <class GeomTraits, class TopTraits, class PointLocation, class ZoneVisitor> -void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, +void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const typename GeomTraits::Curve_2& c, - const PointLocation& pl, ZoneVisitor &visitor, + const PointLocation& pl, ZoneVisitor &visitor, boost::is_same<int, double>::type) { typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr; @@ -104,7 +104,7 @@ void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Initialize the zone-computation object with the given curve. arr_zone.init (*x_curve, pl); - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. arr_access.notify_before_global_change(); @@ -130,21 +130,21 @@ void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Insert an x-monotone curve into the arrangement (incremental insertion). // The inserted x-monotone curve may intersect the existing arrangement. // -// The last parameter is used to resolve ambiguity between this function and -// do_intersect of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the -// same class. The last parameter should be boost::true_type but we used a +// The last parameter is used to resolve ambiguity between this function and +// do_intersect of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the +// same class. The last parameter should be boost::true_type but we used a // workaround since it didn't compile in FC3_g++-3.4.4 with the error of: // -// error: no matching function for call to `do_intersect(Arrangement_2<>&, -// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, +// error: no matching function for call to `do_intersect(Arrangement_2<>&, +// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, // mpl_::bool_< true>)' // // -template <class GeomTraits, class TopTraits, class PointLocation, +template <class GeomTraits, class TopTraits, class PointLocation, class ZoneVisitor> void insert(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const typename GeomTraits::X_monotone_curve_2& c, - const PointLocation& pl, ZoneVisitor &visitor, + const PointLocation& pl, ZoneVisitor &visitor, boost::is_same<int, int>::type) { typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr; @@ -177,11 +177,11 @@ void insert(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, } std::cout << std::endl; std::cout << "xxxxxxxxxxxx" << std::endl; - } + } */ arr_zone.init (c, pl); - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. arr_access.notify_before_global_change(); @@ -195,16 +195,16 @@ void insert(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, //----------------------------------------------------------------------------- // Common interface for the insert of the Curve_2 and X_monotone_curve_2 -template <class GeomTraits, class TopTraits, class Curve, class PointLocation, +template <class GeomTraits, class TopTraits, class Curve, class PointLocation, class ZoneVisitor> void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const Curve& c, const PointLocation& pl, ZoneVisitor &visitor) { typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2; - + typedef typename boost::is_same<Curve, X_monotone_curve_2>::type Is_x_monotone; - + insert(arr, c, pl, visitor, Is_x_monotone()); } @@ -219,13 +219,13 @@ void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, typename PointLocation::Point_2*) { typedef typename TopTraits::Zone_insertion_visitor Zone_visitor; - + Zone_visitor visitor; insert (arr, c, pl, visitor); } //----------------------------------------------------------------------------- -// Insert a curve/x-monotone curve into the arrangement (incremental +// Insert a curve/x-monotone curve into the arrangement (incremental // insertion). // The inserted x-monotone curve may intersect the existing arrangement. // Overloaded version with no point location object - using the default point @@ -265,7 +265,7 @@ void insert_empty(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, * GeomTraits, use a reference to GeomTraits to avoid constructing a new one. * Otherwise, instantiate a local variable of the former and provide * the later as a single parameter to the constructor. - * + * * Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has * only an implicit constructor, (which takes *b as a parameter). */ @@ -298,7 +298,7 @@ void insert_empty(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, typedef typename TopTraits::Sweep_line_construction_visitor Construct_visitor; typedef typename Construct_visitor::Traits_2 Construct_traits; - + const GeomTraits * geom_traits = arr.geometry_traits(); Construct_visitor visitor(&arr); @@ -310,14 +310,14 @@ void insert_empty(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, * GeomTraits, use a reference to GeomTraits to avoid constructing a new one. * Otherwise, instantiate a local variable of the former and provide * the later as a single parameter to the constructor. - * + * * Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has * only an implicit constructor, (which takes *b as a parameter). */ typename boost::mpl::if_<boost::is_same<GeomTraits, Construct_traits>, const Construct_traits&, Construct_traits>::type traits(*geom_traits); - + // Define a sweep-line instance and perform the sweep. Sweep_line_2<typename Construct_visitor::Traits_2, Construct_visitor, typename Construct_visitor::Subcurve, @@ -344,7 +344,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, typedef typename Insert_visitor::Traits_2::X_monotone_curve_2 Ex_x_monotone_curve_2; typedef typename Insert_visitor::Traits_2::Point_2 Ex_point_2; - + const GeomTraits * geom_traits = arr.geometry_traits(); Insert_visitor visitor(&arr); @@ -356,7 +356,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, * GeomTraits, use a reference to GeomTraits to avoid constructing a new one. * Otherwise, instantiate a local variable of the former and provide * the later as a single parameter to the constructor. - * + * * Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has * only an implicit constructor, (which takes *b as a parameter). */ @@ -367,7 +367,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Create a set of existing as well as new curves and points. std::list<Ex_x_monotone_curve_2> ex_cvs; std::list<Ex_point_2> ex_pts; - + prepare_for_sweep(arr, begin_xcurves, end_xcurves, // the x-monotone curves begin_points, end_points, // the points (if any) @@ -384,18 +384,18 @@ void insert_non_empty(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, } //----------------------------------------------------------------------------- -// Insert a range of curves into the arrangement (aggregated insertion). -// The inserted curves may intersect one another and may also intersect the +// Insert a range of curves into the arrangement (aggregated insertion). +// The inserted curves may intersect one another and may also intersect the // existing arrangement. // -// The last parameter is used to resolve ambiguity between this function and -// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and -// Curve_2 are the same class. -// The last parameter should be boost::false_type but we used a +// The last parameter is used to resolve ambiguity between this function and +// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and +// Curve_2 are the same class. +// The last parameter should be boost::false_type but we used a // workaround since it didn't compile in FC3_g++-3.4.4 with the error of: // -// error: no matching function for call to `do_intersect(Arrangement_2<>&, -// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, +// error: no matching function for call to `do_intersect(Arrangement_2<>&, +// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, // mpl_::bool_< true>)' // template <class GeomTraits, class TopTraits, class InputIterator> @@ -410,7 +410,7 @@ void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Obtain an arrangement accessor. Arr_accessor<Arr> arr_access (arr); - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. arr_access.notify_before_global_change(); @@ -440,18 +440,18 @@ void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // insertion). The inserted x-monotone curves may intersect one another and // may also intersect the existing arrangement. // -// The last parameter is used to resolve ambiguity between this function and -// insert of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the -// same class. The last parameter should be boost::true_type but we used a +// The last parameter is used to resolve ambiguity between this function and +// insert of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the +// same class. The last parameter should be boost::true_type but we used a // workaround since it didn't compile in FC3_g++-3.4.4 with the error of: // -// error: no matching function for call to `do_intersect(Arrangement_2<>&, -// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, +// error: no matching function for call to `do_intersect(Arrangement_2<>&, +// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, // mpl_::bool_< true>)' // template <class GeomTraits, class TopTraits, class InputIterator> void insert(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, - InputIterator begin, InputIterator end, + InputIterator begin, InputIterator end, boost::is_same<int, int>::type) { typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr; @@ -459,7 +459,7 @@ void insert(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Obtain an arrangement accessor. Arr_accessor<Arr> arr_access (arr); - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. arr_access.notify_before_global_change(); @@ -486,12 +486,12 @@ void insert (Arrangement_on_surface_2<GeomTraits,TopTraits>& arr, InputIterator begin, InputIterator end) { typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2; - typedef typename std::iterator_traits<InputIterator>::value_type + typedef typename std::iterator_traits<InputIterator>::value_type Iterator_value_type; typedef typename boost::is_same<Iterator_value_type,X_monotone_curve_2>::type Is_x_monotone; - + return insert (arr, begin, end, Is_x_monotone()); } @@ -520,7 +520,7 @@ void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Initialize the zone-computation object with the given curve. arr_zone.init_with_hint (c, obj); - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. arr_access.notify_before_global_change(); @@ -555,7 +555,7 @@ CGAL_DEPRECATED void insert_x_monotone_curve /* DEPRECATED use insert() instead */ template <class GeomTraits, class TopTraits, class InputIterator> -CGAL_DEPRECATED void insert_x_monotone_curves +CGAL_DEPRECATED void insert_x_monotone_curves (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, InputIterator begin, InputIterator end) { @@ -696,8 +696,8 @@ insert_non_intersecting_curve vh2 = object_cast<Vertex_const_handle>(&obj2); } - // Notify the arrangement observers that a global operation is about to - // take place. + // Notify the arrangement observers that a global operation is about to + // take place. arr_access.notify_before_global_change(); // Check whether the located features containing the curve endpoints @@ -746,8 +746,8 @@ insert_non_intersecting_curve // << (*fh1)->number_of_outer_ccbs() << std::endl; // std::cout << "(*fh2)->number_of_outer_ccbs(): " // << (*fh2)->number_of_outer_ccbs() << std::endl; - - CGAL_assertion_msg + + CGAL_assertion_msg ((fh1 != NULL) && (fh2 != NULL) && ((*fh1) == (*fh2)), "The curve intersects the interior of existing edges."); @@ -799,7 +799,7 @@ void non_intersecting_insert_empty(Arrangement_on_surface_2<GeomTraits, Construct_visitor; Construct_visitor visitor(&arr); typename Construct_visitor::Traits_2 traits(*geom_traits); - + // Define a basic sweep-line instance (which is not supposed to handle // insersections) and perform the sweep. Basic_sweep_line_2<typename Construct_visitor::Traits_2, Construct_visitor, @@ -838,7 +838,7 @@ void non_intersecting_insert_empty(Arrangement_on_surface_2<GeomTraits, * GeomTraits, use a reference to GeomTraits to avoid constructing a new one. * Otherwise, instantiate a local variable of the former and provide * the later as a single parameter to the constructor. - * + * * Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has * only an implicit constructor, (which takes *b as a parameter). */ @@ -887,18 +887,18 @@ void non_intersecting_insert_non_empty(Arrangement_on_surface_2<GeomTraits, * GeomTraits, use a reference to GeomTraits to avoid constructing a new one. * Otherwise, instantiate a local variable of the former and provide * the later as a single parameter to the constructor. - * + * * Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has * only an implicit constructor, (which takes *b as a parameter). */ typename boost::mpl::if_<boost::is_same<GeomTraits, Insert_traits>, const Insert_traits&, Insert_traits>::type traits(*geom_traits); - + // Create a set of existing as well as new curves and points. std::list<Ex_x_monotone_curve_2> ex_cvs; std::list<Ex_point_2> ex_pts; - + prepare_for_sweep(arr, begin_xcurves, end_xcurves, // the x-monotone curves begin_points, end_points, // the points (if any) @@ -929,7 +929,7 @@ void insert_non_intersecting_curves // Obtain an arrangement accessor. Arr_accessor<Arr> arr_access (arr); - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. arr_access.notify_before_global_change(); @@ -963,7 +963,7 @@ remove_edge typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr; typedef Arr_traits_adaptor_2<GeomTraits> Traits_adaptor_2; - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. Arr_accessor<Arr> arr_access (arr); @@ -974,10 +974,10 @@ remove_edge bool is_removed[2]; v_ends[0] = e->source(); - is_removed[0] = + is_removed[0] = (v_ends[0]->is_at_open_boundary() || v_ends[0]->degree() == 1); v_ends[1] = e->target(); - is_removed[1] = + is_removed[1] = (v_ends[1]->is_at_open_boundary() || v_ends[1]->degree() == 1); // Remove the edge from the arrangement. @@ -987,7 +987,7 @@ remove_edge // curves associated with these edges can be merged, merge the two edges and // remove the vertex. - const Traits_adaptor_2 * traits = + const Traits_adaptor_2 * traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits()); typename Arr::Halfedge_around_vertex_circulator circ; @@ -1021,7 +1021,7 @@ remove_edge // Notify the arrangement observers that the global operation has been // completed. arr_access.notify_after_global_change(); - + // Return the face remaining after the removal of the edge. return (face); } @@ -1047,27 +1047,27 @@ insert_point (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Locate the given point in the arrangement. CGAL::Object obj = pl.locate (p); - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. Arr_accessor<Arr> arr_access (arr); arr_access.notify_before_global_change(); - if ((fh = object_cast<typename Arr::Face_const_handle>(&obj)) != NULL) + if ((fh = object_cast<typename Arr::Face_const_handle>(&obj)) != NULL) { // p lies inside a face: Insert it as an isolated vertex it the interior of // this face. vh_for_p = arr.insert_in_face_interior (p, arr.non_const_handle (*fh)); } - else if ((hh = - object_cast<typename Arr::Halfedge_const_handle>(&obj)) != NULL) + else if ((hh = + object_cast<typename Arr::Halfedge_const_handle>(&obj)) != NULL) { // p lies in the interior of an edge: Split this edge to create a new // vertex associated with p. typename GeomTraits::X_monotone_curve_2 sub_cv1, sub_cv2; typename Arr::Halfedge_handle split_he; - + arr.geometry_traits()->split_2_object() ((*hh)->curve(), p, sub_cv1, sub_cv2); @@ -1083,7 +1083,7 @@ insert_point (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // vertex. vh = object_cast<typename Arr::Vertex_const_handle>(&obj); CGAL_assertion (vh != NULL); - + vh_for_p = arr.modify_vertex (arr.non_const_handle (*vh), p); } @@ -1091,7 +1091,7 @@ insert_point (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // completed. arr_access.notify_after_global_change(); - // Return a handle for the vertex associated with p. + // Return a handle for the vertex associated with p. return (vh_for_p); } @@ -1106,7 +1106,7 @@ insert_point (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, { // Create a default point-location object and use it to insert the point. typename TopTraits::Default_point_location_strategy def_pl (arr); - + return (insert_point (arr, p, def_pl)); } @@ -1121,7 +1121,7 @@ bool remove_vertex typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr; typedef Arr_traits_adaptor_2<GeomTraits> Traits_adaptor_2; - // Notify the arrangement observers that a global operation is about to + // Notify the arrangement observers that a global operation is about to // take place. Arr_accessor<Arr> arr_access (arr); @@ -1187,7 +1187,7 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr; typedef GeomTraits Geometry_traits_2; typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; - + // Define the sweep-line types: typedef Sweep_line_do_curves_x_visitor<Geometry_traits_2> Visitor; typedef Sweep_line_2<Geometry_traits_2, Visitor> Sweep_line_2; @@ -1201,14 +1201,14 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) typedef typename Arr::Vertex_const_handle Vertex_const_handle; typedef typename Arr::Isolated_vertex_const_iterator Isolated_vertex_const_iterator; - typedef typename Arr::Halfedge_around_vertex_const_circulator + typedef typename Arr::Halfedge_around_vertex_const_circulator Halfedge_around_vertex_const_circulator; - + // Perform a sweep over all subcurves associated with arrangement edges. std::vector<X_monotone_curve_2> curves_vec (arr.number_of_edges()); Edge_const_iterator eit; unsigned int i = 0; - + for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit, i++) curves_vec[i] = eit->curve(); @@ -1217,7 +1217,7 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) Sweep_line_2 sweep_line (traits, &visitor); visitor.sweep_xcurves (curves_vec.begin(), curves_vec.end()); - + bool are_edges_disjoint = (! visitor.found_intersection()); if (!are_edges_disjoint) @@ -1229,10 +1229,10 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) // Check that the holes and isolated vertices are located where they should. // At the same time, we prepare a vector that consists of all isolated - // vertices and all leftmost vertices from every hole. + // vertices and all leftmost vertices from every hole. std::list<std::pair<Vertex_const_handle, Face_const_handle> > vf_list; - typename Geometry_traits_2::Compare_xy_2 compare_xy = + typename Geometry_traits_2::Compare_xy_2 compare_xy = traits->compare_xy_2_object(); Face_const_iterator fit; Face_const_handle fh; @@ -1313,7 +1313,7 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) // right. if (he_below->direction() == ARR_RIGHT_TO_LEFT) he_below = he_below->twin(); - + in_face = he_below->face(); } else if (CGAL::assign(v_below, obj)) @@ -1324,7 +1324,7 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) in_face = v_below->face(); } else - { + { // Get the first halfedge aroung v_below that is directed from left to // right and the first halfedge that is directed from right to left. first = circ = v_below->incident_halfedges(); @@ -1344,16 +1344,16 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) break; } ++circ; - + } while(circ != first); - CGAL_assertion (he_left != invalid_he || he_right != invalid_he); + CGAL_assertion (he_left != invalid_he || he_right != invalid_he); if (he_left != invalid_he && he_right != invalid_he) { while (he_left->direction() == ARR_LEFT_TO_RIGHT) he_left = he_left->next()->twin(); - + he_left = he_left->twin()->prev(); CGAL_assertion (he_left->direction() == ARR_LEFT_TO_RIGHT); in_face = he_left->face(); @@ -1362,7 +1362,7 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) { Comparison_result res; Halfedge_const_handle he_curr = he_left; - + do // as long as we have next he_left halfedge which is above { he_left = he_curr; @@ -1371,13 +1371,13 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) he_left->curve(), v_below->point()); } while(res == LARGER); - in_face = he_left->face(); + in_face = he_left->face(); } else { Comparison_result res; Halfedge_const_handle he_curr = he_right; - + do // as long as we have he_right halfedge which is below { he_right = he_curr; @@ -1386,8 +1386,8 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) he_right->curve(), v_below->point()); } while(res == SMALLER); - in_face = he_right->face(); - } + in_face = he_right->face(); + } } } else @@ -1415,26 +1415,26 @@ bool is_valid (const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr) //----------------------------------------------------------------------------- // Compute the zone of the given x-monotone curve in the existing arrangement. -// Meaning, it output the arrangment's vertices, edges and faces that the +// Meaning, it output the arrangment's vertices, edges and faces that the // x-monotone curve intersects. -template <class GeomTraits, class TopTraits, +template <class GeomTraits, class TopTraits, class OutputIterator, class PointLocation> -OutputIterator zone (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, +OutputIterator zone (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const typename GeomTraits::X_monotone_curve_2& c, OutputIterator oi, const PointLocation& pl) { // Obtain an arrangement accessor. - typedef Arrangement_on_surface_2<GeomTraits,TopTraits> + typedef Arrangement_on_surface_2<GeomTraits,TopTraits> Arrangement_on_surface_2; // Define a zone-computation object an a visitor that performs the // intersection check. - typedef Arr_compute_zone_visitor<Arrangement_on_surface_2, OutputIterator> + typedef Arr_compute_zone_visitor<Arrangement_on_surface_2, OutputIterator> Zone_visitor; - + Zone_visitor visitor (oi); - Arrangement_zone_2<Arrangement_on_surface_2, Zone_visitor> + Arrangement_zone_2<Arrangement_on_surface_2, Zone_visitor> arr_zone (arr, &visitor); arr_zone.init (c, pl); @@ -1449,7 +1449,7 @@ OutputIterator zone (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // strategy is used as default. // template <class GeomTraits, class TopTraits, class OutputIterator> -OutputIterator zone (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, +OutputIterator zone (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const typename GeomTraits::X_monotone_curve_2& c, OutputIterator oi) { @@ -1464,16 +1464,16 @@ OutputIterator zone (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, //----------------------------------------------------------------------------- // Checks if the given x-monotone curve intersects the existing arrangement. -// The last parameter is used to resolve ambiguity between this function and -// do_intersect of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the -// same class. The last parameter should be boost::true_type but we used a +// The last parameter is used to resolve ambiguity between this function and +// do_intersect of Curve_2 in case that X_monotone_curve_2 and Curve_2 are the +// same class. The last parameter should be boost::true_type but we used a // workaround since it didn't compile in FC3_g++-3.4.4 with the error of: // -// error: no matching function for call to `do_intersect(Arrangement_on_surface_2<>&, +// error: no matching function for call to `do_intersect(Arrangement_on_surface_2<>&, // const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, mpl_::bool_< true>)' // template <class GeomTraits, class TopTraits, class PointLocation> -bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, +bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const typename GeomTraits::X_monotone_curve_2& c, const PointLocation& pl, boost::is_same<int, int>::type) { @@ -1484,9 +1484,9 @@ bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Define a zone-computation object an a visitor that performs the // intersection check. typedef Arr_do_intersect_zone_visitor<Arrangement_on_surface_2> Zone_visitor; - + Zone_visitor visitor; - Arrangement_zone_2<Arrangement_on_surface_2, Zone_visitor> + Arrangement_zone_2<Arrangement_on_surface_2, Zone_visitor> arr_zone (arr, &visitor); arr_zone.init (c, pl); @@ -1497,17 +1497,17 @@ bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, //----------------------------------------------------------------------------- // Checks if the given curve intersects the existing arrangement. -// The last parameter is used to resolve ambiguity between this function and -// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and -// Curve_2 are the same class. -// The last parameter should be boost::false_type but we used a +// The last parameter is used to resolve ambiguity between this function and +// do_intersect of X_monotone_curve_2 in case that X_monotone_curve_2 and +// Curve_2 are the same class. +// The last parameter should be boost::false_type but we used a // workaround since it didn't compile in FC3_g++-3.4.4 with the error of: // -// error: no matching function for call to `do_intersect(Arrangement_on_surface_2<>&, +// error: no matching function for call to `do_intersect(Arrangement_on_surface_2<>&, // const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, mpl_::bool_< true>)' // template <class GeomTraits, class TopTraits, class PointLocation> -bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, +bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const typename GeomTraits::X_monotone_curve_2& c, const PointLocation& pl, boost::is_same<int, double>::type) { @@ -1519,7 +1519,7 @@ bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, typedef Arr_traits_adaptor_2<GeomTraits> Traits_adaptor_2; const Traits_adaptor_2 * traits = - static_cast<const Traits_adaptor_2*> (arr.traits()); + static_cast<const Traits_adaptor_2*> (arr.geometry_traits()); std::list<CGAL::Object> x_objects; std::list<CGAL::Object>::const_iterator obj_iter; @@ -1533,7 +1533,7 @@ bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, for (obj_iter = x_objects.begin(); obj_iter != x_objects.end(); ++obj_iter) { // Act according to the type of the current object. - x_curve = object_cast<typename GeomTraits::X_monotone_curve_2> + x_curve = object_cast<typename GeomTraits::X_monotone_curve_2> (&(*obj_iter)); if (x_curve != NULL) { @@ -1545,12 +1545,12 @@ bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, { iso_p = object_cast<typename GeomTraits::Point_2> (&(*obj_iter)); CGAL_assertion (iso_p != NULL); - + // Check whether the isolated point lies inside a face (otherwise, // it conincides with a vertex or an edge). CGAL::Object obj = pl.locate (*iso_p); - - return (object_cast<typename + + return (object_cast<typename Arrangement_on_surface_2::Face_const_handle>(&obj) != NULL); } } @@ -1562,14 +1562,14 @@ bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, //----------------------------------------------------------------------------- // Common interface for the do_intersect of the Curve_2 and X_monotone_curve_2 template <class GeomTraits, class TopTraits, class Curve, class PointLocation> -bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, +bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const Curve& c, const PointLocation& pl) { typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2; - + typedef typename boost::is_same<Curve, X_monotone_curve_2>::type Is_x_monotone; - + return do_intersect(arr, c, pl, Is_x_monotone()); } @@ -1578,13 +1578,13 @@ bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, // Overloaded version with no point location object - the walk point-location // strategy is used as default. template <class GeomTraits, class TopTraits, class Curve> -bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, +bool do_intersect (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr, const Curve& c) { // Create a default point-location object and use it to insert the curve. typename TopTraits::Default_point_location_strategy def_pl (arr); - - // check if the curve intersects the arrangement using the walk point + + // check if the curve intersects the arrangement using the walk point // location. return do_intersect (arr, c, def_pl); }
- [cgal-discuss] use do_intersect() & zone() with Arrangement_with_history_2, Yajie Yan, 07/11/2014
- Re: [cgal-discuss] use do_intersect() & zone() with Arrangement_with_history_2, Efi Fogel, 07/13/2014
- Re: [cgal-discuss] use do_intersect() & zone() with Arrangement_with_history_2, Yajie Yan, 07/15/2014
- Re: [cgal-discuss] use do_intersect() & zone() with Arrangement_with_history_2, Efi Fogel, 07/16/2014
- Re: [cgal-discuss] use do_intersect() & zone() with Arrangement_with_history_2, Yajie Yan, 07/15/2014
- Re: [cgal-discuss] use do_intersect() & zone() with Arrangement_with_history_2, Efi Fogel, 07/13/2014
Archive powered by MHonArc 2.6.18.