X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FPartSet%2FPartSet_Module.cpp;h=09b8ef5d58c71373cb2e8b60fdbcd7e0b8e8c851;hb=9d1e3115a33fa4e36bfb193f110b31c5bc198068;hp=b81a64bb3291fb07b2280883008df0594e201f99;hpb=36a9b277899567c39eeb02fe2e8e510768d4a740;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index b81a64bb3..09b8ef5d5 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include "PartSet_SketcherMgr.h" #include "PartSet_MenuMgr.h" @@ -18,17 +18,11 @@ #include #include #include -#include -#include -#include -#include -#include #include #include #include #include -#include #include #include @@ -164,15 +158,6 @@ void PartSet_Module::registerFilters() //Registering of selection filters XGUI_ModuleConnector* aConnector = dynamic_cast(workshop()); ModuleBase_FilterFactory* aFactory = aConnector->selectionFilters(); - - //aFactory->registerFilter("EdgeFilter", new ModuleBase_FilterLinearEdge); - //aFactory->registerFilter("FaceFilter", new ModuleBase_FilterFace); - //aFactory->registerFilter("MultiFilter", new ModuleBase_FilterMulti); - //Handle(SelectMgr_Filter) aSelectFilter = new ModuleBase_FilterNoConsructionSubShapes(workshop()); - //aFactory->registerFilter("NoConstructionSubShapesFilter", - // new ModuleBase_FilterCustom(aSelectFilter)); - //Handle(SelectMgr_Filter) aSelectFilter = new PartSet_FilterSketchEntity(workshop()); - //aFactory->registerFilter("SketchEntityFilter", new ModuleBase_FilterCustom(aSelectFilter)); } void PartSet_Module::registerProperties() @@ -472,12 +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 == "sketch_constraint_shape_selector") { - PartSet_WidgetConstraintShapeSelector* aConstraintShapeSelectorWgt = - new PartSet_WidgetConstraintShapeSelector(theParent, workshop(), theWidgetApi, theParentId); - aConstraintShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch()); - aWgt = aConstraintShapeSelectorWgt; - } 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; @@ -506,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(); @@ -520,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();