]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_WidgetPoint2DFlyout.h
Salome HOME
Add ellipse data type
[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   /// Set the given wrapped value to the current widget
34   /// This value should be processed in the widget according to the needs
35   /// \param theValues the wrapped widget values
36   /// \param theToValidate a validation flag
37   virtual bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
38                             const bool theToValidate);
39
40   /// Checks if the selection presentation is valid in widget
41   /// \param theValue a selected presentation in the view
42   /// \return a boolean value
43   virtual bool isValidSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
44
45   /// Activates the editor control only in case if the mouse over the OCC window, otherwise
46   /// set focus to the usual double value control
47   /// \return the state whether the widget can accept the focus
48   virtual bool focusTo();
49
50   /// Returns true if the attribute can be changed using the selected shapes in the viewer
51   /// and creating a coincidence constraint to them. This control does not use them.
52   virtual bool useSelectedShapes() const;
53
54 private:
55   //! Returns workshop
56   XGUI_Workshop* workshop() const;
57 };
58
59 #endif