1 // Copyright (C) 2016-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Angle2d.h
4 // Created: 19 April 2016
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAPI_Angle_H_
8 #define GeomAPI_Angle_H_
10 #include <GeomAPI_Interface.h>
15 /// \class GeomAPI_Angle2d
16 /// \ingroup DataModel
17 /// \brief Build an angle in plane
18 class GeomAPI_Angle2d : public GeomAPI_Interface
21 /// Creation of an angle defined by two lines' start, end points
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
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
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);
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();
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();
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);