| 272 | } |
| 273 | |
| 274 | void vtkGPUVolumeRayCastMapper::CloneInput(vtkDataSet* input, int port) |
| 275 | { |
| 276 | // Clone input into a transformed input |
| 277 | vtkDataSet* clone; |
| 278 | vtkDataSet* currentData = this->FindData(port, this->TransformedInputs); |
| 279 | if (!currentData) |
| 280 | { |
| 281 | if (vtkImageData::SafeDownCast(input)) |
| 282 | { |
| 283 | if (vtkUniformGrid::SafeDownCast(input)) |
| 284 | { |
| 285 | clone = vtkUniformGrid::New(); |
| 286 | } |
| 287 | else |
| 288 | { |
| 289 | clone = vtkImageData::New(); |
| 290 | } |
| 291 | } |
| 292 | else if (vtkRectilinearGrid::SafeDownCast(input)) |
| 293 | { |
| 294 | clone = vtkRectilinearGrid::New(); |
| 295 | } |
| 296 | else |
| 297 | { |
| 298 | clone = nullptr; |
| 299 | } |
| 300 | clone->Register(this); |
| 301 | this->TransformedInputs[port] = clone; |
| 302 | clone->Delete(); |
| 303 | |
| 304 | this->LastInputs[port] = nullptr; |
| 305 | } |
| 306 | else |
| 307 | { |
| 308 | clone = this->TransformedInputs[port]; |
| 309 | } |
| 310 | |
| 311 | // If we have a timestamp change or data change then create a new clone |
| 312 | if (input != this->LastInputs[port] || |
| 313 | (input != nullptr && input->GetMTime() > clone->GetMTime())) |
| 314 | { |
| 315 | this->LastInputs[port] = input; |
| 316 | this->TransformInput(port); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | int vtkGPUVolumeRayCastMapper::ValidateInput(vtkVolumeProperty* property, int port) |
| 321 | { |