OpenLexocad  28.0
Geom::Pnt Class Reference

Defines a non-persistent 3D Cartesian point.
More...

#include <Pnt.h>

Public Member Functions

 Pnt ()
 Creates an indefinite point.
More...
 
 Pnt (const Geom::XYZ &Coord)
 Creates a point with a triplet of coordinates.
More...
 
 Pnt (const double Xp, const double Yp, const double Zp=.0)
 Creates a point with its 3 Cartesian's coordinates : Xp, Yp, Zp.
More...
 
 Pnt (const Pnt &rhs)
 Copy constructor. More...
 
void setCoord (const int Index, const double Xi)
 
void setCoord (const double Xp, const double Yp, const double Zp=.0)
 For this point, assigns the values Xp, Yp and Zp to its three coordinates.
More...
 
void setX (const double X)
 Assigns the given value to the X coordinate of this point.
More...
 
void setY (const double Y)
 Assigns the given value to the Y coordinate of this point.
More...
 
void setZ (const double Z)
 Assigns the given value to the Z coordinate of this point.
More...
 
void setXYZ (const Geom::XYZ &Coord)
 Assigns the three coordinates of Coord to this point.
More...
 
double coord (const int Index) const
 
void coord (double &Xp, double &Yp, double &Zp) const
 For this point gives its three coordinates Xp, Yp and Zp.
More...
 
double x () const
 For this point, returns its X coordinate.
More...
 
double y () const
 For this point, returns its X coordinate.
More...
 
double z () const
 For this point, returns its X coordinate.
More...
 
float fx () const
 
float fy () const
 
float fz () const
 
const Geom::XYZxyz () const
 For this point, returns its three coordinates as a number triple.
More...
 
const Geom::XYZcoord () const
 For this point, returns its three coordinates as a number triple.
More...
 
Geom::XYZchangeCoord ()
 
void baryCenter (const double Alpha, const Pnt &P, const double Beta)
 
bool isEqual (const Pnt &Other, const double LinearTolerance) const
 
double distance (const Pnt &Other) const
 Computes the distance between two points.
More...
 
double squareDistance (const Pnt &Other) const
 Computes the square distance between two points.
More...
 
void mirror (const Pnt &P)
 
Pnt mirrored (const Pnt &P) const
 
void mirror (const Geom::Ax1 &A1)
 
Pnt mirrored (const Geom::Ax1 &A1) const
 
void mirror (const Geom::Ax2 &A2)
 
Pnt mirrored (const Geom::Ax2 &A2) const
 
void rotate (const Geom::Ax1 &A1, const double Ang)
 
Pnt rotated (const Geom::Ax1 &A1, const double Ang) const
 
void scale (const Pnt &P, const double S)
 Scales a point. S is the scaling value.
More...
 
Pnt scaled (const Pnt &P, const double S) const
 
void transform (const Geom::Trsf &T)
 Transforms a point with the transformation T.
More...
 
Pnt transformed (const Geom::Trsf &T) const
 
void translate (const Geom::Vec &V)
 
Pnt translated (const Geom::Vec &V) const
 Translates a point from the point P1 to the point P2.
More...
 
void translate (const Pnt &P1, const Pnt &P2)
 
Pnt translated (const Pnt &P1, const Pnt &P2) const
 
bool operator== (const Geom::Pnt &other) const
 Checks whether two points are equal within linear tolerance (default 1E-07) More...
 
bool operator!= (const Geom::Pnt &other) const
 Checks whether two points are unequal within linear tolerance (default 1E-07) More...
 
double & operator[] (int i)
 
const double & operator[] (int i) const
 
Pnt operator- (const Geom::Pnt &other) const
 
Pnt operator+ (const Geom::Pnt &other) const
 
Pnt operator* (const Geom::Pnt &other) const
 
Pnt operator* (double scalar) const
 
bool operator< (const Geom::Pnt &rhs) const
 

Static Public Member Functions

static Pnt ZeroPnt ()
 

Detailed Description

Defines a non-persistent 3D Cartesian point.

Constructor & Destructor Documentation

◆ Pnt() [1/4]

Geom::Pnt::Pnt ( )

Creates an indefinite point.

◆ Pnt() [2/4]

Geom::Pnt::Pnt ( const Geom::XYZ Coord)

Creates a point with a triplet of coordinates.

◆ Pnt() [3/4]

Geom::Pnt::Pnt ( const double  Xp,
const double  Yp,
const double  Zp = .0 
)

Creates a point with its 3 Cartesian's coordinates : Xp, Yp, Zp.

◆ Pnt() [4/4]

Geom::Pnt::Pnt ( const Pnt rhs)

Copy constructor.

Member Function Documentation

◆ baryCenter()

void Geom::Pnt::baryCenter ( const double  Alpha,
const Pnt P,
const double  Beta 
)

Assigns the result of the following expression to this point
(Alpha*this + Beta*P) / (Alpha + Beta)

◆ changeCoord()

Geom::XYZ& Geom::Pnt::changeCoord ( )

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

