SheafSystem  0.0.0.0
cylindrical_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 STD_CMATH_H
22 #include "SheafSystem/std_cmath.h"
23 #endif
24 
25 #ifndef CYLINDRICAL_POINT_LOCATOR_H
26 #define CYLINDRICAL_POINT_LOCATOR_H
27 
28 #ifndef SHEAF_DLL_SPEC_H
29 #include "SheafSystem/sheaf_dll_spec.h"
30 #endif
31 
32 #ifndef POINT_LOCATOR_H
33 #include "SheafSystem/point_locator.h"
34 #endif
35 
36 #ifndef D_BOUNDING_BOX_H
37 #include "SheafSystem/d_bounding_box.h"
38 #endif
39 
40 #ifndef EVAL_ITERATOR_H
41 #include "SheafSystem/eval_iterator.h"
42 #endif
43 
44 
45 
46 #ifndef STD_SET_H
47 #include "SheafSystem/std_set.h"
48 #endif
49 
50 #ifndef SINGLY_LINKED_LIST_H
51 #include "SheafSystem/singly_linked_list.h"
52 #endif
53 
54 #ifndef STL_SCOPED_INDEX_H
55 #include "SheafSystem/stl_scoped_index.h"
56 #endif
57 
58 //#undef DIAGNOSTIC_OUTPUT
59 //#define DIAGNOSTIC_OUTPUT
60 
61 namespace geometry
62 {
63 
64 template <int DC, int DB>
66 
73 class SHEAF_DLL_SPEC cylindrical_point_locator : public point_locator
74 {
75 
76  // ===========================================================
78  // ===========================================================
80 
81 public:
82 
86  // static const int DC = 3;
87 
91  // static const int DB = 2;
92 
94  {
95  DC = 3, DB = 2
96  };
97 
102 
106  virtual ~cylindrical_point_locator();
107 
111  const block<size_type>& bin_ub() const;
112 
116  const block<sec_vd_value_type>& bin_size() const;
117 
121  size_type box_ct() const;
122 
126  bool is_empty() const;
127 
132  d_bin_coordinates<2, 2>* relative_position(sec_vd_value_type* xpt, size_type xpt_ub) const;
133 
138  void relative_position_pa(sec_vd_value_type* xpt,
139  size_type xpt_ub,
140  d_bin_coordinates<2, 2>& xresult) const;
141 
145  virtual void insert_box(d_bounding_box<2, 2>* xbox) = 0;
146 
150  virtual void remove_box(d_bounding_box<2, 2>* xbox) = 0;
151 
155  virtual const box_list_type& box_list(sec_vd_value_type* xpt, size_type xpt_ub) const = 0;
156 
160  virtual bool contains_box(d_bounding_box<2, 2>* xbox) const = 0;
161 
165  virtual void clear() = 0;
166 
167 protected:
168 
173 
178 
183 
187  virtual cylindrical_point_locator& operator=(const point_locator& xother);
188 
192  cylindrical_point_locator& operator=(const cylindrical_point_locator& xother);
193 
198 
203 
208 
213 
217  virtual void update_bins() = 0;
218 
223 
228 
233 
240 
246  std::set< stl_scoped_index<> > _branches;
247 
252  void insert_quad(block<sec_vd_dof_type>& xdofs,
253  const scoped_index& xbranch_id,
254  const scoped_index& xeval_id);
255 
260  void insert_triangle(block<sec_vd_dof_type>& xdofs,
261  const scoped_index& xbranch_id,
262  const scoped_index& xeval_id);
263 
264 
269  void xyz_to_lat_lon(const sec_vd_dof_type xcartesian[3], sec_vd_dof_type xresult[2]);
270 
274  void make_quad_bounding_box(block<sec_vd_dof_type>& xlat_lon_dofs,
275  const scoped_index& xbranch_id,
276  const scoped_index& xeval_id);
277 
281  void make_triangle_bounding_box(block<sec_vd_dof_type>& xlat_lon_dofs,
282  const scoped_index& xbranch_id,
283  const scoped_index& xeval_id);
284 
286 
287 
288  // ===========================================================
290  // ===========================================================
292 
293 public:
294 
298  virtual bool invariant() const;
299 
303  virtual void update();
304 
308  virtual void point_at_value(const sec_vd_value_type* xvalue,
309  size_type xvalue_ub,
310  chart_point& xresult);
311 
318  virtual void all_points_at_value(const sec_vd_value_type* xvalue,
319  size_type xvalue_ub,
320  block<chart_point_3d>& xresult);
321 
326  virtual void branch_points_at_value(const sec_vd_value_type* xvalue,
327  size_type xvalue_ub,
328  block<branch_point_pair>& xresult);
329 
330 
332 
333 };
334 
335 } // namespace geometry
336 
337 #endif // CYLINDRICAL_POINT_LOCATOR_H
block< sec_vd_value_type > _one_over_min_bin_size
Reciprocal of the dimensions of the smallest bins.
singly_linked_list< const d_bounding_box< 2, 2 > * > box_list_type
The type of box list.
An iterator over the members of the evaluation subposet contained in the downset of the base space of...
Definition: eval_iterator.h:66
space_dimensions
Dimension of coordinate space.
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.
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
cylindrical_point_locator()
Default constructor; disabled.
block< size_type > _bin_ub
The upper bound for the bin index.
Fixed point relative coordinates for a tree domain.
sec_vd_value_type _bin_0_max
A sec_vd_value_type that truncates to the maximum index for bin 0.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Definition: sec_ed.h:47
block< sec_vd_value_type > _bin_size
The dimensions of the smallest bins.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
block< sec_vd_dof_type > _gathered_dofs
The dofs of gathered by evaluation member.
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 point location query in domains with global coordinate dimension dc and local coordinate ...
size_type _box_ct
The number of bounding boxes stored in the search structure.
block< d_bounding_box< 2, 2 > > _boxes
Bounding boxes for the evaluation members.
cylindrical_point_locator(const cylindrical_point_locator &xother)
Copy constructor; disabled.
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
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