OpenLexocad  27.1
Geom::Pnt2d Class Reference

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...
 
XYchangeCoord ()
 
const XYcoord () 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 XYxy () 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...
 

Detailed Description

Defines a non-persistent 2D cartesian point.

Constructor & Destructor Documentation

◆ Pnt2d() [1/3]

Geom::Pnt2d::Pnt2d ( )

◆ Pnt2d() [2/3]

Geom::Pnt2d::Pnt2d ( const XY Coord)

Creates a point with a doublet of coordinates.

◆ Pnt2d() [3/3]

Geom::Pnt2d::Pnt2d ( const double  Xp,
const double  Yp 
)

Creates a point with its 2 cartesian's coordinates : Xp, Yp.

Member Function Documentation

◆ changeCoord()

XY& Geom::Pnt2d::changeCoord ( )

Returns the coordinates of this point.
Note: This syntax allows direct modification of the returned value.

◆ coord() [1/3]

const XY& Geom::Pnt2d::coord ( ) const

For this point, returns its two coordinates as a number pair.

◆ coord() [2/3]

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}.

◆ coord() [3/3]

void Geom::Pnt2d::coord ( double &  Xp,
double &  Yp 
) const

For this point returns its two coordinates as a number pair.

◆ distance()

double Geom::Pnt2d::distance ( const Pnt2d Other) const

Computes the distance between two points.

◆ isEqual()

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.

◆ mirror() [1/2]

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.

◆ mirror() [2/2]

void Geom::Pnt2d::mirror ( const Ax2d A)

◆ mirrored() [1/2]

Pnt2d Geom::Pnt2d::mirrored ( const Pnt2d P) const

Performs the symmetrical transformation of a point
with respect to an axis placement which is the axis

◆ mirrored() [2/2]

Pnt2d Geom::Pnt2d::mirrored ( const Ax2d A) const

Rotates a point. A1 is the axis of the rotation.
Ang is the angular value of the rotation in radians.

◆ operator!=()

bool Geom::Pnt2d::operator!= ( const Geom::Pnt2d other) const

Checks whether two points are unequal within linear tolerance (default 1E-07)

◆ operator==()

bool Geom::Pnt2d::operator== ( const Geom::Pnt2d other) const

Checks whether two points are equal within linear tolerance (default 1E-07)

◆ rotate()

void Geom::Pnt2d::rotate ( const Pnt2d P,
const double  Ang 
)

◆ rotated()

Pnt2d Geom::Pnt2d::rotated ( const Pnt2d P,
const double  Ang 
) const

Scales a point. S is the scaling value.

◆ scale()

void Geom::Pnt2d::scale ( const Pnt2d P,
const double  S 
)

◆ scaled()

Pnt2d Geom::Pnt2d::scaled ( const Pnt2d P,
const double  S 
) const

Transforms a point with the transformation T.

◆ setCoord() [1/2]

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}.

◆ setCoord() [2/2]

void Geom::Pnt2d::setCoord ( const double  Xp,
const double  Yp 
)

For this point, assigns the values Xp and Yp to its two coordinates

◆ setX()

void Geom::Pnt2d::setX ( const double  X)

Assigns the given value to the X coordinate of this point.

◆ setXY()

void Geom::Pnt2d::setXY ( const XY Coord)

Assigns the two coordinates of Coord to this point.

◆ setY()

void Geom::Pnt2d::setY ( const double  Y)

Assigns the given value to the Y coordinate of this point.

◆ squareDistance()

double Geom::Pnt2d::squareDistance ( const Pnt2d Other) const

Computes the square distance between two points.

◆ transform()

void Geom::Pnt2d::transform ( const Trsf2d T)

◆ transformed()

Pnt2d Geom::Pnt2d::transformed ( const Trsf2d T) const

◆ translate() [1/2]

void Geom::Pnt2d::translate ( const Vec2d V)

◆ translate() [2/2]

void Geom::Pnt2d::translate ( const Pnt2d P1,
const Pnt2d P2 
)

◆ translated() [1/2]

Pnt2d Geom::Pnt2d::translated ( const Vec2d V) const

◆ translated() [2/2]

Pnt2d Geom::Pnt2d::translated ( const Pnt2d P1,
const Pnt2d P2 
) const

◆ x()

double Geom::Pnt2d::x ( ) const

For this point, returns its x coordinate.

◆ xy()

const XY& Geom::Pnt2d::xy ( ) const

For this point, returns its two coordinates as a number pair.

◆ y()

double Geom::Pnt2d::y ( ) const

For this point, returns its y coordinate.


The documentation for this class was generated from the following file: