Open CASCADE Technology  7.4.0
Public Member Functions

gp_Pnt2d Class Reference

Defines a non-persistent 2D cartesian point. More...

#include <gp_Pnt2d.hxx>

Public Member Functions

 gp_Pnt2d ()
 Creates a point with zero coordinates. More...
 
 gp_Pnt2d (const gp_XY &Coord)
 Creates a point with a doublet of coordinates. More...
 
 gp_Pnt2d (const Standard_Real Xp, const Standard_Real Yp)
 Creates a point with its 2 cartesian's coordinates : Xp, Yp. More...
 
void SetCoord (const Standard_Integer Index, const Standard_Real 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}. More...
 
void SetCoord (const Standard_Real Xp, const Standard_Real Yp)
 For this point, assigns the values Xp and Yp to its two coordinates. More...
 
void SetX (const Standard_Real X)
 Assigns the given value to the X coordinate of this point. More...
 
void SetY (const Standard_Real Y)
 Assigns the given value to the Y coordinate of this point. More...
 
void SetXY (const gp_XY &Coord)
 Assigns the two coordinates of Coord to this point. More...
 
Standard_Real Coord (const Standard_Integer Index) const
 Returns the coordinate of range Index : Index = 1 => X is returned Index = 2 => Y is returned Raises OutOfRange if Index != {1, 2}. More...
 
void Coord (Standard_Real &Xp, Standard_Real &Yp) const
 For this point returns its two coordinates as a number pair. More...
 
Standard_Real X () const
 For this point, returns its X coordinate. More...
 
Standard_Real Y () const
 For this point, returns its Y coordinate. More...
 
const gp_XYXY () const
 For this point, returns its two coordinates as a number pair. More...
 
const gp_XYCoord () const
 For this point, returns its two coordinates as a number pair. More...
 
gp_XYChangeCoord ()
 Returns the coordinates of this point. Note: This syntax allows direct modification of the returned value. More...
 
Standard_Boolean IsEqual (const gp_Pnt2d &Other, const Standard_Real LinearTolerance) const
 Comparison Returns True if the distance between the two points is lower or equal to LinearTolerance. More...
 
Standard_Real Distance (const gp_Pnt2d &Other) const
 Computes the distance between two points. More...
 
Standard_Real SquareDistance (const gp_Pnt2d &Other) const
 Computes the square distance between two points. More...
 
void Mirror (const gp_Pnt2d &P)
 Performs the symmetrical transformation of a point with respect to the point P which is the center of the symmetry. More...
 
gp_Pnt2d Mirrored (const gp_Pnt2d &P) const
 Performs the symmetrical transformation of a point with respect to an axis placement which is the axis. More...
 
void Mirror (const gp_Ax2d &A)
 
gp_Pnt2d Mirrored (const gp_Ax2d &A) const
 Rotates a point. A1 is the axis of the rotation. Ang is the angular value of the rotation in radians. More...
 
void Rotate (const gp_Pnt2d &P, const Standard_Real Ang)
 
gp_Pnt2d Rotated (const gp_Pnt2d &P, const Standard_Real Ang) const
 Scales a point. S is the scaling value. More...
 
void Scale (const gp_Pnt2d &P, const Standard_Real S)
 
gp_Pnt2d Scaled (const gp_Pnt2d &P, const Standard_Real S) const
 Transforms a point with the transformation T. More...
 
void Transform (const gp_Trsf2d &T)
 
gp_Pnt2d Transformed (const gp_Trsf2d &T) const
 Translates a point in the direction of the vector V. The magnitude of the translation is the vector's magnitude. More...
 
void Translate (const gp_Vec2d &V)
 
gp_Pnt2d Translated (const gp_Vec2d &V) const
 Translates a point from the point P1 to the point P2. More...
 
void Translate (const gp_Pnt2d &P1, const gp_Pnt2d &P2)
 
gp_Pnt2d Translated (const gp_Pnt2d &P1, const gp_Pnt2d &P2) const
 

Detailed Description

Defines a non-persistent 2D cartesian point.

Constructor & Destructor Documentation

◆ gp_Pnt2d() [1/3]

