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

Method CopyAndCastFrom

Common/DataModel/vtkImageData.cxx:1150–1168  ·  view source on GitHub ↗

------------------------------------------------------------------------------ This method is passed a input and output region, and executes the filter algorithm to fill the output from the input. It just executes a switch statement to call the correct function for the regions data types.

Source from the content-addressed store, hash-verified

1148// It just executes a switch statement to call the correct function for
1149// the regions data types.
1150void vtkImageData::CopyAndCastFrom(vtkImageData* inData, int extent[6])
1151{
1152 void* inPtr = inData->GetScalarPointerForExtent(extent);
1153
1154 if (inPtr == nullptr)
1155 {
1156 vtkErrorMacro("Scalars not allocated.");
1157 return;
1158 }
1159
1160 int scalarType = inData->GetPointData()->GetScalars()->GetDataType();
1161 switch (scalarType)
1162 {
1163 vtkTemplateMacro(vtkImageDataCastExecute(inData, static_cast<VTK_TT*>(inPtr), this, extent));
1164 default:
1165 vtkErrorMacro(<< "Execute: Unknown input ScalarType");
1166 return;
1167 }
1168}
1169
1170//------------------------------------------------------------------------------
1171void vtkImageData::Crop(const int* updateExtent)

Callers 6

ImageDataExecuteMethod · 0.80
CopyAndCastFromFunction · 0.80
ThreadedRequestDataMethod · 0.80
ThreadedRequestDataMethod · 0.80
ThreadedRequestDataMethod · 0.80
ProcessRequestMethod · 0.80

Calls 5

vtkImageDataCastExecuteFunction · 0.85
GetDataTypeMethod · 0.45
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45

Tested by

no test coverage detected