Skip to content

Commit

Permalink
fix(slice-explorer): properly handling coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Oct 29, 2024
1 parent dfb767e commit d379ce6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pan3d/explorers/slice_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def _generate_vtk_pipeline(self):
slice_mapper = vtk.vtkDataSetMapper()
slice_mapper.SetInputConnection(cutter.GetOutputPort())
slice_mapper.SetScalarRange(float(var_range[0]), float(var_range[1]))
slice_mapper.SelectColorArray(self.vars[0])
slice_mapper.SetScalarModeToUsePointFieldData()
slice_mapper.InterpolateScalarsBeforeMappingOn()
slice_actor.SetMapper(slice_mapper)
self._plane = plane
self._cutter = cutter
Expand Down Expand Up @@ -403,6 +406,7 @@ def _on_data_change(self, **_):
output = self._cutter.GetOutput()
vrange = output.GetPointData().GetArray(self.state.data_var).GetRange()
self._slice_mapper.SetScalarRange(float(vrange[0]), float(vrange[1]))
self._slice_mapper.SelectColorArray(self.state.data_var)
self.state.varmin = float(vrange[0])
self.state.varmax = float(vrange[1])
self._sbar_actor.SetLookupTable(self._slice_mapper.GetLookupTable())
Expand Down

0 comments on commit d379ce6

Please sign in to comment.