MeVisLab Toolbox Reference
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
17ML_START_NAMESPACE
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 double x;
36 double y;
37 double z;
40 WEMPosition(const Vector3& v, int index)
41 {
42 x = v[0];
43 y = v[1];
44 z = v[2];
45 nodeIndex = index;
46 manhattanDistToOrigin = fabs(x) + fabs(y) + fabs(z);
47 }
48
49 WEMPosition(const WEMPosition& v) = default;
50 };
51
53 WEMPatchDiagnosis(bool hasEdges);
56
58 inline bool hasDuplicateNodes() const { return (_duplicateNodes > 0); }
60 inline int numDuplicateNodes() const { return _duplicateNodes; }
62 inline bool hasHoles() const { return (_holes > 0); }
64 inline int numHoles() const { return _holes; }
66 inline bool hasNonCloseableHoles() const { return (_nonCloseableHoles > 0); }
68 inline int numNonCloseableHoles() const { return _nonCloseableHoles; }
70 inline bool isInverted() const { return _inverted; }
71
73 inline int numNotices() const { return _numNotices; }
75 inline int numWarnings() const { return _numWarnings; }
77 inline int numErrors() const { return _numErrors; }
79 inline int numFatals() const { return _numFatals; }
80
82 inline bool isOk() const {
83 return (_numNotices == 0 && _numWarnings == 0 && _numErrors == 0 && _numFatals == 0);
84 }
86 inline std::string getErrorMessage() const { return _message; }
87
89 int getSeverity() const;
91 inline WEMPatch* getPatch() { return _patch; }
93 inline const WEMPatch* getPatch() const { return _patch; }
94
97
100 std::string message;
103
104private:
105
107 int _numNotices;
109 int _numWarnings;
111 int _numErrors;
113 int _numFatals;
114
116 WEMPatch *_patch;
117
119 bool _hasEdges;
120
122 std::string _message;
123
125 int _duplicateNodes;
127 int _holes;
129 int _nonCloseableHoles;
131 bool _inverted;
132};
133
135
136ML_END_NAMESPACE
#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
long double fabs(__int64 i)
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 WEMPosition &v)=default
WEMPosition(const Vector3 &v, int index)