SheafSystem  0.0.0.0
d_bounding_box.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_BOUNDING_BOX_H
22 #define D_BOUNDING_BOX_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef SCOPED_INDEX_H
29 #include "SheafSystem/scoped_index.h"
30 #endif
31 
32 #ifndef SHEAF_H
33 #include "SheafSystem/sheaf.h"
34 #endif
35 
36 #ifndef STD_IOSTREAM_H
37 #include "SheafSystem/std_iostream.h"
38 #endif
39 
40 #ifndef D_BIN_COORDINATES_H
41 #include "SheafSystem/d_bin_coordinates.h"
42 #endif
43 
44 namespace fiber_bundle
45 {
46 class section_evaluator;
47 }
48 
49 namespace geometry
50 {
51 
52 using namespace sheaf;
53 using namespace fiber_bundle;
54 
58 template <int DC, int DB>
59 class SHEAF_DLL_SPEC d_bounding_box
60 {
61 public:
62 
67 
68 
69  // ===========================================================
71  // ===========================================================
73 
74 public:
75 
80 
85 
89  d_bounding_box<DC, DB>& operator=(const d_bounding_box<DC, DB>& xbox);
90 
94  ~d_bounding_box();
95 
99  bool invariant() const;
100 
104  bool operator==(const d_bounding_box<DC, DB>& xbox) const;
105 
107 
108 
109  // ===========================================================
111  // ===========================================================
113 
114 public:
115 
119  bool contains_point(const d_bin_coordinates<DC, DB>& xpt) const;
120 
124  void to_stream(std::ostream& xos) const;
125 
129  const d_bin_coordinates<DC, DB>& lb() const;
130 
134  void put_lb(const d_bin_coordinates<DC, DB>& xlb);
135 
139  const d_bin_coordinates<DC, DB>& ub() const;
140 
144  void put_ub(const d_bin_coordinates<DC, DB>& xub);
145 
149  const scoped_index& member_id() const;
150 
154  void put_member_id(const scoped_index& xid);
155 
159  const scoped_index& branch_id() const;
160 
164  void put_branch_id(const scoped_index& xid);
165 
169  section_evaluator* evaluator() const;
170 
174  void put_evaluator(section_evaluator* xevaluator);
175 
179  size_type dofs_index() const;
180 
184  void put_dofs_index(size_type xindex);
185 
190  size_type dof_ct() const;
191 
195  void put_dof_ct(size_type xct);
196 
200  void size_pa(d_bin_coordinates<DC, DB>& xresult) const;
201 
205  static int dc();
206 
207 private:
208 
213 
218 
222  scoped_index _member_id;
223 
227  scoped_index _branch_id;
228 
232  section_evaluator* _evaluator;
233 
237  size_type _dofs_index;
238 
243  size_type _dof_ct;
244 
246 
247 };
248 
249 // ===========================================================
250 // NON-MEMBER FUNCTIONS
251 // ===========================================================
252 
256 template <int DC, int DB>
257 SHEAF_DLL_SPEC
258 std::ostream&
259 operator<<(std::ostream& xos, const d_bounding_box<DC, DB>& xbox);
260 
261 } // namespace geometry
262 
263 #endif // D_BOUNDING_BOX_H
Fixed point relative coordinates for a tree domain.
sheaf::size_type size_type
An unsigned integral type used to represent sizes and capacities.
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...
bool operator==(const singly_linked_list< T, Alloc > &lhs, const singly_linked_list< T, Alloc > &rhs)
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs compares equal with the element in rhs at the same position.
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