From 06c10561d1a251b0952fefd69b6148765883b626 Mon Sep 17 00:00:00 2001 From: Uwe Date: Tue, 29 Mar 2022 04:48:59 +0200 Subject: [PATCH] [FEM] fix sphere cut filter when using a sphere as function for a filter, the pipeline must be recomputed when the sphere geometry is changed, not only the sphere --- .../Fem/Gui/ViewProviderFemPostFunction.cpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp index 336ff942ca..65064d6230 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp @@ -576,14 +576,36 @@ void ViewProviderFemPostSphereFunction::updateData(const App::Property* p) { getManipulator()->setMatrix(t); } Gui::ViewProviderDocumentObject::updateData(p); -} + // after updating the geometry we must recompute the pipeline the sphere is in + 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 + if (!directParents.empty()) { + for (auto obj : directParents) { + if (obj->getTypeId() == Base::Type::fromName("Fem::FemPostFunctionProvider")) { + auto outerParents = obj->getInList(); + if (!outerParents.empty()) { + 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); + } + } + } + } + } + } + } +} FunctionWidget* ViewProviderFemPostSphereFunction::createControlWidget() { return new SphereWidget(); } - SphereWidget::SphereWidget() { ui = new Ui_SphereWidget();