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

Method GetLevelZeroCoordinatesFromIndex

Common/DataModel/vtkHyperTreeGrid.cxx:1452–1477  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1450
1451//------------------------------------------------------------------------------
1452void vtkHyperTreeGrid::GetLevelZeroCoordinatesFromIndex(
1453 vtkIdType treeindex, unsigned int& i, unsigned int& j, unsigned int& k) const
1454{
1455 // Distinguish between two cases depending on indexing order
1456 if (this->TransposedRootIndexing)
1457 {
1458 unsigned long nbKxJ =
1459 static_cast<unsigned long>(this->CellDims[2]) * static_cast<unsigned long>(this->CellDims[1]);
1460 i = static_cast<unsigned int>(treeindex / nbKxJ);
1461 vtkIdType reste = treeindex - i * nbKxJ;
1462 j = static_cast<unsigned int>(reste / this->CellDims[2]);
1463 k = static_cast<unsigned int>(reste - j * this->CellDims[2]);
1464 }
1465 else
1466 {
1467 unsigned long nbIxJ = this->CellDims[0] * this->CellDims[1];
1468 k = static_cast<unsigned int>(treeindex / nbIxJ);
1469 vtkIdType reste = treeindex - k * nbIxJ;
1470 j = static_cast<unsigned int>(reste / this->CellDims[0]);
1471 i = static_cast<unsigned int>(reste - j * this->CellDims[0]);
1472 }
1473
1474 assert(i < this->CellDims[0]);
1475 assert(j < this->CellDims[1]);
1476 assert(k < this->CellDims[2]);
1477}
1478
1479//------------------------------------------------------------------------------
1480void vtkHyperTreeGrid::GetLevelZeroOriginAndSizeFromIndex(

Callers 15

IsSelectedHTMethod · 0.80
InitializeMethod · 0.80
InitializeMethod · 0.80
InitializeMethod · 0.80
InitializeMethod · 0.80
InitializeMethod · 0.80
ProcessTreesMethod · 0.80

Calls 1

assertFunction · 0.50

Tested by

no test coverage detected