Salome HOME
Issue #1834: Fix length of lines
[modules/shaper.git] / src / GeomAPI / GeomAPI_Angle2d.h
1 // Copyright (C) 2016-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Angle2d.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_Lin2d;
13 class GeomAPI_Pnt2d;
14
15 /// \class GeomAPI_Angle2d
16 /// \ingroup DataModel
17 /// \brief Build an angle in plane
18 class GeomAPI_Angle2d : public GeomAPI_Interface
19 {
20 public:
21   /// Creation of an angle defined by two lines' start, end points
22   GEOMAPI_EXPORT
23   GeomAPI_Angle2d(const std::shared_ptr<GeomAPI_Pnt2d>& theStartLine1,
24                   const std::shared_ptr<GeomAPI_Pnt2d>& theEndLine1,
25                   const std::shared_ptr<GeomAPI_Pnt2d>& theStartLine2,
26                   const std::shared_ptr<GeomAPI_Pnt2d>& theEndLine2);
27   /// Creation of an angle defined by two lines taking into account their orientation
28   GEOMAPI_EXPORT
29   GeomAPI_Angle2d(const std::shared_ptr<GeomAPI_Lin2d>& theLine1, bool theReversed1,
30                   const std::shared_ptr<GeomAPI_Lin2d>& theLine2, bool theReversed2);
31   /// Creation of an angle defined by three points
32   GEOMAPI_EXPORT
33   GeomAPI_Angle2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
34                   const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
35                   const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2);
36
37   /// Returns central point of the angle
38   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt2d> center();
39   /// Returns point on the first edge
40   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt2d> firstPoint();
41   /// Returns point on the second edge
42   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt2d> 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, 
51   /// if theIndex = 1, the to the second line
52   GEOMAPI_EXPORT bool isReversed(int theIndex);
53 };
54
55 #endif
56