SheafSystem  0.0.0.0
line_surface_intersecter.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 LINE_SURFACE_INTERSECTER_H
22 #define LINE_SURFACE_INTERSECTER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ANY_H
29 #include "SheafSystem/any.h"
30 #endif
31 
32 #ifndef CHART_POINT_1D_H
33 #include "SheafSystem/chart_point_1d.h"
34 #endif
35 
36 #ifndef D_ARRAY_POINT_LOCATOR_H
37 #include "SheafSystem/d_array_point_locator.h"
38 #endif
39 
40 #ifndef E3_H
41 #include "SheafSystem/e3.h"
42 #endif
43 
44 #ifndef GEOMETRY_H
45 #include "SheafSystem/geometry.h"
46 #endif
47 
48 #ifndef LINEAR_2D_H
49 #include "SheafSystem/linear_2d.h"
50 #endif
51 
52 #ifndef STD_IOSTREAM_H
53 #include "SheafSystem/std_iostream.h"
54 #endif
55 
56 #ifndef STD_MAP_H
57 #include "SheafSystem/std_map.h"
58 #endif
59 
60 namespace sheaf
61 {
62  class subposet;
63 }
64 
65 namespace fiber_bundle
66 {
67  class sec_e3;
68  class base_space_poset;
69 }
70 
71 namespace geometry
72 {
73 
79 class SHEAF_DLL_SPEC line_surface_intersecter : public any
80 {
81 
82  friend SHEAF_DLL_SPEC std::ostream & operator << (std::ostream &os, const line_surface_intersecter& xp);
83 
84  // ===========================================================
86  // ===========================================================
88 
89 public:
90 
96  line_surface_intersecter(sec_e3& xcoords, const block<size_type>& xbin_ubs);
97 
102 
106  virtual ~line_surface_intersecter();
107 
111  const sec_e3& coords() const;
112 
117  {
118  bool operator()(sec_vd_value_type x1, sec_vd_value_type x2) const
119  {
120  return (x2 - x1) > (std::abs(x1) + std::abs(x2))*1.0e-6;
121  }
122  };
123 
129  typedef std::map<sec_vd_value_type, pod_index_type, really_less_than> intersection_set_type;
130 
135 
140  void intersect(const e3_lite& xp0, const e3_lite& xp1, intersection_set_type& xresult) const;
141 
142 protected:
143 
148 
153 
158 
163 
168 
170 
175 
180 
185 
189  search_structure_type* _locator;
190 
196  bool intersect(const e3_lite& xp0, const e3_lite& xp1, const d_bounding_box<3, 2>& xbox, e3_lite& xr) const;
197 
198 private:
199 
201 
202 
203  // ===========================================================
205  // ===========================================================
207 
208 public:
209 
213  virtual bool is_ancestor_of(const any *other) const;
214 
219  virtual line_surface_intersecter* clone() const;
220 
224  line_surface_intersecter& operator=(const line_surface_intersecter& xother);
225 
229  virtual bool invariant() const;
230 
232 
233 };
234 
235 // ===========================================================
236 // NON-MEMBER FUNCTIONS
237 // ===========================================================
238 
242 SHEAF_DLL_SPEC
243 std::ostream&
244 operator<< (std::ostream &os, const line_surface_intersecter& xp);
245 
246 } // end namespace geometry
247 
248 #endif // ifndef LINE_SURFACE_INTERSECTER_H
index_space_handle * _surface_id_space
The surface id space.
std::map< sec_vd_value_type, pod_index_type, really_less_than > intersection_set_type
The type of intersetion set, a map from z coordinate to surface id; sorted by z coordinate.
Euclidean vector space of dimension 3 (volatile version).
Definition: e3.h:116
search_structure_type::box_set_type box_set_type
The type of search structure box set.
base_space_poset * _host
The base space.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
d_bounding_box< 3, 2 > box_type
The type of search structure box.
sec_e3 * _coords
The coordinate section for lines.
Abstract base class with useful features for all objects.
Definition: any.h:39
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
A line-surface intersection query.
index_space_handle * _eval_id_space
The id space for surface evaluators.
A bounding box that can be strung together into a list.
d_array_point_locator< 3, 2 > search_structure_type
The type of collision search structure.
linear_2d _evaluator
The evaluator for surface sections; temporarily assumes triangle.
A section of a fiber bundle with a 3-dimensional Euclidean vector space fiber.
Definition: sec_e3.h:47
A section evaluator using linear interpolation over a triangular 2D domain.
Definition: linear_2d.h:39
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
search_structure_type * _locator
The intersection search structure.
std::set< const d_bounding_box< DC, DB > * > box_set_type
The type of box set.
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
A point location query in domains with global coordinate dimension DC and local coordinate dimension ...
Compare functor makes sure surface values are really different.