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

Method DoProbing

Filters/Parallel/vtkHyperTreeGridPProbeFilter.cxx:273–297  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

271
272//------------------------------------------------------------------------------
273bool vtkHyperTreeGridPProbeFilter::DoProbing(
274 vtkDataSet* probe, vtkHyperTreeGrid* source, vtkDataSet* output, vtkIdList* localPointIds)
275{
276 // locate all present points of probe
277 unsigned int nPoints = probe->GetNumberOfPoints();
278 vtkNew<vtkIdList> locCellIds;
279 locCellIds->Initialize();
280 ProbingWorklet worker(probe, this->Locator, localPointIds, locCellIds);
281 vtkSMPTools::For(0, nPoints, worker);
282
283 // copy values from source
284 unsigned int numSourceCellArrays = source->GetCellData()->GetNumberOfArrays();
285 for (unsigned int iA = 0; iA < numSourceCellArrays; iA++)
286 {
287 vtkDataArray* sourceArray = source->GetCellData()->GetArray(iA);
288 if (!(output->GetPointData()->HasArray(sourceArray->GetName())))
289 {
290 vtkErrorMacro("Array " << sourceArray->GetName() << " missing in output");
291 return false;
292 }
293 vtkDataArray* outputArray = output->GetPointData()->GetArray(sourceArray->GetName());
294 outputArray->InsertTuplesStartingAt(0, locCellIds, sourceArray);
295 }
296 return true;
297}
298
299//------------------------------------------------------------------------------
300bool vtkHyperTreeGridPProbeFilter::Initialize(

Callers 1

RequestDataMethod · 0.95

Calls 10

ForFunction · 0.50
GetNumberOfPointsMethod · 0.45
InitializeMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetCellDataMethod · 0.45
GetArrayMethod · 0.45
HasArrayMethod · 0.45
GetPointDataMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected