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

Method RequestDataObject

Common/ExecutionModel/vtkHyperTreeGridAlgorithm.cxx:119–151  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

117
118//------------------------------------------------------------------------------
119int vtkHyperTreeGridAlgorithm::RequestDataObject(
120 vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
121{
122 if (this->GetNumberOfInputPorts() == 0 || this->GetNumberOfOutputPorts() == 0)
123 {
124 return 1;
125 }
126
127 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
128 if (!inInfo)
129 {
130 return 0;
131 }
132 vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());
133
134 if (input)
135 {
136 // for each output
137 for (int i = 0; i < this->GetNumberOfOutputPorts(); ++i)
138 {
139 vtkInformation* info = outputVector->GetInformationObject(i);
140 vtkDataObject* output = info->Get(vtkDataObject::DATA_OBJECT());
141
142 if (!output || !output->IsA(input->GetClassName()))
143 {
144 vtkDataObject* newOutput = input->NewInstance();
145 info->Set(vtkDataObject::DATA_OBJECT(), newOutput);
146 newOutput->Delete();
147 }
148 }
149 }
150 return 1;
151}
152
153//------------------------------------------------------------------------------
154vtkTypeBool vtkHyperTreeGridAlgorithm::ProcessRequest(

Callers 1

ProcessRequestMethod · 0.95

Calls 9

GetInformationObjectMethod · 0.80
IsAMethod · 0.80
DeleteMethod · 0.65
GetNumberOfInputPortsMethod · 0.45
GetMethod · 0.45
GetClassNameMethod · 0.45
NewInstanceMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected