1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_WidgetPoint2D.cpp
4 // Created: 25 Apr 2014
5 // Author: Natalia ERMOLAEVA
7 #include "PartSet_WidgetPoint2DFlyout.h"
9 #include <XGUI_Workshop.h>
10 #include <XGUI_ModuleConnector.h>
11 #include <XGUI_Displayer.h>
13 #include <Config_WidgetAPI.h>
14 #include <Config_Keywords.h>
19 PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent,
20 ModuleBase_IWorkshop* theWorkshop,
21 const Config_WidgetAPI* theData)
22 : PartSet_WidgetPoint2D(theParent, theWorkshop, theData)
26 bool PartSet_WidgetPoint2DFlyout::useSelectedShapes() const
31 bool PartSet_WidgetPoint2DFlyout::focusTo()
33 bool aCanAcceptFocus = true;
34 if (isInternal() && isComputedDefault()) {
35 AISObjectPtr anObject = workshop()->displayer()->getAISObject(feature());
36 aCanAcceptFocus = anObject.get() && !anObject->isEmptyDistanceGeometry();
39 aCanAcceptFocus = PartSet_WidgetPoint2D::focusTo();
40 return aCanAcceptFocus;
43 XGUI_Workshop* PartSet_WidgetPoint2DFlyout::workshop() const
45 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
46 return aConnector->workshop();