// If this check is absent, a selected plane in the viewer can be set in the sketch
// even if the sketch is built on another plane.
Scenario: show a plane, create sketch, call a line creation, select a plane in the browser(face is selected in the viewer), abort line creation. Result-modification data model outside the transaction. Reason - the sketch is resumed and the selected face is set as the sketch preselection.
erasePreviewPlanes();
}
+bool PartSet_WidgetSketchLabel::setSelection(ModuleBase_ViewerPrs theValue)
+{
+ // do not use the given selection if the plane of the sketch has been already set.
+ // If this check is absent, a selected plane in the viewer can be set in the sketch
+ // even if the sketch is built on another plane.
+ if (plane().get())
+ return true;
+
+ return ModuleBase_WidgetValidated::setSelection(theValue);
+}
+
QList<QWidget*> PartSet_WidgetSketchLabel::getControls() const
{
QList<QWidget*> aResult;
virtual ~PartSet_WidgetSketchLabel();
+ /// Set the given wrapped value to the current widget
+ /// This value should be processed in the widget according to the needs
+ /// The method is called by the current operation to process the operation preselection.
+ /// It is redefined to do nothing if the plane of the sketch has been already set.
+ /// \param theValue the wrapped widget value
+ virtual bool setSelection(ModuleBase_ViewerPrs theValue);
+
virtual bool restoreValue()
{
return true;