Use Orthtree everywhere + define Octree/Quadtree aliases
|
|
@ -130,7 +130,7 @@
|
||||||
\package_listing{SearchStructures}
|
\package_listing{SearchStructures}
|
||||||
\package_listing{Box_intersection_d}
|
\package_listing{Box_intersection_d}
|
||||||
\package_listing{AABB_tree}
|
\package_listing{AABB_tree}
|
||||||
\package_listing{Octree}
|
\package_listing{Orthtree}
|
||||||
\package_listing{Spatial_sorting}
|
\package_listing{Spatial_sorting}
|
||||||
\package_listing{Optimal_bounding_box}
|
\package_listing{Optimal_bounding_box}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ Minkowski_sum_3 3D Minkowski Sum of Polyhedra
|
||||||
Nef_2 2D Boolean Operations on Nef Polygons
|
Nef_2 2D Boolean Operations on Nef Polygons
|
||||||
Nef_3 3D Boolean Operations on Nef Polyhedra
|
Nef_3 3D Boolean Operations on Nef Polyhedra
|
||||||
Nef_S2 2D Boolean Operations on Nef Polygons Embedded on the Sphere
|
Nef_S2 2D Boolean Operations on Nef Polygons Embedded on the Sphere
|
||||||
Octree Octree
|
Orthtree Quadtree, Octree and Orthree
|
||||||
Optimal_bounding_box Optimal Bounding Box
|
Optimal_bounding_box Optimal Bounding Box
|
||||||
Optimal_transportation_reconstruction_2 Optimal Transportation Curve Reconstruction
|
Optimal_transportation_reconstruction_2 Optimal Transportation Curve Reconstruction
|
||||||
Partition_2 2D Polygon Partitioning
|
Partition_2 2D Polygon Partitioning
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/// \defgroup PkgOctreeRef Octree Reference
|
|
||||||
|
|
||||||
/// \defgroup PkgOctreeClasses Classes
|
|
||||||
/// \ingroup PkgOctreeRef
|
|
||||||
|
|
||||||
/// \defgroup PkgOctreeConcepts Concepts
|
|
||||||
/// \ingroup PkgOctreeRef
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\addtogroup PkgOctreeRef
|
|
||||||
|
|
||||||
\cgalPkgDescriptionBegin{Octree,PkgOctree}
|
|
||||||
\cgalPkgPicture{octree_thumbnail.png}
|
|
||||||
\cgalPkgSummaryBegin
|
|
||||||
\cgalPkgAuthor{Jackson Campolattaro, Cédric Portaneri, Tong Zhao, xxx}
|
|
||||||
\cgalPkgDesc{The Octree package provides a data structure that subdivides 3d space, and a collection of algorithms for operating on the structure.}
|
|
||||||
\cgalPkgManuals{Chapter_Octree,PkgOctreeRef}
|
|
||||||
\cgalPkgSummaryEnd
|
|
||||||
|
|
||||||
\cgalPkgShortInfoBegin
|
|
||||||
\cgalPkgSince{5.3}
|
|
||||||
\cgalPkgBib{cgal:cpz-o}
|
|
||||||
\cgalPkgDemo{Polyhedron demo,polyhedron_3.zip}
|
|
||||||
\cgalPkgShortInfoEnd
|
|
||||||
|
|
||||||
\cgalPkgDescriptionEnd
|
|
||||||
|
|
||||||
\todo * Thumbnail
|
|
||||||
|
|
||||||
\todo * Windows demo
|
|
||||||
|
|
||||||
\cgalClassifedRefPages
|
|
||||||
|
|
||||||
\cgalCRPSection{Concepts}
|
|
||||||
- `Traversal`
|
|
||||||
- `SplitCriterion`
|
|
||||||
|
|
||||||
\cgalCRPSection{Classes}
|
|
||||||
- `CGAL::Octree::Octree<class PointRange, class PointMap>`
|
|
||||||
- `CGAL::Octree::Node<class Point_index>`
|
|
||||||
*/
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
|
||||||
#include <CGAL/Octree.h>
|
|
||||||
#include <CGAL/Octree/IO.h>
|
|
||||||
|
|
||||||
// Type Declarations
|
|
||||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
|
||||||
typedef Kernel::Point_2 Point;
|
|
||||||
typedef std::vector<Point> Point_vector;
|
|
||||||
typedef CGAL::Octree::Octree<Point_vector> Octree;
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
|
|
||||||
// Here, our point set is a vector
|
|
||||||
Point_vector points;
|
|
||||||
|
|
||||||
// Add a few points to the vector
|
|
||||||
points.emplace_back(1, 1, 1);
|
|
||||||
points.emplace_back(2, 1, -11);
|
|
||||||
points.emplace_back(2, 1, 1);
|
|
||||||
points.emplace_back(1, -2, 1);
|
|
||||||
points.emplace_back(1, 1, 1);
|
|
||||||
points.emplace_back(-1, 1, 1);
|
|
||||||
|
|
||||||
// Create an octree from the points
|
|
||||||
Octree octree(points);
|
|
||||||
|
|
||||||
// Build the octree
|
|
||||||
octree.refine(10, 20);
|
|
||||||
|
|
||||||
std::cout << (2 << (3-1)) << std::endl;
|
|
||||||
std::cout << (2 << (2-1)) << std::endl;
|
|
||||||
|
|
||||||
// Print out the tree
|
|
||||||
std::cout << octree;
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Created by the script cgal_create_cmake_script
|
||||||
|
# This is the CMake script for compiling a CGAL application.
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.1...3.14)
|
||||||
|
project(Octree_benchmarks)
|
||||||
|
|
||||||
|
# TODO: I shouldn't leave this here
|
||||||
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
|
||||||
|
find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core)
|
||||||
|
|
||||||
|
create_single_source_cgal_program("construction.cpp")
|
||||||
|
create_single_source_cgal_program("nearest_neighbor.cpp")
|
||||||
|
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
|
||||||
|
#define CGAL_TRACE_STREAM std::cerr
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
#include <CGAL/Octree.h>
|
||||||
|
|
||||||
|
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||||
|
typedef Kernel::Point_3 Point;
|
||||||
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
|
|
||||||
|
typedef CGAL::Octree::Octree<Point_set, typename Point_set::Point_map> Octree;
|
||||||
|
|
||||||
|
using std::chrono::high_resolution_clock;
|
||||||
|
using std::chrono::duration_cast;
|
||||||
|
using std::chrono::microseconds;
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
// Set output file
|
||||||
|
std::ofstream file;
|
||||||
|
file.open((argc > 1) ? argv[1] : "../construction_benchmark.csv");
|
||||||
|
|
||||||
|
// Add header for CSV
|
||||||
|
file << "Number of Points,Build Time (ms) \n";
|
||||||
|
|
||||||
|
// Perform tests for various dataset sizes
|
||||||
|
for (size_t num_points = 10; num_points < 1000000; num_points *= 1.1) {
|
||||||
|
|
||||||
|
// Create a collection of the right number of points
|
||||||
|
auto points = generate<Kernel>(num_points);
|
||||||
|
|
||||||
|
// Start the timer
|
||||||
|
auto start = high_resolution_clock::now();
|
||||||
|
|
||||||
|
// Build the tree
|
||||||
|
Octree octree(points, points.point_map());
|
||||||
|
octree.refine();
|
||||||
|
|
||||||
|
// End the timer
|
||||||
|
auto end = high_resolution_clock::now();
|
||||||
|
|
||||||
|
file << num_points << ",";
|
||||||
|
file << duration_cast<microseconds>(end - start).count() << "\n";
|
||||||
|
|
||||||
|
std::cout << num_points << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
#define CGAL_TRACE_STREAM std::cerr
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
#include <CGAL/Octree.h>
|
||||||
|
|
||||||
|
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||||
|
typedef Kernel::Point_3 Point;
|
||||||
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
|
|
||||||
|
typedef CGAL::Octree::Octree<Point_set, typename Point_set::Point_map> Octree;
|
||||||
|
|
||||||
|
using std::chrono::high_resolution_clock;
|
||||||
|
using std::chrono::duration_cast;
|
||||||
|
using std::chrono::microseconds;
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
// Set output file
|
||||||
|
std::ofstream file;
|
||||||
|
file.open((argc > 1) ? argv[1] : "../nearest_neighbor_benchmark.csv");
|
||||||
|
|
||||||
|
// Add header for CSV
|
||||||
|
file << "Number of Points,Search Time (ms) \n";
|
||||||
|
|
||||||
|
// Perform tests for various dataset sizes
|
||||||
|
for (size_t num_points = 10; num_points < 1000000; num_points *= 1.1) {
|
||||||
|
|
||||||
|
// Create a collection of the right number of points
|
||||||
|
auto points = generate<Kernel>(num_points);
|
||||||
|
|
||||||
|
// Create a search point
|
||||||
|
auto search_point = *generate<Kernel>().points().begin();
|
||||||
|
|
||||||
|
// Build the tree (not timed)
|
||||||
|
Octree octree(points, points.point_map());
|
||||||
|
octree.refine();
|
||||||
|
|
||||||
|
// Start the timer
|
||||||
|
auto start = high_resolution_clock::now();
|
||||||
|
|
||||||
|
// Find the nearest point to the search point
|
||||||
|
std::vector<Point> nearest_neighbors;
|
||||||
|
octree.nearest_k_neighbors(search_point, 10, std::back_inserter(nearest_neighbors));
|
||||||
|
|
||||||
|
// End the timer
|
||||||
|
auto end = high_resolution_clock::now();
|
||||||
|
|
||||||
|
file << num_points << ",";
|
||||||
|
file << duration_cast<microseconds>(end - start).count() << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef OCTREE_UTIL_H
|
||||||
|
#define OCTREE_UTIL_H
|
||||||
|
|
||||||
|
#include <CGAL/Point_set_3.h>
|
||||||
|
#include <CGAL/Point_set_3/IO.h>
|
||||||
|
#include <CGAL/point_generators_3.h>
|
||||||
|
|
||||||
|
template<class Kernel>
|
||||||
|
CGAL::Point_set_3<typename Kernel::Point_3> generate(size_t num_points = 1) {
|
||||||
|
|
||||||
|
typedef typename Kernel::Point_3 Point;
|
||||||
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
|
|
||||||
|
// Create an empty point set
|
||||||
|
Point_set points;
|
||||||
|
points.reserve(num_points);
|
||||||
|
|
||||||
|
// Fill the point set with random points
|
||||||
|
CGAL::Random_points_on_sphere_3<Point> generator;
|
||||||
|
for (size_t i = 0; i < num_points; ++i)
|
||||||
|
points.insert(*generator++);
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //OCTREE_UTIL_H
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS}
|
@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS}
|
||||||
|
|
||||||
PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Octree"
|
PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Quadtree, Octree and Orthtree"
|
||||||
|
|
||||||
EXTRACT_ALL = false
|
EXTRACT_ALL = false
|
||||||
HIDE_UNDOC_MEMBERS = true
|
HIDE_UNDOC_MEMBERS = true
|
||||||
HIDE_UNDOC_CLASSES = true
|
HIDE_UNDOC_CLASSES = true
|
||||||
|
|
||||||
EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples
|
EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@ namespace CGAL {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\mainpage User Manual
|
\mainpage User Manual
|
||||||
\anchor Chapter_Octree
|
\anchor Chapter_Orthtree
|
||||||
|
|
||||||
\cgalAutoToc
|
\cgalAutoToc
|
||||||
\author Jackson Campolattaro
|
\author Jackson Campolattaro
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
/// \defgroup PkgOrthtreeRef Quadtree\, Octree and Orthtree Reference
|
||||||
|
|
||||||
|
/// \defgroup PkgOrthtreeClasses Classes
|
||||||
|
/// \ingroup PkgOrthtreeRef
|
||||||
|
|
||||||
|
/// \defgroup PkgOrthtreeConcepts Concepts
|
||||||
|
/// \ingroup PkgOrthtreeRef
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\addtogroup PkgOrthtreeRef
|
||||||
|
|
||||||
|
\cgalPkgDescriptionBegin{Quadtree\, Octree and Orthtree,PkgOrthtree}
|
||||||
|
\cgalPkgPicture{octree_thumbnail.png}
|
||||||
|
\cgalPkgSummaryBegin
|
||||||
|
\cgalPkgAuthor{Jackson Campolattaro, Cédric Portaneri, Tong Zhao, xxx}
|
||||||
|
\cgalPkgDesc{The Orthtree package provides a data structure that subdivides 3d space, and a collection of algorithms for operating on the structure.}
|
||||||
|
\cgalPkgManuals{Chapter_Orthtree,PkgOrthtreeRef}
|
||||||
|
\cgalPkgSummaryEnd
|
||||||
|
|
||||||
|
\cgalPkgShortInfoBegin
|
||||||
|
\cgalPkgSince{5.3}
|
||||||
|
\cgalPkgBib{cgal:cpz-o}
|
||||||
|
\cgalPkgDemo{Polyhedron demo,polyhedron_3.zip}
|
||||||
|
\cgalPkgShortInfoEnd
|
||||||
|
|
||||||
|
\cgalPkgDescriptionEnd
|
||||||
|
|
||||||
|
\todo * Thumbnail
|
||||||
|
|
||||||
|
\todo * Windows demo
|
||||||
|
|
||||||
|
\cgalClassifedRefPages
|
||||||
|
|
||||||
|
\cgalCRPSection{Concepts}
|
||||||
|
- `Traversal`
|
||||||
|
- `SplitCriterion`
|
||||||
|
|
||||||
|
\cgalCRPSection{Classes}
|
||||||
|
- `CGAL::Orthtree<Traits, PointRange, PointMap>`
|
||||||
|
- `CGAL::Octree<GeomTraits, PointRange, PointMap>`
|
||||||
|
- `CGAL::Quadtree<GeomTraits, PointRange, PointMap>`
|
||||||
|
*/
|
||||||
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 628 B |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
|
@ -15,7 +15,7 @@ if (CGAL_FOUND)
|
||||||
create_single_source_cgal_program("Octree_traversal_manual.cpp")
|
create_single_source_cgal_program("Octree_traversal_manual.cpp")
|
||||||
create_single_source_cgal_program("Octree_traversal_preorder.cpp")
|
create_single_source_cgal_program("Octree_traversal_preorder.cpp")
|
||||||
create_single_source_cgal_program("Octree_grade.cpp")
|
create_single_source_cgal_program("Octree_grade.cpp")
|
||||||
create_single_source_cgal_program("Octree_quadtree.cpp")
|
create_single_source_cgal_program("Quadtree_build_from_Point_vector.cpp")
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
message(WARNING
|
message(WARNING
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Octree.h>
|
||||||
#include <CGAL/Octree_traits_3.h>
|
|
||||||
#include <CGAL/Point_set_3.h>
|
#include <CGAL/Point_set_3.h>
|
||||||
#include <CGAL/Point_set_3/IO.h>
|
#include <CGAL/Point_set_3/IO.h>
|
||||||
|
|
||||||
|
|
@ -13,8 +12,7 @@ typedef Kernel::Point_3 Point;
|
||||||
typedef CGAL::Point_set_3<Point> Point_set;
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
typedef Point_set::Point_map Point_map;
|
typedef Point_set::Point_map Point_map;
|
||||||
|
|
||||||
typedef CGAL::Octree_traits_3<Kernel> Traits;
|
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
|
||||||
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
@ -3,15 +3,13 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Octree.h>
|
||||||
#include <CGAL/Octree_traits_3.h>
|
|
||||||
|
|
||||||
// Type Declarations
|
// Type Declarations
|
||||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||||
typedef Kernel::Point_3 Point;
|
typedef Kernel::Point_3 Point;
|
||||||
typedef std::vector<Point> Point_vector;
|
typedef std::vector<Point> Point_vector;
|
||||||
|
|
||||||
typedef CGAL::Octree_traits_3<Kernel> Traits;
|
typedef CGAL::Octree<Kernel, Point_vector> Octree;
|
||||||
typedef CGAL::Octree<Traits, Point_vector> Octree;
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Octree.h>
|
||||||
#include <CGAL/Octree_traits_3.h>
|
|
||||||
#include <CGAL/Point_set_3.h>
|
#include <CGAL/Point_set_3.h>
|
||||||
#include <CGAL/Point_set_3/IO.h>
|
#include <CGAL/Point_set_3/IO.h>
|
||||||
|
|
||||||
|
|
@ -14,8 +13,7 @@ typedef Kernel::FT FT;
|
||||||
typedef CGAL::Point_set_3<Point> Point_set;
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
typedef Point_set::Point_map Point_map;
|
typedef Point_set::Point_map Point_map;
|
||||||
|
|
||||||
typedef CGAL::Octree_traits_3<Kernel> Traits;
|
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
|
||||||
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
|
|
||||||
|
|
||||||
// Split Criterion
|
// Split Criterion
|
||||||
// The criterion is a functor which returns a boolean value, whether a node needs to be split or not
|
// The criterion is a functor which returns a boolean value, whether a node needs to be split or not
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Octree.h>
|
||||||
#include <CGAL/Octree_traits_3.h>
|
|
||||||
#include <CGAL/Point_set_3.h>
|
#include <CGAL/Point_set_3.h>
|
||||||
#include <CGAL/Point_set_3/IO.h>
|
#include <CGAL/Point_set_3/IO.h>
|
||||||
|
|
||||||
|
|
@ -13,8 +12,7 @@ typedef Kernel::Point_3 Point;
|
||||||
typedef CGAL::Point_set_3<Point> Point_set;
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
typedef Point_set::Point_map Point_map;
|
typedef Point_set::Point_map Point_map;
|
||||||
|
|
||||||
typedef CGAL::Octree_traits_3<Kernel> Traits;
|
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
|
||||||
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
@ -3,14 +3,12 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Octree.h>
|
||||||
#include <CGAL/Octree_traits_3.h>
|
|
||||||
|
|
||||||
// Type Declarations
|
// Type Declarations
|
||||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||||
typedef Kernel::Point_3 Point;
|
typedef Kernel::Point_3 Point;
|
||||||
typedef std::vector<Point> Point_vector;
|
typedef std::vector<Point> Point_vector;
|
||||||
typedef CGAL::Octree_traits_3<Kernel> Traits;
|
typedef CGAL::Octree<Kernel, Point_vector> Octree;
|
||||||
typedef CGAL::Octree<Traits, Point_vector> Octree;
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Octree.h>
|
||||||
#include <CGAL/Octree_traits_3.h>
|
|
||||||
#include <CGAL/Point_set_3.h>
|
#include <CGAL/Point_set_3.h>
|
||||||
#include <CGAL/Point_set_3/IO.h>
|
#include <CGAL/Point_set_3/IO.h>
|
||||||
|
|
||||||
|
|
@ -13,8 +12,7 @@ typedef Kernel::Point_3 Point;
|
||||||
typedef CGAL::Point_set_3<Point> Point_set;
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
typedef Point_set::Point_map Point_map;
|
typedef Point_set::Point_map Point_map;
|
||||||
|
|
||||||
typedef CGAL::Octree_traits_3<Kernel> Traits;
|
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
|
||||||
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Octree.h>
|
||||||
#include <CGAL/Octree_traits_3.h>
|
|
||||||
#include <CGAL/Point_set_3.h>
|
#include <CGAL/Point_set_3.h>
|
||||||
#include <CGAL/Point_set_3/IO.h>
|
#include <CGAL/Point_set_3/IO.h>
|
||||||
|
|
||||||
|
|
@ -13,8 +12,7 @@ typedef Kernel::Point_3 Point;
|
||||||
typedef CGAL::Point_set_3<Point> Point_set;
|
typedef CGAL::Point_set_3<Point> Point_set;
|
||||||
typedef Point_set::Point_map Point_map;
|
typedef Point_set::Point_map Point_map;
|
||||||
|
|
||||||
typedef CGAL::Octree_traits_3<Kernel> Traits;
|
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
|
||||||
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Octree.h>
|
#include <CGAL/Quadtree.h>
|
||||||
#include <CGAL/Octree_traits_2.h>
|
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
|
|
||||||
// Type Declarations
|
// Type Declarations
|
||||||
|
|
@ -11,8 +10,7 @@ typedef CGAL::Simple_cartesian<double> Kernel;
|
||||||
typedef Kernel::Point_2 Point_2;
|
typedef Kernel::Point_2 Point_2;
|
||||||
typedef std::vector<Point_2> Point_vector;
|
typedef std::vector<Point_2> Point_vector;
|
||||||
|
|
||||||
typedef CGAL::Octree_traits_2<Kernel> Traits;
|
typedef CGAL::Quadtree<Kernel, Point_vector> Quadtree;
|
||||||
typedef CGAL::Octree<Traits, Point_vector> Quadtree;
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright (c) 2020 GeometryFactory (France).
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// This file is part of CGAL (www.cgal.org).
|
||||||
|
//
|
||||||
|
// $URL$
|
||||||
|
// $Id$
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||||
|
//
|
||||||
|
// Author(s) : Simon Giraudot
|
||||||
|
|
||||||
|
#ifndef CGAL_OCTREE_H
|
||||||
|
#define CGAL_OCTREE_H
|
||||||
|
|
||||||
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
|
#include <CGAL/Orthtree.h>
|
||||||
|
#include <CGAL/Orthtree_traits_3.h>
|
||||||
|
|
||||||
|
namespace CGAL {
|
||||||
|
|
||||||
|
template <typename GeomTraits, typename PointRange,
|
||||||
|
typename PointMap = Identity_property_map
|
||||||
|
<typename std::iterator_traits<typename PointRange::iterator>::value_type> >
|
||||||
|
using Octree = Orthtree<Orthtree_traits_3<GeomTraits>, PointRange, PointMap>;
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CGAL_OCTREE_H
|
||||||
|
|
@ -9,14 +9,14 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_3_H
|
#ifndef CGAL_ORTHTREE_H
|
||||||
#define CGAL_OCTREE_3_H
|
#define CGAL_ORTHTREE_H
|
||||||
|
|
||||||
#include <CGAL/license/Octree.h>
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
#include <CGAL/Octree/Split_criterion.h>
|
#include <CGAL/Orthtree/Split_criterion.h>
|
||||||
#include <CGAL/Octree/Traversal.h>
|
#include <CGAL/Orthtree/Traversal.h>
|
||||||
#include <CGAL/Octree/Traversal_iterator.h>
|
#include <CGAL/Orthtree/Traversal_iterator.h>
|
||||||
|
|
||||||
#include <CGAL/bounding_box.h>
|
#include <CGAL/bounding_box.h>
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ using namespace std::placeholders;
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup PkgOctreeClasses
|
* \ingroup PkgOrthtreeClasses
|
||||||
*
|
*
|
||||||
* \brief a data structure for efficient computations in 3D space.
|
* \brief a data structure for efficient computations in 3D space.
|
||||||
*
|
*
|
||||||
|
|
@ -56,10 +56,10 @@ namespace CGAL {
|
||||||
* \tparam Point_range is a range type that provides random access iterators over the indices of a set of points.
|
* \tparam Point_range is a range type that provides random access iterators over the indices of a set of points.
|
||||||
* \tparam PointMap is a type that maps items in the range to Point data
|
* \tparam PointMap is a type that maps items in the range to Point data
|
||||||
*/
|
*/
|
||||||
template<typename Traits, typename PointRange, typename
|
template<typename Traits, typename PointRange,
|
||||||
PointMap = Identity_property_map
|
typename PointMap = Identity_property_map
|
||||||
<typename std::iterator_traits<typename PointRange::iterator>::value_type> >
|
<typename std::iterator_traits<typename PointRange::iterator>::value_type> >
|
||||||
class Octree
|
class Orthtree
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -70,7 +70,7 @@ public:
|
||||||
/*!
|
/*!
|
||||||
* \brief self typedef for convenience
|
* \brief self typedef for convenience
|
||||||
*/
|
*/
|
||||||
typedef Octree<Traits, PointRange, PointMap> Self;
|
typedef Orthtree<Traits, PointRange, PointMap> Self;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The point type is given by the traits
|
* \brief The point type is given by the traits
|
||||||
|
|
@ -132,7 +132,7 @@ private: // data members :
|
||||||
PointRange& m_range; /* input point range */
|
PointRange& m_range; /* input point range */
|
||||||
PointMap m_point_map; /* property map: `value_type of InputIterator` -> `Point` (Position) */
|
PointMap m_point_map; /* property map: `value_type of InputIterator` -> `Point` (Position) */
|
||||||
|
|
||||||
Node m_root; /* root node of the octree */
|
Node m_root; /* root node of the orthtree */
|
||||||
|
|
||||||
Point m_bbox_min; /* input bounding box min value */
|
Point m_bbox_min; /* input bounding box min value */
|
||||||
|
|
||||||
|
|
@ -144,19 +144,19 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Create an octree from a collection of points
|
* \brief Create an orthtree from a collection of points
|
||||||
*
|
*
|
||||||
* The resulting octree will have a root node with no children that contains the points passed.
|
* The resulting orthtree will have a root node with no children that contains the points passed.
|
||||||
* That root node will have a bounding box that encloses all of the points passed,
|
* That root node will have a bounding box that encloses all of the points passed,
|
||||||
* with padding according to the enlarge_ratio
|
* with padding according to the enlarge_ratio
|
||||||
* This single-node octree is valid and compatible with all Octree functionality,
|
* This single-node orthtree is valid and compatible with all Orthtree functionality,
|
||||||
* but any performance benefits are unlikely to be realized unless the tree is refined.
|
* but any performance benefits are unlikely to be realized unless the tree is refined.
|
||||||
*
|
*
|
||||||
* \param point_range random access iterator over the indices of the points
|
* \param point_range random access iterator over the indices of the points
|
||||||
* \param point_map maps the point indices to their coordinate locations
|
* \param point_map maps the point indices to their coordinate locations
|
||||||
* \param enlarge_ratio the degree to which the bounding box should be enlarged
|
* \param enlarge_ratio the degree to which the bounding box should be enlarged
|
||||||
*/
|
*/
|
||||||
Octree(PointRange& point_range,
|
Orthtree(PointRange& point_range,
|
||||||
PointMap point_map = PointMap(),
|
PointMap point_map = PointMap(),
|
||||||
const FT enlarge_ratio = 1.2,
|
const FT enlarge_ratio = 1.2,
|
||||||
Traits traits = Traits())
|
Traits traits = Traits())
|
||||||
|
|
@ -193,7 +193,7 @@ public:
|
||||||
Vector diff_centroid = bbox_centroid - bbox_transformed_centroid;
|
Vector diff_centroid = bbox_centroid - bbox_transformed_centroid;
|
||||||
bbox = bbox.transform(Aff_transformation(TRANSLATION, diff_centroid));
|
bbox = bbox.transform(Aff_transformation(TRANSLATION, diff_centroid));
|
||||||
|
|
||||||
// save octree attributes
|
// save orthtree attributes
|
||||||
m_bbox_min = bbox.min();
|
m_bbox_min = bbox.min();
|
||||||
m_side_per_depth.push_back(bbox.max()[0] - m_bbox_min[0]);
|
m_side_per_depth.push_back(bbox.max()[0] - m_bbox_min[0]);
|
||||||
m_root.points() = {point_range.begin(), point_range.end()};
|
m_root.points() = {point_range.begin(), point_range.end()};
|
||||||
|
|
@ -205,7 +205,7 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief subdivide an octree's nodes and sub-nodes until it meets the given criteria
|
* \brief subdivide an orthtree's nodes and sub-nodes until it meets the given criteria
|
||||||
*
|
*
|
||||||
* The split criterion can be any function pointer that takes a Node pointer
|
* The split criterion can be any function pointer that takes a Node pointer
|
||||||
* and returns a boolean value (where true implies that a Node needs to be split).
|
* and returns a boolean value (where true implies that a Node needs to be split).
|
||||||
|
|
@ -255,13 +255,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief refine an octree using a max depth and max number of points in a node as split criterion
|
* \brief refine an orthtree using a max depth and max number of points in a node as split criterion
|
||||||
*
|
*
|
||||||
* This is equivalent to calling:
|
* This is equivalent to calling:
|
||||||
*
|
*
|
||||||
* refine(Split_criterion::Max_depth_or_bucket_size(max_depth, bucket_size));
|
* refine(Split_criterion::Max_depth_or_bucket_size(max_depth, bucket_size));
|
||||||
*
|
*
|
||||||
* This functionality is provided for consistency with older octree implementations
|
* This functionality is provided for consistency with older orthtree implementations
|
||||||
* which did not allow for custom split criterion.
|
* which did not allow for custom split criterion.
|
||||||
*
|
*
|
||||||
* \param max_depth deepest a tree is allowed to be (nodes at this depth will not be split)
|
* \param max_depth deepest a tree is allowed to be (nodes at this depth will not be split)
|
||||||
|
|
@ -388,15 +388,15 @@ public:
|
||||||
/*!
|
/*!
|
||||||
* \brief find the leaf node which would contain a point
|
* \brief find the leaf node which would contain a point
|
||||||
*
|
*
|
||||||
* Traverses the octree and finds the deepest cell that has a domain enclosing the point passed.
|
* Traverses the orthtree and finds the deepest cell that has a domain enclosing the point passed.
|
||||||
* The point passed must be within the region enclosed by the octree (bbox of the root node).
|
* The point passed must be within the region enclosed by the orthtree (bbox of the root node).
|
||||||
*
|
*
|
||||||
* \param p The point to find a node for
|
* \param p The point to find a node for
|
||||||
* \return A const reference to the node which would contain the point
|
* \return A const reference to the node which would contain the point
|
||||||
*/
|
*/
|
||||||
const Node &locate(const Point &p) const {
|
const Node &locate(const Point &p) const {
|
||||||
|
|
||||||
// Make sure the point is enclosed by the octree
|
// Make sure the point is enclosed by the orthtree
|
||||||
assert(CGAL::do_intersect(p, bbox(m_root)));
|
assert(CGAL::do_intersect(p, bbox(m_root)));
|
||||||
|
|
||||||
// Start at the root node
|
// Start at the root node
|
||||||
|
|
@ -525,7 +525,7 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief compares the topology of a pair of Octrees
|
* \brief compares the topology of a pair of Orthtrees
|
||||||
*
|
*
|
||||||
* Trees may be considered equivalent even if they contain different points.
|
* Trees may be considered equivalent even if they contain different points.
|
||||||
* Equivalent trees must have the same bounding box and the same node structure.
|
* Equivalent trees must have the same bounding box and the same node structure.
|
||||||
|
|
@ -550,7 +550,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief compares the topology of a pair of Octrees
|
* \brief compares the topology of a pair of Orthtrees
|
||||||
* \param rhs tree to compare with
|
* \param rhs tree to compare with
|
||||||
* \return whether the trees have different topology
|
* \return whether the trees have different topology
|
||||||
*/
|
*/
|
||||||
|
|
@ -675,7 +675,7 @@ private: // functions :
|
||||||
// Note: there might be none, and that should be fine!
|
// Note: there might be none, and that should be fine!
|
||||||
for (auto point_index : node.points()) {
|
for (auto point_index : node.points()) {
|
||||||
|
|
||||||
// Retrieve each point from the octree's point map
|
// Retrieve each point from the orthtree's point map
|
||||||
auto point = get(m_point_map, point_index);
|
auto point = get(m_point_map, point_index);
|
||||||
|
|
||||||
// Pair that point with its distance from the search point
|
// Pair that point with its distance from the search point
|
||||||
|
|
@ -822,10 +822,10 @@ public:
|
||||||
<< box.xmax() << " " << box.ymax() << " " << box.zmax() << std::endl;
|
<< box.xmax() << " " << box.ymax() << " " << box.zmax() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend std::ostream& operator<< (std::ostream& os, const Self& octree)
|
friend std::ostream& operator<< (std::ostream& os, const Self& orthtree)
|
||||||
{
|
{
|
||||||
// Create a range of nodes
|
// Create a range of nodes
|
||||||
auto nodes = octree.traverse(CGAL::Traversal::Preorder());
|
auto nodes = orthtree.traverse(CGAL::Traversal::Preorder());
|
||||||
// Iterate over the range
|
// Iterate over the range
|
||||||
for (auto &n : nodes) {
|
for (auto &n : nodes) {
|
||||||
// Show the depth
|
// Show the depth
|
||||||
|
|
@ -839,10 +839,10 @@ public:
|
||||||
|
|
||||||
/// \endcond
|
/// \endcond
|
||||||
|
|
||||||
}; // end class Octree
|
}; // end class Orthtree
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#include <CGAL/Octree/Node.h>
|
#include <CGAL/Orthtree/Node.h>
|
||||||
|
|
||||||
#endif // CGAL_OCTREE_3_H
|
#endif // CGAL_ORTHTREE_H
|
||||||
|
|
@ -9,10 +9,10 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_IO_H
|
#ifndef CGAL_ORTHTREE_IO_H
|
||||||
#define CGAL_OCTREE_IO_H
|
#define CGAL_ORTHTREE_IO_H
|
||||||
|
|
||||||
#include <CGAL/license/Octree.h>
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
@ -23,7 +23,7 @@ namespace internal
|
||||||
{
|
{
|
||||||
|
|
||||||
template<typename Node>
|
template<typename Node>
|
||||||
std::ostream& print_octree_node(std::ostream& os, const Node& node)
|
std::ostream& print_orthtree_node(std::ostream& os, const Node& node)
|
||||||
{
|
{
|
||||||
// Show the depth of the node
|
// Show the depth of the node
|
||||||
// for (int i = 0; i < node.depth(); ++i)
|
// for (int i = 0; i < node.depth(); ++i)
|
||||||
|
|
@ -72,4 +72,4 @@ std::ostream& print_octree_node(std::ostream& os, const Node& node)
|
||||||
} // internal
|
} // internal
|
||||||
} // CGAL
|
} // CGAL
|
||||||
|
|
||||||
#endif //CGAL_OCTREE_IO_H
|
#endif //CGAL_ORTHTREE_IO_H
|
||||||
|
|
@ -9,12 +9,12 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_NODE_H
|
#ifndef CGAL_ORTHTREE_NODE_H
|
||||||
#define CGAL_OCTREE_NODE_H
|
#define CGAL_ORTHTREE_NODE_H
|
||||||
|
|
||||||
#include <CGAL/license/Octree.h>
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
#include <CGAL/Octree/IO.h>
|
#include <CGAL/Orthtree/IO.h>
|
||||||
|
|
||||||
#include <boost/range/iterator_range.hpp>
|
#include <boost/range/iterator_range.hpp>
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup PkgOctreeClasses
|
* \ingroup PkgOrthtreeClasses
|
||||||
*
|
*
|
||||||
* \brief represents a single node of the tree. Alternatively referred to as a cell, octant, or subtree
|
* \brief represents a single node of the tree. Alternatively referred to as a cell, octant, or subtree
|
||||||
*
|
*
|
||||||
|
|
@ -36,12 +36,12 @@ namespace CGAL {
|
||||||
* \tparam Point_index is the datatype the node will contain
|
* \tparam Point_index is the datatype the node will contain
|
||||||
*/
|
*/
|
||||||
template<class Traits, class PointRange, class PointMap>
|
template<class Traits, class PointRange, class PointMap>
|
||||||
class Octree<Traits, PointRange, PointMap>::Node {
|
class Orthtree<Traits, PointRange, PointMap>::Node {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// \cond SKIP_IN_MANUAL
|
/// \cond SKIP_IN_MANUAL
|
||||||
typedef Octree<Traits, PointRange, PointMap> Parent;
|
typedef Orthtree<Traits, PointRange, PointMap> Parent;
|
||||||
typedef typename Parent::Dimension Dimension;
|
typedef typename Parent::Dimension Dimension;
|
||||||
typedef typename Parent::Degree Degree;
|
typedef typename Parent::Degree Degree;
|
||||||
/// \endcond
|
/// \endcond
|
||||||
|
|
@ -52,7 +52,7 @@ public:
|
||||||
/*!
|
/*!
|
||||||
* \brief self typedef for convenience
|
* \brief self typedef for convenience
|
||||||
*/
|
*/
|
||||||
typedef Octree<Traits, PointRange, PointMap>::Node Self;
|
typedef Orthtree<Traits, PointRange, PointMap>::Node Self;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief array for containing the child nodes of this node
|
* \brief array for containing the child nodes of this node
|
||||||
|
|
@ -589,11 +589,11 @@ public:
|
||||||
/// \cond SKIP_IN_MANUAL
|
/// \cond SKIP_IN_MANUAL
|
||||||
friend std::ostream& operator<< (std::ostream& os, const Self& node)
|
friend std::ostream& operator<< (std::ostream& os, const Self& node)
|
||||||
{
|
{
|
||||||
return internal::print_octree_node(os, node);
|
return internal::print_orthtree_node(os, node);
|
||||||
}
|
}
|
||||||
/// \endcond
|
/// \endcond
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //CGAL_OCTREE_NODE_H
|
#endif //CGAL_ORTHTREE_NODE_H
|
||||||
|
|
@ -9,10 +9,10 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_SPLIT_CRITERION_H
|
#ifndef CGAL_ORTHTREE_SPLIT_CRITERION_H
|
||||||
#define CGAL_OCTREE_SPLIT_CRITERION_H
|
#define CGAL_ORTHTREE_SPLIT_CRITERION_H
|
||||||
|
|
||||||
#include <CGAL/license/Octree.h>
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace CGAL {
|
||||||
namespace Split_criterion {
|
namespace Split_criterion {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief criterion to split nodes of an octree when they contain more than a certain number of items
|
* \brief criterion to split nodes of an orthtree when they contain more than a certain number of items
|
||||||
*/
|
*/
|
||||||
struct Bucket_size {
|
struct Bucket_size {
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ struct Bucket_size {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief criterion to split nodes of an octree when they are less than a certain depth
|
* \brief criterion to split nodes of an orthtree when they are less than a certain depth
|
||||||
*/
|
*/
|
||||||
struct Max_depth {
|
struct Max_depth {
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ struct Max_depth_or_bucket_size {
|
||||||
/*
|
/*
|
||||||
|
|
||||||
// Just for an example using outside info (like a normal map)
|
// Just for an example using outside info (like a normal map)
|
||||||
// The normals remain unknown to the octree but are used for construction
|
// The normals remain unknown to the orthtree but are used for construction
|
||||||
struct Stop_at_normal_deviation {
|
struct Stop_at_normal_deviation {
|
||||||
Normal_map normal_map;
|
Normal_map normal_map;
|
||||||
FT max_dev;
|
FT max_dev;
|
||||||
|
|
@ -100,4 +100,4 @@ struct Stop_at_normal_deviation {
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif //CGAL_OCTREE_SPLIT_CRITERION_H
|
#endif //CGAL_ORTHTREE_SPLIT_CRITERION_H
|
||||||
|
|
@ -9,10 +9,10 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_TRAVERSAL_CRITERION_H
|
#ifndef CGAL_ORTHTREE_TRAVERSAL_CRITERION_H
|
||||||
#define CGAL_OCTREE_TRAVERSAL_CRITERION_H
|
#define CGAL_ORTHTREE_TRAVERSAL_CRITERION_H
|
||||||
|
|
||||||
#include <CGAL/license/Octree.h>
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/range/iterator_range.hpp>
|
#include <boost/range/iterator_range.hpp>
|
||||||
|
|
@ -202,4 +202,4 @@ struct Leaves {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //CGAL_OCTREE_TRAVERSAL_CRITERION_H
|
#endif //CGAL_ORTHTREE_TRAVERSAL_CRITERION_H
|
||||||
|
|
@ -9,10 +9,10 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_TRAVERSAL_ITERATOR_H
|
#ifndef CGAL_ORTHTREE_TRAVERSAL_ITERATOR_H
|
||||||
#define CGAL_OCTREE_TRAVERSAL_ITERATOR_H
|
#define CGAL_ORTHTREE_TRAVERSAL_ITERATOR_H
|
||||||
|
|
||||||
#include <CGAL/license/Octree.h>
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <boost/iterator/iterator_facade.hpp>
|
#include <boost/iterator/iterator_facade.hpp>
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup PkgOctreeClasses
|
* \ingroup PkgOrthtreeClasses
|
||||||
*
|
*
|
||||||
* \brief
|
* \brief
|
||||||
*
|
*
|
||||||
|
|
@ -92,4 +92,4 @@ private:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //CGAL_OCTREE_TRAVERSAL_ITERATOR_H
|
#endif //CGAL_ORTHTREE_TRAVERSAL_ITERATOR_H
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2020 GF (France).
|
// Copyright (c) 2020 GeometryFactory (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org).
|
// This file is part of CGAL (www.cgal.org).
|
||||||
|
|
@ -9,14 +9,14 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Simon Giraudot
|
// Author(s) : Simon Giraudot
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_TRAITS_3_H
|
#ifndef CGAL_ORTHTREE_TRAITS_3_H
|
||||||
#define CGAL_OCTREE_TRAITS_3_H
|
#define CGAL_ORTHTREE_TRAITS_3_H
|
||||||
|
|
||||||
namespace CGAL
|
namespace CGAL
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename GeomTraits>
|
template <typename GeomTraits>
|
||||||
struct Octree_traits_2
|
struct Orthtree_traits_2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -66,4 +66,4 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CGAL_OCTREE_TRAITS_2_H
|
#endif // CGAL_ORTHTREE_TRAITS_2_H
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2020 GF (France).
|
// Copyright (c) 2020 GeometryFactory (France).
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// This file is part of CGAL (www.cgal.org).
|
// This file is part of CGAL (www.cgal.org).
|
||||||
|
|
@ -9,14 +9,14 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Simon Giraudot
|
// Author(s) : Simon Giraudot
|
||||||
|
|
||||||
#ifndef CGAL_OCTREE_TRAITS_3_H
|
#ifndef CGAL_ORTHTREE_TRAITS_3_H
|
||||||
#define CGAL_OCTREE_TRAITS_3_H
|
#define CGAL_ORTHTREE_TRAITS_3_H
|
||||||
|
|
||||||
namespace CGAL
|
namespace CGAL
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename GeomTraits>
|
template <typename GeomTraits>
|
||||||
struct Octree_traits_3
|
struct Orthtree_traits_3
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -66,4 +66,4 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CGAL_OCTREE_TRAITS_3_H
|
#endif // CGAL_ORTHTREE_TRAITS_3_H
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright (c) 2020 GeometryFactory (France).
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// This file is part of CGAL (www.cgal.org).
|
||||||
|
//
|
||||||
|
// $URL$
|
||||||
|
// $Id$
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||||
|
//
|
||||||
|
// Author(s) : Simon Giraudot
|
||||||
|
|
||||||
|
#ifndef CGAL_QUADTREE_H
|
||||||
|
#define CGAL_QUADTREE_H
|
||||||
|
|
||||||
|
#include <CGAL/license/Orthtree.h>
|
||||||
|
|
||||||
|
#include <CGAL/Orthtree.h>
|
||||||
|
#include <CGAL/Orthtree_traits_2.h>
|
||||||
|
|
||||||
|
namespace CGAL {
|
||||||
|
|
||||||
|
template <typename GeomTraits, typename PointRange,
|
||||||
|
typename PointMap = Identity_property_map
|
||||||
|
<typename std::iterator_traits<typename PointRange::iterator>::value_type> >
|
||||||
|
using Quadtree = Orthtree<Orthtree_traits_2<GeomTraits>, PointRange, PointMap>;
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
|
|
||||||
|
#endif // CGAL_OCTREE_H
|
||||||