SheafSystem  0.0.0.0
d_bin_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_BIN_POINT_LOCATOR_H
22 #define D_BIN_POINT_LOCATOR_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef POINT_LOCATOR_H
29 #include "SheafSystem/point_locator.h"
30 #endif
31 
32 #ifndef D_BOUNDING_BOX_H
33 #include "SheafSystem/d_bounding_box.h"
34 #endif
35 
36 #ifndef EVAL_ITERATOR_H
37 #include "SheafSystem/eval_iterator.h"
38 #endif
39 
40 #ifndef STD_SET_H
41 #include "SheafSystem/std_set.h"
42 #endif
43 
44 #ifndef SINGLY_LINKED_LIST_H
45 #include "SheafSystem/singly_linked_list.h"
46 #endif
47 
48 #ifndef STL_SCOPED_INDEX_H
49 #include "SheafSystem/stl_scoped_index.h"
50 #endif
51 
52 //#undef DIAGNOSTIC_OUTPUT
53 //#define DIAGNOSTIC_OUTPUT
54 
55 namespace geometry
56 {
57 
58 template <int DC, int DB>
59 class d_bin_coordinates;
60 
67 template <int DC, int DB>
68 class SHEAF_DLL_SPEC d_bin_point_locator : public point_locator
69 {
70 
71  // ===========================================================
73  // ===========================================================
75 
76 public:
77 
82 
86  virtual ~d_bin_point_locator();
87 
91  virtual bool invariant() const;
92 
96  const block<size_type>& bin_ub() const;
97 
101  const block<sec_vd_value_type>& bin_size() const;
102 
106  size_type box_ct() const;
107 
111  bool is_empty() const;
112 
117  d_bin_coordinates<DC, DB>* relative_position(sec_vd_value_type* xpt,
118  size_type xpt_ub) const;
119 
124  void relative_position_pa(sec_vd_value_type* xpt,
125  size_type xpt_ub,
126  d_bin_coordinates<DC, DB>& xresult) const;
127 
132  d_bounding_box<DC, DB>* assign_box(const scoped_index& xmbr_id,
133  const scoped_index& xbranch_id,
134  section_evaluator& xeval,
135  const sec_vd_dof_type* xdofs,
136  size_type xdofs_ct);
137 
141  size_type box_capacity();
142 
147 
151  void update_box(pod_index_type xi, const sec_vd_dof_type* xdofs, size_type xdofs_ct);
152 
153 
157  virtual void insert_box(d_bounding_box<DC, DB>* xbox) = 0;
158 
162  virtual void remove_box(d_bounding_box<DC, DB>* xbox) = 0;
163 
167  virtual const box_list_type& box_list(sec_vd_value_type* xpt,
168  size_type xpt_ub) const = 0;
169 
173  virtual bool contains_box(d_bounding_box<DC, DB>* xbox) const = 0;
174 
178  virtual void clear() = 0;
179 
183  const block<sec_vd_dof_type>& gathered_dofs() const;
184 
185 protected:
186 
190  d_bin_point_locator(sec_ed& xcoords);
191 
196 
201 
205  virtual d_bin_point_locator& operator=(const point_locator& xother) {return *this;};
206 
211 
215  block<size_type> _bin_ub;
216 
221 
226 
230  virtual void update_bins() = 0;
231 
236 
241 
246 
253 
259  std::set< stl_scoped_index<> > _branches;
260 
262 
263 
264  // ===========================================================
266  // ===========================================================
268 
269 public:
270 
271  using point_locator::update;
272 
277  virtual void update();
278 
284  virtual void update(bool xpopulate, size_type xeval_capacity);
285 
289  virtual void point_at_value(const sec_vd_value_type* xvalue,
290  size_type xvalue_ub,
291  chart_point& xresult);
292 
299  virtual void all_points_at_value(const sec_vd_value_type* xvalue,
300  size_type xvalue_ub,
301  block<chart_point_3d>& xresult);
302 
307  virtual void branch_points_at_value(const sec_vd_value_type* xvalue,
308  size_type xvalue_ub,
309  block<branch_point_pair>& xresult);
310 
311 
313 
314 };
315 
316 } // namespace geometry
317 
318 #endif // D_BIN_POINT_LOCATOR_H
std::set< stl_scoped_index<> > _branches
The branches for which a point has already been found for the current evaluation member. Used in all_points_at_value, allocated her to avoid reallocation for each query.
d_bin_point_locator(const d_bin_point_locator< DC, DB > &xother)
Copy constructor; disabled.
virtual void update()=0
Updates the search structure to the current values of coordinates().
block< sec_vd_value_type > _one_over_min_bin_size
Reciprocal of the dimensions of the smallest bins.
An iterator over the members of the evaluation subposet contained in the downset of the base space of...
Definition: eval_iterator.h:66
eval_iterator _eval_itr
The evaluator iterator used to populate the search structure; must have same life time as the search ...
A point in chart space.
Definition: chart_point.h:52
singly_linked_list< const d_bounding_box< DC, DB > * > box_list_type
The type of box list.
Fixed point relative coordinates for a tree domain.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Definition: sec_ed.h:47
block< d_bounding_box< DC, DB > > _boxes
Bounding boxes for the evaluation members.
virtual d_bin_point_locator & operator=(const point_locator &xother)
Assignment operator; disabled.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
A bounding box that can be strung together into a list.
An abstract local section evaluator; a map from {local coordinates x dofs} to section value...
d_bin_point_locator & operator=(const d_bin_point_locator< DC, DB > &xother)
Assignment operator; disabled.
size_type _box_ct
The number of bounding boxes stored in the search structure.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
double sec_vd_dof_type
The type of degree of freedom in the section space.
Definition: fiber_bundle.h:78
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 ...
block< sec_vd_dof_type > _gathered_dofs
The dofs of gathered by evaluation member.
block< sec_vd_value_type > _bin_size
The dimensions of the smallest bins.
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
d_bin_point_locator()
Default constructor; disabled.