#include <PartSet_WidgetPoint2d.h>
#include <PartSet_WidgetPoint2dDistance.h>
#include <PartSet_WidgetShapeSelector.h>
+#include <PartSet_WidgetMultiSelector.h>
#include <PartSet_WidgetEditor.h>
#include "PartSet_SketcherMgr.h"
#include "PartSet_MenuMgr.h"
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;
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();
// when sketch operation is active
std::set<FeaturePtr> anIgnoredFeatures;
anIgnoredFeatures.insert(mySketchMgr->activeSketch());
- aWorkshop->deleteFeatures(aSelectedObj, anIgnoredFeatures);
+ aWorkshop->deleteFeatures(aSketchObjects, anIgnoredFeatures);
// 5. stop operation
aWorkshop->displayer()->updateViewer();