------------------------------------------------------------------------------
| 1708 | |
| 1709 | //------------------------------------------------------------------------------ |
| 1710 | void vtkHyperTreeGrid::GetGridBounds(double* bounds) |
| 1711 | { |
| 1712 | assert("pre: exist_coordinates_explict" && this->WithCoordinates); |
| 1713 | |
| 1714 | // Recompute each call |
| 1715 | // Retrieve coordinate arrays |
| 1716 | vtkDataArray* coords[3] = { this->XCoordinates, this->YCoordinates, this->ZCoordinates }; |
| 1717 | for (unsigned int i = 0; i < 3; ++i) |
| 1718 | { |
| 1719 | if (!coords[i] || !coords[i]->GetNumberOfTuples()) |
| 1720 | { |
| 1721 | return; |
| 1722 | } |
| 1723 | } |
| 1724 | |
| 1725 | // Get grid bounds from coordinate arrays |
| 1726 | for (unsigned int i = 0; i < 3; ++i) |
| 1727 | { |
| 1728 | unsigned int di = 2 * i; |
| 1729 | unsigned int dip = di + 1; |
| 1730 | bounds[di] = coords[i]->GetComponent(0, 0); |
| 1731 | bounds[dip] = coords[i]->GetComponent(coords[i]->GetNumberOfTuples() - 1, 0); |
| 1732 | |
| 1733 | // Ensure that the bounds are increasing |
| 1734 | if (bounds[di] > bounds[dip]) |
| 1735 | { |
| 1736 | std::swap(bounds[di], bounds[dip]); |
| 1737 | } |
| 1738 | } |
| 1739 | } |
| 1740 | |
| 1741 | //------------------------------------------------------------------------------ |
| 1742 | double* vtkHyperTreeGrid::GetCenter() |
no test coverage detected