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

Function TestCellIds

Common/DataModel/Testing/Cxx/TestStructuredData.cxx:186–217  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

184
185//------------------------------------------------------------------------------
186int 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//------------------------------------------------------------------------------
220int TestPointIds()

Callers 1

TestStructuredDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected