SheafSystem  0.0.0.0
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 POINT_LOCATOR_H
22 #define POINT_LOCATOR_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef BLOCK_H
29 #include "SheafSystem/block.h"
30 #endif
31 
32 #ifndef GEOMETRY_H
33 #include "SheafSystem/geometry.h"
34 #endif
35 
36 namespace fiber_bundle
37 {
38 class chart_point;
39 class sec_ed;
40 }
41 
42 namespace geometry
43 {
44 
45 using namespace sheaf;
46 using namespace fiber_bundle;
47 
52 class SHEAF_DLL_SPEC point_locator
53 {
54 
55  // ===========================================================
57  // ===========================================================
59 
60 public:
61 
65  virtual bool invariant() const;
66 
70  virtual ~point_locator();
71 
73 
74 
75  // ===========================================================
77  // ===========================================================
79 
83  sec_ed& coordinates() const;
84 
88  const block<sec_vd_value_type>& lb() const;
89 
93  const block<sec_vd_value_type>& ub() const;
94 
99  int dc() const;
100 
105  int db() const;
106 
110  bool domain_contains(sec_vd_value_type* xpt, size_type xpt_ub) const;
111 
115  virtual void update() = 0;
116 
120  virtual void point_at_value(const sec_vd_value_type* xvalue,
121  size_type xvalue_ub,
122  chart_point& xresult) = 0;
123 
130  virtual void all_points_at_value(const sec_vd_value_type* xvalue,
131  size_type xvalue_ub,
132  block<chart_point_3d>& xresult) = 0;
133 
138  virtual void branch_points_at_value(const sec_vd_value_type* xvalue,
139  size_type xvalue_ub,
140  block<branch_point_pair>& xresult) = 0;
141 
142 protected:
143 
147  point_locator();
148 
152  point_locator(sec_ed& xcoords);
153 
157  static sec_vd_value_type slightly_greater_than(sec_vd_value_type x);
158 
162  static sec_vd_value_type slightly_less_than(sec_vd_value_type x);
163 
164 
169 
174 
179  int _dc;
180 
185  int _db;
186 
190  void update_domain();
191 
192 
193 private:
194 
198  point_locator(const point_locator& xother);
199 
203  virtual point_locator& operator=(const point_locator& xother);
204 
208  sec_ed& _coordinates;
209 
211 };
212 
213 
217 SHEAF_DLL_SPEC
218 std::ostream&
219 operator<<(std::ostream& xos, const point_locator& xpl);
220 
221 } // namespace geometry
222 
223 #endif // POINT_LOCATOR_H
int _dc
The spatial dimension of the domain; the dimension of the global coordinates.
A point in chart space.
Definition: chart_point.h:52
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Definition: sec_ed.h:47
block< sec_vd_value_type > _lb
The lower bound of the domain.
int _db
The intrinsic dimension of the domain; the dimension of the local coordinates.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
block< sec_vd_value_type > _ub
The upper bound of the domain.
Namespace for the sheaves component of the sheaf system.
Namespace for the fiber_bundles component of the sheaf system.
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 ...
Definition: point_locator.h:52
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.
Definition: binary_index.cc:35