------------------------------------------------------------------------------
| 185 | |
| 186 | //------------------------------------------------------------------------------ |
| 187 | void vtkImageActor::SetDisplayExtent(const int extent[6]) |
| 188 | { |
| 189 | int idx, modified = 0; |
| 190 | |
| 191 | for (idx = 0; idx < 6; ++idx) |
| 192 | { |
| 193 | if (this->DisplayExtent[idx] != extent[idx]) |
| 194 | { |
| 195 | this->DisplayExtent[idx] = extent[idx]; |
| 196 | modified = 1; |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | if (modified) |
| 201 | { |
| 202 | if (this->Mapper && this->Mapper->IsA("vtkImageSliceMapper")) |
| 203 | { |
| 204 | if (this->DisplayExtent[0] <= this->DisplayExtent[1]) |
| 205 | { |
| 206 | static_cast<vtkImageSliceMapper*>(this->Mapper)->CroppingOn(); |
| 207 | static_cast<vtkImageSliceMapper*>(this->Mapper)->SetCroppingRegion(this->DisplayExtent); |
| 208 | static_cast<vtkImageSliceMapper*>(this->Mapper) |
| 209 | ->SetOrientation(vtkImageActor::GetOrientationFromExtent(this->DisplayExtent)); |
| 210 | } |
| 211 | else |
| 212 | { |
| 213 | static_cast<vtkImageSliceMapper*>(this->Mapper)->CroppingOff(); |
| 214 | static_cast<vtkImageSliceMapper*>(this->Mapper)->SetOrientationToZ(); |
| 215 | } |
| 216 | } |
| 217 | this->Modified(); |
| 218 | } |
| 219 | } |
| 220 | //------------------------------------------------------------------------------ |
| 221 | void vtkImageActor::SetDisplayExtent(int minX, int maxX, int minY, int maxY, int minZ, int maxZ) |
| 222 | { |