From 0a48c9eec4dcbfe70e3863db2aa5436fbaf578b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Tayeb?= Date: Fri, 23 Oct 2009 09:30:49 +0000 Subject: [PATCH] Fix traits (remove use of deprecated Regular_triangulation_filtered_traits_3). --- ..._weighted_circumcenter_filtered_traits_3.h | 116 +++++++++--------- Mesh_3/include/CGAL/Mesh_triangulation_3.h | 8 +- 2 files changed, 61 insertions(+), 63 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Robust_weighted_circumcenter_filtered_traits_3.h b/Mesh_3/include/CGAL/Mesh_3/Robust_weighted_circumcenter_filtered_traits_3.h index 4cfdb90e083..18545e3677f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Robust_weighted_circumcenter_filtered_traits_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Robust_weighted_circumcenter_filtered_traits_3.h @@ -40,111 +40,111 @@ template < typename K_ > class Robust_filtered_construct_weighted_circumcenter_3 { public: - typedef typename K_::Weighted_point_3 Weighted_point_3; - typedef typename K_::Bare_point Bare_point; - typedef typename K_::FT FT; - typedef typename K_::Sphere_3 Sphere_3; - typedef Bare_point result_type; - - typedef Exact_predicates_exact_constructions_kernel EK2; - typedef Regular_triangulation_euclidean_traits_3 EK; - typedef Weighted_converter_3< - Cartesian_converter > To_exact; - typedef Weighted_converter_3< - Cartesian_converter > Back_from_exact; - - + typedef Exact_predicates_exact_constructions_kernel EK; + typedef Weighted_converter_3 > To_exact; + typedef Weighted_converter_3 > Back_from_exact; + + typedef CGAL::Regular_triangulation_euclidean_traits_3 Rt; + typedef CGAL::Regular_triangulation_euclidean_traits_3 Exact_Rt; + + typedef typename Rt::Weighted_point_3 Weighted_point_3; + typedef typename Rt::Bare_point Bare_point; + typedef typename Rt::FT FT; + typedef typename Rt::Sphere_3 Sphere_3; + + typedef Bare_point result_type; + Bare_point operator() ( const Weighted_point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r, const Weighted_point_3 & s ) const { - CGAL_precondition(! K_().coplanar_3_object()(p,q,r,s) ); + CGAL_precondition(! Rt().coplanar_3_object()(p,q,r,s) ); + + typename Rt::Construct_weighted_circumcenter_3 weighted_circumcenter = + Rt().construct_weighted_circumcenter_3_object(); + typename Rt::Has_on_bounded_side_3 on_bounded_side = + Rt().has_on_bounded_side_3_object(); - typename K_::Construct_weighted_circumcenter_3 weighted_circumcenter = - K_().construct_weighted_circumcenter_3_object(); - typename K_::Has_on_bounded_side_3 on_bounded_side = - K_().has_on_bounded_side_3_object(); - // Compute denominator to swith to exact if it is 0 const FT denom = compute_denom(p,q,r,s); if ( ! CGAL_NTS is_zero(denom) ) { result_type point = weighted_circumcenter(p,q,r,s); - + // Fast output if ( on_bounded_side(Sphere_3(p,q,r,s),point) ) return point; } - + // Switch to exact To_exact to_exact; Back_from_exact back_from_exact; - EK::Construct_weighted_circumcenter_3 exact_weighted_circumcenter = - EK().construct_weighted_circumcenter_3_object(); - + Exact_Rt::Construct_weighted_circumcenter_3 exact_weighted_circumcenter = + Exact_Rt().construct_weighted_circumcenter_3_object(); + return back_from_exact(exact_weighted_circumcenter(to_exact(p), - to_exact(q), - to_exact(r), - to_exact(s))); + to_exact(q), + to_exact(r), + to_exact(s))); } - + Bare_point operator() ( const Weighted_point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r ) const { - CGAL_precondition(! K_().collinear_3_object()(p,q,r) ); + CGAL_precondition(! Rt().collinear_3_object()(p,q,r) ); + + typename Rt::Construct_weighted_circumcenter_3 weighted_circumcenter = + Rt().construct_weighted_circumcenter_3_object(); + typename Rt::Has_on_bounded_side_3 on_bounded_side = + Rt().has_on_bounded_side_3_object(); - typename K_::Construct_weighted_circumcenter_3 weighted_circumcenter = - K_().construct_weighted_circumcenter_3_object(); - typename K_::Has_on_bounded_side_3 on_bounded_side = - K_().has_on_bounded_side_3_object(); - // Compute denominator to swith to exact if it is 0 const FT denom = compute_denom(p,q,r); if ( ! CGAL_NTS is_zero(denom) ) { result_type point = weighted_circumcenter(p,q,r); - + // Fast output if ( on_bounded_side(Sphere_3(p,q,r),point) ) return point; } - + // Switch to exact To_exact to_exact; Back_from_exact back_from_exact; - EK::Construct_weighted_circumcenter_3 exact_weighted_circumcenter = - EK().construct_weighted_circumcenter_3_object(); - + Exact_Rt::Construct_weighted_circumcenter_3 exact_weighted_circumcenter = + Exact_Rt().construct_weighted_circumcenter_3_object(); + return back_from_exact(exact_weighted_circumcenter(to_exact(p), - to_exact(q), - to_exact(r))); + to_exact(q), + to_exact(r))); } - + Bare_point operator() ( const Weighted_point_3 & p, const Weighted_point_3 & q ) const { - typename K_::Construct_weighted_circumcenter_3 weighted_circumcenter = - K_().construct_weighted_circumcenter_3_object(); - typename K_::Has_on_bounded_side_3 on_bounded_side = - K_().has_on_bounded_side_3_object(); - + typename Rt::Construct_weighted_circumcenter_3 weighted_circumcenter = + Rt().construct_weighted_circumcenter_3_object(); + typename Rt::Has_on_bounded_side_3 on_bounded_side = + Rt().has_on_bounded_side_3_object(); + // No division here result_type point = weighted_circumcenter(p,q); - + // Fast output if ( on_bounded_side(Sphere_3(p,q),point) ) return point; - + // Switch to exact To_exact to_exact; Back_from_exact back_from_exact; - EK::Construct_weighted_circumcenter_3 exact_weighted_circumcenter = - EK().construct_weighted_circumcenter_3_object(); - + Exact_Rt::Construct_weighted_circumcenter_3 exact_weighted_circumcenter = + Exact_Rt().construct_weighted_circumcenter_3_object(); + return back_from_exact(exact_weighted_circumcenter(to_exact(p), - to_exact(q))); + to_exact(q))); } private: @@ -215,15 +215,15 @@ private: */ template struct Robust_weighted_circumcenter_filtered_traits_3 -: public K_ +: public CGAL::Regular_triangulation_euclidean_traits_3 { typedef CGAL::Robust_filtered_construct_weighted_circumcenter_3 - Construct_weighted_circumcenter_3; - + Construct_weighted_circumcenter_3; + Construct_weighted_circumcenter_3 construct_weighted_circumcenter_3_object() const { return Construct_weighted_circumcenter_3(); } - + }; // end class Robust_weighted_circumcenter_filtered_traits_3 diff --git a/Mesh_3/include/CGAL/Mesh_triangulation_3.h b/Mesh_3/include/CGAL/Mesh_triangulation_3.h index ed2f3c355e4..d2a7d5a290a 100644 --- a/Mesh_3/include/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/include/CGAL/Mesh_triangulation_3.h @@ -39,8 +39,7 @@ namespace CGAL { struct Mesh_geom_traits_generator { private: - typedef Regular_triangulation_filtered_traits_3 Regular_traits; - typedef Robust_weighted_circumcenter_filtered_traits_3 + typedef Robust_weighted_circumcenter_filtered_traits_3 Geom_traits; public: @@ -51,13 +50,11 @@ namespace CGAL { } // end namespace details - - // Struct Mesh_triangulation_3 // template::Kernel> struct Mesh_triangulation_3 -{ + { private: typedef typename details::Mesh_geom_traits_generator::type Geom_traits; typedef Mesh_vertex_base_3 Vertex_base; @@ -71,6 +68,7 @@ public: }; // end struct Mesh_triangulation_3 + } // end namespace CGAL #endif // CGAL_MESH_TRIANGULATION_3_H