diff --git a/Orthtree/examples/Orthtree/orthtree_build.cpp b/Orthtree/examples/Orthtree/orthtree_build.cpp index 114e709ad12..54d629a5916 100644 --- a/Orthtree/examples/Orthtree/orthtree_build.cpp +++ b/Orthtree/examples/Orthtree/orthtree_build.cpp @@ -12,14 +12,15 @@ using Kernel = CGAL::Epick_d; using Point_d = Kernel::Point_d; using Point_vector = std::vector; using Traits = CGAL::Orthtree_traits_point; -using Orthtree = CGAL::Orthtree; +using Traits2 = CGAL::Orthtree_traits_point::value_type>, CGAL::Dimension_tag<4>>; +using Orthtree = CGAL::Orthtree; int main() { CGAL::Random r; Point_vector points_dd; - for (std::size_t i = 0; i < 5; ++ i) + for (std::size_t i = 0; i < 500; ++ i) { std::array init{}; for (double& v : init) diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index fea8a74713c..43d9c78c177 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -167,6 +168,7 @@ private: // data members : Node_property_container::Array & m_node_children; using Bbox_dimensions = std::array; + CGAL::NT_converter conv; Bbox_dimensions m_bbox_min; std::vector m_side_per_depth; /* side length per node's depth */ @@ -473,7 +475,7 @@ public: using Cartesian_coordinate = std::array; Cartesian_coordinate min_corner, max_corner; Bbox_dimensions size = m_side_per_depth[depth(n)]; - CGAL::Cartesian_converter conv; + for (int i = 0; i < Dimension::value; i++) { min_corner[i] = conv(m_bbox_min[i] + int(global_coordinates(n)[i]) * size[i]); max_corner[i] = conv(m_bbox_min[i] + int(global_coordinates(n)[i] + 1) * size[i]); @@ -971,7 +973,7 @@ public: bary[i] = FT(global_coordinates(n)[i]) * size[i] + size[i] / FT(2) + m_bbox_min[i]; // Convert that location into a point - CGAL::Cartesian_converter conv; + std::array tmp; for (std::size_t i = 0; i < Dimension::value; i++) tmp[i] = conv(bary[i]); diff --git a/Orthtree/include/CGAL/Orthtree_traits_base_for_dimension.h b/Orthtree/include/CGAL/Orthtree_traits_base_for_dimension.h index ad55e7ba59d..8729fa9c98a 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_base_for_dimension.h +++ b/Orthtree/include/CGAL/Orthtree_traits_base_for_dimension.h @@ -54,7 +54,7 @@ struct Orthtree_traits_base_for_dimension { auto construct_point_d_object() const { return [](auto... Args) -> Point_d { std::initializer_list args_list{Args...}; - return Point_d{args_list.size(), args_list.begin(), args_list.end()}; + return Point_d{static_cast(args_list.size()), args_list.begin(), args_list.end()}; }; } /// @}