MCPcopy Create free account
hub / github.com/Kitware/VTK / ClipVolume

Method ClipVolume

Filters/General/vtkClipDataSet.cxx:734–770  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

732
733//------------------------------------------------------------------------------
734void 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//------------------------------------------------------------------------------
773int vtkClipDataSet::FillInputPortInformation(int, vtkInformation* info)

Callers 1

RequestDataMethod · 0.95

Calls 15

DeleteMethod · 0.65
NewFunction · 0.50
AddObserverMethod · 0.45
ShallowCopyMethod · 0.45
SetInputDataMethod · 0.45
SetValueMethod · 0.45
SetDebugMethod · 0.45
UpdateMethod · 0.45
RemoveObserverMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected