From 1db10135a60ce7bdc7f34de12bdc76d1a68b6f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Mar 2020 13:47:50 +0100 Subject: [PATCH] Change namespaces from internal::Convex_hull_3 to Convex_hull_3::internal On-going uniformization work --- ...fspace_intersection_with_constructions_3.h | 2 +- .../CGAL/Extreme_points_traits_adapter_3.h | 33 ++++++----- Convex_hull_3/include/CGAL/convex_hull_3.h | 56 ++++++++++--------- .../quick_hull_default_traits.cpp | 2 +- 4 files changed, 50 insertions(+), 43 deletions(-) diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h index cb994d5d8ea..4b529217f68 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h @@ -142,7 +142,7 @@ namespace CGAL boost::optional::value_type>::Kernel::Point_3> const& origin = boost::none) { typedef typename Kernel_traits::value_type>::Kernel K; typedef typename K::Point_3 Point_3; - typedef typename internal::Convex_hull_3::Default_traits_for_Chull_3::type Traits; + typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3::type Traits; halfspace_intersection_with_constructions_3(pbegin, pend, P, origin, Traits()); } diff --git a/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h b/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h index 2bfc28b4384..8934091b740 100644 --- a/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h +++ b/Convex_hull_3/include/CGAL/Extreme_points_traits_adapter_3.h @@ -24,11 +24,10 @@ #include #include - - namespace CGAL { +namespace Convex_hull_3 { +namespace internal { -namespace Convex_hull_impl{ template struct Forward_functor : public F @@ -67,10 +66,13 @@ struct Forward_functor get(vpm_,s)); } }; -}//end Convex_hull_impl + +} // namespace internal +} // namespace Convex_hull_3 + template< class PointPropertyMap, - class Base_traits=typename internal::Convex_hull_3::Default_traits_for_Chull_3< + class Base_traits = typename Convex_hull_3::internal::Default_traits_for_Chull_3< typename boost::property_traits::value_type>::type > class Extreme_points_traits_adapter_3 @@ -85,10 +87,11 @@ public: {} typedef typename boost::property_traits::key_type Vertex; typedef Vertex Point_3; - typedef Convex_hull_impl::Forward_functor Equal_3; - typedef Convex_hull_impl::Forward_functor Collinear_3; - typedef Convex_hull_impl::Forward_functor Coplanar_3; - typedef Convex_hull_impl::Forward_functor Less_distance_to_point_3; + typedef Convex_hull_3::internal::Forward_functor Equal_3; + typedef Convex_hull_3::internal::Forward_functor Collinear_3; + typedef Convex_hull_3::internal::Forward_functor Coplanar_3; + typedef Convex_hull_3::internal::Forward_functor Less_distance_to_point_3; + class Less_signed_distance_to_plane_3 :public Base_traits::Less_signed_distance_to_plane_3 { @@ -167,11 +170,11 @@ public: Proj_traits_3(const PointPropertyMap& map,const Btt& base): Base_proj_traits(base),vpm_(map){} typedef Point_3 Point_2; - typedef Convex_hull_impl::Forward_functor Equal_2; - typedef Convex_hull_impl::Forward_functor Less_xy_2; - typedef Convex_hull_impl::Forward_functor Less_yx_2; - typedef Convex_hull_impl::Forward_functor Less_signed_distance_to_line_2; - typedef Convex_hull_impl::Forward_functor Left_turn_2; + typedef Convex_hull_3::internal::Forward_functor Equal_2; + typedef Convex_hull_3::internal::Forward_functor Less_xy_2; + typedef Convex_hull_3::internal::Forward_functor Less_yx_2; + typedef Convex_hull_3::internal::Forward_functor Less_signed_distance_to_line_2; + typedef Convex_hull_3::internal::Forward_functor Left_turn_2; class Less_rotate_ccw_2:public Btt::Less_rotate_ccw_2 { @@ -212,7 +215,7 @@ public: Orientation_2 orientation_2_object ()const{return Orientation_2(vpm_,static_cast(this)->orientation_2_object() );} }; - typedef internal::Convex_hull_3::Projection_traits Base_PTraits; + typedef Convex_hull_3::internal::Projection_traits Base_PTraits; typedef Proj_traits_3 Traits_xy_3; typedef Proj_traits_3 Traits_yz_3; typedef Proj_traits_3 Traits_xz_3; diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 15dd55705fd..d1a1be76a2d 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -67,7 +67,8 @@ namespace CGAL { // Forward declaration template class Extreme_points_traits_adapter_3; -namespace internal{ namespace Convex_hull_3{ +namespace Convex_hull_3 { +namespace internal { // wrapper used as a MutableFaceGraph to extract extreme points template @@ -81,7 +82,7 @@ struct Output_iterator_wrapper template void add_isolated_points(const Point_3& point, - internal::Convex_hull_3::Output_iterator_wrapper& w) + Convex_hull_3::internal::Output_iterator_wrapper& w) { *w.out++ = point; } @@ -94,16 +95,17 @@ void add_isolated_points(const Point_3& point, Polyhedron_3& P) template void copy_ch2_to_face_graph(const std::list& CH_2, - internal::Convex_hull_3::Output_iterator_wrapper& w) + Convex_hull_3::internal::Output_iterator_wrapper& w) { for(const Point_3& p : CH_2) *w.out++ = p; } -} } // internal::Convex_hull_3 +} // namespace internal +} // namespace Convex_hull_3 template -void copy_face_graph(const TDS& tds, internal::Convex_hull_3::Output_iterator_wrapper& wrapper) +void copy_face_graph(const TDS& tds, Convex_hull_3::internal::Output_iterator_wrapper& wrapper) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typename boost::property_map::const_type vpm = get(boost::vertex_point, tds); @@ -114,12 +116,12 @@ void copy_face_graph(const TDS& tds, internal::Convex_hull_3::Output_iterator_wr } template -void clear(internal::Convex_hull_3::Output_iterator_wrapper&) +void clear(Convex_hull_3::internal::Output_iterator_wrapper&) {} template void make_tetrahedron(const Point& p0, const Point& p1, const Point& p2, const Point& p3, - internal::Convex_hull_3::Output_iterator_wrapper& w) + Convex_hull_3::internal::Output_iterator_wrapper& w) { *w.out++ = p0; *w.out++ = p1; @@ -129,19 +131,20 @@ void make_tetrahedron(const Point& p0, const Point& p1, const Point& p2, const P } // CGAL -namespace boost{ +namespace boost { + // needed so that the regular make_tetrahedron of CGAL does not complain when tried to be instantiated template -struct graph_traits > +struct graph_traits > { typedef void* halfedge_descriptor; }; -} + +} // namespace boost namespace CGAL { - - -namespace internal{ namespace Convex_hull_3{ +namespace Convex_hull_3 { +namespace internal { //struct to select the default traits class for computing convex hull template< class Point_3, @@ -440,7 +443,7 @@ void coplanar_3_hull(InputIterator first, InputIterator beyond, const Point_3& p1, const Point_3& p2, const Point_3& p3, Polyhedron_3& P, const Traits& traits ) { - typedef typename internal::Convex_hull_3::Projection_traits PTraits; + typedef typename Convex_hull_3::internal::Projection_traits PTraits; typedef typename PTraits::Traits_xy_3 Traits_xy_3; typedef typename PTraits::Traits_yz_3 Traits_yz_3; typedef typename PTraits::Traits_xz_3 Traits_xz_3; @@ -848,7 +851,8 @@ ch_quickhull_polyhedron_3(std::list& points, } -} } //namespace internal::Convex_hull_3 +} // namespace internal +} // namespace Convex_hull_3 template void @@ -936,7 +940,7 @@ convex_hull_3(InputIterator first, InputIterator beyond, } // result will be a polyhedron - typedef typename internal::Convex_hull_3::Default_polyhedron_for_Chull_3::type Polyhedron; + typedef typename Convex_hull_3::internal::Default_polyhedron_for_Chull_3::type Polyhedron; Polyhedron P; P3_iterator minx, maxx, miny, it; @@ -948,9 +952,9 @@ convex_hull_3(InputIterator first, InputIterator beyond, if(it->y() < miny->y()) miny = it; } if(! collinear(*minx, *maxx, *miny) ){ - internal::Convex_hull_3::ch_quickhull_polyhedron_3(points, minx, maxx, miny, P, traits); + Convex_hull_3::internal::ch_quickhull_polyhedron_3(points, minx, maxx, miny, P, traits); } else { - internal::Convex_hull_3::ch_quickhull_polyhedron_3(points, point1_it, point2_it, point3_it, P, traits); + Convex_hull_3::internal::ch_quickhull_polyhedron_3(points, point1_it, point2_it, point3_it, P, traits); } CGAL_assertion(num_vertices(P)>=3); typename boost::graph_traits::vertex_iterator b,e; @@ -976,7 +980,7 @@ template void convex_hull_3(InputIterator first, InputIterator beyond, Object& ch_object) { typedef typename std::iterator_traits::value_type Point_3; - typedef typename internal::Convex_hull_3::Default_traits_for_Chull_3::type Traits; + typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3::type Traits; convex_hull_3(first, beyond, ch_object, Traits()); } @@ -1009,7 +1013,7 @@ void convex_hull_3(InputIterator first, InputIterator beyond, // if there is only one point or all points are equal if(point2_it == points.end()) { - internal::Convex_hull_3::add_isolated_points(*point1_it, polyhedron); + Convex_hull_3::internal::add_isolated_points(*point1_it, polyhedron); return; } @@ -1028,12 +1032,12 @@ void convex_hull_3(InputIterator first, InputIterator beyond, min_max_element(points.begin(), points.end(), boost::bind(less_dist, *points.begin(), _1, _2), boost::bind(less_dist, *points.begin(), _1, _2)); - internal::Convex_hull_3::add_isolated_points(*endpoints.first, polyhedron); - internal::Convex_hull_3::add_isolated_points(*endpoints.second, polyhedron); + Convex_hull_3::internal::add_isolated_points(*endpoints.first, polyhedron); + Convex_hull_3::internal::add_isolated_points(*endpoints.second, polyhedron); return; } - internal::Convex_hull_3::ch_quickhull_polyhedron_3(points, point1_it, point2_it, point3_it, + Convex_hull_3::internal::ch_quickhull_polyhedron_3(points, point1_it, point2_it, point3_it, polyhedron, traits); } @@ -1046,7 +1050,7 @@ void convex_hull_3(InputIterator first, InputIterator beyond, >::type* =0) //workaround to avoid ambiguity with next overload. { typedef typename std::iterator_traits::value_type Point_3; - typedef typename internal::Convex_hull_3::Default_traits_for_Chull_3::type Traits; + typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3::type Traits; convex_hull_3(first, beyond, polyhedron, Traits()); } @@ -1080,7 +1084,7 @@ extreme_points_3(const InputRange& range, OutputIterator out, const Traits& traits) { - internal::Convex_hull_3::Output_iterator_wrapper wrapper(out); + Convex_hull_3::internal::Output_iterator_wrapper wrapper(out); convex_hull_3(range.begin(), range.end(), wrapper, traits); return out; } @@ -1091,7 +1095,7 @@ extreme_points_3(const InputRange& range, OutputIterator out) { typedef typename InputRange::const_iterator Iterator_type; typedef typename std::iterator_traits::value_type Point_3; - typedef typename internal::Convex_hull_3::Default_traits_for_Chull_3::type Traits; + typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3::type Traits; return extreme_points_3(range, out, Traits()); } diff --git a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp index 968cbf5a510..1ae001fc693 100644 --- a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp +++ b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp @@ -19,7 +19,7 @@ typedef CGAL::Simple_cartesian SCD; typedef CGAL::Simple_homogeneous SHD; typedef CGAL::Simple_cartesian SCR; -using namespace CGAL::internal::Convex_hull_3; +using namespace CGAL::Convex_hull_3::internal; int main() {