------------------------------------------------------------------------------
| 383 | |
| 384 | //------------------------------------------------------------------------------ |
| 385 | inline 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 | //------------------------------------------------------------------------------ |
| 402 | inline void vtkStructuredData::GetCellExtentFromPointExtent( |