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

Method GetGridBounds

Common/DataModel/vtkHyperTreeGrid.cxx:1710–1739  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1708
1709//------------------------------------------------------------------------------
1710void 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//------------------------------------------------------------------------------
1742double* vtkHyperTreeGrid::GetCenter()

Callers 4

CalculateHTsMethod · 0.45
ShallowCopyMethod · 0.45
GetBoundsFunction · 0.45
GetBoundsFunction · 0.45

Calls 4

assertFunction · 0.50
swapFunction · 0.50
GetNumberOfTuplesMethod · 0.45
GetComponentMethod · 0.45

Tested by

no test coverage detected