Use Orthtree everywhere + define Octree/Quadtree aliases

This commit is contained in:
Simon Giraudot 2020-10-22 13:00:34 +02:00
parent e931bc2288
commit 066712c881
62 changed files with 50349 additions and 186 deletions

View File

@ -130,7 +130,7 @@
\package_listing{SearchStructures}
\package_listing{Box_intersection_d}
\package_listing{AABB_tree}
\package_listing{Octree}
\package_listing{Orthtree}
\package_listing{Spatial_sorting}
\package_listing{Optimal_bounding_box}

View File

@ -32,7 +32,7 @@ Minkowski_sum_3 3D Minkowski Sum of Polyhedra
Nef_2 2D Boolean Operations on Nef Polygons
Nef_3 3D Boolean Operations on Nef Polyhedra
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_transportation_reconstruction_2 Optimal Transportation Curve Reconstruction
Partition_2 2D Polygon Partitioning

View File

@ -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>`
*/

View File

@ -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;
}

View File

@ -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")

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -1,12 +1,9 @@
@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
HIDE_UNDOC_MEMBERS = true
HIDE_UNDOC_CLASSES = true
EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples

View File

@ -2,7 +2,7 @@ namespace CGAL {
/*!
\mainpage User Manual
\anchor Chapter_Octree
\anchor Chapter_Orthtree
\cgalAutoToc
\author Jackson Campolattaro

View File

@ -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>`
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -15,7 +15,7 @@ if (CGAL_FOUND)
create_single_source_cgal_program("Octree_traversal_manual.cpp")
create_single_source_cgal_program("Octree_traversal_preorder.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 ()
message(WARNING

View File

@ -3,7 +3,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_3.h>
#include <CGAL/Point_set_3.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 Point_set::Point_map Point_map;
typedef CGAL::Octree_traits_3<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
int main(int argc, char **argv) {

View File

@ -3,15 +3,13 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_3.h>
// Type Declarations
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
typedef std::vector<Point> Point_vector;
typedef CGAL::Octree_traits_3<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_vector> Octree;
typedef CGAL::Octree<Kernel, Point_vector> Octree;
int main(int argc, char **argv) {

View File

@ -3,7 +3,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_3.h>
#include <CGAL/Point_set_3.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 Point_set::Point_map Point_map;
typedef CGAL::Octree_traits_3<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
// Split Criterion
// The criterion is a functor which returns a boolean value, whether a node needs to be split or not

View File

@ -3,7 +3,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_3.h>
#include <CGAL/Point_set_3.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 Point_set::Point_map Point_map;
typedef CGAL::Octree_traits_3<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
int main(int argc, char **argv) {

View File

@ -3,14 +3,12 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_3.h>
// Type Declarations
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
typedef std::vector<Point> Point_vector;
typedef CGAL::Octree_traits_3<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_vector> Octree;
typedef CGAL::Octree<Kernel, Point_vector> Octree;
int main(int argc, char **argv) {

View File

@ -3,7 +3,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_3.h>
#include <CGAL/Point_set_3.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 Point_set::Point_map Point_map;
typedef CGAL::Octree_traits_3<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
int main(int argc, char **argv) {

View File

@ -3,7 +3,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_3.h>
#include <CGAL/Point_set_3.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 Point_set::Point_map Point_map;
typedef CGAL::Octree_traits_3<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_set, Point_map> Octree;
typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;
int main(int argc, char **argv) {

View File

@ -2,8 +2,7 @@
#include <iostream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Octree_traits_2.h>
#include <CGAL/Quadtree.h>
#include <CGAL/Random.h>
// Type Declarations
@ -11,8 +10,7 @@ typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef std::vector<Point_2> Point_vector;
typedef CGAL::Octree_traits_2<Kernel> Traits;
typedef CGAL::Octree<Traits, Point_vector> Quadtree;
typedef CGAL::Quadtree<Kernel, Point_vector> Quadtree;
int main()
{

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -9,14 +9,14 @@
//
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
#ifndef CGAL_OCTREE_3_H
#define CGAL_OCTREE_3_H
#ifndef CGAL_ORTHTREE_H
#define CGAL_ORTHTREE_H
#include <CGAL/license/Octree.h>
#include <CGAL/license/Orthtree.h>
#include <CGAL/Octree/Split_criterion.h>
#include <CGAL/Octree/Traversal.h>
#include <CGAL/Octree/Traversal_iterator.h>
#include <CGAL/Orthtree/Split_criterion.h>
#include <CGAL/Orthtree/Traversal.h>
#include <CGAL/Orthtree/Traversal_iterator.h>
#include <CGAL/bounding_box.h>
@ -44,7 +44,7 @@ using namespace std::placeholders;
namespace CGAL {
/*!
* \ingroup PkgOctreeClasses
* \ingroup PkgOrthtreeClasses
*
* \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 PointMap is a type that maps items in the range to Point data
*/
template<typename Traits, typename PointRange, typename
PointMap = Identity_property_map
template<typename Traits, typename PointRange,
typename PointMap = Identity_property_map
<typename std::iterator_traits<typename PointRange::iterator>::value_type> >
class Octree
class Orthtree
{
public:
@ -70,7 +70,7 @@ public:
/*!
* \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
@ -132,7 +132,7 @@ private: // data members :
PointRange& m_range; /* input point range */
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 */
@ -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,
* 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.
*
* \param point_range random access iterator over the indices of the points
* \param point_map maps the point indices to their coordinate locations
* \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(),
const FT enlarge_ratio = 1.2,
Traits traits = Traits())
@ -193,7 +193,7 @@ public:
Vector diff_centroid = bbox_centroid - bbox_transformed_centroid;
bbox = bbox.transform(Aff_transformation(TRANSLATION, diff_centroid));
// save octree attributes
// save orthtree attributes
m_bbox_min = bbox.min();
m_side_per_depth.push_back(bbox.max()[0] - m_bbox_min[0]);
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
* 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:
*
* 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.
*
* \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
*
* Traverses the octree 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).
* 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 orthtree (bbox of the root node).
*
* \param p The point to find a node for
* \return A const reference to the node which would contain the point
*/
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)));
// 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.
* 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
* \return whether the trees have different topology
*/
@ -675,7 +675,7 @@ private: // functions :
// Note: there might be none, and that should be fine!
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);
// Pair that point with its distance from the search point
@ -822,10 +822,10 @@ public:
<< 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
auto nodes = octree.traverse(CGAL::Traversal::Preorder());
auto nodes = orthtree.traverse(CGAL::Traversal::Preorder());
// Iterate over the range
for (auto &n : nodes) {
// Show the depth
@ -839,10 +839,10 @@ public:
/// \endcond
}; // end class Octree
}; // end class Orthtree
} // namespace CGAL
#include <CGAL/Octree/Node.h>
#include <CGAL/Orthtree/Node.h>
#endif // CGAL_OCTREE_3_H
#endif // CGAL_ORTHTREE_H

View File

@ -9,10 +9,10 @@
//
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
#ifndef CGAL_OCTREE_IO_H
#define CGAL_OCTREE_IO_H
#ifndef CGAL_ORTHTREE_IO_H
#define CGAL_ORTHTREE_IO_H
#include <CGAL/license/Octree.h>
#include <CGAL/license/Orthtree.h>
#include <iostream>
#include <ostream>
@ -23,7 +23,7 @@ namespace internal
{
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
// for (int i = 0; i < node.depth(); ++i)
@ -72,4 +72,4 @@ std::ostream& print_octree_node(std::ostream& os, const Node& node)
} // internal
} // CGAL
#endif //CGAL_OCTREE_IO_H
#endif //CGAL_ORTHTREE_IO_H

View File

@ -9,12 +9,12 @@
//
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
#ifndef CGAL_OCTREE_NODE_H
#define CGAL_OCTREE_NODE_H
#ifndef CGAL_ORTHTREE_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>
@ -27,7 +27,7 @@
namespace CGAL {
/*!
* \ingroup PkgOctreeClasses
* \ingroup PkgOrthtreeClasses
*
* \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
*/
template<class Traits, class PointRange, class PointMap>
class Octree<Traits, PointRange, PointMap>::Node {
class Orthtree<Traits, PointRange, PointMap>::Node {
public:
/// \cond SKIP_IN_MANUAL
typedef Octree<Traits, PointRange, PointMap> Parent;
typedef Orthtree<Traits, PointRange, PointMap> Parent;
typedef typename Parent::Dimension Dimension;
typedef typename Parent::Degree Degree;
/// \endcond
@ -52,7 +52,7 @@ public:
/*!
* \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
@ -589,11 +589,11 @@ public:
/// \cond SKIP_IN_MANUAL
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
};
}
#endif //CGAL_OCTREE_NODE_H
#endif //CGAL_ORTHTREE_NODE_H

View File

@ -9,10 +9,10 @@
//
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
#ifndef CGAL_OCTREE_SPLIT_CRITERION_H
#define CGAL_OCTREE_SPLIT_CRITERION_H
#ifndef CGAL_ORTHTREE_SPLIT_CRITERION_H
#define CGAL_ORTHTREE_SPLIT_CRITERION_H
#include <CGAL/license/Octree.h>
#include <CGAL/license/Orthtree.h>
#include <iostream>
@ -21,7 +21,7 @@ namespace CGAL {
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 {
@ -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 {
@ -75,7 +75,7 @@ struct Max_depth_or_bucket_size {
/*
// 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 {
Normal_map normal_map;
FT max_dev;
@ -100,4 +100,4 @@ struct Stop_at_normal_deviation {
*/
#endif //CGAL_OCTREE_SPLIT_CRITERION_H
#endif //CGAL_ORTHTREE_SPLIT_CRITERION_H

View File

@ -9,10 +9,10 @@
//
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
#ifndef CGAL_OCTREE_TRAVERSAL_CRITERION_H
#define CGAL_OCTREE_TRAVERSAL_CRITERION_H
#ifndef CGAL_ORTHTREE_TRAVERSAL_CRITERION_H
#define CGAL_ORTHTREE_TRAVERSAL_CRITERION_H
#include <CGAL/license/Octree.h>
#include <CGAL/license/Orthtree.h>
#include <iostream>
#include <boost/range/iterator_range.hpp>
@ -202,4 +202,4 @@ struct Leaves {
}
#endif //CGAL_OCTREE_TRAVERSAL_CRITERION_H
#endif //CGAL_ORTHTREE_TRAVERSAL_CRITERION_H

View File

@ -9,10 +9,10 @@
//
// Author(s) : Jackson Campolattaro, Cédric Portaneri, Tong Zhao
#ifndef CGAL_OCTREE_TRAVERSAL_ITERATOR_H
#define CGAL_OCTREE_TRAVERSAL_ITERATOR_H
#ifndef CGAL_ORTHTREE_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/iterator/iterator_facade.hpp>
@ -20,7 +20,7 @@
namespace CGAL {
/*!
* \ingroup PkgOctreeClasses
* \ingroup PkgOrthtreeClasses
*
* \brief
*
@ -92,4 +92,4 @@ private:
};
}
#endif //CGAL_OCTREE_TRAVERSAL_ITERATOR_H
#endif //CGAL_ORTHTREE_TRAVERSAL_ITERATOR_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2020 GF (France).
// Copyright (c) 2020 GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
@ -9,14 +9,14 @@
//
// Author(s) : Simon Giraudot
#ifndef CGAL_OCTREE_TRAITS_3_H
#define CGAL_OCTREE_TRAITS_3_H
#ifndef CGAL_ORTHTREE_TRAITS_3_H
#define CGAL_ORTHTREE_TRAITS_3_H
namespace CGAL
{
template <typename GeomTraits>
struct Octree_traits_2
struct Orthtree_traits_2
{
public:
@ -66,4 +66,4 @@ public:
}
#endif // CGAL_OCTREE_TRAITS_2_H
#endif // CGAL_ORTHTREE_TRAITS_2_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2020 GF (France).
// Copyright (c) 2020 GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
@ -9,14 +9,14 @@
//
// Author(s) : Simon Giraudot
#ifndef CGAL_OCTREE_TRAITS_3_H
#define CGAL_OCTREE_TRAITS_3_H
#ifndef CGAL_ORTHTREE_TRAITS_3_H
#define CGAL_ORTHTREE_TRAITS_3_H
namespace CGAL
{
template <typename GeomTraits>
struct Octree_traits_3
struct Orthtree_traits_3
{
public:
@ -66,4 +66,4 @@ public:
}
#endif // CGAL_OCTREE_TRAITS_3_H
#endif // CGAL_ORTHTREE_TRAITS_3_H

View File

@ -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