21 #include "SheafSystem/chart_point_2d.h" 22 #include "SheafSystem/assert_contract.h" 64 ensure(*
this == xother);
94 _chart_id = xchart_id;
95 _local_coords[0] = xu;
96 _local_coords[1] = xv;
101 ensure(chart_id() == xchart_id);
117 _chart_id = xchart_id.
hub_pod();
118 _local_coords[0] = xu;
119 _local_coords[1] = xv;
124 ensure(chart_id() == xchart_id.
hub_pod());
140 require(xlocal_coords != 0);
141 require(xlocal_coords_ub >= db());
145 _chart_id = xchart_id;
146 put_local_coords(xlocal_coords, xlocal_coords_ub);
151 ensure(chart_id() == xchart_id);
166 require(xlocal_coords != 0);
167 require(xlocal_coords_ub >= db());
171 _chart_id = xchart_id.
hub_pod();
172 put_local_coords(xlocal_coords, xlocal_coords_ub);
177 ensure(chart_id() == xchart_id.
hub_pod());
215 require((0 <= xi) && (xi < db()));
219 result = _local_coords[xi];
237 require((0 <= xi) && (xi < db()));
241 _local_coords[xi] = xvalue;
265 result = _local_coords;
286 result = _local_coords;
353 _chart_id = xchart_id;
354 _local_coords[0] = xu;
355 _local_coords[1] = xv;
360 ensure(chart_id() == xchart_id);
377 put(xchart_id.
hub_pod(), xu, xv);
382 ensure(chart_id() == xchart_id.
hub_pod());
445 if(invariant_check())
449 disable_invariant_check();
452 invariance(db() == 2);
456 enable_invariant_check();
504 ensure(unexecutable(*
this == xother));
chart_point_2d & 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.
const coord_type & u() const
The 0-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.
void put(pod_index_type xchart, coord_type xu, coord_type xv)
Sets chart_id() == xchart_id, u() == xu, v() == xv.
chart_point_2d()
Default constructor.
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.
coord_type _local_coords[2]
The local coordinates of this point.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual ~chart_point_2d()
Destructor.
A point in a 2D chart space.
virtual bool invariant() const
Class invariant.
const coord_type & v() const
The 1-th local coordinate of this.
coord_type * local_coords()
The array of local coordinates.
virtual void put_local_coord(int xi, coord_type xvalue)
Sets the xi-th local coordinate of this point to xvalue.
int_type pod_index_type
The plain old data index type.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual coord_type local_coord(int xi) const
The xi-th local coordinate of this point.
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.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
virtual chart_point_2d * clone() const
Virtual constructor, makes a new instance of the same type as this.
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.