MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
WEMPatchDiagnosis.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2010, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#pragma once
14
16
18
20
22const int PATCH_SEVERITY_NOTICE = 1;
24const int PATCH_SEVERITY_ERROR = 3;
25const int PATCH_SEVERITY_FATAL = 4;
26
28
31{
32public:
34 {
35 WEMPosition(const Vector3& v, int index) noexcept
36 : m_x(v[0])
37 , m_y(v[1])
38 , m_z(v[2])
39 , m_manhattanDistToOrigin(std::abs(m_x) + std::abs(m_y) + std::abs(m_z))
40 , m_nodeIndex(index)
41 {}
42
43 double x() const noexcept
44 {
45 return m_x;
46 }
47 double y() const noexcept
48 {
49 return m_y;
50 }
51 double z() const noexcept
52 {
53 return m_z;
54 }
56 {
57 return m_manhattanDistToOrigin;
58 }
60 {
61 return m_nodeIndex;
62 }
63
64 private:
65 double m_x;
66 double m_y;
67 double m_z;
68 double m_manhattanDistToOrigin;
69 int m_nodeIndex;
70 };
71
73 WEMPatchDiagnosis(bool hasEdges);
76
78 inline bool hasDuplicateNodes() const
79 {
80 return (_duplicateNodes > 0);
81 }
83 inline int numDuplicateNodes() const
84 {
85 return _duplicateNodes;
86 }
88 inline bool hasHoles() const
89 {
90 return (_holes > 0);
91 }
93 inline int numHoles() const
94 {
95 return _holes;
96 }
98 inline bool hasNonCloseableHoles() const
99 {
100 return (_nonCloseableHoles > 0);
101 }
103 inline int numNonCloseableHoles() const
104 {
105 return _nonCloseableHoles;
106 }
108 inline bool isInverted() const
109 {
110 return _inverted;
111 }
112
114 inline int numNotices() const
115 {
116 return _numNotices;
117 }
119 inline int numWarnings() const
120 {
121 return _numWarnings;
122 }
124 inline int numErrors() const
125 {
126 return _numErrors;
127 }
129 inline int numFatals() const
130 {
131 return _numFatals;
132 }
133
135 inline bool isOk() const
136 {
137 return (_numNotices == 0 && _numWarnings == 0 && _numErrors == 0 && _numFatals == 0);
138 }
140 inline std::string getErrorMessage() const
141 {
142 return _message;
143 }
144
146 int getSeverity() const;
149 {
150 return _patch;
151 }
153 inline const WEMPatch* getPatch() const
154 {
155 return _patch;
156 }
157
160
163 std::string message;
166
167private:
169 int _numNotices;
171 int _numWarnings;
173 int _numErrors;
175 int _numFatals;
176
178 WEMPatch* _patch;
179
181 bool _hasEdges;
182
184 std::string _message;
185
187 int _duplicateNodes;
189 int _holes;
191 int _nonCloseableHoles;
193 bool _inverted;
194};
195
197
#define MLWEM_EXPORT
Definition MLWEMSystem.h:18
This class provides diagnostic information on a WEMNode.
int numFatals() const
Returns the number of fatals.
WEMPatchDiagnosis(bool hasEdges)
Standard constructor.
std::string getErrorMessage() const
Returns the error message.
void checkIntegrity(WEMPatch *patch)
Checks the integrity of the given patch.
bool hasNonCloseableHoles() const
Returns whether 'Non-closeable holes' errors were found.
bool selected
Is the node selected.
std::string message
Stuff used by SoWEMDiagnosis.
int numDuplicateNodes() const
Returns whether 'Get amount of duplicate nodes' errors were found.
int numHoles() const
Returns the number of found holes.
int numWarnings() const
Returns the number of warnings.
bool hasDuplicateNodes() const
Returns whether 'Duplicate nodes' errors were found.
WEMPatch * getPatch()
Returns the patch.
bool isOk() const
Returns whether the patch is ok.
bool isInverted() const
Returns whether the patch is inverted.
int getSeverity() const
Returns the severity of errors.
int numErrors() const
Returns the number of errors.
const WEMPatch * getPatch() const
Returns the patch.
int numNonCloseableHoles() const
Returns the number of non-closeable holes.
int numNotices() const
Returns the number of notices.
bool hasHoles() const
Returns whether Get 'Holes' errors were found.
~WEMPatchDiagnosis()
Standard destructor.
Base class for triangle and quad patches.
Definition WEMPatch.h:61
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
const int PATCH_SEVERITY_WARNING
Error status: a warning.
const int PATCH_SEVERITY_ALLISWELL
Error status: no error at all.
const int PATCH_SEVERITY_ERROR
Error status: an error.
const int PATCH_SEVERITY_NOTICE
Error status: just a notice.
const int PATCH_SEVERITY_FATAL
Error status: a serious error.
WEMPosition(const Vector3 &v, int index) noexcept
double manhattanDistToOrigin() const noexcept