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

Method GetNumberOfCells

Common/DataModel/vtkStructuredData.h:385–399  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

383
384//------------------------------------------------------------------------------
385inline vtkIdType vtkStructuredData::GetNumberOfCells(const int ext[6], int)
386{
387 int dims[3];
388 vtkStructuredData::GetDimensionsFromExtent(ext, dims);
389
390 // if any of the dimensions is 0, then there are no cells
391 const int cellDims[3] = { dims[0] != 0 ? vtkStructuredData::Max(dims[0] - 1, 1) : 0,
392 dims[1] != 0 ? vtkStructuredData::Max(dims[1] - 1, 1) : 0,
393 dims[2] != 0 ? vtkStructuredData::Max(dims[2] - 1, 1) : 0 };
394
395 // Note, when we compute the result below, we statically cast to vtkIdType to
396 // ensure the compiler will generate a 32x32=64 instruction.
397 return static_cast<vtkIdType>(cellDims[0]) * static_cast<vtkIdType>(cellDims[1]) *
398 static_cast<vtkIdType>(cellDims[2]);
399}
400
401//------------------------------------------------------------------------------
402inline void vtkStructuredData::GetCellExtentFromPointExtent(

Callers

nothing calls this directly

Calls 1

MaxFunction · 0.70

Tested by

no test coverage detected