]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #30 - Sketch base GUI: create, draw lines
authornds <natalia.donis@opencascade.com>
Tue, 6 May 2014 08:08:21 +0000 (12:08 +0400)
committernds <natalia.donis@opencascade.com>
Tue, 6 May 2014 08:08:21 +0000 (12:08 +0400)
Set empty selected feature to edit line operation in order to it is aborted by this.

src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_OperationSketch.cpp

index 39af2f3d58f281da6d19b1c8de878aedfa1a43d2..6bfffa8ce5b65010ec692947c9a81be88f880932 100644 (file)
@@ -133,11 +133,11 @@ void PartSet_Module::onSelectionChanged()
 
       XGUI_Displayer* aDisplayer = myWorkshop->displayer();
       boost::shared_ptr<ModelAPI_Feature> aFeature;
+      // only first selected shape is processed
       if (!aList.IsEmpty()) {
-        const TopoDS_Shape& aShape = aList.First();
-        aFeature = aDisplayer->GetFeature(aShape);
-        aPreviewOp->setSelected(aFeature, aShape);
+        aFeature = aDisplayer->GetFeature(aList.First());
       }
+      aPreviewOp->setSelected(aFeature, !aList.IsEmpty() ? aList.First() : TopoDS_Shape());
     }
   }
 }
index 5bd17a0f9cb9a09295be05ea82c8080efc02c4c7..8f2b4ae09109027d212b265411fe02fa049e08f1 100644 (file)
@@ -41,6 +41,9 @@ std::list<int> PartSet_OperationSketch::getSelectionModes(boost::shared_ptr<Mode
 void PartSet_OperationSketch::setSelected(boost::shared_ptr<ModelAPI_Feature> theFeature,
                                           const TopoDS_Shape& theShape)
 {
+  if (theShape.IsNull())
+    return;
+
   if (!myIsEditMode) {
     setSketchPlane(theShape);
     myIsEditMode = true;