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

Method RequestDataObject

Filters/Geometry/vtkImageDataToUniformGrid.cxx:38–76  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

36
37//------------------------------------------------------------------------------
38int vtkImageDataToUniformGrid::RequestDataObject(
39 vtkInformation*, vtkInformationVector** inV, vtkInformationVector* outV)
40{
41 vtkInformation* inInfo = inV[0]->GetInformationObject(0);
42 if (!inInfo)
43 {
44 return VTK_ERROR;
45 }
46
47 vtkInformation* outInfo = outV->GetInformationObject(0);
48
49 if (vtkDataObjectTree* input = vtkDataObjectTree::GetData(inInfo))
50 { // multiblock data sets
51 vtkDataObjectTree* output = vtkDataObjectTree::GetData(outInfo);
52 if (!output)
53 {
54 output = input->NewInstance();
55 outInfo->Set(vtkDataObject::DATA_OBJECT(), output);
56 this->GetOutputPortInformation(0)->Set(
57 vtkDataObject::DATA_EXTENT_TYPE(), output->GetExtentType());
58 output->Delete();
59 }
60 return VTK_OK;
61 }
62 if (vtkImageData::GetData(inInfo) != nullptr)
63 {
64 vtkUniformGrid* output = vtkUniformGrid::New();
65 outInfo->Set(vtkDataObject::DATA_OBJECT(), output);
66 this->GetOutputPortInformation(0)->Set(
67 vtkDataObject::DATA_EXTENT_TYPE(), output->GetExtentType());
68 output->Delete();
69
70 return VTK_OK;
71 }
72
73 vtkErrorMacro(
74 "Don't know how to handle input of type " << vtkDataObject::GetData(inInfo)->GetClassName());
75 return VTK_ERROR;
76}
77
78//------------------------------------------------------------------------------
79int vtkImageDataToUniformGrid::RequestData(

Callers

nothing calls this directly

Calls 8

GetInformationObjectMethod · 0.80
DeleteMethod · 0.65
GetDataFunction · 0.50
NewFunction · 0.50
NewInstanceMethod · 0.45
SetMethod · 0.45
GetClassNameMethod · 0.45

Tested by

no test coverage detected