Commit febeb780 authored by Aron Helser's avatar Aron Helser
Browse files

vtk Representation: reset slice viz and position when volume is added later.

parent 93b80096
Pipeline #166729 failed with stages
in 19 minutes and 15 seconds
......@@ -290,12 +290,26 @@ int vtkSMTKResourceRepresentation::RequestData(
this->SliceXY->SetSliceMode(vtkImageSliceRepresentation::XY_PLANE);
this->SliceYZ->SetSliceMode(vtkImageSliceRepresentation::YZ_PLANE);
this->SliceXZ->SetSliceMode(vtkImageSliceRepresentation::XZ_PLANE);
// when slice reps were hidden, their default slice is zero - reset
if (this->SliceXY->GetSlice() == 0 && this->SliceYZ->GetSlice() == 0 &&
this->SliceXZ->GetSlice() == 0)
{
int dimensions[3];
sliceVolume->GetDimensions(dimensions);
this->SliceXY->SetSlice((dimensions[2] - 1) / 2);
this->SliceYZ->SetSlice((dimensions[0] - 1) / 2);
this->SliceXZ->SetSlice((dimensions[1] - 1) / 2);
}
this->SliceXY->SetInputArrayToProcess(
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, scalarName.c_str());
this->SliceYZ->SetInputArrayToProcess(
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, scalarName.c_str());
this->SliceXZ->SetInputArrayToProcess(
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, scalarName.c_str());
this->SliceXY->SetVisibility(true);
this->SliceYZ->SetVisibility(true);
this->SliceXZ->SetVisibility(true);
}
}
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment