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

Function AddCellData

Filters/ParallelDIY2/vtkProbeLineFilter.cxx:149–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 return targetArray;
148}
149void AddCellData(const std::vector<HitCellInfo>& intersections, vtkCellData* inputCellAttribute,
150 vtkPointData* resultPointData, vtkIdType npts)
151{
152 for (int i = 0; i < inputCellAttribute->GetNumberOfArrays(); ++i)
153 {
154 vtkAbstractArray* sourceArray = inputCellAttribute->GetAbstractArray(i);
155 if (auto targetArray = ::AddAttribute(sourceArray, resultPointData, npts))
156 {
157 vtkSMPTools::For(0, intersections.size(),
158 [&](vtkIdType begin, vtkIdType end)
159 {
160 for (vtkIdType j = begin; j < end; ++j)
161 {
162 const auto& inter = intersections[j];
163 targetArray->SetTuple(j * 2, inter.CellId, sourceArray);
164 targetArray->SetTuple(j * 2 + 1, inter.CellId, sourceArray);
165 }
166 });
167 }
168 }
169}
170
171//------------------------------------------------------------------------------
172// Return the entry point and exit point of a given cell for the segment [p1,p2].

Callers 1

IntersectCellsMethod · 0.85

Calls 6

GetAbstractArrayMethod · 0.80
AddAttributeFunction · 0.70
ForFunction · 0.50
GetNumberOfArraysMethod · 0.45
sizeMethod · 0.45
SetTupleMethod · 0.45

Tested by

no test coverage detected