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

Method RequestData

Common/ExecutionModel/vtkImageInPlaceFilter.cxx:22–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20//------------------------------------------------------------------------------
21
22int vtkImageInPlaceFilter::RequestData(vtkInformation* vtkNotUsed(request),
23 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
24{
25 // get the data object
26 vtkInformation* outInfo = outputVector->GetInformationObject(0);
27 vtkImageData* output = vtkImageData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
28
29 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
30 vtkImageData* input = vtkImageData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
31
32 int *inExt, *outExt;
33 inExt = inInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT());
34 outExt = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT());
35
36 // if the total size of the data is the same then can be in place
37 vtkLargeInteger inSize;
38 vtkLargeInteger outSize;
39 inSize = (inExt[1] - inExt[0] + 1);
40 inSize = inSize * (inExt[3] - inExt[2] + 1);
41 inSize = inSize * (inExt[5] - inExt[4] + 1);
42 outSize = (outExt[1] - outExt[0] + 1);
43 outSize = outSize * (outExt[3] - outExt[2] + 1);
44 outSize = outSize * (outExt[5] - outExt[4] + 1);
45 if (inSize == outSize &&
46 (vtkDataObject::GetGlobalReleaseDataFlag() ||
47 inInfo->Get(vtkDemandDrivenPipeline::RELEASE_DATA())))
48 {
49 // pass the data
50 output->GetPointData()->PassData(input->GetPointData());
51 output->SetExtent(outExt);
52 }
53 else
54 {
55 output->SetExtent(outExt);
56 output->AllocateScalars(outInfo);
57 this->CopyData(input, output, outExt);
58 }
59
60 return 1;
61}
62
63void vtkImageInPlaceFilter::CopyData(vtkImageData* inData, vtkImageData* outData, int* outExt)
64{

Callers

nothing calls this directly

Calls 7

CopyDataMethod · 0.95
GetInformationObjectMethod · 0.80
GetMethod · 0.45
PassDataMethod · 0.45
GetPointDataMethod · 0.45
SetExtentMethod · 0.45
AllocateScalarsMethod · 0.45

Tested by

no test coverage detected