------------------------------------------------------------------------------
| 184 | |
| 185 | //------------------------------------------------------------------------------ |
| 186 | int TestCellIds() |
| 187 | { |
| 188 | int dim[3] = { 3, 4, 5 }; |
| 189 | |
| 190 | for (int i = 0; i < dim[0] - 1; ++i) |
| 191 | { |
| 192 | for (int j = 0; j < dim[1] - 1; ++j) |
| 193 | { |
| 194 | for (int k = 0; k < dim[2] - 1; ++k) |
| 195 | { |
| 196 | int pos[3]; |
| 197 | pos[0] = i; |
| 198 | pos[1] = j; |
| 199 | pos[2] = k; |
| 200 | |
| 201 | int ijk[3]; |
| 202 | vtkIdType id = vtkStructuredData::ComputeCellId(dim, pos); |
| 203 | |
| 204 | vtkStructuredData::ComputeCellStructuredCoords(id, dim, ijk); |
| 205 | |
| 206 | if (!(pos[0] == ijk[0] && pos[1] == ijk[1] && pos[2] == ijk[2])) |
| 207 | { |
| 208 | std::cerr << "TestStructuredData failed! Structured coords should be (" << i << ", " << j |
| 209 | << ", " << k << ") but they are (" << ijk[0] << ", " << ijk[1] << ", " << ijk[2] |
| 210 | << ")" << std::endl; |
| 211 | return EXIT_FAILURE; |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | return EXIT_SUCCESS; |
| 217 | } |
| 218 | |
| 219 | //------------------------------------------------------------------------------ |
| 220 | int TestPointIds() |
no outgoing calls
no test coverage detected