// Author: Vitaly Smetannikov
#include "ModuleBase_WidgetShapeSelector.h"
- #include "ModuleBase_IWorkshop.h"
+ #include <ModuleBase_IWorkshop.h>
+#include "ModuleBase_WidgetValue.h"
+ #include <ModuleBase_Tools.h>
+#include "ModuleBase_WidgetValueFeature.h"
#include <Events_Loop.h>
#include <ModelAPI_Events.h>
commit();
}
-
-
-void PartSet_OperationFeatureBase::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
+/*bool PartSet_OperationFeatureBase::setWidgetValue(ObjectPtr theFeature, double theX, double theY)
{
- if(myActiveWidget) {
- myActiveWidget->setHighlighted(false);
- }
- if(theWidget) {
- theWidget->setHighlighted(true);
- }
-
- myActiveWidget = theWidget;
- activateByPreselection();
- if (myInitFeature && myActiveWidget) {
- ModuleBase_WidgetPoint2D* aWgt = dynamic_cast<ModuleBase_WidgetPoint2D*>(myActiveWidget);
- if (aWgt && aWgt->initFromPrevious(myInitFeature)) {
- myInitFeature = FeaturePtr();
- emit activateNextWidget(myActiveWidget);
- }
- }
-}
-
-void PartSet_OperationFeatureBase::activateByPreselection()
-{
- if ((myPreSelection.size() > 0) && myActiveWidget) {
- const ModuleBase_ViewerPrs& aPrs = myPreSelection.front();
- ModuleBase_WidgetValueFeature aValue;
- aValue.setObject(aPrs.object());
- if (myActiveWidget->setValue(&aValue)) {
- myPreSelection.remove(aPrs);
- if(isValid()) {
- myActiveWidget = NULL;
- commit();
- } else {
- emit activateNextWidget(myActiveWidget);
- }
- }
- // If preselection is enough to make a valid feature - apply it immediately
- }
-}
-
-bool PartSet_OperationFeatureBase::setWidgetValue(ObjectPtr theFeature, double theX, double theY)
-{
- if (!myActiveWidget)
+ ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+ if (!aActiveWgt)
return false;
ModuleBase_WidgetValueFeature* aValue = new ModuleBase_WidgetValueFeature();
aValue->setObject(theFeature);