diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index 3363d458600..8b61ae25dbd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -875,64 +875,64 @@ protected: return (traits->compare_curve_end_xy_2_object()(ce1, ce2) == SMALLER); } - //template - //bool is_end_point_left_low(const T& t, const Dag_node& node) const + template + bool is_end_point_left_low(const T& t, const Dag_node& node) const + { + typename Traits::Compare_curve_end_xy_2 compare = + traits->compare_curve_end_xy_2_object(); + Td_map_item vtx_item (node.get_data()); + bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + if (is_fict_vtx) { + return (compare(t, + *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + vtx_item))) == SMALLER); + //return (is_end_point_left_low(t, + // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + // vtx_item))));// == SMALLER); + } + else { + return (compare(t, + boost::apply_visitor(point_for_vertex_visitor(), + vtx_item)) == SMALLER); + //return (is_end_point_left_low(t, + // boost::apply_visitor(point_for_vertex_visitor(), + // vtx_item)));// == SMALLER); + } + } + //bool is_end_point_left_low(const Point& p, const Dag_node& node) const //{ // typename Traits::Compare_curve_end_xy_2 compare = // traits->compare_curve_end_xy_2_object(); // Td_map_item vtx_item (node.get_data()); // bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); // if (is_fict_vtx) { - // return (compare(t, + // return (compare(p, // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), // vtx_item))) == SMALLER); - // //return (is_end_point_left_low(t, - // // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - // // vtx_item))));// == SMALLER); // } // else { - // return (compare(t, + // return (compare(p, // boost::apply_visitor(point_for_vertex_visitor(), // vtx_item)) == SMALLER); - // //return (is_end_point_left_low(t, - // // boost::apply_visitor(point_for_vertex_visitor(), - // // vtx_item)));// == SMALLER); // } - //} - bool is_end_point_left_low(const Point& p, const Dag_node& node) const - { - typename Traits::Compare_curve_end_xy_2 compare = - traits->compare_curve_end_xy_2_object(); - Td_map_item vtx_item (node.get_data()); - bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); - if (is_fict_vtx) { - return (compare(p, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - vtx_item))) == SMALLER); - } - else { - return (compare(p, - boost::apply_visitor(point_for_vertex_visitor(), - vtx_item)) == SMALLER); - } - } - bool is_end_point_left_low(const Curve_end& ce, const Dag_node& node) const - { - typename Traits::Compare_curve_end_xy_2 compare = - traits->compare_curve_end_xy_2_object(); - Td_map_item vtx_item (node.get_data()); - bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); - if (is_fict_vtx) { - return (compare(ce, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - vtx_item))) == SMALLER); - } - else { - return (compare(ce, - boost::apply_visitor(point_for_vertex_visitor(), - vtx_item)) == SMALLER); - } - } + //} + //bool is_end_point_left_low(const Curve_end& ce, const Dag_node& node) const + //{ + // typename Traits::Compare_curve_end_xy_2 compare = + // traits->compare_curve_end_xy_2_object(); + // Td_map_item vtx_item (node.get_data()); + // bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + // if (is_fict_vtx) { + // return (compare(ce, + // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + // vtx_item))) == SMALLER); + // } + // else { + // return (compare(ce, + // boost::apply_visitor(point_for_vertex_visitor(), + // vtx_item)) == SMALLER); + // } + //} /*! is_end_point_right_top variants: returning true if the first curve-end is right-top of the second curve-end */ @@ -956,66 +956,66 @@ protected: return (traits->compare_curve_end_xy_2_object()(ce1, ce2) == LARGER); } - //template - //bool is_end_point_right_top(const T& t, const Dag_node& node) const + template + bool is_end_point_right_top(const T& t, const Dag_node& node) const + { + typename Traits::Compare_curve_end_xy_2 compare = + traits->compare_curve_end_xy_2_object(); + Td_map_item vtx_item (node.get_data()); + bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + if (is_fict_vtx) { + return (compare(t, + *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + vtx_item))) == LARGER); + //return is_end_point_right_top(t, + // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + // vtx_item))); + } + else { + return (compare(t, + boost::apply_visitor(point_for_vertex_visitor(), + vtx_item)) == LARGER); + //return is_end_point_right_top(t, + // boost::apply_visitor(point_for_vertex_visitor(), + // vtx_item)); + } + } + //bool is_end_point_right_top(const Point& p, const Dag_node& node) const //{ // typename Traits::Compare_curve_end_xy_2 compare = // traits->compare_curve_end_xy_2_object(); // Td_map_item vtx_item (node.get_data()); // bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); // if (is_fict_vtx) { - // return (compare(t, + // return (compare(p, // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), // vtx_item))) == LARGER); - // //return is_end_point_right_top(t, - // // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - // // vtx_item))); // } // else { - // return (compare(t, + // return (compare(p, + // boost::apply_visitor(point_for_vertex_visitor(), + // vtx_item)) == LARGER); + // } + //} + //bool is_end_point_right_top(const Curve_end& ce, const Dag_node& node) const + //{ + // typename Traits::Compare_curve_end_xy_2 compare = + // traits->compare_curve_end_xy_2_object(); + // Td_map_item vtx_item (node.get_data()); + // bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + // if (is_fict_vtx) { + // return (compare(ce, + // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + // vtx_item))) == LARGER); + // } + // else { + // return (compare(ce, // boost::apply_visitor(point_for_vertex_visitor(), // vtx_item)) == LARGER); - // //return is_end_point_right_top(t, - // // boost::apply_visitor(point_for_vertex_visitor(), - // // vtx_item)); // } //} - bool is_end_point_right_top(const Point& p, const Dag_node& node) const - { - typename Traits::Compare_curve_end_xy_2 compare = - traits->compare_curve_end_xy_2_object(); - Td_map_item vtx_item (node.get_data()); - bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); - if (is_fict_vtx) { - return (compare(p, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - vtx_item))) == LARGER); - } - else { - return (compare(p, - boost::apply_visitor(point_for_vertex_visitor(), - vtx_item)) == LARGER); - } - } - bool is_end_point_right_top(const Curve_end& ce, const Dag_node& node) const - { - typename Traits::Compare_curve_end_xy_2 compare = - traits->compare_curve_end_xy_2_object(); - Td_map_item vtx_item (node.get_data()); - bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); - if (is_fict_vtx) { - return (compare(ce, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - vtx_item))) == LARGER); - } - else { - return (compare(ce, - boost::apply_visitor(point_for_vertex_visitor(), - vtx_item)) == LARGER); - } - } - /*template + template bool are_equal_end_points(const T& t, const Dag_node& node) const { typename Traits::Equal_curve_end_2 equal = traits->equal_curve_end_2_object(); @@ -1031,39 +1031,39 @@ protected: boost::apply_visitor(point_for_vertex_visitor(), vtx_item)); } - }*/ - bool are_equal_end_points(const Point& p, const Dag_node& node) const - { - typename Traits::Equal_curve_end_2 equal = traits->equal_curve_end_2_object(); - Td_map_item vtx_item (node.get_data()); - bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); - if (is_fict_vtx) { - return equal(p, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - vtx_item))); - } - else { - return equal(p, - boost::apply_visitor(point_for_vertex_visitor(), - vtx_item)); - } - } - bool are_equal_end_points(const Curve_end& ce, const Dag_node& node) const - { - typename Traits::Equal_curve_end_2 equal = traits->equal_curve_end_2_object(); - Td_map_item vtx_item (node.get_data()); - bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); - if (is_fict_vtx) { - return equal(ce, - *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), - vtx_item))); - } - else { - return equal(ce, - boost::apply_visitor(point_for_vertex_visitor(), - vtx_item)); - } } + //bool are_equal_end_points(const Point& p, const Dag_node& node) const + //{ + // typename Traits::Equal_curve_end_2 equal = traits->equal_curve_end_2_object(); + // Td_map_item vtx_item (node.get_data()); + // bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + // if (is_fict_vtx) { + // return equal(p, + // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + // vtx_item))); + // } + // else { + // return equal(p, + // boost::apply_visitor(point_for_vertex_visitor(), + // vtx_item)); + // } + //} + //bool are_equal_end_points(const Curve_end& ce, const Dag_node& node) const + //{ + // typename Traits::Equal_curve_end_2 equal = traits->equal_curve_end_2_object(); + // Td_map_item vtx_item (node.get_data()); + // bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + // if (is_fict_vtx) { + // return equal(ce, + // *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + // vtx_item))); + // } + // else { + // return equal(ce, + // boost::apply_visitor(point_for_vertex_visitor(), + // vtx_item)); + // } + //} /*! * finds the node of the leftmost trapezoid with respect to a curve. * \param left_cv_end_node The dag node representing the left endpoint of