21 #include "SheafSystem/chart_point_3d.h" 22 #include "SheafSystem/assert_contract.h" 63 ensure(*
this == xother);
96 _chart_id = xchart_id;
97 _local_coords[0] = xu;
98 _local_coords[1] = xv;
99 _local_coords[2] = xw;
104 ensure(chart_id() == xchart_id);
124 _chart_id = xchart_id.
hub_pod();
125 _local_coords[0] = xu;
126 _local_coords[1] = xv;
127 _local_coords[2] = xw;
132 ensure(chart_id() == xchart_id.
hub_pod());
150 require(xlocal_coords != 0);
151 require(xlocal_coords_ub >= db());
155 _chart_id = xchart_id;
156 put_local_coords(xlocal_coords, xlocal_coords_ub);
161 ensure(chart_id() == xchart_id);
177 require(xlocal_coords != 0);
178 require(xlocal_coords_ub >= db());
182 _chart_id = xchart_id.
hub_pod();
183 put_local_coords(xlocal_coords, xlocal_coords_ub);
188 ensure(chart_id() == xchart_id.
hub_pod());
225 require((0 <= xi) && (xi < db()));
229 result = _local_coords[xi];
247 require((0 <= xi) && (xi < db()));
251 _local_coords[xi] = xvalue;
275 result = _local_coords;
297 result = _local_coords;
383 _chart_id = xchart_id;
384 _local_coords[0] = xu;
385 _local_coords[1] = xv;
386 _local_coords[2] = xw;
391 ensure(chart_id() == xchart_id);
409 put(xchart_id.
hub_pod(), xu, xv, xw);
414 ensure(chart_id() == xchart_id.
hub_pod());
477 if(invariant_check())
481 disable_invariant_check();
484 invariance(db() == 3);
488 enable_invariant_check();
535 ensure(unexecutable(*
this == xother));
chart_point_3d & operator=(const chart_point &xother)
Assignment operator.
chart_point_coord_type coord_type
The type of local coordinate; the scalar type for the local coordinate vector space.
virtual bool invariant() const
Class invariant.
virtual ~chart_point_3d()
Destructor.
A point in a 3D chart space.
const coord_type & w() const
The 2-th local coordinate of this.
const coord_type & v() const
The 1-th local coordinate of this.
virtual int db() const
The dimension of this chart.
pod_index_type _chart_id
The id of the chart this point is in.
Abstract base class with useful features for all objects.
virtual bool invariant() const
Class invariant.
An index within the external ("client") scope of a given id space.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual void put_local_coord(int xi, coord_type xvalue)
Sets the xi-th local coordinate of this point to xvalue.
const coord_type & u() const
The 0-th local coordinate of this.
coord_type * local_coords()
The array of local coordinates.
virtual coord_type local_coord(int xi) const
The xi-th local coordinate of this point.
int_type pod_index_type
The plain old data index type.
void put(pod_index_type xchart_id, coord_type xu, coord_type xv, coord_type xw)
Sets chart_id() == xchart_id, u() == xu, v() == xv, w() == xw.
chart_point_3d()
Default constructor.
virtual chart_point_3d * clone() const
Virtual constructor, makes a new instance of the same type as this.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
bool is_same_type(const any *other) const
True if other is the same type as this.
coord_type _local_coords[3]
The local coordinates of this point.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.