SheafSystem  0.0.0.0
d_tree_point_locator.h
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 #ifndef D_TREE_POINT_LOCATOR_H
22 #define D_TREE_POINT_LOCATOR_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef D_BIN_POINT_LOCATOR_H
29 #include "SheafSystem/d_bin_point_locator.h"
30 #endif
31 
32 #ifndef D_TREE_POINT_LOCATOR_NODE_H
33 #include "SheafSystem/d_tree_point_locator_node.h"
34 #endif
35 
36 #ifndef PTR_LINKED_POOL_H
37 #include "SheafSystem/ptr_linked_pool.h"
38 #endif
39 
40 #ifndef STD_IOSTREAM_H
41 #include "SheafSystem/std_iostream.h"
42 #endif
43 
44 //#undef DIAGNOSTIC_OUTPUT
45 //#define DIAGNOSTIC_OUTPUT
46 
47 namespace geometry
48 {
49 
56 template <int DC, int DB>
57 class SHEAF_DLL_SPEC d_tree_point_locator : public d_bin_point_locator<DC, DB>
58 {
59  friend class d_tree_point_locator_node<DC, DB>;
60 
61  // ===========================================================
63  // ===========================================================
65 
66 public:
67 
71  d_tree_point_locator(sec_ed& xcoords, size_type xdepth);
72 
77  d_tree_point_locator(sec_ed& xcoords);
78 
82  virtual ~d_tree_point_locator();
83 
87  const d_tree_point_locator_node<DC, DB>& root() const;
88 
93  size_type depth() const;
94 
98  static size_type max_depth();
99 
103  size_type size();
104 
108  size_type capacity();
109 
114  static size_type& default_depth();
115 
116 protected:
117 
122 
127 
131  virtual d_tree_point_locator& operator=(const point_locator& xother) {return *this;};
132 
137 
141  void update_bins();
142 
147 
152 
157 
163 
165 
166 
167  // ===========================================================
169  // ===========================================================
171 
172 public:
173 
178 
182  virtual void insert_box(d_bounding_box<DC, DB>* xbox);
183 
187  virtual void remove_box(d_bounding_box<DC, DB>* xbox);
188 
192  virtual const box_list_type& box_list(sec_vd_value_type* xpt,
193  size_type xpt_ub) const;
194 
198  virtual bool contains_box(d_bounding_box<DC, DB>* xbox) const;
199 
203  virtual void clear();
204 
206 
207 
208  // ===========================================================
210  // ===========================================================
212 
213 public:
214 
218  virtual bool invariant() const;
219 
221 
222 
223 };
224 
225 // ===========================================================
226 // NON-MEMBER FUNCTIONS
227 // ===========================================================
228 
232 template <int DC, int DB>
233 SHEAF_DLL_SPEC
234 std::ostream&
235 operator<<(std::ostream& xos, const d_tree_point_locator<DC, DB>& xtree);
236 
237 } // namespace geometry
238 
239 #endif // D_TREE_POINT_LOCATOR_H
A reallocatable pool of objects of type T. Objects in the pool are either "allocated" or linked toget...
d_tree_point_locator_node< DC, DB > _root
The root node of the tree.
d_tree_point_locator & operator=(const d_tree_point_locator< DC, DB > &xother)
Assignment operator; disabled.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Definition: sec_ed.h:47
virtual d_tree_point_locator & operator=(const point_locator &xother)
Assignment operator; disabled.
A point location query in domains with global coordinate dimension dc and local coordinate dimension ...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
d_tree_point_locator(const d_tree_point_locator< DC, DB > &xother)
Copy constructor; disabled.
A bounding box that can be strung together into a list.
d_tree_point_locator()
Default constructor; disabled.
size_type _depth
The number of levels in the tree; the length of the longest path from the root to a leaf...
ptr_linked_pool< d_tree_point_locator_node< DC, DB > > _node_pool
Pool for efficiently allocating and deallocating nodes.
singly_linked_list< const d_bounding_box< DC, DB > * > box_list_type
The type of box list.
A node in a d_tree_point_locator search structure.
Namespace for geometry component of sheaf system.
Definition: field_vd.h:54
vd_value_type sec_vd_value_type
The type of component in the value of a section at a point.
Definition: fiber_bundle.h:73
An abstract point location query in domains with global coordinate dimension dc and local coordinate ...
Wrapper class for forward_list or slist depending on compiler. The class replicates the minimum subse...
An abstract point location query in domains with global coordinate dimension dc and local coordinate ...
Definition: point_locator.h:52