------------------------------------------------------------------------------
| 732 | |
| 733 | //------------------------------------------------------------------------------ |
| 734 | void vtkClipDataSet::ClipVolume(vtkDataSet* input, vtkUnstructuredGrid* output) |
| 735 | { |
| 736 | vtkClipVolume* clipVolume = vtkClipVolume::New(); |
| 737 | |
| 738 | clipVolume->AddObserver(vtkCommand::ProgressEvent, this->InternalProgressObserver); |
| 739 | |
| 740 | // We cannot set the input directly. This messes up the partitioning. |
| 741 | // output->UpdateNumberOfPieces gets set to 1. |
| 742 | vtkImageData* tmp = vtkImageData::New(); |
| 743 | tmp->ShallowCopy(vtkImageData::SafeDownCast(input)); |
| 744 | |
| 745 | clipVolume->SetInputData(tmp); |
| 746 | double value = 0.0; |
| 747 | if (this->UseValueAsOffset || !this->ClipFunction) |
| 748 | { |
| 749 | value = this->Value; |
| 750 | } |
| 751 | clipVolume->SetValue(value); |
| 752 | clipVolume->SetInsideOut(this->InsideOut); |
| 753 | clipVolume->SetClipFunction(this->ClipFunction); |
| 754 | clipVolume->SetGenerateClipScalars(this->GenerateClipScalars); |
| 755 | clipVolume->SetGenerateClippedOutput(this->GenerateClippedOutput); |
| 756 | clipVolume->SetMergeTolerance(this->MergeTolerance); |
| 757 | clipVolume->SetDebug(this->Debug); |
| 758 | clipVolume->SetInputArrayToProcess(0, this->GetInputArrayInformation(0)); |
| 759 | clipVolume->SetContainerAlgorithm(this); |
| 760 | clipVolume->Update(); |
| 761 | |
| 762 | clipVolume->RemoveObserver(this->InternalProgressObserver); |
| 763 | vtkUnstructuredGrid* clipOutput = clipVolume->GetOutput(); |
| 764 | |
| 765 | output->CopyStructure(clipOutput); |
| 766 | output->GetPointData()->ShallowCopy(clipOutput->GetPointData()); |
| 767 | output->GetCellData()->ShallowCopy(clipOutput->GetCellData()); |
| 768 | clipVolume->Delete(); |
| 769 | tmp->Delete(); |
| 770 | } |
| 771 | |
| 772 | //------------------------------------------------------------------------------ |
| 773 | int vtkClipDataSet::FillInputPortInformation(int, vtkInformation* info) |
no test coverage detected