From: nds Date: Tue, 6 May 2014 08:08:21 +0000 (+0400) Subject: refs #30 - Sketch base GUI: create, draw lines X-Git-Tag: V_0.2~85^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=091645866d22aa788edf955a8b5ae861aeb1cdb3;p=modules%2Fshaper.git refs #30 - Sketch base GUI: create, draw lines Set empty selected feature to edit line operation in order to it is aborted by this. --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 39af2f3d5..6bfffa8ce 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -133,11 +133,11 @@ void PartSet_Module::onSelectionChanged() XGUI_Displayer* aDisplayer = myWorkshop->displayer(); boost::shared_ptr 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()); } } } diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index 5bd17a0f9..8f2b4ae09 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -41,6 +41,9 @@ std::list PartSet_OperationSketch::getSelectionModes(boost::shared_ptr theFeature, const TopoDS_Shape& theShape) { + if (theShape.IsNull()) + return; + if (!myIsEditMode) { setSketchPlane(theShape); myIsEditMode = true;