From 66ff55a2aa56accc645fc8d355bc68ef82911917 Mon Sep 17 00:00:00 2001 From: Uwe Date: Wed, 27 Jul 2022 16:56:06 +0200 Subject: [PATCH] [FEM] fix PostObject hiding issue - when a PostObject is hidden the FemPostDataAtPointFilter must not be taken into account --- src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index 721d19c11e..5d1112e05a 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include "ViewProviderFemPostObject.h" #include "TaskPostBoxes.h" @@ -667,8 +668,9 @@ void ViewProviderFemPostObject::hide(void) { m_colorStyle->style = SoDrawStyle::INVISIBLE; // The object is now hidden but the color bar is wrong // if there are other FemPostObjects visible. - // We must therefore search for the first visible FemPostObjects - // in the document and refresh ist color bar + // We must therefore search for the first visible FemPostObject + // according to their order in the Tree View (excluding the point + // object FemPostDataAtPointFilter) and refresh its color bar. // get all objects in the document auto docGui = Gui::Application::Instance->activeDocument(); @@ -680,7 +682,8 @@ void ViewProviderFemPostObject::hide(void) { // step through the objects for (auto it = ObjectsList.begin(); it != ObjectsList.end(); ++it) { if ((*it)->getTypeId().isDerivedFrom(Fem::FemPostObject::getClassTypeId())) { - if (!firstVisiblePostObject && (*it)->Visibility.getValue()) { + if (!firstVisiblePostObject && (*it)->Visibility.getValue() + && !(*it)->isDerivedFrom(Fem::FemPostDataAtPointFilter::getClassTypeId())) { firstVisiblePostObject = *it; break; }