MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLWEM/WEMTools/WEMDiagnostics/WEMNodeDiagnosis.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00011 #ifndef __WEMNodeDiagnosis_H
00012 #define __WEMNodeDiagnosis_H
00013 
00014 #include "WEMTools/WEMToolsIncludes.h"
00015 
00016 
00017 ML_START_NAMESPACE
00018 
00020 
00021 const int NODE_SEVERITY_ALLISWELL = 0; 
00022 const int NODE_SEVERITY_NOTICE    = 1; 
00023 const int NODE_SEVERITY_WARNING   = 2; 
00024 const int NODE_SEVERITY_ERROR     = 3; 
00025 const int NODE_SEVERITY_FATAL     = 4; 
00026 
00028 
00030 class MLWEM_EXPORT WEMNodeDiagnosis
00031 {
00032 
00033 public:
00034 
00036   WEMNodeDiagnosis(bool hasEdges);
00038   ~WEMNodeDiagnosis();
00039 
00041   inline bool hasDoubleEntry() const { return _doubleEntry; }
00043   inline bool hasNonConnected() const { return _nonConnected; }
00045   inline bool isBoundary() const { return _boundary; }
00047   inline bool isOrphan() const { return _orphan; }
00049   inline bool isRedundant() const { return _redundant; }
00051   inline bool isCollinear() const { return _collinear; }
00053   inline bool hasBadNormalLength() const { return _badNormalLength; }
00055   inline bool isDeadEnd() const { return _deadEnd; }
00057   inline bool isFlatRegion() const { return _flatRegion; }
00059   inline bool isNeighborhoodNotSet() const { return _neighborhoodNotSet; }
00061   inline bool hasValence3() const { return _valence3; }
00062 
00064   inline int numNotices() const { return _numNotices; }
00066   inline int numWarnings() const { return _numWarnings; }
00068   inline int numErrors() const { return _numErrors; }
00070   inline int numFatals() const { return _numFatals; }
00071 
00073   inline bool isOk() const {
00074     return (_numNotices == 0 && _numWarnings == 0 && _numErrors == 0 && _numFatals == 0);
00075   }
00077   inline std::string getErrorMessage() const { return _message; }
00078 
00080   int getSeverity() const;
00082   inline WEMNode* getNode() { return _node; }
00084   inline const WEMNode* getNode() const { return _node; }
00085 
00087   void checkIntegrity(WEMNode *node);
00088 
00091   std::string message;
00093   bool selected;
00094 
00095 private:
00096 
00098   int _numNotices;
00100   int _numWarnings;
00102   int _numErrors;
00104   int _numFatals;
00105 
00107   WEMNode *_node;
00108 
00110   bool _hasEdges;
00111 
00113   std::string _message;
00114 
00116   bool _doubleEntry;
00118   bool _nonConnected;
00120   bool _boundary;
00122   bool _orphan;
00124   bool _redundant;
00126   bool _collinear;
00128   bool _badNormalLength;
00130   bool _deadEnd;
00132   bool _flatRegion;
00134   bool _neighborhoodNotSet;
00136   bool _valence3;
00137 };
00138 
00140 
00141 ML_END_NAMESPACE
00142 
00143 #endif // __WEMNodeDiagnosis_H