- 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)