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

Method RequestDataObject

Common/ExecutionModel/vtkPassInputTypeAlgorithm.cxx:193–226  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

191
192//------------------------------------------------------------------------------
193int vtkPassInputTypeAlgorithm::RequestDataObject(
194 vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
195{
196 if (this->GetNumberOfInputPorts() == 0 || this->GetNumberOfOutputPorts() == 0)
197 {
198 return 1;
199 }
200
201 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
202 if (!inInfo)
203 {
204 return 0;
205 }
206 vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());
207
208 if (input)
209 {
210 // for each output
211 for (int i = 0; i < this->GetNumberOfOutputPorts(); ++i)
212 {
213 vtkInformation* info = outputVector->GetInformationObject(i);
214 vtkDataObject* output = info->Get(vtkDataObject::DATA_OBJECT());
215
216 if (!output || !output->IsA(input->GetClassName()))
217 {
218 vtkDataObject* newOutput = input->NewInstance();
219 info->Set(vtkDataObject::DATA_OBJECT(), newOutput);
220 newOutput->Delete();
221 }
222 }
223 return 1;
224 }
225 return 0;
226}
227
228//------------------------------------------------------------------------------
229int vtkPassInputTypeAlgorithm::FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info)

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