Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / GeomAPI / GeomAPI_Lin2d.h
1 // File:        GeomAPI_Lin2d.h
2 // Created:     29 May 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef GeomAPI_Lin2d_H_
6 #define GeomAPI_Lin2d_H_
7
8 #include <GeomAPI_Interface.h>
9 #include <boost/shared_ptr.hpp>
10
11 class GeomAPI_Pnt2d;
12
13 /**\class GeomAPI_Lin2d
14  * \ingroup DataModel
15  * \brief Line in 2D
16  */
17
18 class GEOMAPI_EXPORT GeomAPI_Lin2d : public GeomAPI_Interface
19 {
20  public:
21   /// Creation of line defined by cordinates of start and end points
22   GeomAPI_Lin2d(const double theStartX, const double theStartY, const double theEndX,
23                 const double theEndY);
24   /// Creation of line defined by start and end points
25   GeomAPI_Lin2d(const boost::shared_ptr<GeomAPI_Pnt2d>& theStart,
26                 const boost::shared_ptr<GeomAPI_Pnt2d>& theEnd);
27
28   /// Distance between two points
29   double distance(const boost::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
30   /// Intersection of two lines
31   const boost::shared_ptr<GeomAPI_Pnt2d> intersect(
32       const boost::shared_ptr<GeomAPI_Lin2d>& theLine) const;
33   /// Project point on line
34   const boost::shared_ptr<GeomAPI_Pnt2d> project(
35       const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
36   /// Computes the cross product of the line direction and a vector from the line start point to the point
37   bool isRight(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
38 };
39
40 #endif
41