diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits_2.h b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits_2.h index 0800d966b2b..eeb824d0f96 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits_2.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBRayIntersectionGeomTraits_2.h @@ -22,12 +22,12 @@ define the Intersection_distance functor. class AABBRayIntersectionGeomTraits_2 { public: /*! - Type of a 3D ray. + Type of a 2D ray. */ typedef unspecified_type Ray_2; /*! - Type of a 3D vector. + Type of a 2D vector. */ typedef unspecified_type Vector_2; @@ -42,12 +42,12 @@ public: Construct_source_2 construct_source_2_object(); /*! - A model of `CartesianConstIterator3`. + A model of `CartesianConstIterator2`. */ typedef unspecified_type Cartesian_const_iterator_2; /*! - A model of `ConstructCartesianConstIterator3`. + A model of `ConstructCartesianConstIterator2`. */ typedef unspecified_type Construct_cartesian_const_iterator_2; diff --git a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h index 685ce425d66..8fd9ef2458e 100644 --- a/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h +++ b/AABB_tree/doc/AABB_tree/Concepts/AABBTraits.h @@ -28,7 +28,7 @@ Value type of the `Squared_distance` functor. typedef unspecified_type FT; /*! -Type of a 3D point. +Type of a point. */ typedef unspecified_type Point; diff --git a/AABB_tree/include/CGAL/AABB_traits_2.h b/AABB_tree/include/CGAL/AABB_traits_2.h index 6300d4188bf..8ccc73fbcf3 100644 --- a/AABB_tree/include/CGAL/AABB_traits_2.h +++ b/AABB_tree/include/CGAL/AABB_traits_2.h @@ -46,11 +46,8 @@ struct AABB_traits_intersection_base_2{}; template struct AABB_traits_intersection_base_2{ - typedef typename GeomTraits::Ray_2 Ray_2; typedef typename GeomTraits::Ray_2 Ray; - typedef typename GeomTraits::Point_2 Point_2; typedef typename GeomTraits::Point_2 Point; - typedef typename GeomTraits::Vector_2 Vector_2; typedef typename GeomTraits::Vector_2 Vector; typedef typename GeomTraits::FT FT; typedef typename GeomTraits::Cartesian_const_iterator_2 Cartesian_const_iterator_2; @@ -65,7 +62,7 @@ struct AABB_traits_intersection_base_2{ typedef typename CGAL::Bbox_2 Bounding_box; struct Intersection_distance { - std::optional operator()(const Ray_2& ray, const Bounding_box& bbox) const { + std::optional operator()(const Ray& ray, const Bounding_box& bbox) const { FT t_near = -DBL_MAX; // std::numeric_limits::lowest(); C++1903 FT t_far = DBL_MAX; @@ -73,8 +70,8 @@ struct AABB_traits_intersection_base_2{ = GeomTraits().construct_cartesian_const_iterator_2_object(); const Construct_source_2 construct_source_2 = GeomTraits().construct_source_2_object(); const Construct_vector_2 construct_vector_2 = GeomTraits().construct_vector_2_object(); - const Point_2 source = construct_source_2(ray); - const Vector_2 direction = construct_vector_2(ray); + const Point source = construct_source_2(ray); + const Vector direction = construct_vector_2(ray); Cartesian_const_iterator_2 source_iter = construct_cartesian_const_iterator_2(source); Cartesian_const_iterator_2 direction_iter = construct_cartesian_const_iterator_2(direction); @@ -90,13 +87,6 @@ struct AABB_traits_intersection_base_2{ t_near = (std::max)(t_near, (std::min)(t1, t2)); t_far = (std::min)(t_far, (std::max)(t1, t2)); - // if(t1 > t2) - // std::swap(t1, t2); - // if(t1 > t_near) - // t_near = t1; - // if(t2 < t_far) - // t_far = t2; - if(t_near > t_far || t_far < FT(0.)) return std::nullopt; } @@ -190,13 +180,10 @@ public: /// \name Types /// @{ - /// Point query type. - typedef typename GeomTraits::Point_2 Point_2; - /// /// point type /// - typedef Point_2 Point; + typedef typename GeomTraits::Point_2 Point; /// additional types for the search tree, required by the RangeSearchTraits concept /// \bug This is not documented for now in the AABBTraits concept. @@ -360,7 +347,7 @@ public: // This should go down to the GeomTraits, i.e. the kernel class Closest_point { - typedef typename AT::Point_2 Point; + typedef typename AT::Point Point; typedef typename AT::Primitive Primitive; const AABB_traits_2& m_traits; public: @@ -384,7 +371,7 @@ public: // do_intersect to something like does_contain (this is what we compute, // this is not the same do_intersect as the spherical kernel) class Compare_distance { - typedef typename AT::Point_2 Point; + typedef typename AT::Point Point; typedef typename AT::FT FT; typedef typename AT::Primitive Primitive; public: diff --git a/AABB_tree/include/CGAL/AABB_traits_3.h b/AABB_tree/include/CGAL/AABB_traits_3.h index 9e9499b5971..97d1a156def 100644 --- a/AABB_tree/include/CGAL/AABB_traits_3.h +++ b/AABB_tree/include/CGAL/AABB_traits_3.h @@ -69,11 +69,8 @@ struct AABB_traits_intersection_base{}; template struct AABB_traits_intersection_base{ - typedef typename GeomTraits::Ray_3 Ray_3; typedef typename GeomTraits::Ray_3 Ray; - typedef typename GeomTraits::Point_3 Point_3; typedef typename GeomTraits::Point_3 Point; - typedef typename GeomTraits::Vector_3 Vector_3; typedef typename GeomTraits::Vector_3 Vector; typedef typename GeomTraits::FT FT; typedef typename GeomTraits::Cartesian_const_iterator_3 Cartesian_const_iterator_3; @@ -88,7 +85,7 @@ struct AABB_traits_intersection_base{ typedef typename CGAL::Bbox_3 Bounding_box; struct Intersection_distance { - std::optional operator()(const Ray_3& ray, const Bounding_box& bbox) const { + std::optional operator()(const Ray& ray, const Bounding_box& bbox) const { FT t_near = -DBL_MAX; // std::numeric_limits::lowest(); C++1903 FT t_far = DBL_MAX; @@ -113,13 +110,6 @@ struct AABB_traits_intersection_base{ t_near = (std::max)(t_near, (std::min)(t1, t2)); t_far = (std::min)(t_far, (std::max)(t1, t2)); - // if(t1 > t2) - // std::swap(t1, t2); - // if(t1 > t_near) - // t_near = t1; - // if(t2 < t_far) - // t_far = t2; - if(t_near > t_far || t_far < FT(0.)) return std::nullopt; } @@ -213,11 +203,8 @@ public: /// \name Types /// @{ - /// Point query type. - typedef typename GeomTraits::Point_3 Point_3; - - /// Poin type - typedef Point_3 Point; // because the AABB_tree is dimension agnostic + /// Point type + typedef typename GeomTraits::Point_3 Point; // because the AABB_tree is dimension agnostic /// additional types for the search tree, required by the RangeSearchTraits concept /// \bug This is not documented for now in the AABBTraits concept. @@ -384,7 +371,7 @@ public: // This should go down to the GeomTraits, i.e. the kernel class Closest_point { - typedef typename AT::Point_3 Point; + typedef typename AT::Point Point; typedef typename AT::Primitive Primitive; const AABB_traits_3& m_traits; public: @@ -408,7 +395,7 @@ public: // do_intersect to something like does_contain (this is what we compute, // this is not the same do_intersect as the spherical kernel) class Compare_distance { - typedef typename AT::Point_3 Point; + typedef typename AT::Point Point; typedef typename AT::FT FT; typedef typename AT::Primitive Primitive; public: diff --git a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h index b670266e8a4..9103b05e6b7 100644 --- a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_ray_intersection.h @@ -204,7 +204,7 @@ std::optional< typename AABB_tree::template Intersection_and_primiti AABB_tree::first_intersection(const Ray& query, const SkipFunctor& skip) const { static_assert(std::is_same::value, - "Ray and Ray_3 must be the same type"); + "Ray and AABBTraits::Ray must be the same type"); switch(size()) // copy-paste from AABB_tree::traversal { diff --git a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h index cb421f42ba4..11fe903df93 100644 --- a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h +++ b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h @@ -59,7 +59,7 @@ template class First_intersection_traits { typedef typename AABBTraits::FT FT; - typedef typename AABBTraits::Point_3 Point; + typedef typename AABBTraits::Point Point; typedef typename AABBTraits::Primitive Primitive; typedef typename AABBTraits::Bounding_box Bounding_box; typedef typename AABBTraits::Primitive::Id Primitive_id; @@ -108,7 +108,7 @@ template class Listing_intersection_traits { typedef typename AABBTraits::FT FT; - typedef typename AABBTraits::Point_3 Point; + typedef typename AABBTraits::Point Point; typedef typename AABBTraits::Primitive Primitive; typedef typename AABBTraits::Bounding_box Bounding_box; typedef typename AABBTraits::Primitive::Id Primitive_id; @@ -191,7 +191,7 @@ template class First_primitive_traits { typedef typename AABBTraits::FT FT; - typedef typename AABBTraits::Point_3 Point; + typedef typename AABBTraits::Point Point; typedef typename AABBTraits::Primitive Primitive; typedef typename AABBTraits::Bounding_box Bounding_box; typedef typename AABBTraits::Primitive::Id Primitive_id; @@ -237,7 +237,7 @@ template class Do_intersect_traits { typedef typename AABBTraits::FT FT; - typedef typename AABBTraits::Point_3 Point; + typedef typename AABBTraits::Point Point; typedef typename AABBTraits::Primitive Primitive; typedef typename AABBTraits::Bounding_box Bounding_box; typedef typename AABBTraits::Primitive::Id Primitive_id; diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index fae5abfe17c..9bce2bd1456 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -322,7 +322,7 @@ class Naive_implementations typedef typename Traits::Object_and_primitive_id Object_and_primitive_id; typedef typename Pr::Id Primitive_id; typedef typename Traits::FT FT; - typedef typename Traits::Point_3 Point; + typedef typename Traits::Point Point; typedef typename Traits::Point_and_primitive_id Point_and_primitive_id; typedef std::optional Intersection_result;