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

Method RequestData

Filters/Statistics/vtkExtractStatisticalModelTables.cxx:136–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136int vtkExtractStatisticalModelTables::RequestData(vtkInformation* vtkNotUsed(request),
137 vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec)
138{
139 auto* model = vtkStatisticalModel::GetData(inInfoVec[0]);
140 auto* pdc = vtkPartitionedDataSetCollection::GetData(inInfoVec[0]);
141 auto* out = vtkPartitionedDataSetCollection::GetData(outInfoVec);
142
143 if (pdc && (pdc->GetNumberOfPartitionedDataSets() == 0 || !pdc->GetDataAssembly()))
144 {
145 // Empty input ⇒ empty output
146 out->Initialize();
147 return 1;
148 }
149
150 vtkNew<vtkDataAssembly> resultAssy;
151
152 if (model)
153 {
154 AddModelToAssembly(out, model, resultAssy, /*root node of model*/ 0);
155 }
156 else if (pdc)
157 {
158 // Copy the input's structure so all node IDs match, but remove dataset references:
159 auto* assemblyIn = pdc->GetDataAssembly();
160 resultAssy->DeepCopy(assemblyIn);
161 resultAssy->RemoveAllDataSetIndices(0, /*traverse_subtree*/ true);
162 // Create a visitor for the input collection.
163 vtkNew<ModelExtractor> extractor;
164 extractor->Initialize(pdc, out, resultAssy);
165 // Add new node IDs for statistical models by traversing the input:
166 assemblyIn->Visit(extractor);
167 }
168 else
169 {
170 auto* data = vtkDataObject::GetData(inInfoVec[0]);
171 vtkErrorMacro("Unhandled input type \"" << (data ? data->GetClassName() : "null") << "\".");
172 return 0;
173 }
174 out->SetDataAssembly(resultAssy);
175
176 return 1;
177}
178
179VTK_ABI_NAMESPACE_END

Callers

nothing calls this directly

Calls 9

AddModelToAssemblyFunction · 0.85
GetDataAssemblyMethod · 0.80
GetDataFunction · 0.50
InitializeMethod · 0.45
DeepCopyMethod · 0.45
VisitMethod · 0.45
GetClassNameMethod · 0.45

Tested by

no test coverage detected