Salome HOME
An angle widget for the rotation operation.
[modules/shaper.git] / src / PartSet / PartSet_WidgetPoint2dAngle.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_WidgetPoint2dAngle.h
4 // Created:     30 Apr 2015
5 // Author:      Natalia Ermolaeva
6
7 #ifndef PartSet_WidgetPoint2dAngle_H
8 #define PartSet_WidgetPoint2dAngle_H
9
10 #include "PartSet.h"
11 #include "PartSet_WidgetPoint2dDistance.h"
12
13 #include <ModelAPI_Feature.h>
14
15 class GeomAPI_Pnt2d;
16
17 /**
18 * \ingroup Modules
19 * Implementation of model widget for widget which provides input of an anble between two points
20 * The XML definion is the same as the parent one.
21 */ 
22 class PARTSET_EXPORT PartSet_WidgetPoint2dAngle : public PartSet_WidgetPoint2dDistance
23 {
24 Q_OBJECT
25  public:
26   /// Constructor
27   /// \param theParent the parent object
28   /// \param theData the widget configuation. The attribute of the model widget is obtained from
29   /// \param theParentId is Id of a parent of the current attribute
30   PartSet_WidgetPoint2dAngle(QWidget* theParent, const Config_WidgetAPI* theData,
31                              const std::string& theParentId);
32
33   virtual ~PartSet_WidgetPoint2dAngle();
34
35 protected:
36   /// Compute an angle between points
37   /// \param theFirstPnt a point value of the out point attribute
38   /// \param theCurrentPnt a point of the current widget
39   /// \return a double value
40   virtual double computeValue(const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPnt,
41                               const std::shared_ptr<GeomAPI_Pnt2d>& theCurrentPnt);
42 };
43
44 #endif