X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_SketcherReentrantMgr.cpp;h=839da3fa082c2d3a161d055e2527272ab2e100ee;hb=ca925f26180f15699a77e76461679f11abd499ba;hp=b0d19549b987d7aab87e7248646d2a6fd2642ef9;hpb=a9d601b424970cbb2ef1d393101e7fec1d713a3d;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_SketcherReentrantMgr.cpp b/src/PartSet/PartSet_SketcherReentrantMgr.cpp index b0d19549b..839da3fa0 100644 --- a/src/PartSet/PartSet_SketcherReentrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReentrantMgr.cpp @@ -19,6 +19,7 @@ // #include "PartSet_SketcherReentrantMgr.h" +#include "PartSet_ExternalObjectsMgr.h" #include "PartSet_Module.h" #include "PartSet_SketcherMgr.h" #include "PartSet_WidgetPoint2d.h" @@ -254,6 +255,7 @@ bool PartSet_SketcherReentrantMgr::processMouseReleased(ModuleBase_IViewWindow* myClickedSketchPoint = PartSet_Tools::getPnt2d(theEvent, theWindow, module()->sketchMgr()->activeSketch()); + FeaturePtr anExternalCreatedFeature; if (!aPreSelected.empty()) { ModuleBase_ViewerPrsPtr aValue = aPreSelected.first(); module()->getGeomSelection(aValue, mySelectedObject, mySelectedAttribute); @@ -262,10 +264,23 @@ bool PartSet_SketcherReentrantMgr::processMouseReleased(ModuleBase_IViewWindow* if (aPointWidget) { GeomShapePtr aShape; aPointWidget->getGeomSelection_(aValue, mySelectedObject, aShape); + ObjectPtr anExternalObject = + aPointWidget->getExternalObjectMgr()->getExternalObjectValidated(); + // if external object is during reentrant operation and is used as a parameter of feature + // it should be removed after the operation is restarted. (Circle feature, Projection) + if (anExternalObject.get()) + anExternalCreatedFeature = ModelAPI_Feature::feature(anExternalObject); } } restartOperation(); + // remove created external feature + if (anExternalCreatedFeature.get()) { + QObjectPtrList anObjects; + anObjects.append(anExternalCreatedFeature); + workshop()->deleteFeatures(anObjects); + } + myClickedSketchPoint = std::shared_ptr(); mySelectedObject = ObjectPtr(); mySelectedAttribute = AttributePtr();