SHAPER  9.12.0
GeomAPI_Lin2d Class Reference

Line in 2D. More...

Inheritance diagram for GeomAPI_Lin2d:
Inheritance graph

Public Member Functions

GEOMAPI_EXPORT GeomAPI_Lin2d (const double theStartX, const double theStartY, const double theEndX, const double theEndY)
 Creation of line defined by cordinates of start and end points. More...
 
GEOMAPI_EXPORT GeomAPI_Lin2d (const std::shared_ptr< GeomAPI_Pnt2d > &theStart, const std::shared_ptr< GeomAPI_Pnt2d > &theEnd)
 Creation of line defined by start and end points. More...
 
GEOMAPI_EXPORT GeomAPI_Lin2d (const std::shared_ptr< GeomAPI_Pnt2d > &theOrigin, const std::shared_ptr< GeomAPI_Dir2d > &theDirection)
 Creation of line defined by origin and direction. More...
 
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Pnt2dlocation ()
 Returns point on the line (first point) More...
 
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Dir2ddirection ()
 Returns a line direction. More...
 
GEOMAPI_EXPORT double distance (const std::shared_ptr< GeomAPI_Pnt2d > &theOther) const
 Distance between two points. More...
 
GEOMAPI_EXPORT const std::shared_ptr< GeomAPI_Pnt2dintersect (const std::shared_ptr< GeomAPI_Lin2d > &theLine) const
 Intersection of two lines. More...
 
GEOMAPI_EXPORT const std::shared_ptr< GeomAPI_Pnt2dproject (const std::shared_ptr< GeomAPI_Pnt2d > &thePoint) const
 Project point on line. More...
 
GEOMAPI_EXPORT bool isRight (const std::shared_ptr< GeomAPI_Pnt2d > &thePoint) const
 Computes the cross product of the line direction and a vector from the line start point to the point. More...
 
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Pnt2dshiftedLocation (double theShift) const
 Returns a location point shifted on theShift in perpendicular direction. More...
 
template<class T >
T * implPtr ()
 Returns the pointer to the impl. More...
 
template<class T >
const T * implPtr () const
 Returns the pointer to the impl. More...
 
template<class T >
const T & impl () const
 Returns the reference object of the impl. More...
 
template<class T >
void setImpl (T *theImpl)
 Updates the impl (deletes the old one) More...
 
GEOMAPI_EXPORT bool empty () const
 Returns true if the impl is empty. More...
 

Detailed Description

Line in 2D.

Constructor & Destructor Documentation

◆ GeomAPI_Lin2d() [1/3]

GeomAPI_Lin2d::GeomAPI_Lin2d ( const double  theStartX,
const double  theStartY,
const double  theEndX,
const double  theEndY 
)

Creation of line defined by cordinates of start and end points.

◆ GeomAPI_Lin2d() [2/3]

GeomAPI_Lin2d::GeomAPI_Lin2d ( const std::shared_ptr< GeomAPI_Pnt2d > &  theStart,
const std::shared_ptr< GeomAPI_Pnt2d > &  theEnd 
)

Creation of line defined by start and end points.

◆ GeomAPI_Lin2d() [3/3]

GeomAPI_Lin2d::GeomAPI_Lin2d ( const std::shared_ptr< GeomAPI_Pnt2d > &  theOrigin,
const std::shared_ptr< GeomAPI_Dir2d > &  theDirection 
)

Creation of line defined by origin and direction.

Member Function Documentation

◆ location()

std::shared_ptr< GeomAPI_Pnt2d > GeomAPI_Lin2d::location ( )

Returns point on the line (first point)

◆ direction()

std::shared_ptr< GeomAPI_Dir2d > GeomAPI_Lin2d::direction ( )

Returns a line direction.

◆ distance()

double GeomAPI_Lin2d::distance ( const std::shared_ptr< GeomAPI_Pnt2d > &  theOther) const

Distance between two points.

◆ intersect()

const std::shared_ptr< GeomAPI_Pnt2d > GeomAPI_Lin2d::intersect ( const std::shared_ptr< GeomAPI_Lin2d > &  theLine) const

Intersection of two lines.

◆ project()

const std::shared_ptr< GeomAPI_Pnt2d > GeomAPI_Lin2d::project ( const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint) const

Project point on line.

◆ isRight()

bool GeomAPI_Lin2d::isRight ( const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint) const

Computes the cross product of the line direction and a vector from the line start point to the point.

◆ shiftedLocation()

std::shared_ptr< GeomAPI_Pnt2d > GeomAPI_Lin2d::shiftedLocation ( double  theShift) const

Returns a location point shifted on theShift in perpendicular direction.

◆ implPtr() [1/2]

template<class T >
T* GeomAPI_Interface::implPtr ( )
inlineinherited

Returns the pointer to the impl.

◆ implPtr() [2/2]

template<class T >
const T* GeomAPI_Interface::implPtr ( ) const
inlineinherited

Returns the pointer to the impl.

◆ impl()

template<class T >
const T& GeomAPI_Interface::impl ( ) const
inlineinherited

Returns the reference object of the impl.

◆ setImpl()

template<class T >
void GeomAPI_Interface::setImpl ( T *  theImpl)
inlineinherited

Updates the impl (deletes the old one)

◆ empty()

bool GeomAPI_Interface::empty ( ) const
inherited

Returns true if the impl is empty.