◆ coord() [1/3]

const Geom::XYZ& Geom::Pnt::coord ( ) const

For this point, returns its three coordinates as a number triple.

◆ coord() [2/3]

double Geom::Pnt::coord ( const int  Index) const

Returns the coordinate of corresponding to the value of Index :
Index = 1 => X is returned
Index = 2 => Y is returned
Index = 3 => Z is returned
Raises OutOfRange if Index != {1, 2, 3}.
//! Raised if Index != {1, 2, 3}.

◆ coord() [3/3]

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

For this point gives its three coordinates Xp, Yp and Zp.

◆ distance()

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

Computes the distance between two points.

◆ fx()

float Geom::Pnt::fx ( ) const

◆ fy()

float Geom::Pnt::fy ( ) const

◆ fz()

float Geom::Pnt::fz ( ) const

◆ isEqual()

bool Geom::Pnt::isEqual ( const Pnt Other,
const double  LinearTolerance 
) const

Comparison
Returns True if the distance between the two points is
lower or equal to LinearTolerance.

◆ mirror() [1/3]

void Geom::Pnt::mirror ( const Geom::Ax1 A1)

◆ mirror() [2/3]

void Geom::Pnt::mirror ( const Geom::Ax2 A2)

◆ mirror() [3/3]

void Geom::Pnt::mirror ( const Pnt P)

Performs the symmetrical transformation of a point
with respect to the point P which is the center of
the symmetry.

◆ mirrored() [1/3]

Pnt Geom::Pnt::mirrored ( const Geom::Ax1 A1) const

Performs the symmetrical transformation of a point
with respect to a plane. The axis placement A2 locates
the plane of the symmetry : (Location, XDirection, YDirection).

◆ mirrored() [2/3]

Pnt Geom::Pnt::mirrored ( const Geom::Ax2 A2) const

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

◆ mirrored() [3/3]

Pnt Geom::Pnt::mirrored ( const Pnt P) const

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

◆ operator!=()

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

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

◆ operator*() [1/2]

Pnt Geom::Pnt::operator* ( const Geom::Pnt other) const

◆ operator*() [2/2]

Pnt Geom::Pnt::operator* ( double  scalar) const

◆ operator+()

Pnt Geom::Pnt::operator+ ( const Geom::Pnt other) const

◆ operator-()

Pnt Geom::Pnt::operator- ( const Geom::Pnt other) const

◆ operator<()

bool Geom::Pnt::operator< ( const Geom::Pnt rhs) const

◆ operator==()

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

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

◆ operator[]() [1/2]

double& Geom::Pnt::operator[] ( int  i)

◆ operator[]() [2/2]

const double& Geom::Pnt::operator[] ( int  i) const

◆ rotate()

void Geom::Pnt::rotate ( const Geom::Ax1 A1,
const double  Ang 
)

◆ rotated()

Pnt Geom::Pnt::rotated ( const Geom::Ax1 A1,
const double  Ang 
) const

◆ scale()

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

Scales a point. S is the scaling value.

◆ scaled()

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

◆ setCoord() [1/2]

void Geom::Pnt::setCoord ( const double  Xp,
const double  Yp,
const double  Zp = .0 
)

For this point, assigns the values Xp, Yp and Zp to its three coordinates.

◆ setCoord() [2/2]

void Geom::Pnt::setCoord ( const int  Index,
const double  Xi 
)

Changes the coordinate of range Index :
Index = 1 => X is modified
Index = 2 => Y is modified
Index = 3 => Z is modified
//! Raised if Index != {1, 2, 3}.

◆ setX()

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

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

◆ setXYZ()

void Geom::Pnt::setXYZ ( const Geom::XYZ Coord)

Assigns the three coordinates of Coord to this point.

◆ setY()

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

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

◆ setZ()

void Geom::Pnt::setZ ( const double  Z)

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

◆ squareDistance()

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

Computes the square distance between two points.

◆ transform()

void Geom::Pnt::transform ( const Geom::Trsf T)

Transforms a point with the transformation T.

◆ transformed()

Pnt Geom::Pnt::transformed ( const Geom::Trsf T) const

◆ translate() [1/2]

void Geom::Pnt::translate ( const Geom::Vec V)

Translates a point in the direction of the vector V.
The magnitude of the translation is the vector's magnitude.

◆ translate() [2/2]

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

◆ translated() [1/2]

Pnt Geom::Pnt::translated ( const Geom::Vec V) const

Translates a point from the point P1 to the point P2.

◆ translated() [2/2]

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

◆ x()

double Geom::Pnt::x ( ) const

For this point, returns its X coordinate.

◆ xyz()

const Geom::XYZ& Geom::Pnt::xyz ( ) const

For this point, returns its three coordinates as a number triple.

◆ y()

double Geom::Pnt::y ( ) const

For this point, returns its X coordinate.

◆ z()

double Geom::Pnt::z ( ) const

For this point, returns its X coordinate.

◆ ZeroPnt()

static Pnt Geom::Pnt::ZeroPnt ( )
inlinestatic

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