diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp index 0eb3282079..442a8447b5 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp @@ -51,8 +51,10 @@ #include #include #include +#include #include "ViewProviderFemPostFunction.h" +#include "ActiveAnalysisObserver.h" #include "TaskPostBoxes.h" #include "ui_PlaneWidget.h" @@ -577,24 +579,13 @@ void ViewProviderFemPostSphereFunction::updateData(const App::Property* p) { } Gui::ViewProviderDocumentObject::updateData(p); - // after updating the geometry we must recompute the pipeline the sphere is in + // after updating the geometry we must recompute + // A sphere can be used by filters in other pipelines than the one the sphere is in. + // Therefore we must recompute the analysis, not only a single pipeline if (p == &func->Center || p == &func->Radius) { - auto directParents = func->getInList(); - // directParents is at the level of the functions container, so we must read the parent of this container - for (auto obj : directParents) { - if (obj->getTypeId() == Base::Type::fromName("Fem::FemPostFunctionProvider")) { - auto outerParents = obj->getInList(); - for (auto objOuter : outerParents) { - if (objOuter->getTypeId() == Base::Type::fromName("Fem::FemPostPipeline") ) { - if (!isDragging()) - // not recursve, otherwise VTK will show an error on initialization - objOuter->recomputeFeature(); - else - objOuter->recomputeFeature(true); - } - } - } - } + auto pcAnalysis = FemGui::ActiveAnalysisObserver::instance()->getActiveObject(); + if (pcAnalysis) + pcAnalysis->recomputeFeature(true); } }