Salome HOME
Creating an arc by 3 points and a tangent arc
[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_Lin : public GeomAPI_Interface
22 {
23  public:
24   /// Creation of line defined by cordinates of start and end points
25   GEOMAPI_EXPORT 
26   GeomAPI_Lin(const double theStartX, const double theStartY, const double theStartZ,
27               const double theEndX, const double theEndY, const double theEndZ);
28   /// Creation of line defined by start and end points
29   GEOMAPI_EXPORT 
30   GeomAPI_Lin(const std::shared_ptr<GeomAPI_Pnt>& theStart,
31               const std::shared_ptr<GeomAPI_Pnt>& theEnd);
32   /// Creation of line defined by origin and direction
33   GEOMAPI_EXPORT
34   GeomAPI_Lin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
35               const std::shared_ptr<GeomAPI_Dir>& theDirection);
36
37   /// Returns point on the line (first point)
38   GEOMAPI_EXPORT 
39   std::shared_ptr<GeomAPI_Pnt> location();
40
41   /// Returns a line direction
42   GEOMAPI_EXPORT 
43   std::shared_ptr<GeomAPI_Dir> direction();
44
45   /// Distance between two points
46   GEOMAPI_EXPORT 
47   double distance(const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
48   /// Intersection of two lines
49   GEOMAPI_EXPORT 
50   const std::shared_ptr<GeomAPI_Pnt> intersect(
51       const std::shared_ptr<GeomAPI_Lin>& theLine) const;
52   /// Project point on line
53   GEOMAPI_EXPORT 
54   const std::shared_ptr<GeomAPI_Pnt> project(
55       const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
56 };
57
58 #endif
59