VTK  9.2.6
vtkCellValidator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCellValidator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
74 #ifndef vtkCellValidator_h
75 #define vtkCellValidator_h
76 
77 #include "vtkDataSetAlgorithm.h"
78 #include "vtkFiltersGeneralModule.h" // For export macro
79 
80 class vtkCell;
81 class vtkGenericCell;
82 class vtkEmptyCell;
83 class vtkVertex;
84 class vtkPolyVertex;
85 class vtkLine;
86 class vtkPolyLine;
87 class vtkTriangle;
88 class vtkTriangleStrip;
89 class vtkPolygon;
90 class vtkPixel;
91 class vtkQuad;
92 class vtkTetra;
93 class vtkVoxel;
94 class vtkHexahedron;
95 class vtkWedge;
96 class vtkPyramid;
97 class vtkPentagonalPrism;
98 class vtkHexagonalPrism;
99 class vtkQuadraticEdge;
101 class vtkQuadraticQuad;
102 class vtkQuadraticPolygon;
103 class vtkQuadraticTetra;
105 class vtkQuadraticWedge;
106 class vtkQuadraticPyramid;
107 class vtkBiQuadraticQuad;
115 class vtkCubicLine;
116 class vtkConvexPointSet;
117 class vtkPolyhedron;
118 class vtkLagrangeCurve;
119 class vtkLagrangeTriangle;
121 class vtkLagrangeTetra;
123 class vtkLagrangeWedge;
124 class vtkBezierCurve;
125 class vtkBezierTriangle;
127 class vtkBezierTetra;
128 class vtkBezierHexahedron;
129 class vtkBezierWedge;
130 
131 class VTKFILTERSGENERAL_EXPORT vtkCellValidator : public vtkDataSetAlgorithm
132 {
133 public:
135  void PrintSelf(ostream& os, vtkIndent indent) override;
136 
137  // Description:
138  // Construct to compute the validity of cells.
139  static vtkCellValidator* New();
140 
141  enum State : short
142  {
143  Valid = 0x0,
144  WrongNumberOfPoints = 0x01,
145  IntersectingEdges = 0x02,
146  IntersectingFaces = 0x04,
147  NoncontiguousEdges = 0x08,
148  Nonconvex = 0x10,
149  FacesAreOrientedIncorrectly = 0x20,
150  };
151 
152  friend inline State operator&(State a, State b)
153  {
154  return static_cast<State>(static_cast<short>(a) & static_cast<short>(b));
155  }
156  friend inline State operator|(State a, State b)
157  {
158  return static_cast<State>(static_cast<short>(a) | static_cast<short>(b));
159  }
160  friend inline State& operator&=(State& a, State b) { return a = a & b; }
161 
162  friend inline State& operator|=(State& a, State b) { return a = a | b; }
163 
164  static void PrintState(State state, ostream& os, vtkIndent indent);
165 
166  static State Check(vtkGenericCell*, double tolerance);
167  static State Check(vtkCell*, double tolerance);
168 
169  static State Check(vtkEmptyCell*, double tolerance);
170  static State Check(vtkVertex*, double tolerance);
171  static State Check(vtkPolyVertex*, double tolerance);
172  static State Check(vtkLine*, double tolerance);
173  static State Check(vtkPolyLine*, double tolerance);
174  static State Check(vtkTriangle*, double tolerance);
175  static State Check(vtkTriangleStrip*, double tolerance);
176  static State Check(vtkPolygon*, double tolerance);
177  static State Check(vtkPixel*, double tolerance);
178  static State Check(vtkQuad*, double tolerance);
179  static State Check(vtkTetra*, double tolerance);
180  static State Check(vtkVoxel*, double tolerance);
181  static State Check(vtkHexahedron*, double tolerance);
182  static State Check(vtkWedge*, double tolerance);
183  static State Check(vtkPyramid*, double tolerance);
184  static State Check(vtkPentagonalPrism*, double tolerance);
185  static State Check(vtkHexagonalPrism*, double tolerance);
186  static State Check(vtkQuadraticEdge*, double tolerance);
187  static State Check(vtkQuadraticTriangle*, double tolerance);
188  static State Check(vtkQuadraticQuad*, double tolerance);
189  static State Check(vtkQuadraticPolygon*, double tolerance);
190  static State Check(vtkQuadraticTetra*, double tolerance);
191  static State Check(vtkQuadraticHexahedron*, double tolerance);
192  static State Check(vtkQuadraticWedge*, double tolerance);
193  static State Check(vtkQuadraticPyramid*, double tolerance);
194  static State Check(vtkBiQuadraticQuad*, double tolerance);
195  static State Check(vtkTriQuadraticHexahedron*, double tolerance);
196  static State Check(vtkTriQuadraticPyramid*, double tolerance);
197  static State Check(vtkQuadraticLinearQuad*, double tolerance);
198  static State Check(vtkQuadraticLinearWedge*, double tolerance);
199  static State Check(vtkBiQuadraticQuadraticWedge*, double tolerance);
200  static State Check(vtkBiQuadraticQuadraticHexahedron*, double tolerance);
201  static State Check(vtkBiQuadraticTriangle*, double tolerance);
202  static State Check(vtkCubicLine*, double tolerance);
203  static State Check(vtkConvexPointSet*, double tolerance);
204  static State Check(vtkPolyhedron*, double tolerance);
205  static State Check(vtkLagrangeCurve*, double tolerance);
206  static State Check(vtkLagrangeTriangle*, double tolerance);
207  static State Check(vtkLagrangeQuadrilateral*, double tolerance);
208  static State Check(vtkLagrangeTetra*, double tolerance);
209  static State Check(vtkLagrangeHexahedron*, double tolerance);
210  static State Check(vtkLagrangeWedge*, double tolerance);
211  static State Check(vtkBezierCurve*, double tolerance);
212  static State Check(vtkBezierTriangle*, double tolerance);
213  static State Check(vtkBezierQuadrilateral*, double tolerance);
214  static State Check(vtkBezierTetra*, double tolerance);
215  static State Check(vtkBezierHexahedron*, double tolerance);
216  static State Check(vtkBezierWedge*, double tolerance);
217 
219 
224  vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
225  vtkGetMacro(Tolerance, double);
227 
228 protected:
230  ~vtkCellValidator() override = default;
231 
232  double Tolerance;
233 
235 
236  static bool NoIntersectingEdges(vtkCell* cell, double tolerance);
237  static bool NoIntersectingFaces(vtkCell* cell, double tolerance);
238  static bool ContiguousEdges(vtkCell* twoDimensionalCell, double tolerance);
239  static bool Convex(vtkCell* cell, double tolerance);
240  static bool FacesAreOrientedCorrectly(vtkCell* threeDimensionalCell, double tolerance);
241 
242 private:
243  vtkCellValidator(const vtkCellValidator&) = delete;
244  void operator=(const vtkCellValidator&) = delete;
245 };
246 
247 #endif
cell represents a parabolic, 13-node isoparametric pyramid
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
friend State operator&(State a, State b)
Store vtkAlgorithm input/output information.
a cell that represents a 3D point
Definition: vtkVertex.h:33
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:46
a cell that represents an orthogonal quadrilateral
Definition: vtkPixel.h:37
cell represents a parabolic, 9-node isoparametric quad
friend State operator|(State a, State b)
A 2D cell that represents an arbitrary order Bezier triangle.
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:38
A 3D cell that represents an arbitrary order Bezier hex.
cell represents a parabolic, 19-node isoparametric pyramid
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:32
cell represents a set of 0D vertices
Definition: vtkPolyVertex.h:35
A 3D cell that represents an arbitrary order Lagrange tetrahedron.
cell represents a parabolic, 18-node isoparametric wedge
provides thread-safe access to cells
cell represents a biquadratic, 24-node isoparametric hexahedron
a 3D cell that represents a prism with hexagonal base
cell represents a cubic , isoparametric 1D line
Definition: vtkCubicLine.h:45
friend State & operator|=(State &a, State b)
friend State & operator&=(State &a, State b)
a cell that represents a triangle strip
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:44
a 3D cell that represents a convex prism with pentagonal base
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
cell represents a 1D line
Definition: vtkLine.h:33
abstract class to specify cell behavior
Definition: vtkCell.h:60
A 3D cell that represents an arbitrary order Lagrange wedge.
a cell that represents a 3D orthogonal parallelepiped
Definition: vtkVoxel.h:41
A 2D cell that represents an arbitrary order Lagrange triangle.
cell represents a parabolic, 8-node isoparametric quad
a simple class to control print indentation
Definition: vtkIndent.h:39
A 3D cell that represents an arbitrary order Bezier tetrahedron.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:42
validates cells in a dataset
cell represents a parabolic, isoparametric triangle
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:44
cell represents a parabolic, 10-node isoparametric tetrahedron
a 3D cell defined by a set of convex points
A 3D cell that represents an arbitrary order Bezier wedge.
cell represents a parabolic, 27-node isoparametric hexahedron
a cell that represents a parabolic n-sided polygon
cell represents a parabolic, isoparametric edge
a cell that represents a triangle
Definition: vtkTriangle.h:38
cell represents a parabolic, 20-node isoparametric hexahedron
cell represents a parabolic, isoparametric triangle
cell represents a parabolic, 15-node isoparametric wedge
Store zero or more vtkInformation instances.
a 3D cell defined by a set of polygonal faces
Definition: vtkPolyhedron.h:60
Superclass for algorithms that produce output of the same type as input.
A 3D cell that represents an arbitrary order Lagrange hex.
cell represents a, 12-node isoparametric wedge
static vtkDataSetAlgorithm * New()
cell represents a quadratic-linear, 6-node isoparametric quad
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:46
cell represents a set of 1D lines
Definition: vtkPolyLine.h:39