MeVisLab Toolbox Reference
WEMFaceDiagnosis.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, 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 FACE_SEVERITY_NOTICE = 1;
23const int FACE_SEVERITY_WARNING = 2;
24const int FACE_SEVERITY_ERROR = 3;
25const int FACE_SEVERITY_FATAL = 4;
26
28
31{
32public:
33
35 WEMFaceDiagnosis(bool hasEdges);
38
40 inline bool hasBadNormalLength() const { return _badNormalLength; }
42 inline bool isNeighborhoodNotSet() const { return _neighborhoodNotSet; }
44 inline bool hasNULLNode() const { return _nullNode; }
46 inline bool hasNULLEdge() const { return _nullEdge; }
48 inline bool isInvalid() const { return _invalid; }
50 inline bool hasEdgeOffset() const { return _edgeOffset; }
52 inline bool isConcave() const { return _concave; }
54 inline bool isNormalInverted() const { return _normalInverted; }
56 inline bool hasDoubleEntry() const { return _doubleEntry; }
58 inline bool hasNonConnected() const { return _nonConnected; }
60 inline bool hasZeroArea() const { return _zeroArea; }
61
63 inline int numNotices() const { return _numNotices; }
65 inline int numWarnings() const { return _numWarnings; }
67 inline int numErrors() const { return _numErrors; }
69 inline int numFatals() const { return _numFatals; }
70
72 inline bool isOk() const {
73 return (_numNotices == 0 && _numWarnings == 0 && _numErrors == 0 && _numFatals == 0);
74 }
76 inline std::string getErrorMessage() const { return _message; }
77
79 int getSeverity() const;
81 inline WEMFace* getFace() { return _face; }
83 inline const WEMFace* getFace() const { return _face; }
84
87
90 std::string message;
93
94private:
95
97 int _numNotices;
99 int _numWarnings;
101 int _numErrors;
103 int _numFatals;
104
106 WEMFace *_face;
107
109 bool _hasEdges;
110
112 std::string _message;
113
115 bool _badNormalLength;
117 bool _neighborhoodNotSet;
119 bool _nullNode;
121 bool _nullEdge;
123 bool _invalid;
125 bool _edgeOffset;
127 bool _concave;
129 bool _normalInverted;
131 bool _doubleEntry;
133 bool _nonConnected;
135 bool _zeroArea;
136};
137
139
#define MLWEM_EXPORT
Definition MLWEMSystem.h:18
This class provides diagnostic information on a WEMFace.
bool isConcave() const
Returns whether 'Concave' errors were found.
int getSeverity() const
Returns the severity of errors.
int numErrors() const
Returns the number of errors.
std::string getErrorMessage() const
Returns the error message.
bool selected
Is the face selected?
WEMFaceDiagnosis(bool hasEdges)
Standard constructor.
bool hasNULLNode() const
Returns whether 'NULL node' errors were found.
const WEMFace * getFace() const
Returns the face.
~WEMFaceDiagnosis()
Standard destructor.
bool hasNonConnected() const
Returns whether 'Non connected' errors were found.
bool isOk() const
Returns whether the face is ok.
WEMFace * getFace()
Returns the face.
int numNotices() const
Returns the number of notices.
bool hasNULLEdge() const
Returns whether 'NULL edge' errors were found.
bool isInvalid() const
Returns whether 'Invalid' error were found.
bool isNormalInverted() const
Returns whether 'Normal inverted' errors were found.
int numWarnings() const
Returns the number of warnings.
bool hasBadNormalLength() const
Returns whether 'Bad normal length' errors were found.
void checkIntegrity(WEMFace *face)
Checks the integrity of the given face.
bool hasEdgeOffset() const
Returns whether 'Edge offset' errors were found.
bool hasZeroArea() const
Returns whether 'Zero area' errors were found.
std::string message
Stuff used by SoWEMDiagnosis.
bool isNeighborhoodNotSet() const
Returns whether 'Neighborhood not set' errors were found.
bool hasDoubleEntry() const
Returns whether 'Double entry' errors were found.
int numFatals() const
Returns the number of fatals.
Defines the mesh component: face.
Definition WEMFace.h:30
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
const int FACE_SEVERITY_ERROR
Error status: an error.
const int FACE_SEVERITY_FATAL
Error status: a serious error.
const int FACE_SEVERITY_WARNING
Error status: a warning.
const int FACE_SEVERITY_ALLISWELL
Error status: no error at all.
const int FACE_SEVERITY_NOTICE
Error status: just a notice.