Salome HOME
Issue #1393 Angle constraint : incorrect angle displayed. solution: do not select...
[modules/shaper.git] / src / PartSet / PartSet_WidgetPoint2DFlyout.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_WidgetPoint2dFlyout.h
4 // Created:     14 Oct 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef PartSet_WidgetPoint2DFlyout_H
8 #define PartSet_WidgetPoint2DFlyout_H
9
10 #include "PartSet.h"
11 #include <PartSet_WidgetPoint2d.h>
12
13 class XGUI_Workshop;
14
15 /**\class PartSet_WidgetPoint2DFlyout
16  * \ingroup Modules
17  * \brief Implementation of usual point 2d widget with a condition that it can not accept the focus
18  * when the AIS presentation is not visualized in the viewer.
19  */
20 class PARTSET_EXPORT PartSet_WidgetPoint2DFlyout : public PartSet_WidgetPoint2D
21 {
22   Q_OBJECT
23 public:
24   /// Constructor
25   /// \param theParent the parent object
26   /// \param theWorkshop a current workshop
27   /// \param theData the widget configuation. The attribute of the model widget is obtained from
28   PartSet_WidgetPoint2DFlyout(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
29                               const Config_WidgetAPI* theData);
30   /// Destructor
31   virtual ~PartSet_WidgetPoint2DFlyout() {};
32
33   /// Checks if the selection presentation is valid in widget 
34   /// \param theValue a selected presentation in the view
35   /// \return a boolean value
36   virtual bool isValidSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
37
38   /// Activates the editor control only in case if the mouse over the OCC window, otherwise
39   /// set focus to the usual double value control
40   /// \return the state whether the widget can accept the focus
41   virtual bool focusTo();
42
43   /// Returns true if the attribute can be changed using the selected shapes in the viewer
44   /// and creating a coincidence constraint to them. This control does not use them.
45   virtual bool useSelectedShapes() const;
46
47 private:
48   //! Returns workshop
49   XGUI_Workshop* workshop() const;
50 };
51
52 #endif