NDEVR
API Documentation
VirtualTree.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Tree
28File: VirtualTree
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "RTree.h>
34#include "KDTree.h>
35
36namespace NDEVR
37{
41 template<uint01 t_dims, class t_type>
43 {
44 public:
49 {
51 , R
52 };
55 TreeObject* m_object;
56
59 void createKDTree(uint04 leaf_size)
60 {
61 switch (leaf_size)
62 {
63 case 4: m_object = new KDTree<t_dims, t_type, 4>();
64 case 8: m_object = new KDTree<t_dims, t_type, 8>();
65 case 12: m_object = new KDTree<t_dims, t_type, 12>();
66 case 16: m_object = new KDTree<t_dims, t_type, 16>();
67 case 20: m_object = new KDTree<t_dims, t_type, 20>();
68 case 24: m_object = new KDTree<t_dims, t_type, 24>();
69 case 32: m_object = new KDTree<t_dims, t_type, 32>();
70 case 48: m_object = new KDTree<t_dims, t_type, 48>();
71 case 64: m_object = new KDTree<t_dims, t_type, 64>();
72 case 128: m_object = new KDTree<t_dims, t_type, 128>();
73 default:
74 assert(false, "Uncompiled KD Tree Bucket Size");
75 }
76 }
77
80 void createRTree(uint04 leaf_size)
81 {
82 switch (leaf_size)
83 {
84 case 4: m_object = new RTree<t_dims, t_type, 4>();
85 case 8: m_object = new RTree<t_dims, t_type, 8>();
86 case 12: m_object = new RTree<t_dims, t_type, 12>();
87 case 16: m_object = new RTree<t_dims, t_type, 16>();
88 case 20: m_object = new RTree<t_dims, t_type, 20>();
89 case 24: m_object = new RTree<t_dims, t_type, 24>();
90 case 32: m_object = new RTree<t_dims, t_type, 32>();
91 case 48: m_object = new RTree<t_dims, t_type, 48>();
92 case 64: m_object = new RTree<t_dims, t_type, 64>();
93 case 128: m_object = new RTree<t_dims, t_type, 128>();
94 default:
95 assert(false, "Uncompiled R Tree Bucket Size");
96 }
97 }
98 };
99}
A polymorphic spatial tree that can instantiate either a KDTree or RTree at runtime based on configur...
Definition VirtualTree.h:43
uint04 m_bucket_size
The bucket size for leaf nodes.
Definition VirtualTree.h:54
TreeType m_type
The currently selected tree type.
Definition VirtualTree.h:53
void createKDTree(uint04 leaf_size)
Creates a KDTree with the specified leaf size.
Definition VirtualTree.h:59
void createRTree(uint04 leaf_size)
Creates an RTree with the specified leaf size.
Definition VirtualTree.h:80
TreeType
Enumerates the available spatial tree implementations.
Definition VirtualTree.h:49
@ e_KD
KD-Tree spatial index.
Definition VirtualTree.h:50
@ R
R-Tree spatial index.
Definition VirtualTree.h:51
TreeObject * m_object
Pointer to the underlying tree implementation.
Definition VirtualTree.h:55
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...