SheafSystem  0.0.0.0
chart_point.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 CHART_POINT_H
22 #define CHART_POINT_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 FIBER_BUNDLE_H
33 #include "SheafSystem/fiber_bundle.h"
34 #endif
35 
36 #ifndef SCOPED_INDEX_H
37 #include "SheafSystem/scoped_index.h"
38 #endif
39 
40 #ifndef STD_IOSTREAM_H
41 #include "SheafSystem/std_iostream.h"
42 #endif
43 
44 namespace fiber_bundle
45 {
46 
47  using namespace sheaf;
48 
52 class SHEAF_DLL_SPEC chart_point : public any
53 {
54  // ===========================================================
56  // ===========================================================
58 
59 public:
60 
66 
67 
71  static chart_point* new_chart_point(int xdb);
72 
76  virtual ~chart_point();
77 
81  pod_index_type chart_id() const;
82 
86  void put_chart_id(pod_index_type xchart);
87 
91  void put_chart_id(const scoped_index& xchart);
92 
96  virtual int db() const = 0;
97 
101  virtual coord_type local_coord(int xi) const = 0;
102 
106  virtual void put_local_coord(int xi, coord_type xvalue) = 0;
107 
111  virtual coord_type* local_coords() = 0;
112 
116  virtual const coord_type* local_coords() const = 0;
117 
121  void put_local_coords(const coord_type* xvalues, size_type xvalues_ub);
122 
126  void put_local_coords_zero();
127 
131  bool is_valid() const;
132 
136  void invalidate();
137 
138 protected:
139 
143  chart_point();
144 
149 
150 private:
151 
156  chart_point(const chart_point& xother);
157 
159 
160 
161  // ===========================================================
163  // ===========================================================
164 
165 public:
166 
171  virtual chart_point* clone() const = 0;
172 
176  virtual bool invariant() const;
177 
181  virtual bool is_ancestor_of(const any* other) const;
182 
187  chart_point& operator=(const chart_point& xother);
188 
192  bool operator==(const chart_point& xother) const;
193 
194 protected:
195 
196 private:
197 
199 
200 
201  // ===========================================================
203  // ===========================================================
204 
205 public:
206 
210  void to_stream(std::ostream& xos = std::cout) const;
211 
212 
216  std::string to_string() const;
217 
218 protected:
219 
220 private:
221 
223 };
224 
225 // ===========================================================
226 // NON-MEMBER FUNCTIONS
227 // ===========================================================
228 
229 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
230 
234 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream &os, const chart_point& xpt);
235 
236 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
237 
238 } // namespace fiber_bundle
239 
240 
241 #endif // ifndef CHART_POINT_H
double chart_point_coord_type
The type of local coordinate in the base space; the scalar type for the local coordinate vector space...
Definition: fiber_bundle.h:57
chart_point_coord_type coord_type
The type of local coordinate; the scalar type for the local coordinate vector space.
Definition: chart_point.h:65
pod_index_type _chart_id
The id of the chart this point is in.
Definition: chart_point.h:148
A point in chart space.
Definition: chart_point.h:52
Abstract base class with useful features for all objects.
Definition: any.h:39
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
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.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Definition: pod_types.cc:37
Namespace for the fiber_bundles component of the sheaf system.
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