Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / GeomAPI / GeomAPI_Lin.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Lin.h
4 // Created:     29 May 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAPI_Lin_H_
8 #define GeomAPI_Lin_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12
13 class GeomAPI_Dir;
14 class GeomAPI_Pnt;
15
16 /**\class GeomAPI_Lin
17  * \ingroup DataModel
18  * \brief Line in 3D
19  */
20
21 class GEOMAPI_EXPORT GeomAPI_Lin : public GeomAPI_Interface
22 {
23  public:
24   /// Creation of line defined by cordinates of start and end points
25   GeomAPI_Lin(const double theStartX, const double theStartY, const double theStartZ,
26               const double theEndX, const double theEndY, const double theEndZ);
27   /// Creation of line defined by start and end points
28   GeomAPI_Lin(const std::shared_ptr<GeomAPI_Pnt>& theStart,
29               const std::shared_ptr<GeomAPI_Pnt>& theEnd);
30
31   /// Returns point on the line (first point)
32   std::shared_ptr<GeomAPI_Pnt> location();
33
34   /// Returns a line direction
35   std::shared_ptr<GeomAPI_Dir> direction();
36
37   /// Distance between two points
38   double distance(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
39   /// Intersection of two lines
40   const std::shared_ptr<GeomAPI_Pnt> intersect(
41       const std::shared_ptr<GeomAPI_Lin>& theLine) const;
42   /// Project point on line
43   const std::shared_ptr<GeomAPI_Pnt> project(
44       const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
45 };
46
47 #endif
48