Fixed not getting Alpha shapes 2 predicates and constructions from Lazy alpha NT

This commit is contained in:
Mael Rouxel-Labbé 2017-05-02 11:53:28 +02:00
parent c1d2146af4
commit 1b3a608b30
3 changed files with 64 additions and 36 deletions

View File

@ -68,13 +68,20 @@ public:
typedef typename Dt::Geom_traits Gt; typedef typename Dt::Geom_traits Gt;
typedef typename Dt::Triangulation_data_structure Tds; typedef typename Dt::Triangulation_data_structure Tds;
typedef typename internal::Alpha_nt_selector_2<Gt,ExactAlphaComparisonTag>::Type_of_alpha Type_of_alpha; typedef typename internal::Alpha_nt_selector_2<
//check simplices are correctly instantiated Gt, ExactAlphaComparisonTag, typename Dt::Weighted_tag>::Type_of_alpha Type_of_alpha;
CGAL_static_assertion( (boost::is_same<Type_of_alpha,typename Dt::Face::FT>::value) ); typedef typename internal::Alpha_nt_selector_2<
CGAL_static_assertion( (boost::is_same<Type_of_alpha,typename Dt::Vertex::FT>::value) ); 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 NT;
typedef Type_of_alpha FT; typedef Type_of_alpha FT;
//check simplices are correctly instantiated
CGAL_static_assertion( (boost::is_same<NT, typename Dt::Face::NT>::value) );
CGAL_static_assertion( (boost::is_same<NT, typename Dt::Vertex::NT>::value) );
typedef typename Gt::Point_2 Point; typedef typename Gt::Point_2 Point;
typedef typename Gt::Segment_2 Segment; typedef typename Gt::Segment_2 Segment;
typedef typename Gt::Line_2 Line; typedef typename Gt::Line_2 Line;
@ -714,8 +721,7 @@ private:
bool is_attached(const Face_handle& f, int i) const bool is_attached(const Face_handle& f, int i) const
{ {
Bounded_side b = Bounded_side b = Side_of_bounded_circle_2()(*this)(f->vertex(cw(i))->point(),
this->geom_traits().side_of_bounded_circle_2_object()(f->vertex(cw(i))->point(),
f->vertex(ccw(i))->point(), f->vertex(ccw(i))->point(),
f->vertex(i)->point()); f->vertex(i)->point());
@ -726,16 +732,14 @@ private:
Type_of_alpha squared_radius(const Face_handle& f) const Type_of_alpha squared_radius(const Face_handle& f) const
{ {
return return Compute_squared_radius_2()(*this)(f->vertex(0)->point(),
this->geom_traits().compute_squared_radius_2_object()(f->vertex(0)->point(),
f->vertex(1)->point(), f->vertex(1)->point(),
f->vertex(2)->point()); f->vertex(2)->point());
} }
Type_of_alpha squared_radius(const Face_handle& f, int i) const Type_of_alpha squared_radius(const Face_handle& f, int i) const
{ {
return return Compute_squared_radius_2()(*this)(f->vertex(ccw(i))->point(),
this->geom_traits().compute_squared_radius_2_object()(f->vertex(ccw(i))->point(),
f->vertex(cw(i))->point()); f->vertex(cw(i))->point());
} }

View File

@ -387,8 +387,20 @@ template <class GeomTraits, class ExactAlphaComparisonTag, class Weighted_tag>
struct Alpha_nt_selector_2 struct Alpha_nt_selector_2
: public Alpha_nt_selector_impl_2< : public Alpha_nt_selector_impl_2<
GeomTraits, 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<boost::is_floating_point<typename GeomTraits::FT>::value && Boolean_tag<boost::is_floating_point<typename GeomTraits::FT>::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 } // namespace internal

View File

@ -356,13 +356,25 @@ struct Alpha_nt_selector_impl_3<GeomTraits,Tag_true,Tag_true>
}; };
template <class GeomTraits,class ExactAlphaComparisonTag,class Weighted_tag> template <class GeomTraits,class ExactAlphaComparisonTag,class Weighted_tag>
struct Alpha_nt_selector_3: struct Alpha_nt_selector_3
public Alpha_nt_selector_impl_3<GeomTraits, : public Alpha_nt_selector_impl_3<
Boolean_tag< boost::is_floating_point<typename GeomTraits::FT>::value && ExactAlphaComparisonTag::value >, 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<boost::is_floating_point<typename GeomTraits::FT>::value &&
boost::is_convertible<
typename GeomTraits::Point_3,
typename Kernel_traits<
typename GeomTraits::Point_3>::Kernel::Point_3
>::value &&
ExactAlphaComparisonTag::value >,
Weighted_tag> Weighted_tag>
{ }; { };
} //namespace internal } //namespace internal
template<class Input_traits, bool mode, class Weighted_tag> template<class Input_traits, bool mode, class Weighted_tag>