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