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::Triangulation_data_structure Tds;
typedef typename internal::Alpha_nt_selector_2<Gt,ExactAlphaComparisonTag>::Type_of_alpha Type_of_alpha;
//check simplices are correctly instantiated
CGAL_static_assertion( (boost::is_same<Type_of_alpha,typename Dt::Face::FT>::value) );
CGAL_static_assertion( (boost::is_same<Type_of_alpha,typename Dt::Vertex::FT>::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<NT, typename Dt::Face::NT>::value) );
CGAL_static_assertion( (boost::is_same<NT, typename Dt::Vertex::NT>::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;
@ -713,31 +720,28 @@ private:
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());
{
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;
}
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());
}
{
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());
}
{
return Compute_squared_radius_2()(*this)(f->vertex(ccw(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
: 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<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

View File

@ -356,12 +356,24 @@ struct Alpha_nt_selector_impl_3<GeomTraits,Tag_true,Tag_true>
};
template <class GeomTraits,class ExactAlphaComparisonTag,class Weighted_tag>
struct Alpha_nt_selector_3:
public Alpha_nt_selector_impl_3<GeomTraits,
Boolean_tag< boost::is_floating_point<typename GeomTraits::FT>::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<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>
{ };
} //namespace internal