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

Method GetCellTypes

Common/DataModel/vtkStructuredData.cxx:344–363  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

342
343//------------------------------------------------------------------------------
344vtkSmartPointer<vtkConstantArray<unsigned char>> vtkStructuredData::GetCellTypes(
345 int extent[6], bool usePixelVoxelOrientation)
346{
347 const int dataDescription = vtkStructuredData::GetDataDescriptionFromExtent(extent);
348 const int dimension = vtkStructuredData::GetDataDimension(dataDescription);
349 // NOLINTNEXTLINE(readability-avoid-nested-conditional-operator)
350 const int cellType = dimension == 3 ? (usePixelVoxelOrientation ? VTK_VOXEL : VTK_HEXAHEDRON)
351 // NOLINTNEXTLINE(readability-avoid-nested-conditional-operator)
352 : dimension == 2 ? (usePixelVoxelOrientation ? VTK_PIXEL : VTK_QUAD)
353 // NOLINTNEXTLINE(readability-avoid-nested-conditional-operator)
354 : dimension == 1 ? VTK_LINE
355 // NOLINTNEXTLINE(readability-avoid-nested-conditional-operator)
356 : dimension == 0 && dataDescription == VTK_STRUCTURED_SINGLE_POINT ? VTK_VERTEX
357 : VTK_EMPTY_CELL;
358 auto cellTypesArray = vtkSmartPointer<vtkConstantArray<unsigned char>>::New();
359 cellTypesArray->ConstructBackend(cellType);
360 cellTypesArray->SetNumberOfComponents(1);
361 cellTypesArray->SetNumberOfTuples(vtkStructuredData::GetNumberOfCells(extent));
362 return cellTypesArray;
363}
364
365//------------------------------------------------------------------------------
366vtkSmartPointer<vtkConstantArray<int>> vtkStructuredData::GetCellTypesArray(

Callers

nothing calls this directly

Calls 5

GetDataDimensionFunction · 0.85
GetNumberOfCellsFunction · 0.70
NewFunction · 0.50
SetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45

Tested by

no test coverage detected