VTK  9.3.1
vtkDGCell.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkDGCell_h
20 #define vtkDGCell_h
21 
22 #include "vtkFiltersCellGridModule.h" // for export macro
23 
24 #include "vtkCellMetadata.h"
25 #include "vtkStringToken.h" // for vtkStringToken::Hash
26 
27 #include <vector> // for side connectivity
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkCellAttribute;
31 class vtkCellGrid;
33 class vtkTypeFloat32Array;
34 class vtkTypeInt32Array;
35 
36 class VTKFILTERSCELLGRID_EXPORT vtkDGCell : public vtkCellMetadata
37 {
38 public:
39  vtkTypeMacro(vtkDGCell, vtkCellMetadata);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43  enum Shape : int
44  {
46  Edge,
52  Pyramid
53 
54  // It is probably more efficient to create a new cell type for arbitrary shapes
55  // than to attempt generalizing vtkDGCell, but for the sake of completeness:
56  // Polygon //!< We may one day support an n-sided polygonal face.
57  // Polyhedron //!< We may one day support an n-faced polyhedral volume with polygonal sides.
58  };
59 
60  static int GetShapeCornerCount(Shape shape);
61  static int GetShapeDimension(Shape shape);
62  static vtkStringToken GetShapeName(Shape shape);
63 
65  virtual Shape GetShape() const = 0;
66 
68  virtual int GetDimension() const { return vtkDGCell::GetShapeDimension(this->GetShape()); }
69 
71  virtual int GetNumberOfCorners() const
72  {
73  return vtkDGCell::GetShapeCornerCount(this->GetShape());
74  }
75 
81  virtual const std::array<double, 3>& GetCornerParameter(int corner) const = 0;
82 
86  virtual int GetNumberOfSideTypes() const = 0;
87 
100  virtual std::pair<int, int> GetSideRangeForType(int sideType) const = 0;
101 
112  virtual int GetNumberOfSidesOfDimension(int dimension) const = 0;
113 
120  virtual Shape GetSideShape(int side) const = 0;
121 
130  virtual const std::vector<vtkIdType>& GetSideConnectivity(int side) const = 0;
131 
137  virtual vtkTypeFloat32Array* GetReferencePoints() const = 0;
138 
146  virtual vtkTypeInt32Array* GetSideConnectivity() const = 0;
147 
153  virtual vtkTypeInt32Array* GetSideOffsetsAndShapes() const = 0;
154 
156  void FillReferencePoints(vtkTypeFloat32Array* arr) const;
157 
159  void FillSideConnectivity(vtkTypeInt32Array* arr) const;
160 
181  void FillSideOffsetsAndShapes(vtkTypeInt32Array* arr) const;
182 
183 protected:
184  vtkDGCell();
185  ~vtkDGCell() override;
186 
187 private:
188  vtkDGCell(const vtkDGCell&) = delete;
189  void operator=(const vtkDGCell&) = delete;
190 };
191 
192 VTK_ABI_NAMESPACE_END
193 #endif
virtual int GetDimension() const
Return the parametric dimension of this cell type (0, 1, 2, or 3).
Definition: vtkDGCell.h:68
Metadata for a particular type of cell (finite element).
A four-cornered volume bounded by 4 triangular shapes.
Definition: vtkDGCell.h:49
A volumetric, triangular prism.
Definition: vtkDGCell.h:51
Visualization data composed of cells of arbitrary type.
Definition: vtkCellGrid.h:41
a simple class to control print indentation
Definition: vtkIndent.h:28
A function defined over the physical domain of a vtkCellGrid.
Base class for a discontinuous Galerkin cells of all shapes.
Definition: vtkDGCell.h:36
virtual int GetNumberOfCorners() const
Return the number of corner points for this cell type.
Definition: vtkDGCell.h:71
represent and manipulate attribute data in a dataset
Represent a string by its integer hash.
A three-cornered face bounded by 3 edges.
Definition: vtkDGCell.h:47
A corner point.
Definition: vtkDGCell.h:45
A four-cornered face bounded by 4 edges.
Definition: vtkDGCell.h:48
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An eight-cornered volume; a quadrilateral prism.
Definition: vtkDGCell.h:50
Shape
All possible shapes for DG cells.
Definition: vtkDGCell.h:43
static int GetShapeCornerCount(Shape shape)
A curve connecting two vertices.
Definition: vtkDGCell.h:46
static int GetShapeDimension(Shape shape)