[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
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user