From b0e748d552d53f830c6eb1beaa44f2af7f891d13 Mon Sep 17 00:00:00 2001 From: Eric Berberich Date: Sun, 7 Jun 2009 19:16:31 +0000 Subject: [PATCH] added (some) missing boundary-specific functors --- .../Gps_agg_meta_traits.h | 190 ++++++++++++++++-- 1 file changed, 177 insertions(+), 13 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h index c21b4cdb720..c4a91271088 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h @@ -21,6 +21,7 @@ #define CGAL_GPS_AGG_META_TRAITS_H #include +#include #include #include #include @@ -100,12 +101,12 @@ public: template class Gps_agg_meta_traits : - public Gps_traits_decorator, Point_with_vertex > { typedef Arrangement_ Arrangement; - typedef typename Arrangement::Geometry_traits_2 Traits; + typedef typename Arrangement::Traits_adaptor_2 Traits; typedef typename Traits::X_monotone_curve_2 Base_X_monotone_curve_2; typedef typename Traits::Point_2 Base_Point_2; @@ -118,6 +119,14 @@ class Gps_agg_meta_traits : typedef typename Traits::Intersect_2 Base_Intersect_2; typedef typename Traits::Split_2 Base_Split_2; + typedef typename Traits::Parameter_space_in_x_2 Base_Parameter_space_in_x_2; + typedef typename Traits::Compare_y_near_boundary_2 + Base_Compare_y_near_boundary_2; + + typedef typename Traits::Parameter_space_in_y_2 Base_Parameter_space_in_y_2; + typedef typename Traits::Compare_x_near_boundary_2 + Base_Compare_x_near_boundary_2; + typedef Gps_agg_meta_traits Self; typedef Gps_traits_decorator, + boost::is_same< Arr_left_side_tag, Arr_open_side_tag > > + ) + ); + BOOST_MPL_ASSERT( + (boost::mpl::or_< + boost::is_same< Arr_bottom_side_tag, Arr_oblivious_side_tag >, + boost::is_same< Arr_bottom_side_tag, Arr_open_side_tag > > + ) + ); + BOOST_MPL_ASSERT( + (boost::mpl::or_< + boost::is_same< Arr_top_side_tag, Arr_oblivious_side_tag >, + boost::is_same< Arr_top_side_tag, Arr_open_side_tag > > + ) + ); + BOOST_MPL_ASSERT( + (boost::mpl::or_< + boost::is_same< Arr_right_side_tag, Arr_oblivious_side_tag >, + boost::is_same< Arr_right_side_tag, Arr_open_side_tag > > + ) + ); typedef typename Base::Curve_data Curve_data; typedef typename Base::Point_data Point_data; @@ -405,6 +433,142 @@ class Gps_agg_meta_traits : return Compare_xy_2(this->m_base_tr->compare_xy_2_object()); } + + + // left-right + + + class Parameter_space_in_x_2 + { + private: + Base_Parameter_space_in_x_2 m_base; + + public: + + Parameter_space_in_x_2(const Base_Parameter_space_in_x_2& base): + m_base(base) + {} + + /*! Obtains the parameter space at the end of a curve-end along the x-axis. + */ + Arr_parameter_space operator() (const X_monotone_curve_2 & cv, + const Arr_curve_end& end) + { + return m_base(cv.base(), end); + } + }; + + /*! Get a Construct_min_vertex_2 functor object. */ + Parameter_space_in_x_2 parameter_space_in_x_2_object () const + { + return Parameter_space_in_x_2( + this->m_base_tr->parameter_space_in_x_2_object() + ); + } + + class Compare_y_near_boundary_2 + { + private: + Base_Compare_y_near_boundary_2 m_base; + + public: + + Compare_y_near_boundary_2(const Base_Compare_y_near_boundary_2& base): + m_base(base) + {} + + /*! + * Compare the relative y-positions of two curve ends. + */ + Comparison_result operator() (const X_monotone_curve_2 & xcv1, + const X_monotone_curve_2 & xcv2, + Arr_curve_end ce) const + { + return m_base(xcv1, xcv2, ce); + } + }; + + /*! Get a Construct_min_vertex_2 functor object. */ + Compare_y_near_boundary_2 compare_y_near_boundary_2_object () const + { + return Compare_y_near_boundary_2( + this->m_base_tr->compare_y_near_boundary_2_object() + ); + } + + + // bottom-top + + + class Parameter_space_in_y_2 + { + private: + Base_Parameter_space_in_y_2 m_base; + + public: + + Parameter_space_in_y_2(const Base_Parameter_space_in_y_2& base): + m_base(base) + {} + + /*! Obtains the parameter space at the end of a curve-end along the y-axis. + */ + Arr_parameter_space operator() (const X_monotone_curve_2 & cv, + const Arr_curve_end& end) + { + return m_base(cv.base(), end); + } + }; + + /*! Get a Construct_min_vertex_2 functor object. */ + Parameter_space_in_y_2 parameter_space_in_y_2_object () const + { + return Parameter_space_in_y_2( + this->m_base_tr->parameter_space_in_y_2_object() + ); + } + + class Compare_x_near_boundary_2 + { + private: + Base_Compare_x_near_boundary_2 m_base; + + public: + + Compare_x_near_boundary_2(const Base_Compare_x_near_boundary_2& base): + m_base(base) + {} + + /*! Compare the relative x-positions of a vertical curve and another given + * curve end. + */ + Comparison_result operator() (const Point_2 & p, + const X_monotone_curve_2 & xcv, + Arr_curve_end ce) const + { + return m_base(p, xcv, ce); + } + + /*! Compare the relative x-positions of two curve ends. + */ + Comparison_result operator() (const X_monotone_curve_2 & xcv1, + Arr_curve_end ce1, + const X_monotone_curve_2 & xcv2, + Arr_curve_end ce2) const + { + return m_base(xcv1, ce1, xcv2, ce2); + } + }; + + /*! Get a Construct_min_vertex_2 functor object. */ + Compare_x_near_boundary_2 compare_x_near_boundary_2_object () const + { + return Compare_x_near_boundary_2( + this->m_base_tr->compare_x_near_boundary_2_object() + ); + } + + }; CGAL_END_NAMESPACE