VTK  9.5.20251126
vtkCellStatus.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
3#ifndef vtkCellStatus_h
4#define vtkCellStatus_h
5
6#include "vtkCommonDataModelModule.h" // For export macro
7
8#include <ostream>
9
10VTK_ABI_NAMESPACE_BEGIN
11
29
30inline bool operator!=(short a, vtkCellStatus b)
31{
32 return a != static_cast<short>(b);
33}
34
35inline bool operator==(short a, vtkCellStatus b)
36{
37 return a == static_cast<short>(b);
38}
39
40inline bool operator!=(vtkCellStatus a, short b)
41{
42 return static_cast<short>(a) != b;
43}
44
45inline bool operator==(vtkCellStatus a, short b)
46{
47 return static_cast<short>(a) == b;
48}
49
51{
52 return static_cast<vtkCellStatus>(static_cast<short>(a) & static_cast<short>(b));
53}
54
56{
57 return static_cast<vtkCellStatus>(static_cast<short>(a) | static_cast<short>(b));
58}
59
61{
62 a = static_cast<vtkCellStatus>(static_cast<short>(a) & static_cast<short>(b));
63 return a;
64}
65
67{
68 a = static_cast<vtkCellStatus>(static_cast<short>(a) | static_cast<short>(b));
69 return a;
70}
71
72inline bool operator!(const vtkCellStatus& s)
73{
74 return s != vtkCellStatus::Valid;
75}
76
77inline std::ostream& operator<<(std::ostream& os, vtkCellStatus state)
78{
79 if (state == vtkCellStatus::Valid)
80 {
81 os << "valid";
82 }
83 else
84 {
85 bool comma = false;
86 os << "invalid(";
88 {
89 os << "too few points";
90 comma = true;
91 }
93 {
94 if (comma)
95 {
96 os << ", ";
97 }
98 os << "intersecting edges";
99 comma = true;
100 }
102 {
103 if (comma)
104 {
105 os << ", ";
106 }
107 os << "intersecting faces";
108 comma = true;
109 }
111 {
112 if (comma)
113 {
114 os << ", ";
115 }
116 os << "noncontiguous edges";
117 comma = true;
118 }
120 {
121 if (comma)
122 {
123 os << ", ";
124 }
125 os << "nonconvex";
126 comma = true;
127 }
130 {
131 if (comma)
132 {
133 os << ", ";
134 }
135 os << "misoriented faces";
136 comma = true;
137 }
139 {
140 if (comma)
141 {
142 os << ", ";
143 }
144 os << "non-planar faces";
145 }
147 {
148 if (comma)
149 {
150 os << ", ";
151 }
152 os << "degenerate faces";
153 }
155 {
156 if (comma)
157 {
158 os << ", ";
159 }
160 os << "coincident points";
161 }
162 os << ")";
163 }
164 return os;
165}
166
167VTK_ABI_NAMESPACE_END
168#endif // vtkCellStatus_h
169// VTK-HeaderTest-Exclude: vtkCellStatus.h
vtkCellStatus & operator|=(vtkCellStatus &a, vtkCellStatus b)
bool operator==(short a, vtkCellStatus b)
vtkCellStatus
Diagnostic values indicating how well-specified a cell is.
@ DegenerateFaces
A face is collapsed to a line or a point.
@ CoincidentPoints
A cell is otherwise valid but has coincident points.
@ IntersectingFaces
Faces of a volume self-intersect.
@ NoncontiguousEdges
Edge vertices are not ordered head-to-tail.
@ Valid
Cell is in a good state.
@ WrongNumberOfPoints
Lines have <2 points, faces <3.
@ Nonconvex
The cell has a concavity.
@ NonPlanarFaces
Vertices for a face do not all lie in the same plane.
@ FacesAreOrientedIncorrectly
All faces should have CCW windings.
@ IntersectingEdges
Edges of a face self-intersect.
bool operator!=(short a, vtkCellStatus b)
vtkCellStatus operator|(vtkCellStatus a, vtkCellStatus b)
vtkCellStatus & operator&=(vtkCellStatus &a, vtkCellStatus b)
bool operator!(const vtkCellStatus &s)
std::ostream & operator<<(std::ostream &os, vtkCellStatus state)
vtkCellStatus operator&(vtkCellStatus a, vtkCellStatus b)