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

Method ExecuteDataWithInformation

IO/Image/vtkImageImport.cxx:252–269  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

250
251//------------------------------------------------------------------------------
252void vtkImageImport::ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo)
253{
254 // If set, use the callbacks to prepare our input data.
255 this->InvokeExecuteDataCallbacks();
256
257 vtkImageData* data = vtkImageData::SafeDownCast(output);
258 data->SetExtent(0, 0, 0, 0, 0, 0);
259 data->AllocateScalars(outInfo);
260 void* ptr = this->GetImportVoidPointer();
261 vtkIdType size = this->NumberOfScalarComponents;
262 size *= this->DataExtent[1] - this->DataExtent[0] + 1;
263 size *= this->DataExtent[3] - this->DataExtent[2] + 1;
264 size *= this->DataExtent[5] - this->DataExtent[4] + 1;
265
266 data->SetExtent(this->DataExtent);
267 data->GetPointData()->GetScalars()->SetVoidArray(ptr, size, 1);
268 data->GetPointData()->GetScalars()->SetName(this->ScalarArrayName);
269}
270
271//------------------------------------------------------------------------------
272void vtkImageImport::CopyImportVoidPointer(void* ptr, vtkIdType size)

Callers

nothing calls this directly

Calls 7

SetVoidArrayMethod · 0.80
SetExtentMethod · 0.45
AllocateScalarsMethod · 0.45
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45
SetNameMethod · 0.45

Tested by

no test coverage detected