gp_Pnt2d::gp_Pnt2d ( )

Creates a point with zero coordinates.

◆ gp_Pnt2d() [2/3]

gp_Pnt2d::gp_Pnt2d ( const gp_XY Coord)

Creates a point with a doublet of coordinates.

◆ gp_Pnt2d() [3/3]

gp_Pnt2d::gp_Pnt2d ( const Standard_Real  Xp,
const Standard_Real  Yp 
)

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

Member Function Documentation

◆ ChangeCoord()

gp_XY& gp_Pnt2d::ChangeCoord ( )

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

◆ Coord() [1/3]

Standard_Real gp_Pnt2d::Coord ( const Standard_Integer  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() [2/3]

void gp_Pnt2d::Coord ( Standard_Real Xp,
Standard_Real Yp 
) const

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

◆ Coord() [3/3]

const gp_XY& gp_Pnt2d::Coord ( ) const

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

◆ Distance()

Standard_Real gp_Pnt2d::Distance ( const gp_Pnt2d Other) const

Computes the distance between two points.

◆ IsEqual()

Standard_Boolean gp_Pnt2d::IsEqual ( const gp_Pnt2d Other,
const Standard_Real  LinearTolerance 
) const

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

◆ Mirror() [1/2]

void gp_Pnt2d::Mirror ( const gp_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 gp_Pnt2d::Mirror ( const gp_Ax2d A)

◆ Mirrored() [1/2]

gp_Pnt2d gp_Pnt2d::Mirrored ( const gp_Pnt2d P) const

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

◆ Mirrored() [2/2]

gp_Pnt2d gp_Pnt2d::Mirrored ( const gp_Ax2d A) const

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

◆ Rotate()

void gp_Pnt2d::Rotate ( const gp_Pnt2d P,
const Standard_Real  Ang 
)

◆ Rotated()

gp_Pnt2d gp_Pnt2d::Rotated ( const gp_Pnt2d P,
const Standard_Real  Ang 
) const

Scales a point. S is the scaling value.

◆ Scale()

void gp_Pnt2d::Scale ( const gp_Pnt2d P,
const Standard_Real  S 
)

◆ Scaled()

gp_Pnt2d gp_Pnt2d::Scaled ( const gp_Pnt2d P,
const Standard_Real  S 
) const

Transforms a point with the transformation T.

◆ SetCoord() [1/2]

void gp_Pnt2d::SetCoord ( const Standard_Integer  Index,
const Standard_Real  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 gp_Pnt2d::SetCoord ( const Standard_Real  Xp,
const Standard_Real  Yp 
)

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

◆ SetX()

void gp_Pnt2d::SetX ( const Standard_Real  X)

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

◆ SetXY()

void gp_Pnt2d::SetXY ( const gp_XY Coord)

Assigns the two coordinates of Coord to this point.

◆ SetY()

void gp_Pnt2d::SetY ( const Standard_Real  Y)

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

◆ SquareDistance()

Standard_Real gp_Pnt2d::SquareDistance ( const gp_Pnt2d Other) const

Computes the square distance between two points.

◆ Transform()

void gp_Pnt2d::Transform ( const gp_Trsf2d T)

◆ Transformed()

gp_Pnt2d gp_Pnt2d::Transformed ( const gp_Trsf2d T) const

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

◆ Translate() [1/2]

void gp_Pnt2d::Translate ( const gp_Vec2d V)

◆ Translate() [2/2]

void gp_Pnt2d::Translate ( const gp_Pnt2d P1,
const gp_Pnt2d P2 
)

◆ Translated() [1/2]

gp_Pnt2d gp_Pnt2d::Translated ( const gp_Vec2d V) const

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

◆ Translated() [2/2]

gp_Pnt2d gp_Pnt2d::Translated ( const gp_Pnt2d P1,
const gp_Pnt2d P2 
) const

◆ X()

Standard_Real gp_Pnt2d::X ( ) const

For this point, returns its X coordinate.

◆ XY()

const gp_XY& gp_Pnt2d::XY ( ) const

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

◆ Y()

Standard_Real gp_Pnt2d::Y ( ) const

For this point, returns its Y coordinate.


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