OpenLexocad
27.0
|
Defines a non-persistent 2D cartesian point.
More...
#include <Pnt2d.h>
Public Member Functions | |
Pnt2d () | |
Pnt2d (const XY &Coord) | |
Creates a point with a doublet of coordinates. More... | |
Pnt2d (const double Xp, const double Yp) | |
Creates a point with its 2 cartesian's coordinates : Xp, Yp. More... | |
XY & | changeCoord () |
const XY & | coord () const |
For this point, returns its two coordinates as a number pair. More... | |
double | coord (const int Index) const |
void | coord (double &Xp, double &Yp) const |
For this point returns its two coordinates as a number pair. More... | |
double | distance (const Pnt2d &Other) const |
Computes the distance between two points. More... | |
bool | isEqual (const Pnt2d &Other, const double LinearTolerance) const |
void | mirror (const Pnt2d &P) |
Pnt2d | mirrored (const Pnt2d &P) const |
void | mirror (const Ax2d &A) |
Pnt2d | mirrored (const Ax2d &A) const |
void | rotate (const Pnt2d &P, const double Ang) |
Pnt2d | rotated (const Pnt2d &P, const double Ang) const |
Scales a point. S is the scaling value. More... | |
void | scale (const Pnt2d &P, const double S) |
Pnt2d | scaled (const Pnt2d &P, const double S) const |
Transforms a point with the transformation T. More... | |
void | setCoord (const int Index, const double Xi) |
void | setCoord (const double Xp, const double Yp) |
For this point, assigns the values Xp and Yp to its two coordinates More... | |
void | setX (const double X) |
Assigns the given value to the X coordinate of this point. More... | |
void | setXY (const XY &Coord) |
Assigns the two coordinates of Coord to this point. More... | |
void | setY (const double Y) |
Assigns the given value to the Y coordinate of this point. More... | |
double | squareDistance (const Pnt2d &Other) const |
Computes the square distance between two points. More... | |
void | transform (const Trsf2d &T) |
Pnt2d | transformed (const Trsf2d &T) const |
void | translate (const Vec2d &V) |
Pnt2d | translated (const Vec2d &V) const |
void | translate (const Pnt2d &P1, const Pnt2d &P2) |
Pnt2d | translated (const Pnt2d &P1, const Pnt2d &P2) const |
double | x () const |
For this point, returns its x coordinate. More... | |
const XY & | xy () const |
For this point, returns its two coordinates as a number pair. More... | |
double | y () const |
For this point, returns its y coordinate. More... | |
bool | operator== (const Geom::Pnt2d &other) const |
Checks whether two points are equal within linear tolerance (default 1E-07) More... | |
bool | operator!= (const Geom::Pnt2d &other) const |
Checks whether two points are unequal within linear tolerance (default 1E-07) More... | |
Defines a non-persistent 2D cartesian point.
Geom::Pnt2d::Pnt2d | ( | ) |
Geom::Pnt2d::Pnt2d | ( | const XY & | Coord | ) |
Creates a point with a doublet of coordinates.
Geom::Pnt2d::Pnt2d | ( | const double | Xp, |
const double | Yp | ||
) |
Creates a point with its 2 cartesian's coordinates : Xp, Yp.
XY& Geom::Pnt2d::changeCoord | ( | ) |
Returns the coordinates of this point.
Note: This syntax allows direct modification of the returned value.
const XY& Geom::Pnt2d::coord | ( | ) | const |
For this point, returns its two coordinates as a number pair.
double Geom::Pnt2d::coord | ( | const int | Index | ) | const |
Returns the coordinate of range Index :
Index = 1 => x is returned
Index = 2 => y is returned
Raises OutOfRange if Index != {1, 2}.
void Geom::Pnt2d::coord | ( | double & | Xp, |
double & | Yp | ||
) | const |
For this point returns its two coordinates as a number pair.
double Geom::Pnt2d::distance | ( | const Pnt2d & | Other | ) | const |
Computes the distance between two points.
bool Geom::Pnt2d::isEqual | ( | const Pnt2d & | Other, |
const double | LinearTolerance | ||
) | const |
Comparison
Returns True if the distance between the two
points is lower or equal to LinearTolerance.
void Geom::Pnt2d::mirror | ( | const Pnt2d & | P | ) |
Performs the symmetrical transformation of a point
with respect to the point P which is the center of
the symmetry.
void Geom::Pnt2d::mirror | ( | const Ax2d & | A | ) |
Performs the symmetrical transformation of a point
with respect to an axis placement which is the axis
Rotates a point. A1 is the axis of the rotation.
Ang is the angular value of the rotation in radians.
bool Geom::Pnt2d::operator!= | ( | const Geom::Pnt2d & | other | ) | const |
Checks whether two points are unequal within linear tolerance (default 1E-07)
bool Geom::Pnt2d::operator== | ( | const Geom::Pnt2d & | other | ) | const |
Checks whether two points are equal within linear tolerance (default 1E-07)
void Geom::Pnt2d::rotate | ( | const Pnt2d & | P, |
const double | Ang | ||
) |
Scales a point. S is the scaling value.
void Geom::Pnt2d::scale | ( | const Pnt2d & | P, |
const double | S | ||
) |
Transforms a point with the transformation T.
void Geom::Pnt2d::setCoord | ( | const int | Index, |
const double | Xi | ||
) |
Assigns the value Xi to the coordinate that corresponds to Index:
Index = 1 => X is modified
Index = 2 => Y is modified
Raises OutOfRange if Index != {1, 2}.
void Geom::Pnt2d::setCoord | ( | const double | Xp, |
const double | Yp | ||
) |
For this point, assigns the values Xp and Yp to its two coordinates
void Geom::Pnt2d::setX | ( | const double | X | ) |
Assigns the given value to the X coordinate of this point.
void Geom::Pnt2d::setXY | ( | const XY & | Coord | ) |
Assigns the two coordinates of Coord to this point.
void Geom::Pnt2d::setY | ( | const double | Y | ) |
Assigns the given value to the Y coordinate of this point.
double Geom::Pnt2d::squareDistance | ( | const Pnt2d & | Other | ) | const |
Computes the square distance between two points.
void Geom::Pnt2d::transform | ( | const Trsf2d & | T | ) |
void Geom::Pnt2d::translate | ( | const Vec2d & | V | ) |
double Geom::Pnt2d::x | ( | ) | const |
For this point, returns its x coordinate.
const XY& Geom::Pnt2d::xy | ( | ) | const |
For this point, returns its two coordinates as a number pair.
double Geom::Pnt2d::y | ( | ) | const |
For this point, returns its y coordinate.