Salome HOME
Merge branch 'master' of salome:modules/shaper
[modules/shaper.git] / src / GeomAPI / GeomAPI_Angle.h
1 // Copyright (C) 2016-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Angle.h
4 // Created:     19 April 2016
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAPI_Angle_H_
8 #define GeomAPI_Angle_H_
9
10 #include <GeomAPI_Interface.h>
11
12 class GeomAPI_Lin;
13 class GeomAPI_Pnt;
14
15 /// \class GeomAPI_Angle
16 /// \ingroup DataModel
17 /// \brief Build an angle in 3D
18 class GeomAPI_Angle : public GeomAPI_Interface
19 {
20 public:
21   /// Creation of an angle defined by two lines' start, end points
22   GEOMAPI_EXPORT
23   GeomAPI_Angle(const std::shared_ptr<GeomAPI_Pnt>& theStartLine1,
24                 const std::shared_ptr<GeomAPI_Pnt>& theEndLine1,
25                 const std::shared_ptr<GeomAPI_Pnt>& theStartLine2,
26                 const std::shared_ptr<GeomAPI_Pnt>& theEndLine2);
27   /// Creation of an angle defined by two lines taking into account their orientation
28   GEOMAPI_EXPORT
29   GeomAPI_Angle(const std::shared_ptr<GeomAPI_Lin>& theLine1, bool theReversed1,
30                 const std::shared_ptr<GeomAPI_Lin>& theLine2, bool theReversed2);
31   /// Creation of an angle defined by three points
32   GEOMAPI_EXPORT
33   GeomAPI_Angle(const std::shared_ptr<GeomAPI_Pnt>& theCenter,
34                 const std::shared_ptr<GeomAPI_Pnt>& thePoint1,
35                 const std::shared_ptr<GeomAPI_Pnt>& thePoint2);
36
37   /// Returns central point of the angle
38   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> center();
39   /// Returns point on the first edge
40   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> firstPoint();
41   /// Returns point on the second edge
42   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> secondPoint();
43
44   /// Returns value of the angle in degrees
45   GEOMAPI_EXPORT double angleDegree();
46   /// Returns value of the angle in radians
47   GEOMAPI_EXPORT double angleRadian();
48
49   /// Returns \c true if the line is reversed during angle calculation.
50   /// If theIndex = 0, the result corresponds to the first line, if theIndex = 1, the to the second line
51   GEOMAPI_EXPORT bool isReversed(int theIndex);
52 };
53
54 #endif
55