From 091645866d22aa788edf955a8b5ae861aeb1cdb3 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 6 May 2014 12:08:21 +0400 Subject: [PATCH] refs #30 - Sketch base GUI: create, draw lines Set empty selected feature to edit line operation in order to it is aborted by this. --- src/PartSet/PartSet_Module.cpp | 6 +++--- src/PartSet/PartSet_OperationSketch.cpp | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) 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; -- 2.39.2