------------------------------------------------------------------------------
| 1478 | |
| 1479 | //------------------------------------------------------------------------------ |
| 1480 | void vtkHyperTreeGrid::GetLevelZeroOriginAndSizeFromIndex( |
| 1481 | vtkIdType treeindex, double* Origin, double* Size) |
| 1482 | { |
| 1483 | assert("pre: exist_coordinates_explict" && this->WithCoordinates); |
| 1484 | |
| 1485 | // Compute origin and size of the cursor |
| 1486 | unsigned int i, j, k; |
| 1487 | this->GetLevelZeroCoordinatesFromIndex(treeindex, i, j, k); |
| 1488 | |
| 1489 | vtkDataArray* xCoords = this->XCoordinates; |
| 1490 | vtkDataArray* yCoords = this->YCoordinates; |
| 1491 | vtkDataArray* zCoords = this->ZCoordinates; |
| 1492 | Origin[0] = xCoords->GetTuple1(i); |
| 1493 | Origin[1] = yCoords->GetTuple1(j); |
| 1494 | Origin[2] = zCoords->GetTuple1(k); |
| 1495 | |
| 1496 | if (this->Dimensions[0] == 1) |
| 1497 | { |
| 1498 | Size[0] = 0.; |
| 1499 | } |
| 1500 | else |
| 1501 | { |
| 1502 | Size[0] = xCoords->GetTuple1(i + 1) - Origin[0]; |
| 1503 | } |
| 1504 | if (this->Dimensions[1] == 1) |
| 1505 | { |
| 1506 | Size[1] = 0.; |
| 1507 | } |
| 1508 | else |
| 1509 | { |
| 1510 | Size[1] = yCoords->GetTuple1(j + 1) - Origin[1]; |
| 1511 | } |
| 1512 | if (this->Dimensions[2] == 1) |
| 1513 | { |
| 1514 | Size[2] = 0.; |
| 1515 | } |
| 1516 | else |
| 1517 | { |
| 1518 | Size[2] = zCoords->GetTuple1(k + 1) - Origin[2]; |
| 1519 | } |
| 1520 | } |
| 1521 | |
| 1522 | //------------------------------------------------------------------------------ |
| 1523 | void vtkHyperTreeGrid::GetLevelZeroOriginFromIndex(vtkIdType treeindex, double* Origin) |
no test coverage detected