diff --git a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h index dd4e24005a4..1cc09421944 100644 --- a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h +++ b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h @@ -20,6 +20,7 @@ #include #include +#include namespace CGAL { @@ -1210,6 +1211,14 @@ public: }; -} } //namespace CGAL::internal + +} // namespace internal + +template +struct Triangulation_structural_filtering_traits<::CGAL::internal::Projection_traits_3 > { + typedef typename Triangulation_structural_filtering_traits::Use_structural_filtering_tag Use_structural_filtering_tag; +}; + + } //namespace CGAL #endif // CGAL_INTERNAL_PROJECTION_TRAITS_3_H diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 14e8604640f..c0f2c7ba50e 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -434,6 +435,81 @@ protected: bool has_inexact_negative_orientation(const Point &p, const Point &q, const Point &r) const; + + +template +inline +bool +projection_traits_has_inexact_negative_orientation(const Point &p, const Point &q, const Point &r, + const T& ) const +{ + // So that this code works well with Lazy_kernel + internal::Static_filters_predicates::Get_approx get_approx; + + const double px = to_double(get_approx(p).x()); + const double py = to_double(get_approx(p).y()); + const double qx = to_double(get_approx(q).x()); + const double qy = to_double(get_approx(q).y()); + const double rx = to_double(get_approx(r).x()); + const double ry = to_double(get_approx(r).y()); + + const double pqx = qx - px; + const double pqy = qy - py; + const double prx = rx - px; + const double pry = ry - py; + + return ( determinant(pqx, pqy, prx, pry) < 0); +} + +template +inline +bool +projection_traits_has_inexact_negative_orientation(const Point &p, const Point &q, const Point &r, + const ::CGAL::internal::Projection_traits_3& ) const +{ // So that this code works well with Lazy_kernel + internal::Static_filters_predicates::Get_approx get_approx; + + const double px = to_double(get_approx(p).y()); + const double py = to_double(get_approx(p).z()); + const double qx = to_double(get_approx(q).y()); + const double qy = to_double(get_approx(q).z()); + const double rx = to_double(get_approx(r).y()); + const double ry = to_double(get_approx(r).z()); + + const double pqx = qx - px; + const double pqy = qy - py; + const double prx = rx - px; + const double pry = ry - py; + + return ( determinant(pqx, pqy, prx, pry) < 0); +} + + +template +inline +bool +projection_traits_has_inexact_negative_orientation(const Point &p, const Point &q, const Point &r, + const ::CGAL::internal::Projection_traits_3& ) const +{ // So that this code works well with Lazy_kernel + internal::Static_filters_predicates::Get_approx get_approx; + + const double px = to_double(get_approx(p).x()); + const double py = to_double(get_approx(p).z()); + const double qx = to_double(get_approx(q).x()); + const double qy = to_double(get_approx(q).z()); + const double rx = to_double(get_approx(r).x()); + const double ry = to_double(get_approx(r).z()); + + const double pqx = qx - px; + const double pqy = qy - py; + const double prx = rx - px; + const double pry = ry - py; + + return ( determinant(pqx, pqy, prx, pry) < 0); +} + + + public: Face_handle inexact_locate(const Point& p, @@ -3152,6 +3228,7 @@ inexact_locate(const Point & t, Face_handle start, int n_of_turns) const return c; } + template inline bool @@ -3159,22 +3236,8 @@ Triangulation_2:: has_inexact_negative_orientation(const Point &p, const Point &q, const Point &r) const { - // So that this code works well with Lazy_kernel - internal::Static_filters_predicates::Get_approx get_approx; - - const double px = to_double(get_approx(p).x()); - const double py = to_double(get_approx(p).y()); - const double qx = to_double(get_approx(q).x()); - const double qy = to_double(get_approx(q).y()); - const double rx = to_double(get_approx(r).x()); - const double ry = to_double(get_approx(r).y()); - - const double pqx = qx - px; - const double pqy = qy - py; - const double prx = rx - px; - const double pry = ry - py; - - return ( determinant(pqx, pqy, prx, pry) < 0); + Gt gt; + return projection_traits_has_inexact_negative_orientation(p,q,r,gt); } #endif