]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_WidgetPoint2DFlyout.cpp
Salome HOME
#1371 Using auxilliary Sketch elements in any Feature: code improvement to separate...
[modules/shaper.git] / src / PartSet / PartSet_WidgetPoint2DFlyout.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_WidgetPoint2D.cpp
4 // Created:     25 Apr 2014
5 // Author:      Natalia ERMOLAEVA
6
7 #include "PartSet_WidgetPoint2DFlyout.h"
8
9 #include <XGUI_Workshop.h>
10 #include <XGUI_ModuleConnector.h>
11 #include <XGUI_Displayer.h>
12
13 #include <Config_WidgetAPI.h>
14 #include <Config_Keywords.h>
15
16 #include <QWidget>
17
18
19 PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, 
20                                                          ModuleBase_IWorkshop* theWorkshop,
21                                                          const Config_WidgetAPI* theData)
22  : PartSet_WidgetPoint2D(theParent, theWorkshop, theData)
23 {
24 }
25
26 bool PartSet_WidgetPoint2DFlyout::useSelectedShapes() const
27 {
28   return false;
29 }
30
31 bool PartSet_WidgetPoint2DFlyout::focusTo()
32 {
33   bool aCanAcceptFocus = true;
34   if (isInternal() && isComputedDefault()) {
35     AISObjectPtr anObject = workshop()->displayer()->getAISObject(feature());
36     aCanAcceptFocus = anObject.get() && !anObject->isEmptyDistanceGeometry();
37   }
38   if (aCanAcceptFocus)
39     aCanAcceptFocus = PartSet_WidgetPoint2D::focusTo();
40   return aCanAcceptFocus;
41 }
42
43 XGUI_Workshop* PartSet_WidgetPoint2DFlyout::workshop() const
44 {
45   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
46   return aConnector->workshop();
47 }