------------------------------------------------------------------------------
| 1191 | |
| 1192 | //------------------------------------------------------------------------------ |
| 1193 | void vtkExplicitStructuredGrid::ReorderCellsPoints(const int* ptsMap, const int transformFlag[3]) |
| 1194 | { |
| 1195 | // Reorder all cells if necessary |
| 1196 | vtkIdType ids[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1197 | vtkIdType ids2[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1198 | vtkIdType npts, *pts, *ptsTmp, *ptsTmp2; |
| 1199 | vtkCellArray* cells = this->GetCells(); |
| 1200 | for (vtkIdType cellId = 0; cellId < this->GetNumberOfCells(); cellId++) |
| 1201 | { |
| 1202 | if (this->IsCellVisible(cellId)) |
| 1203 | { |
| 1204 | this->GetCellPoints(cellId, npts, pts); |
| 1205 | for (int ptIdx = 0; ptIdx < 8; ptIdx++) |
| 1206 | { |
| 1207 | ids[ptIdx] = pts[ptIdx]; |
| 1208 | } |
| 1209 | ptsTmp = ids; |
| 1210 | ptsTmp2 = ids2; |
| 1211 | for (int axis = 0; axis < 3; axis++) |
| 1212 | { |
| 1213 | if (transformFlag[axis]) |
| 1214 | { |
| 1215 | for (int ptIdx = 0; ptIdx < 8; ptIdx++) |
| 1216 | { |
| 1217 | ptsTmp2[ptIdx] = ptsTmp[ptsMap[axis * 8 + ptIdx]]; |
| 1218 | } |
| 1219 | std::swap(ptsTmp, ptsTmp2); |
| 1220 | } |
| 1221 | } |
| 1222 | cells->ReplaceCellAtId(cellId, 8, ptsTmp); |
| 1223 | this->GetCellPoints(cellId, npts, pts); |
| 1224 | } |
| 1225 | } |
| 1226 | } |
| 1227 | VTK_ABI_NAMESPACE_END |
no test coverage detected