VTK  9.7.20261027
vtkCellTypeSides.h File Reference

The sides of the cells of a dataset, by cell type, read without building the cells. More...

#include "vtkBiQuadraticQuad.h"
#include "vtkBiQuadraticQuadraticHexahedron.h"
#include "vtkBiQuadraticQuadraticWedge.h"
#include "vtkBiQuadraticTriangle.h"
#include "vtkCellType.h"
#include "vtkCellTypeTraits.h"
#include "vtkGenericCell.h"
#include "vtkHexagonalPrism.h"
#include "vtkHexahedron.h"
#include "vtkIdList.h"
#include "vtkPentagonalPrism.h"
#include "vtkPixel.h"
#include "vtkPolyhedronCellArray.h"
#include "vtkPyramid.h"
#include "vtkQuad.h"
#include "vtkQuadraticHexahedron.h"
#include "vtkQuadraticLinearQuad.h"
#include "vtkQuadraticLinearWedge.h"
#include "vtkQuadraticPyramid.h"
#include "vtkQuadraticQuad.h"
#include "vtkQuadraticTetra.h"
#include "vtkQuadraticTriangle.h"
#include "vtkQuadraticWedge.h"
#include "vtkSetGet.h"
#include "vtkTetra.h"
#include "vtkTriQuadraticHexahedron.h"
#include "vtkTriQuadraticPyramid.h"
#include "vtkTriangle.h"
#include "vtkUnstructuredGrid.h"
#include "vtkVoxel.h"
#include "vtkWedge.h"
#include <algorithm>
#include <array>
#include <cstdint>
#include <type_traits>
#include <utility>
Include dependency graph for vtkCellTypeSides.h:

Go to the source code of this file.

Classes

struct  vtkCellTypeSides::FixedSizeCellSideTables< CellType >
struct  vtkCellTypeSides::FixedSizeCellSides< CellType >
struct  vtkCellTypeSides::PointListCellSides< CellType >
struct  vtkCellTypeSides::TriangleStripCellSides
struct  vtkCellTypeSides::PolygonCellSides< Quadratic >
struct  vtkCellTypeSides::ConvexPointSetSides
struct  vtkCellTypeSides::PolyhedronCellSides
struct  vtkCellTypeSides::HigherOrderCellSides< CellType >
struct  vtkCellTypeSides::NonLinearCellSides

Namespaces

namespace  vtkCellTypeSides

Functions

constexpr int vtkCellTypeSides::GetMaximumCellSidePoints ()
constexpr int vtkCellTypeSides::GetFixedSizeSideType (int numPts, int numCorners)
constexpr vtkIdType vtkCellTypeSides::GetNumberOfSideCorners (int sideType, vtkIdType numSidePts)
template<class DataSetT>
vtkCell * vtkCellTypeSides::GetGenericSide (DataSetT *input, vtkIdType cellId, int sideDim, int sideId, vtkGenericCell *cell)
template<class DataSetT>
VTK_NEVER_INLINE vtkIdType vtkCellTypeSides::GetGenericSidePoints (DataSetT *input, vtkIdType cellId, int sideDim, int sideId, vtkIdList *sidePts, const vtkIdType *&ids, vtkIdType &numCorners, vtkGenericCell *cell)
template<class DataSetT>
VTK_NEVER_INLINE int vtkCellTypeSides::GetGenericSideSize (DataSetT *input, vtkIdType cellId, int sideDim, int sideId, vtkGenericCell *cell)
template<class Functor>
VTK_ALWAYS_INLINE constexpr decltype(auto) vtkCellTypeSides::DispatchNonLinearCellSides (unsigned char cellType, Functor &&functor)
constexpr std::array< int, VTK_NUMBER_OF_CELL_TYPES > vtkCellTypeSides::GetDimensions ()
template<class Functor>
VTK_ALWAYS_INLINE constexpr decltype(auto) vtkCellTypeSides::DispatchCellSides (unsigned char cellType, Functor &&functor)
template<class DataSetT>
int vtkCellTypeSides::GetCellNumberOfSides (DataSetT *input, vtkIdType cellId, unsigned char cellType, int sideDim, vtkGenericCell *cell)
int vtkCellTypeSides::GetCellSideType (unsigned char cellType, int sideDim, int sideId)
template<class DataSetT>
int vtkCellTypeSides::GetCellSideSize (DataSetT *input, vtkIdType cellId, unsigned char cellType, int sideDim, int sideId, vtkGenericCell *cell)
template<class DataSetT>
VTK_ALWAYS_INLINE void vtkCellTypeSides::GetCellSidePoints (DataSetT *input, vtkIdType cellId, unsigned char cellType, int sideDim, int sideId, vtkIdType npts, const vtkIdType *pts, vtkIdList *sidePtIds, vtkGenericCell *cell)

