Skip to content

Commit 5713904

Browse files
committed
Fem: Reset field color bar - fixes FreeCAD#13695
1 parent f74bfc4 commit 5713904

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Mod/Fem/Gui/Command.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
#ifdef FC_USE_VTK
6060
#include <Mod/Fem/App/FemPostPipeline.h>
61+
#include <Mod/Fem/Gui/ViewProviderFemPostObject.h>
6162
#endif
6263

6364

@@ -1691,6 +1692,17 @@ void setupFilter(Gui::Command* cmd, std::string Name)
16911692
femFilter->Input.setValue(selObject);
16921693
}
16931694

1695+
femFilter->Data.setValue(static_cast<Fem::FemPostObject*>(selObject)->Data.getValue());
1696+
auto selObjectView = static_cast<FemGui::ViewProviderFemPostObject*>(
1697+
Gui::Application::Instance->getViewProvider(selObject));
1698+
1699+
cmd->doCommand(Gui::Command::Doc,
1700+
"App.activeDocument().ActiveObject.ViewObject.Field = \"%s\"",
1701+
selObjectView->Field.getValueAsString());
1702+
cmd->doCommand(Gui::Command::Doc,
1703+
"App.activeDocument().ActiveObject.ViewObject.VectorMode = \"%s\"",
1704+
selObjectView->VectorMode.getValueAsString());
1705+
16941706
cmd->updateActive();
16951707
// open the dialog to edit the filter
16961708
cmd->doCommand(Gui::Command::Gui, "Gui.activeDocument().setEdit('%s')", FeatName.c_str());

src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ void ViewProviderFemPostObject::show()
10411041

10421042
void ViewProviderFemPostObject::OnChange(Base::Subject<int>& /*rCaller*/, int /*rcReason*/)
10431043
{
1044-
bool ResetColorBarRange = false;
1044+
bool ResetColorBarRange = true;
10451045
WriteColorData(ResetColorBarRange);
10461046
}
10471047

0 commit comments

Comments
 (0)