Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orthtree generalization #7672

Merged
merged 311 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
311 commits
Select commit Hold shift + click to select a range
ed9266e
Add parallel node system using properties
JacksonCampolattaro Jun 22, 2023
1154524
Ensure moved-from properties are reset
JacksonCampolattaro Jun 22, 2023
08b418b
Ensure properties of a moved-from tree are also moved-from
JacksonCampolattaro Jun 22, 2023
bfe5845
Orthtree no longer instantiates Node types
JacksonCampolattaro Jun 22, 2023
774aa1f
Add node-access convenience functions, and simplify tests
JacksonCampolattaro Jun 22, 2023
01aad4a
Add a minimal test of custom node properties
JacksonCampolattaro Jun 25, 2023
c41faf1
Delete independent `Node` type, move relevant typedefs to Orthtree.h
JacksonCampolattaro Jun 25, 2023
b08eaba
Move point-specific functionality to traits class
JacksonCampolattaro Jun 26, 2023
22e76aa
Adapt 2D & dD traits for the new system
JacksonCampolattaro Jun 26, 2023
dc18e1b
Replace `tree.points(node)` with `tree.data(node)`
JacksonCampolattaro Jun 27, 2023
6e1aa89
Add documentation for new features of the OrthtreeTraits concept
JacksonCampolattaro Jun 27, 2023
3e4120c
Merge branch 'master' into orthtree-generalization
sloriot Jul 3, 2023
4e1dabe
version version of traits for triangle meshes
sloriot Jul 3, 2023
02e10bf
add TODO
sloriot Jul 6, 2023
03cda70
Replace boost::optional with std::optional
JacksonCampolattaro Jul 9, 2023
dccda38
Reference type of traversal iterator is a Node_index (and not a refer…
JacksonCampolattaro Jul 9, 2023
533f088
fix dump
sloriot Jul 10, 2023
cfdb167
Fix a couple of small issues which came up during LCC conversion
JacksonCampolattaro Jul 18, 2023
61a29f0
Fix an issue where side-per-depth wasn't updated when a node was manu…
JacksonCampolattaro Jul 26, 2023
7027d5b
Adapt several examples to use the new interface
JacksonCampolattaro Jul 26, 2023
50006c9
Fix an issue with file loading where adding normals would cause addit…
JacksonCampolattaro Jul 26, 2023
85e03d1
Merge branch 'property-maps' into orthtree-generalization
JacksonCampolattaro Jul 26, 2023
4998f7b
Adapt remaining examples to use the generalized orthtree
JacksonCampolattaro Jul 26, 2023
5bc0962
Eliminate non-index versions of split predicates & traversals
JacksonCampolattaro Jul 26, 2023
8fe57f5
Rename traverse_indices to traverse (now that it's the only traversal…
JacksonCampolattaro Jul 27, 2023
6f31cbd
Point traits now share the generic reassign_points method
JacksonCampolattaro Jul 27, 2023
282180d
Add an example which builds a tree that doesn't contain anything
JacksonCampolattaro Jul 27, 2023
b950c6c
Add base traits classes with common typedefs for convenience
JacksonCampolattaro Jul 27, 2023
07c671e
Convert methods to functor objects for consistency (proof-of-concept)
JacksonCampolattaro Aug 29, 2023
2d8f7d4
Rename Properties.h for clarity
JacksonCampolattaro Aug 30, 2023
4a379e5
Delete old Properties system, no longer in use anywhere
JacksonCampolattaro Aug 30, 2023
77f240b
Delete Orthtree::Node class, now used nowhere
JacksonCampolattaro Aug 31, 2023
28dc304
Merge branch 'cgal/master'
sloriot Sep 1, 2023
aae6c1b
add missing license/copyright and fix protection macro
sloriot Sep 1, 2023
6de261e
Rename test_Properties to resolve naming collision
JacksonCampolattaro Sep 1, 2023
40a08f1
add missing license include
sloriot Sep 1, 2023
59fafe8
Fix issues with superfluous Node typedefs
JacksonCampolattaro Sep 1, 2023
599a10c
Merge remote-tracking branch 'origin/orthtree-generalization' into or…
JacksonCampolattaro Sep 1, 2023
e9ca3cc
Update face graph traits to use functors
JacksonCampolattaro Sep 1, 2023
b7a8571
Update empty quadtree to use functors
JacksonCampolattaro Sep 1, 2023
40b2c0d
Convert nearest neighbor methods to free functions
JacksonCampolattaro Sep 1, 2023
d0fa6ed
Add missing license header
JacksonCampolattaro Sep 1, 2023
1566750
Switch license to GPL
JacksonCampolattaro Sep 1, 2023
99a2d56
Replace bbox with Iso_rectangle/_cuboid/_box
JacksonCampolattaro Sep 2, 2023
51aae3a
Bbox construction functor is no longer necessary; Bbox_d type must be…
JacksonCampolattaro Sep 2, 2023
fd34fb5
`root_node_contents` now produces a Bbox directly
JacksonCampolattaro Sep 2, 2023
039b693
Add support for trees with non-cubic bounding boxes
JacksonCampolattaro Sep 2, 2023
2488668
adaptation of Efficient_RANSAC to changed Orthtree interface
soesau Sep 5, 2023
bf5bbcc
Add `construct_point_d_object` to traits classes
JacksonCampolattaro Sep 6, 2023
32c6d61
Eliminate Array and Construct_point_d_from_array
JacksonCampolattaro Sep 7, 2023
750ca57
Combine 2d, 3d, and d-d points traits into one template
JacksonCampolattaro Sep 7, 2023
ea59877
Automatically determine the correct typedefs for an ambient dimension…
JacksonCampolattaro Sep 7, 2023
3e20800
Update documentation for Traits concepts
JacksonCampolattaro Sep 8, 2023
ed32969
Prefer `using` over `typedef` universally, for consistency
JacksonCampolattaro Sep 8, 2023
c4e6ad7
Update documentation for Orthtree member functions.
JacksonCampolattaro Sep 13, 2023
d169adb
Update benchmarks to account for recent changes
JacksonCampolattaro Sep 13, 2023
da33014
Merge remote-tracking branch 'cgal/master'
sloriot Sep 14, 2023
97ed41f
do not document Property_container for now
sloriot Sep 14, 2023
33dce33
fix some doc issues
sloriot Sep 14, 2023
4681f17
Fix a small issue with the Octree definition
JacksonCampolattaro Sep 16, 2023
759905b
Merge remote-tracking branch 'origin/orthtree-generalization' into or…
JacksonCampolattaro Sep 16, 2023
37d60b4
Replace pointer with std::optional
JacksonCampolattaro Sep 16, 2023
25790f6
Replace nullable pmap types with std::optionals
JacksonCampolattaro Sep 16, 2023
e552b0d
Replace pointers to umap and vmap with optionals
JacksonCampolattaro Sep 16, 2023
bae28c3
Fix a typo: Gt is not a dependent type, so typename is unnecessary
JacksonCampolattaro Sep 16, 2023
ce2c7a9
Use optionals for more maps
JacksonCampolattaro Sep 16, 2023
48b502e
Add no-op collect_garbage(visitor) method for backwards compatibility
JacksonCampolattaro Sep 16, 2023
c67bec2
More optionals for non-nullable maps
JacksonCampolattaro Sep 16, 2023
38c35d8
Update orthtree documentation and manual
JacksonCampolattaro Sep 24, 2023
332e4b2
Replace `typedef` with `using` for consistency
JacksonCampolattaro Sep 24, 2023
4c60841
Add boost::span to STL_Extension for compatibility with older version…
JacksonCampolattaro Sep 24, 2023
fbc49ad
Replace boost::tie with optional type
JacksonCampolattaro Sep 24, 2023
9a1701c
More optional non-nullable maps
JacksonCampolattaro Sep 24, 2023
aced885
More optional non-nullable maps
JacksonCampolattaro Sep 24, 2023
f021c0c
Use optional vpm for all property maps
JacksonCampolattaro Sep 24, 2023
6747609
Add a simple test for shared vertices
JacksonCampolattaro Sep 24, 2023
d930a95
Use structured bindings instead of boost::tie
JacksonCampolattaro Sep 24, 2023
ffeb2ae
Remove reference to Node type in traversal concept
JacksonCampolattaro Sep 24, 2023
e39ca2a
Replace more `boost::tie`s with structured bindings
JacksonCampolattaro Sep 24, 2023
3ac8ddf
More accounting for non-nullable maps
JacksonCampolattaro Sep 24, 2023
bf3bc03
Eliminate another `boost::tie`
JacksonCampolattaro Sep 24, 2023
9b738cb
Eliminate more instances of boost::tie found with a global search
JacksonCampolattaro Sep 24, 2023
c575cd2
Remove a couple of default initializations
JacksonCampolattaro Sep 24, 2023
6f86c93
Update function documentation for consistency
JacksonCampolattaro Sep 27, 2023
047a949
Fix mismatched parameter names in documentation
JacksonCampolattaro Sep 30, 2023
44cae21
Merge remote-tracking branch 'CGAL/master' into orthtree-generalization
JacksonCampolattaro Sep 30, 2023
feb87c7
Eliminate most whitespace changes
JacksonCampolattaro Oct 5, 2023
6963e7f
fix emplace_group on MSVC
soesau Oct 5, 2023
f797ae7
fix compilation on MSVC
soesau Oct 5, 2023
047a223
Revert Surface_mesh to the old memory management scheme
JacksonCampolattaro Oct 8, 2023
1b5ebd3
Merge remote-tracking branch 'origin/orthtree-generalization' into or…
JacksonCampolattaro Oct 8, 2023
999ad9b
Merge remote-tracking branch 'cgal/master' into HEAD
sloriot Nov 7, 2023
6383bf9
revert changes to not block the integration of new Orthtree
sloriot Nov 7, 2023
c8cc615
removing trailing whitespaces
soesau Nov 7, 2023
696fb83
moving new property system into CGAL::Experimental namespace
soesau Nov 7, 2023
6cdfbfe
restored é
soesau Nov 7, 2023
8274313
fix ci
soesau Nov 15, 2023
dceff13
added missing header
soesau Nov 15, 2023
b2ac701
dependencies update
soesau Nov 15, 2023
de06eb0
fixing orthtree bbox coordinates
soesau Jan 2, 2024
d5a764c
fixed test
soesau Jan 8, 2024
2d295ac
Merge remote-tracking branch 'cgal/master' into orthtree-generalization
soesau Jan 8, 2024
d2754d3
update dependencies
soesau Jan 8, 2024
24a937e
add missing deps
sloriot Jan 8, 2024
626a23a
fixed exact corners, multi dimension example
soesau Jan 10, 2024
85e5987
pass on doc
soesau Jan 12, 2024
eb84593
switching to Property_array_handle
soesau Jan 12, 2024
64b232e
deleted unused traits base classes
soesau Jan 12, 2024
d43432d
adding locate_halfspace_object to traits
soesau Jan 12, 2024
172044b
removing old references
soesau Jan 12, 2024
beea3f2
fixing comment for Node_index_range
soesau Jan 12, 2024
add12f5
small fixes
afabri Jan 14, 2024
8097ba8
PointSet -> PointRange
afabri Jan 14, 2024
f7eaa95
Remove one group layer
afabri Jan 15, 2024
da9cec8
update deps
sloriot Jan 15, 2024
fa8e09e
backtick
afabri Jan 15, 2024
25d658f
doc the real type
sloriot Jan 15, 2024
cec138c
Update QP_solver/include/CGAL/QP_solver/basic.h
afabri Jan 15, 2024
825029a
improve doc
sloriot Jan 15, 2024
95e06dd
Update Orthtree/include/CGAL/Orthtree_traits_face_graph.h
afabri Jan 16, 2024
552209e
Add the operators in the concept
afabri Jan 16, 2024
cdea8cf
Update Orthtree/include/CGAL/Orthtree_traits_face_graph.h
afabri Jan 18, 2024
620a78c
CGAL_USE
afabri Jan 24, 2024
832389a
property handles are returned by copy
sloriot Jan 24, 2024
f29e307
Add Node_index to the traits concept
afabri Jan 24, 2024
b9a2556
use variable
afabri Jan 24, 2024
876865b
use variable
afabri Jan 24, 2024
f650c6f
Add typedef to base class
afabri Jan 24, 2024
f014326
Use Traits::Node_index
afabri Jan 24, 2024
33a58fa
Do not output just the x-coord of the min of the bbox
afabri Jan 24, 2024
77d9509
protect min/max
afabri Jan 24, 2024
33e09bf
Switch back to the wrong coordinate system
afabri Jan 24, 2024
d078a34
fix warnings
sloriot Jan 24, 2024
5e67892
If smaller is true we want to go in the 0-half space not 1
afabri Jan 24, 2024
0c93490
Revert "If smaller is true we want to go in the 0-half space not 1"
sloriot Jan 24, 2024
91b4a7a
fix zip iterator
sloriot Jan 24, 2024
95d8d8c
clean up axis and commodity enum to work in both 2D and 3D
sloriot Jan 24, 2024
58d26ed
Make parameter const&
afabri Jan 25, 2024
b5945b4
Fix warning
afabri Jan 25, 2024
585467a
As the bbox of nodes gets constructed from Epeck::FT we have to take …
afabri Jan 25, 2024
d515e42
fix doc warning
sloriot Jan 25, 2024
787fb84
pass on the user manual
sloriot Jan 25, 2024
57fbda8
pass on the doc but the Orthtree class
sloriot Jan 25, 2024
caad3b3
pass on Orthtree class
sloriot Jan 25, 2024
f155ad8
please MSVC 2017
sloriot Jan 26, 2024
88f01a5
get rid of EPECK
sloriot Jan 26, 2024
ffb32d9
fix dependencies
sloriot Jan 29, 2024
546c0c8
small doc corrections
soesau Jan 30, 2024
11f0a84
changing dimension and degree in orthtree(_traits) to int
soesau Jan 30, 2024
2802d58
removing Maybe_node_index
soesau Jan 30, 2024
434d3e9
draft for an implementation of bbox corner that are consistent between
sloriot Jan 30, 2024
ef1fc52
clean up implementation and also use it in barycenter
sloriot Jan 30, 2024
3763feb
fix compilation issues
sloriot Jan 30, 2024
85dd768
handle calls to barycenter for leaf nodes
sloriot Jan 30, 2024
a9a37c1
Fix conversion warning
afabri Jan 31, 2024
ecc30d8
removing Locate_halfspace
soesau Jan 31, 2024
7bf9672
spelling
soesau Jan 31, 2024
c8661d0
renaming Orthtree_traits_base_for_dimension to Orthtree_traits_base
soesau Feb 1, 2024
019be3f
some updates on documentation
soesau Feb 1, 2024
834b405
adding surface mesh to examples
soesau Feb 1, 2024
3c55548
traversals are now templated by OrthtreeTraits
soesau Feb 2, 2024
da04410
shortening doc of simple functions
soesau Feb 2, 2024
73bf4ed
moving definition of Node_index into traits
soesau Feb 2, 2024
79eaf04
doc split predicate with bucket_size needs Node_data with random access
soesau Feb 2, 2024
ad5807f
doc locates behaviour
soesau Feb 2, 2024
bd11275
removing Get_geometric_object_for_element and adding Squared_distance…
soesau Feb 2, 2024
6e7587a
fixing tests
soesau Feb 2, 2024
3f361a4
fixes for ci
soesau Feb 2, 2024
f781012
fix for ci
soesau Feb 2, 2024
d9756dd
added missing include
soesau Feb 2, 2024
47bbc08
Revert "traversals are now templated by OrthtreeTraits"
soesau Feb 2, 2024
6f8b3ef
add surface mesh to doc dependencies
soesau Feb 2, 2024
b265ee9
fixing tests
soesau Feb 2, 2024
eb24ac1
Update Orthtree/doc/Orthtree/PackageDescription.txt
soesau Feb 2, 2024
cde61a5
changed property interface of Orthtree to be closer to Surface mesh
soesau Feb 5, 2024
3310585
added Pair_optional_adaptor (WIP)
soesau Feb 5, 2024
e4686a2
removed _node from Orthtree property API
soesau Feb 5, 2024
59ab399
license fix (GPL -> LGPL)
soesau Feb 6, 2024
4c1cf8d
working version of Pair_optional_adaptor
soesau Feb 6, 2024
75d1519
fixed test
soesau Feb 7, 2024
a5aba5b
removing Pair_optional_adaptor
soesau Feb 7, 2024
7b5e2be
switching Property_container to multimap to allow properties that sha…
soesau Feb 8, 2024
9c93b60
removing trailing whitespaces
soesau Feb 8, 2024
8f106bf
removed old occurrence of m_property_arrays
soesau Feb 8, 2024
009791f
adaptation of Orthtree interface to allow OrthtreeTraits without data
soesau Feb 13, 2024
ae18495
simplify implementation of no data case to make it work with non MSVC…
sloriot Feb 13, 2024
6fd4a02
use a wrapper for node data
sloriot Feb 13, 2024
1c6fdbd
undo some changes from b241bc8594ada289b1ed1b3f239dfb5bdc0cee31
sloriot Feb 13, 2024
83d0f63
add missing assignment
sloriot Feb 13, 2024
446d396
return data by ref
sloriot Feb 13, 2024
c04b584
added concept for orthtree without data
soesau Feb 13, 2024
d3fdd5e
update doc of nearest neighbors search
soesau Feb 14, 2024
d5a92a4
renaming OrthtreeTraitsWithoutData and OrthtreeTraits
soesau Feb 14, 2024
20e3cb8
remove no longer needed boost headers
sloriot Feb 15, 2024
c580e30
small doc update
soesau Feb 19, 2024
b503b42
typos + clean up
sloriot Feb 19, 2024
14089f5
clean up
sloriot Feb 19, 2024
c954092
renaming Orthtree_traits_without_data
soesau Feb 20, 2024
6d84c07
pass on doc
soesau Feb 20, 2024
d95d650
added parameter to Orthtree_traits_point to use square/cubic space
soesau Feb 20, 2024
0419507
missing template parameter
soesau Feb 20, 2024
ca4d146
fix for ci
soesau Feb 20, 2024
fc95354
Update Orthtree/doc/Orthtree/Concepts/OrthtreeTraitsWithData.h
soesau Feb 21, 2024
2fb6c40
bug fix
soesau Feb 21, 2024
7b907d5
pass on doc
soesau Feb 21, 2024
5ad3d90
added requirements for Node_data
soesau Feb 21, 2024
2bbf5b8
added functors for accessing Sphere_d
soesau Feb 21, 2024
95ba635
renamed getter for functors in CollectionPartitioningOrthtreeTraits
soesau Feb 21, 2024
9ee06f2
ci fix for msvc2017
soesau Feb 22, 2024
aec5818
re-adding nearest_neighbors as deprecated method in Orthtree
soesau Feb 26, 2024
a628773
ci fix
soesau Feb 26, 2024
9e6fefa
missing header
soesau Feb 26, 2024
a3a102c
more missing headers
soesau Feb 26, 2024
99104e5
replaced call to CGAL::squared_distance
soesau Feb 27, 2024
84d17b6
renaming _3 functors in CollectionPartitioningOrthtreeTraits to _d
soesau Feb 27, 2024
3251248
reintegrated nearest neighbors into Orthtree
soesau Feb 27, 2024
08a7a66
bugfix nearest neighbor search
soesau Feb 28, 2024
b3b9bf0
doc section on migration
soesau Feb 28, 2024
c622af1
add mesh orthtree picture
sloriot Feb 28, 2024
3da1087
try to improve phrasing
sloriot Feb 29, 2024
dffac51
restore old behavior with a forward constructor
sloriot Feb 29, 2024
3714189
Update Orthtree/include/CGAL/Orthtree_traits_base.h
soesau Mar 1, 2024
ff5f855
Update Orthtree/include/CGAL/Orthtree_traits_face_graph.h
soesau Mar 1, 2024
d85edb3
Update Orthtree/include/CGAL/Orthtree_traits_base.h
soesau Mar 1, 2024
d49529d
Update Orthtree/include/CGAL/Orthtree.h
soesau Mar 1, 2024
b5741aa
Update Orthtree/include/CGAL/Orthtree.h
soesau Mar 1, 2024
8574b1c
Update Orthtree/include/CGAL/Orthtree.h
soesau Mar 1, 2024
87d8952
Update Orthtree/include/CGAL/Orthtree_traits_base.h
soesau Mar 1, 2024
020f323
Update Orthtree/include/CGAL/Orthtree.h
soesau Mar 1, 2024
683be7a
Update Orthtree/include/CGAL/Orthtree.h
soesau Mar 1, 2024
5bf13e8
Update Orthtree/include/CGAL/Octree.h
soesau Mar 1, 2024
f90dfba
Update Orthtree/include/CGAL/Quadtree.h
soesau Mar 1, 2024
37220d4
Update Orthtree/doc/Orthtree/Concepts/OrthtreeTraits.h
soesau Mar 1, 2024
159bd6d
Update Orthtree/doc/Orthtree/PackageDescription.txt
soesau Mar 1, 2024
48c1fef
moving package headers to front
soesau Mar 1, 2024
77622a6
renamed nearest_neighbors to neighbors_in_radius
soesau Mar 1, 2024
fd20d98
functor parameter fix
soesau Mar 1, 2024
546888c
lower number of sample points to 20
soesau Mar 1, 2024
a8fd56c
using 'contained elements' instead of elements to descripe split pred…
soesau Mar 1, 2024
caa833f
renaming nearest_neighbors to nearest_k_neighbors
soesau Mar 1, 2024
fcbb922
making benchmark compilable
soesau Mar 1, 2024
130cf57
created local copy of point before using Cartesian_ranges
soesau Mar 1, 2024
7bf227d
removed wrong model which is actually a concept
soesau Mar 5, 2024
22e5a3f
renaming nearest_k_neighbors_in_radius and neighbors_in_radius
soesau Mar 5, 2024
0abf031
doc update on migration
soesau Mar 5, 2024
0f532d7
ws
sloriot Mar 5, 2024
786b015
doc copy and move constructors
sloriot Mar 6, 2024
1e71bbe
update changes
sloriot Mar 6, 2024
426f506
workaround warning
sloriot Mar 13, 2024
3471add
simplify disambiguation
sloriot Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Installation/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Release date: October 2023
- Removed the class templates `Gray_image_mesh_domain_3`, `Implicit_mesh_domain_3`, and `Labeled_image_mesh_domain_3`
which are deprecated since CGAL-4.13.

### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/6.0/Manual/packages.html#PkgOrthtree)
- **Breaking change**:
- Node splitting behavior and per-node data are now customizable via the Traits class.
- Nodes are now stored as a property map, with properties of each node accessed by index.
- Nearest neighbors functions only work for Orthtrees which provide the necessary functionality.

### [Polygon Mesh Processing](https://doc.cgal.org/6.0/Manual/packages.html#PkgPolygonMeshProcessing)

- Added the function `CGAL::Polygon_mesh_processing::interpolated_corrected_curvatures()` which can be used to compute
Expand Down
18 changes: 8 additions & 10 deletions Orthtree/benchmark/Orthtree/construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
#include <iostream>
#include <chrono>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Point_set_3<Point> Point_set;
typedef Point_set::Point_map Point_map;

typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;

typedef CGAL::Search_traits_3<Kernel> Kd_tree_traits;
typedef CGAL::Orthogonal_k_neighbor_search<Kd_tree_traits> Kd_tree_search;
typedef Kd_tree_search::Tree Kdtree;
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using Point = Kernel::Point_3;
using Point_set = CGAL::Point_set_3<Point>;
using Point_map = Point_set::Point_map;
using Octree = CGAL::Octree<Kernel, Point_set, Point_map>;
using Kd_tree_traits = CGAL::Search_traits_3<Kernel>;
using Kd_tree_search = CGAL::Orthogonal_k_neighbor_search<Kd_tree_traits>;
using Kdtree = Kd_tree_search::Tree;

using std::chrono::high_resolution_clock;
using std::chrono::duration_cast;
Expand Down
24 changes: 11 additions & 13 deletions Orthtree/benchmark/Orthtree/nearest_neighbor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@
#include <iostream>
#include <chrono>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Point_set_3<Point> Point_set;
typedef Point_set::Point_map Point_map;

typedef CGAL::Octree<Kernel, Point_set, Point_map> Octree;

typedef CGAL::Search_traits_3<Kernel> Kd_tree_traits;
typedef CGAL::Orthogonal_k_neighbor_search<Kd_tree_traits> Kd_tree_search;
typedef Kd_tree_search::Tree Kdtree;

using std::chrono::high_resolution_clock;
using std::chrono::duration_cast;
using std::chrono::microseconds;

using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using Point = Kernel::Point_3;
using Point_set = CGAL::Point_set_3<Point>;
using Point_map = Point_set::Point_map;
using Octree = CGAL::Octree<Kernel, Point_set, Point_map>;
using Kd_tree_traits = CGAL::Search_traits_3<Kernel>;
using Kd_tree_search = CGAL::Orthogonal_k_neighbor_search<Kd_tree_traits>;
using Kdtree = Kd_tree_search::Tree;

int main(int argc, char **argv) {

int num_runs = 100;
Expand Down Expand Up @@ -103,8 +101,8 @@ int main(int argc, char **argv) {
// Time how long it takes to find neighbors using the octree
auto octreeTime = bench<microseconds>(
[&] {
std::vector<Point> nearest_neighbors;
octree.nearest_neighbors(search_point, k, std::back_inserter(nearest_neighbors));
std::vector<Point_set::Index> nearest_neighbors;
octree.nearest_k_neighbors(search_point, k, std::back_inserter(nearest_neighbors));
}
);

Expand Down
4 changes: 2 additions & 2 deletions Orthtree/benchmark/Orthtree/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
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;
using Point = typename Kernel::Point_3;
using Point_set = CGAL::Point_set_3<Point>;

// Create an empty point set
Point_set points;
Expand Down
101 changes: 101 additions & 0 deletions Orthtree/doc/Orthtree/Concepts/CollectionPartitioningOrthtreeTraits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*!
\ingroup PkgOrthtreeConcepts
\cgalConcept

Refinement of the `OrthtreeTraitsWithData` concept, adding requirements for the
traits class of a `CGAL::Orthtree` in order to supports nearest-neighbor searching.

Nearest neighbor searches expect a tree where `Node_data` is a model of `ForwardRange`.
The leaf nodes of the tree represent an exclusive partition of the elements contained in the tree.
This means that no element should be contained by more than one node.

\cgalRefines{OrthtreeTraitsWithData}

\cgalHasModelsBegin
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, DimensionTag>}
\cgalHasModelsEnd
*/
class CollectionPartitioningOrthtreeTraits {
public:


/// \name Types
/// @{

/*!
* Sphere Type used for the shrinking-sphere approach for neighbor queries; needs to be copy assignable.
*/
using Sphere_d = unspecified_type;

/*!
* \brief The data type contained by each node; must be a model of `ForwardRange` in addition to default constructible, copy constructible and copy assignable.
*/
using Node_data = unspecified_type;

/*!
* \brief An element of the `Node_data` list-like type.
*
* Must be constructible from the value type of a `Node_data::iterator`.
* Typically the same as that type, but can also be an `std::reference_wrapper<>` if the type is not copyable.
*/
using Node_data_element = unspecified_type;

/*!
* \brief Functor with an operator that calculates the squared distance of a `Node_data_element` from a point.
*
* Provides the operator:
* `FT operator()(const Node_data_element&, const Point_d&)`
*/
using Squared_distance_of_element = unspecified_type;

/*!
* \brief Functor with an operator that constructs a `Sphere_d` from a provided center and squared radius.
*
* Provides the operator:
* `Sphere_d operator()(const Point_d&, const FT&)`
*/
using Construct_sphere_d = unspecified_type;

/*!
* \brief Functor with an operator that provides the center of a `Sphere_d`.
*
* Provides the operator:
* `Point_d operator()(const Sphere_d&)`
*/
using Construct_center_d = unspecified_type;

/*!
* \brief Functor with an operator that provides the squared radius of a `Sphere_d`.
*
* Provides the operator:
* `FT operator()(const Sphere_d&)`
*/
using Compute_squared_radius_d = unspecified_type;

/// @}

/// \name Operations
/// @{

/*!
* constructs an object of type `ConstructSphere_d`.
*/
Construct_sphere_d construct_sphere_d_object() const;

/*!
* constructs an object of type `ConstructCenter_d`.
*/
Construct_center_d construct_center_d_object() const;

/*!
* constructs an object of type `ComputeSquaredRadius_d`.
*/
Compute_squared_radius_d compute_squared_radius_d_object() const;

/*!
* constructs an object of type `Squared_distance_of_element`.
*/
Squared_distance_of_element squared_distance_of_element_object() const;

/// @}
};
66 changes: 41 additions & 25 deletions Orthtree/doc/Orthtree/Concepts/OrthtreeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
template parameter of the `CGAL::Orthtree` class.

\cgalHasModelsBegin
\cgalHasModels{CGAL::Orthtree_traits_2<GeomTraits>}
\cgalHasModels{CGAL::Orthtree_traits_3<GeomTraits>}
\cgalHasModels{CGAL::Orthtree_traits_d<GeomTraits,Dimension>}
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>}
\cgalHasModels{CGAL::Orthtree_traits_face_graph<PolygonMesh, VPM>}
\cgalHasModels{CGAL::Orthtree_traits_base<K, dimension>}
\cgalHasModelsEnd
*/
class OrthtreeTraits
Expand All @@ -17,46 +17,62 @@ class OrthtreeTraits

/// \name Types
/// @{

typedef unspecified_type Dimension; ///< Dimension type (see `CGAL::Dimension_tag`).
typedef unspecified_type Bbox_d; ///< Bounding box type.
typedef unspecified_type FT; ///< The number type of the %Cartesian coordinates of types `Point_d`
typedef unspecified_type Point_d; ///< Point type.
typedef unspecified_type Sphere_d; ///< The sphere type for neighbor queries.
using Node_index = unspecified_type; ///< An integer type for nodes
constexpr int dimension; ///< Dimension.
using FT = unspecified_type; ///< The number type of the %Cartesian coordinates of types `Point_d`
using Point_d = unspecified_type; ///< Point type.
using Bbox_d = unspecified_type; ///< Bounding box type. Must be constructible from a pair of `Point_d` objects.

/*!
A random access iterator type to enumerate the
%Cartesian coordinates of a point.
%Cartesian coordinates of a point of type `Point_d`.
*/
typedef unspecified_type Cartesian_const_iterator_d;
typedef std::array<FT, Dimension::value> Array; ///< Array used for easy point constructions.
using Cartesian_const_iterator_d = unspecified_type;

typedef unspecified_type Adjacency; ///< Specify the adjacency directions
/*!
* \brief Integral number type which can take on values indicating adjacency directions.
*
* Must be able to take on values ranging from 0 to the number of faces of the (hyper)rectangle type, equivalent to 2 * D.
*/
using Adjacency = unspecified_type; ///< Specify the adjacency directions

/*!
Functor with an operator to construct a `Point_d` from an `Array` object.
*/
typedef unspecified_type Construct_point_d_from_array;
* \brief Functor with an operator to create the bounding box of the root node.
*
afabri marked this conversation as resolved.
Show resolved Hide resolved
* Provides the operator:
* `Bbox_d operator()()`
*
* The bounding box must enclose all elements contained by the tree.
* It may be tight-fitting. The orthtree constructor produces a bounding box surrounding this region.
* For traits which assign no data to each node, this can be defined to return a fixed region.
*/
using Construct_root_node_bbox = unspecified_type;

/*!
Functor with an operator to construct a `Bbox_d` from two `Array` objects (coordinates of minimum and maximum points).
*/
typedef unspecified_type Construct_bbox_d;
* \brief Functor with an operator to construct a `Point_d` from an initializer list of type `FT`.
*
* Provides the operator:
* `Point_d operator()(arg1, arg2,...)`
*
* For trees which use a different kernel for the bounding box type,
* the return type of this functor must match the kernel used by the bounding box type and not that of the contents.
*/
using Construct_point_d = unspecified_type;

/// @}

/// \name Operations
/// @{

/*!
Function used to construct an object of type `Construct_point_d_from_array`.
*/
Construct_point_d_from_array construct_point_d_from_array_object() const;
* constructs an object of type `Construct_root_node_bbox`.
*/
Construct_root_node_bbox construct_root_node_bbox_object() const;

/*!
Function used to construct an object of type `Construct_bbox_d`.
*/
Construct_bbox_d construct_bbox_d_object() const;
* constructs an object of type `Construct_point_d`.
*/
Construct_point_d construct_point_d_object() const;

/// @}
};
76 changes: 76 additions & 0 deletions Orthtree/doc/Orthtree/Concepts/OrthtreeTraitsWithData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*!
\ingroup PkgOrthtreeConcepts
\cgalConcept

The concept `OrthtreeTraitsWithData` defines the requirements for the
template parameter of the `CGAL::Orthtree` class for a node type that stores data.

\cgalRefines{OrthtreeTraits}

\cgalHasModelsBegin
\cgalHasModels{CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>}
\cgalHasModels{CGAL::Orthtree_traits_face_graph<PolygonMesh, VPM>}
\cgalHasModels{CGAL::Orthtree_traits_base<K, dimension>}
\cgalHasModelsEnd
*/
class OrthtreeTraitsWithData
{
public:

/// \name Types
/// @{
/*!
* \brief The data type contained by each node. Must be default constructible, copy constructible and copy assignable.
*/
using Node_data = unspecified_type;

/*!
* \brief Functor which initializes elements contained by the root node.
*
* Each node of a tree has an associated `Node_data` value.
* This functor initializes the `Node_data` of the root node.
* It takes no arguments, and returns an instance of `Node_data`.
*
* Provides the operator:
* `Node_data operator()()`
*
* Typically, the `Node_data` of the root node contains all the elements in the tree.
* For a tree in which each node contains a span (such as `std::span()`) this function would return the span containing all items.
*
*/
using Construct_root_node_contents = unspecified_type;

/*!
* \brief Functor which fills the contents of the nodes children.
*
* Provides the operator:
* `void operator()(Node_index, Orthtree<Traits>&, const Point_d&)`
*
* The functor is called during refinement of the `Orthtree` on a node after it has been split. The purpose of the functor is to
* distribute the `Node_data`, accessible via `tree.data()`, to the data of the nodes children, accessible via `tree.children()`.
* The first parameter is the `Node_index` of the node. The second parameter provides the instance of the `Orthtree`
* and the last parameter is the barycenter of the node which will be used as shared corner amongst the children of the node.
*
* For a tree in which each node contains a span, this may mean rearranging the contents of the original node
* and producing spans containing a subset of its contents for each of its children.
* For compatibility with locate, the center of the node is considered to be part of the upper half.
*/
using Distribute_node_contents = unspecified_type;

/// @}

/// \name Operations
/// @{

/*!
* constructs an object of type `Construct_root_node_contents`.
*/
Construct_root_node_contents construct_root_node_contents_object() const;

/*!
* constructs an object of type `Distribute_node_contents`.
*/
Distribute_node_contents distribute_node_contents_object() const;

/// @}
};
Loading