Variables

constexpr int vtkCellTypeSides::MaximumCellSidePoints = GetMaximumCellSidePoints()
template<class Sides>
constexpr Sides vtkCellTypeSides::CellSidesInstance {}
constexpr std::array< int, VTK_NUMBER_OF_CELL_TYPES > vtkCellTypeSides::Dimensions = GetDimensions()

Detailed Description

The sides of the cells of a dataset, by cell type, read without building the cells.

The vertices, edges and faces of the cells of a dataset, e.g., a vtkUnstructuredGrid or a vtkPolyData, by classes of cells with a common interface, in the order of vtkCellType.h: FixedSizeCellSides (the cell types of a fixed size, read from static tables sized by vtkCellTypeTraits), PointListCellSides (the poly-vertices and poly-lines), TriangleStripCellSides, PolygonCellSides (the polygons and quadratic polygons), ConvexPointSetSides, PolyhedronCellSides and HigherOrderCellSides. The cell types without traits, which cannot be built, are empty cells, as in vtkGenericCell::SetCellType(). The sides are in the order of vtkCell::GetEdge() and vtkCell::GetFace(), but the faces of a voxel, in the order of a polygon.

GetCellNumberOfSides() gives the number of sides of a dimension of a cell, GetCellSideType() the cell type of one of them, GetCellSideSize() its number of points and GetCellSidePoints() its points, as vtkUnstructuredGrid::GetCellEdgePoints() and GetCellFacePoints(), which use them. DispatchCellSides() calls a functor with the class of sides of a cell type, so that hot loops read the sides with their sizes known at compile time when possible.

[&](auto sides) VTK_ALWAYS_INLINE_LAMBDA
{
const int numEdges = sides.GetNumberOfSides(grid, cellId, cellType, 1, npts);
...
});
VTK_ALWAYS_INLINE constexpr decltype(auto) DispatchCellSides(unsigned char cellType, Functor &&functor)

The nonlinear cells are dispatched out of these loops, by NonLinearCellSides.

The interface of the classes of sides, for the sides of dimension sideDim (0 for the vertices, 1 for the edges, 2 for the faces):

  • UsesNumberOfPoints: whether GetNumberOfSides() reads the number of points of the cell;
  • MaximumFaceCorners and MinimumFaceCorners: the most and the fewest corners of a face, known at compile time, or 0;
  • GetDimension(): the dimension of the cells;
  • GetNumberOfSides(): the number of sides of the cell cellId, of type cellType and npts points;
  • GetSideType(): the cell type of the side sideId, given by the cell type only, e.g., VTK_QUADRATIC_QUAD for a face of a VTK_QUADRATIC_HEXAHEDRON;
  • GetSideSize(): its number of points, without reading them;
  • GetSidePoints(): its points, from the points pts of the cell, in ptIds, of MaximumCellSidePoints points, or in sidePts. Returns their number, sets ids to them and numCorners to the number of its corners, its first points: all of them for a linear side, without the mid-edge and mid-face points otherwise. Two sides are the same if they have the same corners.

The vertices of a cell are its points, mid-edge and mid-face points included. The functions take the dataset of the cell and the scratch objects of the caller: cell, to build the cells whose sides are not read from static tables, e.g., the higher order cells and the edges of the polyhedra, and sidePts, for the points of the sides of the built cells and of the faces of the polyhedra.

See also
vtkCellTypeTraits

Definition in file vtkCellTypeSides.h.