| 147 | return targetArray; |
| 148 | } |
| 149 | void 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]. |
no test coverage detected