Skip to content

Commit

Permalink
Fem: Reset field color bar - fixes #13695 (#13820)
Browse files Browse the repository at this point in the history
* Fem: Reset field color bar - fixes #13695

* Fem: Hide input filter if new filer is created
  • Loading branch information
marioalexis84 committed May 6, 2024
1 parent 0513f10 commit 42d772c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
17 changes: 17 additions & 0 deletions src/Mod/Fem/Gui/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

#ifdef FC_USE_VTK
#include <Mod/Fem/App/FemPostPipeline.h>
#include <Mod/Fem/Gui/ViewProviderFemPostObject.h>
#endif


Expand Down Expand Up @@ -1691,6 +1692,22 @@ void setupFilter(Gui::Command* cmd, std::string Name)
femFilter->Input.setValue(selObject);
}

femFilter->Data.setValue(static_cast<Fem::FemPostObject*>(selObject)->Data.getValue());
auto selObjectView = static_cast<FemGui::ViewProviderFemPostObject*>(
Gui::Application::Instance->getViewProvider(selObject));

cmd->doCommand(Gui::Command::Doc,
"App.activeDocument().ActiveObject.ViewObject.Field = \"%s\"",
selObjectView->Field.getValueAsString());
cmd->doCommand(Gui::Command::Doc,
"App.activeDocument().ActiveObject.ViewObject.VectorMode = \"%s\"",
selObjectView->VectorMode.getValueAsString());

// hide selected filter
cmd->doCommand(Gui::Command::Doc,
"App.activeDocument().%s.ViewObject.Visibility = False",
selObject->getNameInDocument());

cmd->updateActive();
// open the dialog to edit the filter
cmd->doCommand(Gui::Command::Gui, "Gui.activeDocument().setEdit('%s')", FeatName.c_str());
Expand Down
6 changes: 4 additions & 2 deletions src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,13 @@ void ViewProviderFemPostObject::filterArtifacts(vtkDataSet* dset)
m_surface->SetInputData(dset);
}
}

m_blockPropertyChanges = false;

// restore initial vsibility
if (!visibility) {
this->Visibility.setValue(visibility);
}
m_blockPropertyChanges = false;
}

bool ViewProviderFemPostObject::setupPipeline()
Expand Down Expand Up @@ -1041,7 +1043,7 @@ void ViewProviderFemPostObject::show()

void ViewProviderFemPostObject::OnChange(Base::Subject<int>& /*rCaller*/, int /*rcReason*/)
{
bool ResetColorBarRange = false;
bool ResetColorBarRange = true;
WriteColorData(ResetColorBarRange);
}

Expand Down

0 comments on commit 42d772c

Please sign in to comment.