X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Module.cpp;h=09b8ef5d58c71373cb2e8b60fdbcd7e0b8e8c851;hb=9d1e3115a33fa4e36bfb193f110b31c5bc198068;hp=a38f41b65a24baa598eafd38c2526b9f120fbaae;hpb=6f31859c9897eacec13d3912e76f28b8b824ecf4;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index a38f41b65..09b8ef5d5 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "PartSet_SketcherMgr.h" #include "PartSet_MenuMgr.h" @@ -456,7 +457,13 @@ ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& th new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId); aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch()); aWgt = aShapeSelectorWgt; - } if (theType == WDG_DOUBLEVALUE_EDITOR) { + } if (theType == "sketch_multi_selector") { + PartSet_WidgetMultiSelector* aShapeSelectorWgt = + new PartSet_WidgetMultiSelector(theParent, workshop(), theWidgetApi, theParentId); + aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch()); + aWgt = aShapeSelectorWgt; + } + if (theType == WDG_DOUBLEVALUE_EDITOR) { aWgt = new PartSet_WidgetEditor(theParent, workshop(), theWidgetApi, theParentId); } return aWgt; @@ -485,6 +492,20 @@ bool PartSet_Module::deleteObjects() if (aSelectedObj.count() == 0) return false; + // avoid delete of the objects, which are not belong to the current sketch + // in order to do not delete results of other sketches + QObjectPtrList aSketchObjects; + QObjectPtrList::const_iterator anIt = aSelectedObj.begin(), aLast = aSelectedObj.end(); + for ( ; anIt != aLast; anIt++) { + ObjectPtr anObject = *anIt; + if (mySketchMgr->isObjectOfSketch(anObject)) + aSketchObjects.append(anObject); + } + // if the selection contains only local selected presentations from other sketches, + // the Delete operation should not be done at all + if (aSketchObjects.size() == 0) + return true; + // the active nested sketch operation should be aborted unconditionally if (isNestedOp) anOperation->abort(); @@ -499,7 +520,7 @@ bool PartSet_Module::deleteObjects() // when sketch operation is active std::set anIgnoredFeatures; anIgnoredFeatures.insert(mySketchMgr->activeSketch()); - aWorkshop->deleteFeatures(aSelectedObj, anIgnoredFeatures); + aWorkshop->deleteFeatures(aSketchObjects, anIgnoredFeatures); // 5. stop operation aWorkshop->displayer()->updateViewer();