MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLWEM/WEMBase/WEMPrimitive.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00011 #ifndef __WEMPrimitive_H
00012 #define __WEMPrimitive_H
00013 
00014 #include "MLWEMIncludes.h"
00015 
00016 ML_START_NAMESPACE
00017 
00019 #define WEM_TRAVERSED_BIT 16
00020 
00022 
00024 class MLWEM_EXPORT WEMPrimitive 
00025 {
00026 public:
00027 
00029   WEMPrimitive();
00031   WEMPrimitive(const WEMPrimitive &p);
00033   virtual ~WEMPrimitive();
00034 
00038   inline int getEntryNumber() const               { return _entryNumber; }
00040   inline void setEntryNumber(int e)               { _entryNumber = e; }
00042   inline bool isSet(unsigned int bit) const       { return ((_bitFlag & (1 << bit)) != 0); }
00044   inline void setFlag(unsigned int bit)           { _bitFlag |= (1 << bit); }
00046   inline void unsetFlag(unsigned int bit)         { _bitFlag &= (~(1 << bit)); }
00048   inline void clearFlag()                         { _bitFlag = 0; }
00050   inline bool isTraversed() const                 { return ((_bitFlag & (1 << WEM_TRAVERSED_BIT)) != 0); }
00052   void setTraversed(bool traversed);
00054   inline int getHeapPosition() const              { return _heapPosition; }
00056   inline bool inHeap() const                      { return (_heapPosition != -1); }
00058   inline void setHeapPosition(int heapPosition)   { _heapPosition = heapPosition; }
00060   inline double getHeapValue() const               { return _heapValue; }
00062   inline void setHeapValue(double heapValue)       { _heapValue = heapValue; }
00063 
00064 private:
00065 
00067   unsigned int _bitFlag;
00069   int _entryNumber;
00071   int _heapPosition;
00073   double _heapValue;
00074 
00075 };
00076 
00078 
00079 ML_END_NAMESPACE
00080 
00081 #endif // __WEMPrimitive_H