CGAL 5.6.3 - Quadtrees, Octrees, and Orthtrees

Loading...
Searching...
No Matches
Orthtree/orthtree_build.cpp
#include <iostream>
#include <CGAL/Epick_d.h>
#include <CGAL/Orthtree.h>
#include <CGAL/Orthtree_traits_d.h>
#include <CGAL/Random.h>
// Type Declarations
typedef CGAL::Dimension_tag<4> Dimension;
typedef CGAL::Epick_d<Dimension> Kernel;
typedef Kernel::Point_d Point_d;
typedef std::vector<Point_d> Point_vector;
typedef CGAL::Orthtree_traits_d<Kernel, Dimension> Traits;
typedef CGAL::Orthtree<Traits, Point_vector> Orthtree;
int main()
{
CGAL::Random r;
Point_vector points_dd;
for (std::size_t i = 0; i < 5; ++ i)
{
std::array<double, Dimension::value> init;
for (double& v : init)
v = r.get_double(-1., 1.);
points_dd.emplace_back (init.begin(), init.end());
}
Orthtree orthtree(points_dd);
orthtree.refine(10, 5);
return EXIT_SUCCESS;
}
CGAL::Orthtree
A data structure using an axis-aligned hybercubic decomposition of dD space for efficient point acces...
Definition: Orthtree.h:69
Kernel
CGAL::Dimension_tag
CGAL::Epick_d
CGAL::Orthtree_traits_d
The class Orthtree_traits_d can be used as a template parameter of the Orthtree class.
Definition: Orthtree_traits_d.h:39