Salome HOME
The default colors in preferences for sketch elements and features.
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchLabel.cpp
index 239aeb75ad18beec5d7b656c7b4f61110cf63136..c2ca8a4d2d863cefb118caf7f7dd05e92a5cb639 100644 (file)
@@ -85,6 +85,17 @@ PartSet_WidgetSketchLabel::~PartSet_WidgetSketchLabel()
   erasePreviewPlanes();
 }
 
+bool PartSet_WidgetSketchLabel::setSelection(const QList<ModuleBase_ViewerPrs>& theValues, int& thePosition)
+{
+  // 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(theValues, thePosition);
+}
+
 QList<QWidget*> PartSet_WidgetSketchLabel::getControls() const
 {
   QList<QWidget*> aResult;