diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_3.h index 07bdcf92f85..b53cafc3d90 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_3.h @@ -29,7 +29,7 @@ public: /// \name Types /// @{ -typedef RegularTriangulationTraits_3::Bare_point Bare_point; +typedef RegularTriangulationTraits_3::Point_3 Bare_point; /// @} /*! \name Access function @@ -48,7 +48,7 @@ Note that this point has no weight. /// @{ /*! Returns the weighted circumcenter of the cell. -Be careful that the return type is `RegularTriangulationTraits_3::Bare_point`, +Be careful that the return type is `Bare_point`, and the radius of the weighted circumcenter is not supposed to be computed by the constructor `Construct_weighted_circumcenter_3` of the traits diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h index 93f83bdff27..8df8070df7a 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h @@ -33,7 +33,7 @@ public: /// \name Types /// @{ -typedef RegularTriangulationTraits_3::Bare_point Bare_point; +typedef RegularTriangulationTraits_3::Point_3 Bare_point; /// @} /*! \name Access function diff --git a/Triangulation_3/examples/Triangulation_3/parallel_insertion_and_removal_in_regular_3.cpp b/Triangulation_3/examples/Triangulation_3/parallel_insertion_and_removal_in_regular_3.cpp index fb63f969ab5..249d715b20f 100644 --- a/Triangulation_3/examples/Triangulation_3/parallel_insertion_and_removal_in_regular_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/parallel_insertion_and_removal_in_regular_3.cpp @@ -10,7 +10,6 @@ int main() { #ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Exact_predicates_inexact_constructions_kernel K; - typedef K::Point_3 Point; // Regular T3 typedef CGAL::Triangulation_data_structure_3< @@ -19,17 +18,20 @@ int main() CGAL::Parallel_tag> Tds; typedef CGAL::Regular_triangulation_3 Rt; + + typedef Rt::Bare_point Bare_point; + typedef Rt::Weighted_point Weighted_point; typedef Rt::Vertex_handle Vertex_handle; const int NUM_INSERTED_POINTS = 5000; - CGAL::Random_points_in_cube_3 rnd(1.); + CGAL::Random_points_in_cube_3 rnd(1.); // Construction from a vector of 1,000,000 points - std::vector V; + std::vector V; V.reserve(NUM_INSERTED_POINTS); for (int i = 0; i != NUM_INSERTED_POINTS; ++i) - V.push_back(*rnd++); + V.push_back(Weighted_point(*rnd++)); // Construct the locking data-structure, using the bounding-box of the points Rt::Lock_data_structure locking_ds( diff --git a/Triangulation_3/include/CGAL/Regular_traits_adaptor.h b/Triangulation_3/include/CGAL/Regular_traits_adaptor.h index 9ea06382499..31ab041fbef 100644 --- a/Triangulation_3/include/CGAL/Regular_traits_adaptor.h +++ b/Triangulation_3/include/CGAL/Regular_traits_adaptor.h @@ -27,9 +27,7 @@ #include -#include #include -#include namespace CGAL { @@ -43,19 +41,13 @@ class Regular_traits_adaptor typedef Functor_ Functor; typedef typename RTraits::FT FT; -#if 0 - typedef typename boost::mpl::eval_if_c< - internal::Has_nested_type_Bare_point::value, - typename internal::Bare_point_type, - boost::mpl::identity - >::type Point_3; -#else - typedef typename RTT::Point_3 Point_3; -#endif - typedef typename RTraits::Tetrahedron_3 Tetrahedron_3; - typedef typename RTraits::Plane_3 Plane_3; + + typedef typename RTraits::Tetrahedron_3 Tetrahedron_3; + typedef typename RTraits::Plane_3 Plane_3; typedef typename RTraits::Sphere_3 Sphere_3; - typedef typename RTraits::Weighted_point_3 Weighted_point_3; + + typedef typename RTT::Point_3 Point_3; + typedef typename RTT::Weighted_point_3 Weighted_point_3; template struct Conv_wp_to_p diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 9341b1804a4..73007de22ed 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -366,12 +366,14 @@ namespace CGAL { typedef typename Tr_Base::Finite_edges_iterator Finite_edges_iterator; typedef typename Tr_Base::All_cells_iterator All_cells_iterator; - typedef typename Gt::Weighted_point_3 Weighted_point; + // Traits are not supposed to define Bare_point, but leaving below + // for backward compatibility typedef typename boost::mpl::eval_if_c< internal::Has_nested_type_Bare_point::value, typename internal::Bare_point_type, boost::mpl::identity >::type Bare_point; + typedef typename Gt::Weighted_point_3 Weighted_point; typedef typename Gt::Segment_3 Segment; typedef typename Gt::Triangle_3 Triangle; @@ -2240,7 +2242,8 @@ dual(Cell_handle c) const Regular_triangulation_3:: is_Gabriel(Vertex_handle v) const { - return nearest_power_vertex( v->point().point(), v->cell()) == v; + return nearest_power_vertex( + geom_traits().construct_point_3_object()(v->point()), v->cell()) == v; } // Returns diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h index d734b554a11..2d19ca3ed46 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h @@ -44,7 +44,8 @@ public: typedef GT Geom_traits; - typedef typename Geom_traits::Weighted_point_3 Point; + typedef typename Geom_traits::Point_3 Bare_point; + typedef typename Geom_traits::Weighted_point_3 Weighted_point; typedef C Point_container; typedef typename Point_container::iterator Point_iterator; @@ -81,13 +82,13 @@ public: Point_const_iterator hidden_points_begin() const { return _hidden.begin(); } Point_const_iterator hidden_points_end() const { return _hidden.end(); } - void hide_point (const Point &p) { _hidden.push_back(p); } + void hide_point (const Weighted_point &p) { _hidden.push_back(p); } // void unhide_point (Point_iterator i) { _hidden.delete(i); } //note this function is not requested by the RegularTriangulationCellBase_3 //it should be replaced everywhere by weighted_circumcenter() // but remains here for backward compatibility - typename Geom_traits::Point_3 + Bare_point circumcenter(const Geom_traits& gt = Geom_traits()) const { return gt.construct_weighted_circumcenter_3_object() @@ -97,7 +98,7 @@ public: this->vertex(3)->point()); } - typename Geom_traits::Point_3 + Bare_point weighted_circumcenter(const Geom_traits& gt = Geom_traits()) const { return gt.construct_weighted_circumcenter_3_object() diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h index 97e08089c82..e2020084073 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h @@ -26,10 +26,13 @@ #include - #include #include #include +#include + +#include +#include namespace CGAL { @@ -37,8 +40,14 @@ template < typename GT, typename Cb = Regular_triangulation_cell_base_3 > class Regular_triangulation_cell_base_with_weighted_circumcenter_3 : public Cb { - typedef typename GT::Point_3 Point_3; - typedef typename GT::Bare_point Bare_point; + // Traits are not supposed to define Bare_point, but leaving this + // for backward compatibility since GT::Point_3 could be a K::Weighted_point_3 + // in older traits + typedef typename boost::mpl::eval_if_c< + internal::Has_nested_type_Bare_point::value, + typename internal::Bare_point_type, + boost::mpl::identity + >::type Bare_point; mutable Bare_point * weighted_circumcenter_; diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_regular_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_regular_3.h index 9016512ff7c..16a528180cc 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_regular_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_regular_3.h @@ -28,17 +28,17 @@ template void _test_cls_regular_3(const Triangulation &) { - typedef Triangulation Cls; - typedef typename Triangulation::Traits Tr; - CGAL_USE_TYPE(Tr); + typedef Triangulation Cls; + typedef typename Triangulation::Geom_traits Gt; + CGAL_USE_TYPE(Gt); - typedef typename Triangulation::Bare_point Bare_point; // We assume the traits class has been tested already // actually, any traits is good if it has been tested - // typedef typename Cls::Bare_point Point; - typedef typename Cls::Weighted_point Weighted_point; - typedef std::list list_point; + typedef typename Cls::Bare_point Bare_point; + typedef typename Cls::Weighted_point Weighted_point; + + typedef std::list list_point; // temporary version