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

Function PassPointIds

Filters/Geometry/vtkGeometryFilter.cxx:2813–2835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2811// Threaded creation to generate array of originating point ids.
2812template <typename TInputIdType>
2813void PassPointIds(const char* name, vtkIdType numInputPts, vtkIdType numOutputPts,
2814 TInputIdType* ptMap, vtkPointData* outPD)
2815{
2816 vtkNew<vtkIdTypeArray> origPtIds;
2817 origPtIds->SetName(name);
2818 origPtIds->SetNumberOfComponents(1);
2819 origPtIds->SetNumberOfTuples(numOutputPts);
2820 outPD->AddArray(origPtIds);
2821 vtkIdType* origIds = origPtIds->GetPointer(0);
2822
2823 // Now threaded populate the array
2824 vtkSMPTools::For(0, numInputPts,
2825 [&origIds, &ptMap](vtkIdType ptId, vtkIdType endPtId)
2826 {
2827 for (; ptId < endPtId; ++ptId)
2828 {
2829 if (ptMap[ptId] >= 0)
2830 {
2831 origIds[ptMap[ptId]] = ptId;
2832 }
2833 }
2834 });
2835}
2836
2837//------------------------------------------------------------------------------
2838// Threaded compositing of originating cell ids.

Callers 3

ExecuteUnstructuredGridFunction · 0.85
ExecuteStructuredFunction · 0.85
ExecuteDataSetFunction · 0.85

Calls 6

ForFunction · 0.50
SetNameMethod · 0.45
SetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
AddArrayMethod · 0.45
GetPointerMethod · 0.45

Tested by

no test coverage detected