OpenLexocad  27.1
Geom::Lin2d Class Reference

#include <Lin2d.h>

Public Member Functions

 Lin2d ()
 Creates an indefinite Line.
More...
 
 Lin2d (const Ax2d &A)
 Creates a line located with A.
More...
 
 Lin2d (const Pnt2d &P, const Dir2d &V)
 
 Lin2d (const double A, const double B, const double C)
 
double angle (const Lin2d &Other) const
 Computes the angle between two lines in radians.
More...
 
void coefficients (double &A, double &B, double &C) const
 
bool contains (const Pnt2d &P, const double LinearTolerance) const
 
double distance (const Pnt2d &P) const
 Computes the distance between <me> and the point. More...
 
double distance (const Lin2d &Other) const
 Computes the distance between two lines.
More...
 
double signedDistance (const Pnt2d &P) const
 Computes the signed distance between <me> and the point. More...
 
const Dir2d & direction () const
 Returns the direction of the line.
More...
 
const Pnt2d & location () const
 Returns the location point (origin) of the line.
More...
 
void mirror (const Pnt2d &P)
 
void mirror (const Ax2d &A)
 
Lin2d mirrored (const Ax2d &A) const
 
Lin2d mirrored (const Pnt2d &P) const
 
Lin2d normal (const Pnt2d &P) const
 
const Ax2d & position () const
 
void reverse ()
 
Lin2d reversed () const
 
void rotate (const Pnt2d &P, const double Ang)
 
Lin2d rotated (const Pnt2d &P, const double Ang) const
 
void scale (const Pnt2d &P, const double S)
 
Lin2d scaled (const Pnt2d &P, const double S) const
 
void setDirection (const Dir2d &V)
 Changes the direction of the line.
More...
 
void setLocation (const Pnt2d &P)
 Changes the origin of the line.
More...
 
void setPosition (const Ax2d &A)
 
double squareDistance (const Pnt2d &P) const
 
double squareDistance (const Lin2d &Other) const
 Computes the square distance between two lines.
More...
 
void transform (const Trsf2d &T)
 
Lin2d transformed (const Trsf2d &T) const
 Transforms a line with the transformation T from class Trsf2d.
More...
 
void translate (const Vec2d &V)
 
void translate (const Pnt2d &P1, const Pnt2d &P2)
 
Lin2d translated (const Vec2d &V) const
 
Lin2d translated (const Pnt2d &P1, const Pnt2d &P2) const
 Translates a line from the point P1 to the point P2.
More...
 
const Ax2d & _CSFDB_GetLin2dpos () const
 

Detailed Description

Describes a line in 2D space.
A line is positioned in the plane with an axis (a Ax2d
object) which gives the line its origin and unit vector. A
line and an axis are similar objects, thus, we can convert
one into the other.
A line provides direct access to the majority of the edit
and query functions available on its positioning axis. In
addition, however, a line has specific functions for
computing distances and positions.
See Also
GccAna and Geom2dGcc packages which provide
functions for constructing lines defined by geometric
constraints
gce_MakeLin2d which provides functions for more
complex line constructions
Geom2d_Line which provides additional functions for
constructing lines and works, in particular, with the
parametric equations of lines

Constructor & Destructor Documentation

◆ Lin2d() [1/4]

Geom::Lin2d::Lin2d ( )

Creates an indefinite Line.

◆ Lin2d() [2/4]

Geom::Lin2d::Lin2d ( const Ax2d &  A)

Creates a line located with A.

◆ Lin2d() [3/4]

Geom::Lin2d::Lin2d ( const Pnt2d &  P,
const Dir2d &  V 
)

is the location point (origin) of the line and
<V> is the direction of the line.

◆ Lin2d() [4/4]

Geom::Lin2d::Lin2d ( const double  A,
const double  B,
const double  C 
)

Creates the line from the equation A*X + B*Y + C = 0.0 Raises ConstructionError if Sqrt(A*A + B*B) <= Resolution from gp.
//! Raised if Sqrt(A*A + B*B) <= Resolution from gp.

Member Function Documentation

◆ _CSFDB_GetLin2dpos()

const Ax2d& Geom::Lin2d::_CSFDB_GetLin2dpos ( ) const
inline

◆ angle()

double Geom::Lin2d::angle ( const Lin2d &  Other) const

Computes the angle between two lines in radians.

◆ coefficients()

void Geom::Lin2d::coefficients ( double &  A,
double &  B,
double &  C 
) const

Returns the normalized coefficients of the line :
A * X + B * Y + C = 0.

◆ contains()

bool Geom::Lin2d::contains ( const Pnt2d &  P,
const double  LinearTolerance 
) const

Returns true if this line contains the point P, that is, if the
distance between point P and this line is less than or
equal to LinearTolerance.

◆ direction()

const Dir2d& Geom::Lin2d::direction ( ) const

Returns the direction of the line.

◆ distance() [1/2]

double Geom::Lin2d::distance ( const Pnt2d &  P) const

Computes the distance between <me> and the point.

.

◆ distance() [2/2]

double Geom::Lin2d::distance ( const Lin2d &  Other) const

Computes the distance between two lines.

◆ location()

const Pnt2d& Geom::Lin2d::location ( ) const

Returns the location point (origin) of the line.

◆ mirror() [1/2]

void Geom::Lin2d::mirror ( const Pnt2d &  P)

◆ mirror() [2/2]

void Geom::Lin2d::mirror ( const Ax2d &  A)

◆ mirrored() [1/2]

Lin2d Geom::Lin2d::mirrored ( const Ax2d &  A) const

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

◆ mirrored() [2/2]

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

Performs the symmetrical transformation of a line
with respect to the point

which is the center
of the symmetry

◆ normal()

Lin2d Geom::Lin2d::normal ( const Pnt2d &  P) const

Computes the line normal to the direction of <me>,
passing through the point

.

◆ position()

const Ax2d& Geom::Lin2d::position ( ) const

Returns the axis placement one axis whith the same
location and direction as <me>.

◆ reverse()

void Geom::Lin2d::reverse ( )

◆ reversed()

Lin2d Geom::Lin2d::reversed ( ) const

Reverses the positioning axis of this line.
Note:

  • reverse assigns the result to this line, while
  • reversed creates a new one.

◆ rotate()

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

◆ rotated()

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

Rotates a line. P is the center of the rotation.
Ang is the angular value of the rotation in radians.

◆ scale()

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

◆ scaled()

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

Scales a line. S is the scaling value. Only the
origin of the line is modified.

◆ setDirection()

void Geom::Lin2d::setDirection ( const Dir2d &  V)

Changes the direction of the line.

◆ setLocation()

void Geom::Lin2d::setLocation ( const Pnt2d &  P)

Changes the origin of the line.

◆ setPosition()

void Geom::Lin2d::setPosition ( const Ax2d &  A)

Complete redefinition of the line.
The "location" point of is the origin of the line.
The "direction" of is the direction of the line.

◆ signedDistance()

double Geom::Lin2d::signedDistance ( const Pnt2d &  P) const

Computes the signed distance between <me> and the point.

.

◆ squareDistance() [1/2]

double Geom::Lin2d::squareDistance ( const Pnt2d &  P) const

Computes the square distance between <me> and the point

.

◆ squareDistance() [2/2]

double Geom::Lin2d::squareDistance ( const Lin2d &  Other) const

Computes the square distance between two lines.

◆ transform()

void Geom::Lin2d::transform ( const Trsf2d &  T)

◆ transformed()

Lin2d Geom::Lin2d::transformed ( const Trsf2d &  T) const

Transforms a line with the transformation T from class Trsf2d.

◆ translate() [1/2]

void Geom::Lin2d::translate ( const Vec2d &  V)

◆ translate() [2/2]

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

◆ translated() [1/2]

Lin2d Geom::Lin2d::translated ( const Vec2d &  V) const

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

◆ translated() [2/2]

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

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


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