------------------------------------------------------------------------------
| 734 | |
| 735 | //------------------------------------------------------------------------------ |
| 736 | void vtkSmartVolumeMapper::ConnectMapperInput(vtkVolumeMapper* m) |
| 737 | { |
| 738 | assert("pre: m_exists" && m != nullptr); |
| 739 | |
| 740 | bool needShallowCopy = false; |
| 741 | vtkDataSet* data = m->GetInput(); |
| 742 | |
| 743 | if (data == nullptr || data == this->InputDataMagnitude) |
| 744 | { |
| 745 | if (vtkImageData::SafeDownCast(this->GetInput())) |
| 746 | { |
| 747 | if (vtkUniformGrid::SafeDownCast(this->GetInput())) |
| 748 | { |
| 749 | data = vtkUniformGrid::New(); |
| 750 | } |
| 751 | else |
| 752 | { |
| 753 | data = vtkImageData::New(); |
| 754 | } |
| 755 | } |
| 756 | else if (vtkRectilinearGrid::SafeDownCast(this->GetInput())) |
| 757 | { |
| 758 | data = vtkRectilinearGrid::New(); |
| 759 | } |
| 760 | m->SetInputDataObject(data); |
| 761 | needShallowCopy = true; |
| 762 | data->Delete(); |
| 763 | } |
| 764 | else |
| 765 | { |
| 766 | needShallowCopy = |
| 767 | ((this->LastInput != this->GetInput()) || (data->GetMTime() < this->GetInput()->GetMTime())); |
| 768 | |
| 769 | m->SetInputDataObject(data); |
| 770 | } |
| 771 | |
| 772 | if (needShallowCopy) |
| 773 | { |
| 774 | data->ShallowCopy(this->GetInput()); |
| 775 | this->LastInput = this->GetInput(); |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | //------------------------------------------------------------------------------ |
| 780 | void vtkSmartVolumeMapper::ConnectFilterInput(vtkImageResample* f) |
no test coverage detected