Salome HOME
Use GEOMAPI_EXPORT not for the class but for class members.
[modules/shaper.git] / src / GeomAPI / GeomAPI_Lin2d.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Lin2d.h
4 // Created:     29 May 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAPI_Lin2d_H_
8 #define GeomAPI_Lin2d_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12
13 class GeomAPI_Dir2d;
14 class GeomAPI_Pnt2d;
15
16 /**\class GeomAPI_Lin2d
17  * \ingroup DataModel
18  * \brief Line in 2D
19  */
20
21 class GeomAPI_Lin2d : public GeomAPI_Interface
22 {
23  public:
24   /// Creation of line defined by cordinates of start and end points
25   GEOMAPI_EXPORT 
26   GeomAPI_Lin2d(const double theStartX, const double theStartY, const double theEndX,
27                 const double theEndY);
28   /// Creation of line defined by start and end points
29   GEOMAPI_EXPORT 
30   GeomAPI_Lin2d(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
31                 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd);
32
33   /// Returns point on the line (first point)
34   GEOMAPI_EXPORT 
35   std::shared_ptr<GeomAPI_Pnt2d> location();
36
37   /// Returns a line direction
38   GEOMAPI_EXPORT 
39   std::shared_ptr<GeomAPI_Dir2d> direction();
40
41   /// Distance between two points
42   GEOMAPI_EXPORT 
43   double distance(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const;
44   /// Intersection of two lines
45   GEOMAPI_EXPORT 
46   const std::shared_ptr<GeomAPI_Pnt2d> intersect(
47       const std::shared_ptr<GeomAPI_Lin2d>& theLine) const;
48   /// Project point on line
49   GEOMAPI_EXPORT 
50   const std::shared_ptr<GeomAPI_Pnt2d> project(
51       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
52   /// Computes the cross product of the line direction and a vector from the line start point to the point
53   GEOMAPI_EXPORT 
54   bool isRight(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
55
56   /// Returns a location point shifted on theShift in perpendicular direction
57   GEOMAPI_EXPORT 
58   std::shared_ptr<GeomAPI_Pnt2d> shiftedLocation(double theShift) const;
59 };
60
61 #endif
62