activate="true"
shape_types="face"
/>
- <doublevalue id="extrusion_size" label="Size" min="0" step="1.0" default="10" icon=":icons/dimension_v.png" tooltip="Set size of extrusion">
+ <doublevalue id="extrusion_size" label="Size" min="0" step="1.0" default="0" icon=":icons/dimension_v.png" tooltip="Set size of extrusion">
<validator id="GeomValidators_Positive"/>
</doublevalue>
<boolvalue id="extrusion_reverse" label="Reverse" default="false" tooltip="Reverse default direction"/>
aValue.setObject(aPrs.object());
if (aActiveWgt->setValue(&aValue)) {
myPreSelection.remove(aPrs);
- if(isValid()) {
- //myActiveWidget = NULL;
- commit();
- } else {
- myPropertyPanel->activateNextWidget();
- //emit activateNextWidget(myActiveWidget);
- }
+ myPropertyPanel->activateNextWidget();
}
// If preselection is enough to make a valid feature - apply it immediately
}
/// Returns pointer to the root document.
boost::shared_ptr<ModelAPI_Document> document() const;
- ///
+ /// Activates widgets by preselection if it is accepted
virtual void activateByPreselection();
/// Set value to the active widget
return;
setObject(aObject);
+ emit focusOutWidget(this);
}
}
updateSelectionName();
activateSelection(false);
emit valuesChanged();
- emit focusOutWidget(this);
}
//********************************************************************
#include <PartSet_Tools.h>
#include <ModelAPI_ResultBody.h>
+#include <ModuleBase_IPropertyPanel.h>
+#include <ModuleBase_ModelWidget.h>
+#include <ModuleBase_WidgetValueFeature.h>
+
#include <SketchPlugin_Feature.h>
#include <V3d_View.hxx>
#include <AIS_Shape.hxx>
}
emit restartRequired(theType, theFeature);
}
+
+
+
+void PartSet_OperationSketchBase::activateByPreselection()
+{
+ if (!myPropertyPanel)
+ return;
+ ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+ if ((myPreSelection.size() > 0) && aActiveWgt) {
+ const ModuleBase_ViewerPrs& aPrs = myPreSelection.front();
+ ModuleBase_WidgetValueFeature aValue;
+ aValue.setObject(aPrs.object());
+ if (aActiveWgt->setValue(&aValue)) {
+ myPreSelection.remove(aPrs);
+ if(isValid()) {
+ //myActiveWidget = NULL;
+ commit();
+ } else {
+ myPropertyPanel->activateNextWidget();
+ //emit activateNextWidget(myActiveWidget);
+ }
+ }
+ // If preselection is enough to make a valid feature - apply it immediately
+ }
+}
/// \param theFlushMessage the flag whether the create message should be flushed
/// \returns the created feature
virtual FeaturePtr createFeature(const bool theFlushMessage = true);
+
+ /// Activates widgets by preselection if it is accepted
+ virtual void activateByPreselection();
};
#endif