33 :
Geom::Point2D<OrdType>( p ) {}
36 :
Geom::Point2D<OrdType>( cx, cy ) {}
42 {
return ! (crd == *
this); }
44 {
return x<crd.
x || (x==crd.
x && y<crd.
y); }
46 {
return x>crd.
x || (x==crd.
x && y>crd.
y); }
48 DistType horDistTo(
const Coord&)
const;
49 DistType sqHorDistTo(
const Coord&)
const;
52 DistType cosAngle(
const Coord& from,
const Coord& to)
const;
55 Coord normalize()
const;
56 OrdType dot(
const Coord&)
const;
59 const char* toPrettyString(
int nrdec=2)
const;
60 bool fromString(
const char*);
62 static const Coord& udf();
63 inline bool isUdf()
const {
return !isDefined(); }
80 : Coord( xyz.x, xyz.y )
83 : Coord(x_,y_), z(z_) {}
86 {
return idx ? (idx==1 ? y : z) : x; }
88 {
return idx ? (idx==1 ? y : z) : x; }
94 inline Coord3 operator/(
double)
const;
100 inline Coord3& operator/=(
double);
101 inline Coord3& operator*=(
double);
102 inline Coord&
coord() {
return *
this; }
103 inline const Coord&
coord()
const {
return *
this; }
116 inline Coord3 normalize()
const;
118 static const Coord3& udf();
119 inline bool isDefined()
const;
120 inline bool isUdf()
const {
return !isDefined(); }
123 bool fromString(
const char*);
201 return Coord3( -x, -y, -z );
206 {
return Coord3( x*factor, y*factor, z*factor ); }
210 {
return Coord3( x/denominator, y/denominator, z/denominator ); }
214 {
return Coord3( x*factor.
x, y*factor.
y, z*factor.
z ); }
218 {
return Coord3( x/denominator.
x, y/denominator.
y, z/denominator.
z ); }
223 x += p.
x; y += p.
y; z += p.
z;
230 x -= p.
x; y -= p.
y; z -= p.
z;
237 x *= factor; y *= factor; z *= factor;
244 x /= denominator; y /= denominator; z /= denominator;
250 {
return x*b.
x + y*b.
y + z*b.
z; }
254 {
return Coord3( y*b.
z-z*b.
y, z*b.
x-x*b.
z, x*b.
y-y*b.
x ); }
260 if ( absval < 1e-10 )
263 return *
this / absval;
#define mExpClass(module)
Definition: commondefs.h:160
Coord(const Geom::Point2D< OrdType > &p)
Definition: coord.h:32
bool operator==(const Coord &crd) const
Definition: coord.h:38
int operator-(const DateInfo &di1, const DateInfo &di2)
Definition: dateinfo.h:129
static bool isUdf(Coord3 crd)
Definition: coord.h:161
static void setUdf(Coord &crd)
Definition: coord.h:147
T to(const F &fr)
Definition: convert.h:33
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Coord3 operator+(const Coord3 &) const
Definition: coord.h:187
Templatized undefined and initialisation (i.e. null) values.
Definition: color.h:106
DistType dot(const Coord3 &) const
Definition: coord.h:249
Coord3 scaleBy(const Coord3 &) const
Definition: coord.h:213
bool operator==(const Coord3 &) const
Definition: coord.h:168
OrdType operator[](int idx) const
Definition: coord.h:87
#define mIsZero(x, eps)
Definition: commondefs.h:53
Coord3 operator-() const
Definition: coord.h:199
Coord3 & operator*=(double)
Definition: coord.h:235
bool isUdf() const
Definition: coord.h:120
Coord3(const Coord &a, OrdType z_)
Definition: coord.h:77
static Coord val()
Definition: coord.h:144
bool operator!=(const Coord &crd) const
Definition: coord.h:41
bool operator<(const Coord &crd) const
Definition: coord.h:43
static const Coord3 & udf()
bool isDefined() const
Definition: coord.h:181
static bool hasUdf()
Definition: coord.h:145
Pos::Distance_Type DistType
Definition: coord.h:30
A cartesian coordinate in 2D space.
Definition: coord.h:25
Coord3 unScaleBy(const Coord3 &) const
Definition: coord.h:217
Coord3 operator*(double) const
Definition: coord.h:205
static bool isUdf(Coord crd)
Definition: coord.h:146
#define mIsEqual(x, y, eps)
Definition: commondefs.h:54
Coord & coord()
Definition: coord.h:102
double Distance_Type
Definition: commontypes.h:55
Coord3 & operator/=(double)
Definition: coord.h:242
Coord3 cross(const Coord3 &) const
Definition: coord.h:253
double Ordinate_Type
Definition: commontypes.h:54
Coord3 normalize() const
Definition: coord.h:257
T y
Definition: geometry.h:67
bool isDefined() const
Definition: geometry.h:352
const Coord & coord() const
Definition: coord.h:103
OrdType & operator[](int idx)
Definition: coord.h:85
Coord3(OrdType x_, OrdType y_, OrdType z_)
Definition: coord.h:82
Position.
Definition: commontypes.h:42
bool operator>(const Coord &crd) const
Definition: coord.h:45
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
bool isUdf() const
Definition: coord.h:63
Coord(OrdType cx, OrdType cy)
Definition: coord.h:35
#define mDefEps
Definition: commondefs.h:58
A cartesian coordinate in 3D space.
Definition: coord.h:72
static const Coord & udf()
OrdType z
Definition: coord.h:125
bool operator!=(const Coord3 &) const
Definition: coord.h:176
static Coord3 val()
Definition: coord.h:159
Coord3 operator*(double f, const Coord3 &b)
Definition: coord.h:130
Coord3()
Definition: coord.h:76
T x
Definition: geometry.h:66
static void setUdf(Coord3 &crd)
Definition: coord.h:162
Coord3 & operator+=(const Coord3 &)
Definition: coord.h:221
Definition: geometry.h:19
#define mClass(module)
Definition: commondefs.h:164
Basic point class.
Definition: geometry.h:27
Coord()
Definition: coord.h:34
bool isUdf(const T &t)
Definition: undefval.h:243
static bool hasUdf()
Definition: coord.h:160
Pos::Ordinate_Type OrdType
Definition: coord.h:29
Export_Basic const char * toString(ViewStyle)
Coord3 & operator-=(const Coord3 &)
Definition: coord.h:228
Templatized undefined values.
Definition: undefval.h:51
Coord3(const Coord3 &xyz)
Definition: coord.h:79
Coord3 operator/(double) const
Definition: coord.h:209