From e425ed39a6499b4c4d37ba4c1090e2fc92f46027 Mon Sep 17 00:00:00 2001 From: Uwe Date: Tue, 26 Jul 2022 04:00:02 +0200 Subject: [PATCH] [FEM] PostObject: improve color bar refreshing - for data point filters the color bar must not be updated --- src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index 656ccd0c93..c2fdad7d0d 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -698,11 +698,13 @@ void ViewProviderFemPostObject::hide(void) { void ViewProviderFemPostObject::show(void) { Gui::ViewProviderDocumentObject::show(); m_colorStyle->style = SoDrawStyle::FILLED; - // we must update the color bar + // we must update the color bar except for data point filters + auto nameVP = std::string(this->getObject()->getViewProviderName()); + if (nameVP.compare("FemGui::ViewProviderFemPostDataAtPoint") == 0) + return; WriteColorData(true); } - void ViewProviderFemPostObject::OnChange(Base::Subject< int >& /*rCaller*/, int /*rcReason*/) { bool ResetColorBarRange = false; WriteColorData(ResetColorBarRange); @@ -750,16 +752,19 @@ bool ViewProviderFemPostObject::canDelete(App::DocumentObject* obj) const void ViewProviderFemPostObject::selectionChanged(const Gui::SelectionChanges &sel) { // If a FemPostObject is selected in the document tree we must refresh its - // Field property to update the color bar. - // But don't do this if the object is invisible because otherobjects with a + // color bar. + // But don't do this if the object is invisible because other objects with a // color bar might be visible and the color bar is then wrong. + // Also don't do this for point filters because for them a color bar is not sensible. if (sel.Type == sel.AddSelection) { Gui::SelectionObject obj(sel); if (obj.getObject() == this->getObject()) { if (!this->getObject()->Visibility.getValue()) return; + auto nameVP = std::string(this->getObject()->getViewProviderName()); + if (nameVP.compare("FemGui::ViewProviderFemPostDataAtPoint") == 0) + return; WriteColorData(true); } } } -