From cac4fb987472e7764f932c041f34a39fed005cc9 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 9 Jun 2015 19:13:41 +0300 Subject: [PATCH] Launch Sketch with ExtrusionCut --- src/PartSet/PartSet_SketcherMgr.cpp | 7 +++++-- src/PartSet/PartSet_WidgetSketchLabel.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index a086aa868..df93f32a2 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -716,16 +716,19 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) myPlaneFilter = new ModuleBase_ShapeInPlaneFilter(); myModule->workshop()->viewer()->addSelectionFilter(myPlaneFilter); + bool aHasPlane = false; if (theOperation->isEditOperation()) { // If it is editing of sketch then it means that plane is already defined std::shared_ptr aPln = PartSet_Tools::sketchPlane(myCurrentSketch); - if (aPln.get()) + if (aPln.get()) { myPlaneFilter->setPlane(aPln->impl()); + aHasPlane = true; + } } Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); // all sketch objects should be activated in the sketch selection modes by edit operation start // in case of creation operation, there is an active widget, which activates own selection mode - if (theOperation->isEditOperation()) + if (theOperation->isEditOperation() && aHasPlane) aConnector->activateModuleSelectionModes(); } diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 82b234fff..0d1b2bd2c 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -354,7 +354,7 @@ std::shared_ptr PartSet_WidgetSketchLabel::setSketchPlane(const Top { if (theShape.IsNull()) return std::shared_ptr(); - int aType = theShape.ShapeType(); + // get selected shape std::shared_ptr aGShape(new GeomAPI_Shape); aGShape->setImpl(new TopoDS_Shape(theShape)); -- 2.39.2