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

Method RequestDataObject

Common/ExecutionModel/vtkDataSetAlgorithm.cxx:180–208  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

178
179//------------------------------------------------------------------------------
180int vtkDataSetAlgorithm::RequestDataObject(
181 vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
182{
183 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
184 if (!inInfo)
185 {
186 return 0;
187 }
188 vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
189
190 if (input)
191 {
192 // for each output
193 for (int i = 0; i < this->GetNumberOfOutputPorts(); ++i)
194 {
195 vtkInformation* info = outputVector->GetInformationObject(i);
196 vtkDataSet* output = vtkDataSet::SafeDownCast(info->Get(vtkDataObject::DATA_OBJECT()));
197
198 if (!output || !output->IsA(input->GetClassName()))
199 {
200 vtkDataSet* newOutput = input->NewInstance();
201 info->Set(vtkDataObject::DATA_OBJECT(), newOutput);
202 newOutput->Delete();
203 }
204 }
205 return 1;
206 }
207 return 0;
208}
209
210//------------------------------------------------------------------------------
211int vtkDataSetAlgorithm::FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info)

Callers 1

ProcessRequestMethod · 0.95

Calls 8

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

Tested by

no test coverage detected