------------------------------------------------------------------------------
| 587 | |
| 588 | //------------------------------------------------------------------------------ |
| 589 | void vtkSmartVolumeMapper::ComputeMagnitudePointData(vtkDataSet* input, vtkDataArray* arr) |
| 590 | { |
| 591 | vtkImageData* imData = vtkImageData::SafeDownCast(input); |
| 592 | if (!imData) |
| 593 | { |
| 594 | // TODO: Support image magnitude calculation for rectilinear grids |
| 595 | return; |
| 596 | } |
| 597 | vtkNew<vtkImageData> tempInput; |
| 598 | tempInput->ShallowCopy(imData); |
| 599 | |
| 600 | const int id = |
| 601 | tempInput->GetPointData()->SetActiveAttribute(arr->GetName(), vtkDataSetAttributes::SCALARS); |
| 602 | if (id < 0) |
| 603 | { |
| 604 | vtkErrorMacro("Failed to set the active attribute in vtkImageMagnitude's input!"); |
| 605 | return; |
| 606 | } |
| 607 | |
| 608 | this->ImageMagnitude->SetInputData(tempInput); |
| 609 | this->ImageMagnitude->Update(); |
| 610 | this->InputDataMagnitude->ShallowCopy(this->ImageMagnitude->GetOutput()); |
| 611 | } |
| 612 | |
| 613 | //------------------------------------------------------------------------------ |
| 614 | void vtkSmartVolumeMapper::SetupVectorMode(vtkVolume* vol) |
no test coverage detected