diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index a2ba8615f6c..1d0b4454d36 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -68,13 +68,20 @@ public: typedef typename Dt::Geom_traits Gt; typedef typename Dt::Triangulation_data_structure Tds; - typedef typename internal::Alpha_nt_selector_2::Type_of_alpha Type_of_alpha; - //check simplices are correctly instantiated - CGAL_static_assertion( (boost::is_same::value) ); - CGAL_static_assertion( (boost::is_same::value) ); + typedef typename internal::Alpha_nt_selector_2< + Gt, ExactAlphaComparisonTag, typename Dt::Weighted_tag>::Type_of_alpha Type_of_alpha; + typedef typename internal::Alpha_nt_selector_2< + Gt, ExactAlphaComparisonTag, typename Dt::Weighted_tag>::Compute_squared_radius_2 Compute_squared_radius_2; + typedef typename internal::Alpha_nt_selector_2< + Gt, ExactAlphaComparisonTag, typename Dt::Weighted_tag>::Side_of_bounded_circle_2 Side_of_bounded_circle_2; + + typedef Type_of_alpha NT; + typedef Type_of_alpha FT; + + //check simplices are correctly instantiated + CGAL_static_assertion( (boost::is_same::value) ); + CGAL_static_assertion( (boost::is_same::value) ); - typedef Type_of_alpha NT; - typedef Type_of_alpha FT; typedef typename Gt::Point_2 Point; typedef typename Gt::Segment_2 Segment; typedef typename Gt::Line_2 Line; @@ -711,33 +718,30 @@ private: //---------------------- PREDICATES ------------------------------------ private: - - bool is_attached(const Face_handle& f, int i) const - { - Bounded_side b = - this->geom_traits().side_of_bounded_circle_2_object()(f->vertex(cw(i))->point(), - f->vertex(ccw(i))->point(), - f->vertex(i)->point()); - return (b == ON_BOUNDED_SIDE) ? true : false; - } - + bool is_attached(const Face_handle& f, int i) const + { + Bounded_side b = Side_of_bounded_circle_2()(*this)(f->vertex(cw(i))->point(), + f->vertex(ccw(i))->point(), + f->vertex(i)->point()); + + return (b == ON_BOUNDED_SIDE) ? true : false; + } + //-------------------- GEOMETRIC PRIMITIVES ---------------------------- - Type_of_alpha squared_radius(const Face_handle& f) const - { - return - this->geom_traits().compute_squared_radius_2_object()(f->vertex(0)->point(), - f->vertex(1)->point(), - f->vertex(2)->point()); - } + Type_of_alpha squared_radius(const Face_handle& f) const + { + return Compute_squared_radius_2()(*this)(f->vertex(0)->point(), + f->vertex(1)->point(), + f->vertex(2)->point()); + } - Type_of_alpha squared_radius(const Face_handle& f, int i) const - { - return - this->geom_traits().compute_squared_radius_2_object()(f->vertex(ccw(i))->point(), - f->vertex(cw(i))->point()); - } + Type_of_alpha squared_radius(const Face_handle& f, int i) const + { + return Compute_squared_radius_2()(*this)(f->vertex(ccw(i))->point(), + f->vertex(cw(i))->point()); + } //--------------------------------------------------------------------- diff --git a/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h b/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h index 1e2968d44a9..1d44d9ea9a9 100644 --- a/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h +++ b/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h @@ -387,8 +387,20 @@ template struct Alpha_nt_selector_2 : public Alpha_nt_selector_impl_2< GeomTraits, + // We check for two things in addition to the value of ExactAlphaComparisonTag: + // - if the base traits is already exact (then we don't need to do anything, + // and we can simply directly use the traits class) + // - if the traits class' Point_2 can be converted to the underlying + // kernel of the traits class, which is a necessary precondition to + // be able to use the Cartesian converter and the exact kernels Boolean_tag::value && - ExactAlphaComparisonTag::value > > + boost::is_convertible< + typename GeomTraits::Point_2, + typename Kernel_traits< + typename GeomTraits::Point_2>::Kernel::Point_2 + >::value && + ExactAlphaComparisonTag::value >, + Weighted_tag> { }; } // namespace internal diff --git a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h index bd031983d08..a159735cac0 100644 --- a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h @@ -356,12 +356,24 @@ struct Alpha_nt_selector_impl_3 }; template -struct Alpha_nt_selector_3: - public Alpha_nt_selector_impl_3::value && ExactAlphaComparisonTag::value >, - Weighted_tag> -{}; - +struct Alpha_nt_selector_3 + : public Alpha_nt_selector_impl_3< + GeomTraits, + // We check for two things in addition to the value of ExactAlphaComparisonTag: + // - if the base traits is already exact (then we don't need to do anything, + // and we can simply directly use the traits class) + // - if the traits class' Point_3 can be converted to the underlying + // kernel of the traits class, which is a necessary precondition to + // be able to use the Cartesian converter and the exact kernels + Boolean_tag::value && + boost::is_convertible< + typename GeomTraits::Point_3, + typename Kernel_traits< + typename GeomTraits::Point_3>::Kernel::Point_3 + >::value && + ExactAlphaComparisonTag::value >, + Weighted_tag> +{ }; } //namespace internal