VTK  9.0.1
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 =========================================================================*/
71 #ifndef vtkCellValidator_h
72 #define vtkCellValidator_h
73 
74 #include "vtkDataSetAlgorithm.h"
75 #include "vtkFiltersGeneralModule.h" // For export macro
76 
77 class vtkCell;
78 class vtkGenericCell;
79 class vtkEmptyCell;
80 class vtkVertex;
81 class vtkPolyVertex;
82 class vtkLine;
83 class vtkPolyLine;
84 class vtkTriangle;
85 class vtkTriangleStrip;
86 class vtkPolygon;
87 class vtkPixel;
88 class vtkQuad;
89 class vtkTetra;
90 class vtkVoxel;
91 class vtkHexahedron;
92 class vtkWedge;
93 class vtkPyramid;
94 class vtkPentagonalPrism;
95 class vtkHexagonalPrism;
96 class vtkQuadraticEdge;
98 class vtkQuadraticQuad;
100 class vtkQuadraticTetra;
102 class vtkQuadraticWedge;
103 class vtkQuadraticPyramid;
104 class vtkBiQuadraticQuad;
111 class vtkCubicLine;
112 class vtkConvexPointSet;
113 class vtkPolyhedron;
114 class vtkLagrangeCurve;
115 class vtkLagrangeTriangle;
117 class vtkLagrangeTetra;
119 class vtkLagrangeWedge;
120 class vtkBezierCurve;
121 class vtkBezierTriangle;
123 class vtkBezierTetra;
124 class vtkBezierHexahedron;
125 class vtkBezierWedge;
126 
127 class VTKFILTERSGENERAL_EXPORT vtkCellValidator : public vtkDataSetAlgorithm
128 {
129 public:
131  void PrintSelf(ostream& os, vtkIndent indent) override;
132 
133  // Description:
134  // Construct to compute the validity of cells.
135  static vtkCellValidator* New();
136 
137  enum State : short
138  {
139  Valid = 0x0,
140  WrongNumberOfPoints = 0x01,
141  IntersectingEdges = 0x02,
142  IntersectingFaces = 0x04,
143  NoncontiguousEdges = 0x08,
144  Nonconvex = 0x10,
145  FacesAreOrientedIncorrectly = 0x20,
146  };
147 
148  friend inline State operator&(State a, State b)
149  {
150  return static_cast<State>(static_cast<short>(a) & static_cast<short>(b));
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) { return a = a & b; }
157 
158  friend inline State& operator|=(State& a, State b) { return a = a | b; }
159 
160  static void PrintState(State state, ostream& os, vtkIndent indent);
161 
162  static State Check(vtkGenericCell*, double tolerance);
163  static State Check(vtkCell*, double tolerance);
164 
165  static State Check(vtkEmptyCell*, double tolerance);
166  static State Check(vtkVertex*, double tolerance);
167  static State Check(vtkPolyVertex*, double tolerance);
168  static State Check(vtkLine*, double tolerance);
169  static State Check(vtkPolyLine*, double tolerance);
170  static State Check(vtkTriangle*, double tolerance);
171  static State Check(vtkTriangleStrip*, double tolerance);
172  static State Check(vtkPolygon*, double tolerance);
173  static State Check(vtkPixel*, double tolerance);
174  static State Check(vtkQuad*, double tolerance);
175  static State Check(vtkTetra*, double tolerance);
176  static State Check(vtkVoxel*, double tolerance);
177  static State Check(vtkHexahedron*, double tolerance);
178  static State Check(vtkWedge*, double tolerance);
179  static State Check(vtkPyramid*, double tolerance);
180  static State Check(vtkPentagonalPrism*, double tolerance);
181  static State Check(vtkHexagonalPrism*, double tolerance);
182  static State Check(vtkQuadraticEdge*, double tolerance);
183  static State Check(vtkQuadraticTriangle*, double tolerance);
184  static State Check(vtkQuadraticQuad*, double tolerance);
185  static State Check(vtkQuadraticPolygon*, double tolerance);
186  static State Check(vtkQuadraticTetra*, double tolerance);
187  static State Check(vtkQuadraticHexahedron*, double tolerance);
188  static State Check(vtkQuadraticWedge*, double tolerance);
189  static State Check(vtkQuadraticPyramid*, double tolerance);
190  static State Check(vtkBiQuadraticQuad*, double tolerance);
191  static State Check(vtkTriQuadraticHexahedron*, double tolerance);
192  static State Check(vtkQuadraticLinearQuad*, double tolerance);
193  static State Check(vtkQuadraticLinearWedge*, double tolerance);
194  static State Check(vtkBiQuadraticQuadraticWedge*, double tolerance);
195  static State Check(vtkBiQuadraticQuadraticHexahedron*, double tolerance);
196  static State Check(vtkBiQuadraticTriangle*, double tolerance);
197  static State Check(vtkCubicLine*, double tolerance);
198  static State Check(vtkConvexPointSet*, double tolerance);
199  static State Check(vtkPolyhedron*, double tolerance);
200  static State Check(vtkLagrangeCurve*, double tolerance);
201  static State Check(vtkLagrangeTriangle*, double tolerance);
202  static State Check(vtkLagrangeQuadrilateral*, double tolerance);
203  static State Check(vtkLagrangeTetra*, double tolerance);
204  static State Check(vtkLagrangeHexahedron*, double tolerance);
205  static State Check(vtkLagrangeWedge*, double tolerance);
206  static State Check(vtkBezierCurve*, double tolerance);
207  static State Check(vtkBezierTriangle*, double tolerance);
208  static State Check(vtkBezierQuadrilateral*, double tolerance);
209  static State Check(vtkBezierTetra*, double tolerance);
210  static State Check(vtkBezierHexahedron*, double tolerance);
211  static State Check(vtkBezierWedge*, double tolerance);
212 
214 
219  vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
220  vtkGetMacro(Tolerance, double);
222 
223 protected:
225  ~vtkCellValidator() override {}
226 
227  double Tolerance;
228 
230 
231  static bool NoIntersectingEdges(vtkCell* cell, double tolerance);
232  static bool NoIntersectingFaces(vtkCell* cell, double tolerance);
233  static bool ContiguousEdges(vtkCell* twoDimensionalCell, double tolerance);
234  static bool Convex(vtkCell* cell, double tolerance);
235  static bool FacesAreOrientedCorrectly(vtkCell* threeDimensionalCell, double tolerance);
236 
237 private:
238  vtkCellValidator(const vtkCellValidator&) = delete;
239  void operator=(const vtkCellValidator&) = delete;
240 };
241 
242 #endif
vtkLagrangeWedge
A 3D cell that represents an arbitrary order Lagrange wedge.
Definition: vtkLagrangeWedge.h:56
vtkBezierQuadrilateral
Definition: vtkBezierQuadrilateral.h:39
vtkCellValidator::operator&=
friend State & operator&=(State &a, State b)
Definition: vtkCellValidator.h:156
vtkHexagonalPrism
a 3D cell that represents a prism with hexagonal base
Definition: vtkHexagonalPrism.h:45
vtkBezierTetra
A 3D cell that represents an arbitrary order Bezier tetrahedron.
Definition: vtkBezierTetra.h:43
vtkHexahedron
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:41
vtkConvexPointSet
a 3D cell defined by a set of convex points
Definition: vtkConvexPointSet.h:42
vtkBezierWedge
A 3D cell that represents an arbitrary order Bezier wedge.
Definition: vtkBezierWedge.h:57
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkEmptyCell
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:29
vtkBiQuadraticTriangle
cell represents a parabolic, isoparametric triangle
Definition: vtkBiQuadraticTriangle.h:48
vtkBezierCurve
Definition: vtkBezierCurve.h:38
vtkQuadraticTriangle
cell represents a parabolic, isoparametric triangle
Definition: vtkQuadraticTriangle.h:43
vtkDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
Definition: vtkDataSetAlgorithm.h:176
vtkQuadraticHexahedron
cell represents a parabolic, 20-node isoparametric hexahedron
Definition: vtkQuadraticHexahedron.h:45
vtkPyramid
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:43
vtkBiQuadraticQuadraticHexahedron
cell represents a biquadratic, 24-node isoparametric hexahedron
Definition: vtkBiQuadraticQuadraticHexahedron.h:80
vtkQuadraticQuad
cell represents a parabolic, 8-node isoparametric quad
Definition: vtkQuadraticQuad.h:43
vtkVertex
a cell that represents a 3D point
Definition: vtkVertex.h:30
vtkBezierHexahedron
A 3D cell that represents an arbitrary order Bezier hex.
Definition: vtkBezierHexahedron.h:48
vtkLine
cell represents a 1D line
Definition: vtkLine.h:29
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:48
vtkQuadraticPyramid
cell represents a parabolic, 13-node isoparametric pyramid
Definition: vtkQuadraticPyramid.h:52
vtkPentagonalPrism
a 3D cell that represents a convex prism with pentagonal base
Definition: vtkPentagonalPrism.h:53
vtkPolyLine
cell represents a set of 1D lines
Definition: vtkPolyLine.h:36
vtkBiQuadraticQuad
cell represents a parabolic, 9-node isoparametric quad
Definition: vtkBiQuadraticQuad.h:51
vtkQuadraticTetra
cell represents a parabolic, 10-node isoparametric tetrahedron
Definition: vtkQuadraticTetra.h:48
vtkWedge
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:43
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
vtkQuadraticWedge
cell represents a parabolic, 15-node isoparametric wedge
Definition: vtkQuadraticWedge.h:48
vtkQuadraticPolygon
a cell that represents a parabolic n-sided polygon
Definition: vtkQuadraticPolygon.h:43
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCubicLine
cell represents a cubic , isoparametric 1D line
Definition: vtkCubicLine.h:42
vtkLagrangeQuadrilateral
Definition: vtkLagrangeQuadrilateral.h:38
vtkDataSetAlgorithm::New
static vtkDataSetAlgorithm * New()
vtkLagrangeTriangle
A 2D cell that represents an arbitrary order Lagrange triangle.
Definition: vtkLagrangeTriangle.h:43
vtkQuadraticLinearWedge
cell represents a, 12-node isoparametric wedge
Definition: vtkQuadraticLinearWedge.h:52
vtkTriangle
a cell that represents a triangle
Definition: vtkTriangle.h:35
vtkCellValidator::State
State
Definition: vtkCellValidator.h:137
vtkTriQuadraticHexahedron
cell represents a parabolic, 27-node isoparametric hexahedron
Definition: vtkTriQuadraticHexahedron.h:82
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkCellValidator::Tolerance
double Tolerance
Definition: vtkCellValidator.h:227
vtkDataSetAlgorithm.h
vtkPixel
a cell that represents an orthogonal quadrilateral
Definition: vtkPixel.h:34
vtkCellValidator::operator|=
friend State & operator|=(State &a, State b)
Definition: vtkCellValidator.h:158
vtkLagrangeTetra
A 3D cell that represents an arbitrary order Lagrange tetrahedron.
Definition: vtkLagrangeTetra.h:44
vtkQuadraticLinearQuad
cell represents a quadratic-linear, 6-node isoparametric quad
Definition: vtkQuadraticLinearQuad.h:47
vtkCellValidator::operator|
friend State operator|(State a, State b)
Definition: vtkCellValidator.h:152
vtkDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCellValidator::operator&
friend State operator&(State a, State b)
Definition: vtkCellValidator.h:148
vtkCellValidator
validates cells in a dataset
Definition: vtkCellValidator.h:127
vtkBiQuadraticQuadraticWedge
cell represents a parabolic, 18-node isoparametric wedge
Definition: vtkBiQuadraticQuadraticWedge.h:53
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:36
vtkLagrangeCurve
Definition: vtkLagrangeCurve.h:37
vtkTetra
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:41
vtkLagrangeHexahedron
A 3D cell that represents an arbitrary order Lagrange hex.
Definition: vtkLagrangeHexahedron.h:47
vtkQuadraticEdge
cell represents a parabolic, isoparametric edge
Definition: vtkQuadraticEdge.h:40
vtkBezierTriangle
A 2D cell that represents an arbitrary order Bezier triangle.
Definition: vtkBezierTriangle.h:42
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
vtkPolyhedron
a 3D cell defined by a set of polygonal faces
Definition: vtkPolyhedron.h:57
vtkTriangleStrip
a cell that represents a triangle strip
Definition: vtkTriangleStrip.h:37
vtkQuad
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:35
vtkCellValidator::~vtkCellValidator
~vtkCellValidator() override
Definition: vtkCellValidator.h:225
vtkPolyVertex
cell represents a set of 0D vertices
Definition: vtkPolyVertex.h:32
vtkVoxel
a cell that represents a 3D orthogonal parallelepiped
Definition: vtkVoxel.h:38