MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLWEM/WEMTools/WEMDiagnostics/WEMEdgeDiagnosis.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00011 #ifndef __WEMEdgeDiagnosis_H
00012 #define __WEMEdgeDiagnosis_H
00013 
00014 #include "WEMTools/WEMToolsIncludes.h"
00015 
00016 
00017 ML_START_NAMESPACE
00018 
00020 
00021 const int EDGE_SEVERITY_ALLISWELL = 0; 
00022 const int EDGE_SEVERITY_NOTICE    = 1; 
00023 const int EDGE_SEVERITY_WARNING   = 2; 
00024 const int EDGE_SEVERITY_ERROR     = 3; 
00025 const int EDGE_SEVERITY_FATAL     = 4; 
00026 
00028 
00030 class MLWEM_EXPORT WEMEdgeDiagnosis
00031 {
00032 
00033 public:
00034 
00036   WEMEdgeDiagnosis();
00038   ~WEMEdgeDiagnosis();
00039 
00041   inline bool hasNULLHead() const { return _headNull; }
00043   inline bool hasNULLTail() const { return _tailNull; }
00045   inline bool isNeighborhoodNotSet() const { return _neighborhoodNotSet; }
00047   inline bool isBoundary() const { return _boundary; }
00049   inline bool hasEqualPointer() const { return _equalPointer; }
00051   inline bool hasNULLPointer() const { return _nullPointer; }
00053   inline bool hasNonConnectedPointer() const { return _edgePointerNotConnected; }
00055   inline bool hasIncorrectlyLinkedPointer() const { return _edgePointerLink; }
00057   inline bool hasWrongOrder() const { return _order; }
00059   inline bool hasCircularPointer() const { return _circularPointer; }
00061   inline bool hasZeroLength() const { return _zeroLength; }
00063   inline bool hasFold() const { return _fold; }
00064 
00066   inline int numNotices() const { return _numNotices; }
00068   inline int numWarnings() const { return _numWarnings; }
00070   inline int numErrors() const { return _numErrors; }
00072   inline int numFatals() const { return _numFatals; }
00073 
00075   inline bool isOk() const {
00076     return (_numNotices == 0 && _numWarnings == 0 && _numErrors == 0 && _numFatals == 0);
00077   }
00079   inline std::string getErrorMessage() const { return _message; }
00080 
00082   int getSeverity() const;
00084   inline WEMEdge* getEdge() { return _edge; }
00086   inline const WEMEdge* getEdge() const { return _edge; }
00087 
00089   void checkIntegrity(WEMEdge* edge);
00090 
00093   std::string message;
00095   bool selected;
00096 
00097 
00098 private:
00099 
00101   int _numNotices;
00103   int _numWarnings;
00105   int _numErrors;
00107   int _numFatals;
00108 
00110   WEMEdge *_edge;
00111 
00113   bool _hasEdges;
00114 
00116   std::string _message;
00117 
00118 
00120   bool _headNull;
00122   bool _tailNull;
00124   bool _neighborhoodNotSet;
00126   bool _boundary;
00128   bool _equalPointer;
00130   bool _nullPointer;
00132   bool _edgePointerNotConnected;
00134   bool _edgePointerLink;
00136   bool _order;
00138   bool _circularPointer;
00140   bool _zeroLength;
00142   bool _fold;    
00143 };
00144 
00146 
00147 ML_END_NAMESPACE
00148 
00149 #endif // __WEMEdgeDiagnosis_H