From: vsv Date: Thu, 28 Nov 2019 15:18:36 +0000 (+0300) Subject: Issue #3106: Do not process selection of non-faces group X-Git-Tag: V9_5_0a1~147 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1e1b54019292973bdc0ba94fe6f69afdf6262d49;p=modules%2Fshaper.git Issue #3106: Do not process selection of non-faces group --- diff --git a/src/XGUI/XGUI_FacesPanel.cpp b/src/XGUI/XGUI_FacesPanel.cpp index b8fba2d25..cfe66add5 100644 --- a/src/XGUI/XGUI_FacesPanel.cpp +++ b/src/XGUI/XGUI_FacesPanel.cpp @@ -299,6 +299,9 @@ void XGUI_FacesPanel::processSelection() QList aSelected = myWorkshop->selector()->selection()->getSelected(ModuleBase_ISelection::Viewer); + if (aSelected.size() == 0) + return; + bool isModified = false; static Events_ID aDispEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); @@ -313,16 +316,25 @@ void XGUI_FacesPanel::processSelection() continue; ResultGroupPtr aResGroup = std::dynamic_pointer_cast(anObject); - if (!aResGroup.get()) { + if (aResGroup.get()) { + FeaturePtr aFeature = ModelAPI_Feature::feature(aResGroup); + if (aFeature.get()) { + AttributeSelectionListPtr aSelectionListAttr = aFeature->data()->selectionList("group_list"); + std::string aType = aSelectionListAttr->selectionType(); + if (aType != "Faces") + continue; + } + } + else { GeomShapePtr aShapePtr = aPrs->shape(); if (!aShapePtr.get() || !aShapePtr->isFace()) - return; + continue; } QString aItemName = aResGroup.get()? aResGroup->data()->name().c_str() : XGUI_Tools::generateName(aPrs); if (myListView->hasItem(aItemName)) - return; + continue; getObjectsMapFromPrs(aPrs, anObjectToShapes, anObjectToPrs); if (aResGroup.get() && aResGroup->isDisplayed()) {