[FEM] handle Elmer result mesh zoom properly
- also fix an issue that after a successful simulation, no result was visible
This commit is contained in:
@@ -428,13 +428,6 @@ void ViewProviderFemPostObject::WritePointData(vtkPoints* points, vtkDataArray*
|
||||
if (!points)
|
||||
return;
|
||||
|
||||
// if the object contains "Elmer" but no scale has been set, we set it to 1000.0
|
||||
// because for Elmer we work with SI units and thus get a scaled result we need to transform
|
||||
auto Label = std::string(pcObject->Label.getValue());
|
||||
auto found = Label.find(std::string("Elmer"));
|
||||
if (found != std::string::npos && strcmp(Scale.getValueAsString(), "1000") != 0)
|
||||
Scale.setValue("1000");
|
||||
|
||||
// we must inherit the Scale of parent meshes (for example for clip filters)
|
||||
auto parents = pcObject->getInList();
|
||||
if (parents.size()) {
|
||||
|
||||
@@ -169,6 +169,10 @@ class Results(run.Results):
|
||||
"Fem::FemPostPipeline", self.solver.Name + "Result")
|
||||
self.solver.ElmerResult.Label = self.solver.Label + "Result"
|
||||
self.analysis.addObject(self.solver.ElmerResult)
|
||||
# set the scale to 1 (meaning factor 1000) to scale the mesh back for display
|
||||
self.solver.ElmerResult.ViewObject.Scale = 1
|
||||
# to assure the user sees something, set the default to Surface
|
||||
self.solver.ElmerResult.ViewObject.DisplayMode = "Surface"
|
||||
|
||||
def _getResultFile(self):
|
||||
postPath = None
|
||||
|
||||
Reference in New Issue
Block a user