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

Method ReorderCellsPoints

Common/DataModel/vtkExplicitStructuredGrid.cxx:1193–1226  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1191
1192//------------------------------------------------------------------------------
1193void 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}
1227VTK_ABI_NAMESPACE_END

Callers 1

Calls 6

GetNumberOfCellsMethod · 0.95
IsCellVisibleMethod · 0.95
GetCellPointsMethod · 0.95
ReplaceCellAtIdMethod · 0.80
swapFunction · 0.50
GetCellsMethod · 0.45

Tested by

no test coverage detected