From 1e1b54019292973bdc0ba94fe6f69afdf6262d49 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 28 Nov 2019 18:18:36 +0300 Subject: [PATCH] Issue #3106: Do not process selection of non-faces group --- src/XGUI/XGUI_FacesPanel.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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()) { -- 2.39.2