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

Method GetGridBounds

Common/DataModel/vtkUniformHyperTreeGrid.cxx:375–399  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

373
374//------------------------------------------------------------------------------
375void vtkUniformHyperTreeGrid::GetGridBounds(double* bounds)
376{
377 // Recompute each call
378 // Compute bounds from uniform grid parameters
379 for (unsigned int i = 0; i < 3; ++i)
380 {
381 unsigned int di = 2 * i;
382 unsigned int dip = di + 1;
383 bounds[di] = this->Origin[i];
384 if (this->GetDimensions()[i] == 1)
385 {
386 bounds[dip] = this->Origin[i];
387 }
388 else
389 {
390 bounds[dip] = this->Origin[i] + this->GetCellDims()[i] * this->GridScale[i];
391 }
392
393 // Ensure that the bounds are increasing
394 if (bounds[di] > bounds[dip])
395 {
396 std::swap(bounds[di], bounds[dip]);
397 }
398 }
399}
400
401//------------------------------------------------------------------------------
402void vtkUniformHyperTreeGrid::ShallowCopy(vtkDataObject* src)

Callers

nothing calls this directly

Calls 3

swapFunction · 0.50
GetDimensionsMethod · 0.45
GetCellDimsMethod · 0.45

Tested by

no test coverage detected