13 #ifndef mitkMultiLabelEvents_h
14 #define mitkMultiLabelEvents_h
16 #include <itkEventObject.h>
23 #define mitkMultiLabelEventMacroDeclaration(classname, super, IDType) \
24 class MITKMULTILABEL_EXPORT classname : public super \
27 using Self = classname; \
28 using Superclass = super; \
29 classname() = default; \
30 classname(IDType value); \
31 classname(const Self & s); \
32 virtual ~classname() override; \
33 virtual const char * \
34 GetEventName() const override; \
36 CheckEvent(const itk::EventObject * e) const override; \
37 virtual itk::EventObject * \
38 MakeObject() const override; \
42 operator=(const Self &); \
44 static_assert(true, "Compile time eliminated. Used to require a semi-colon at end of macro.")
46 #define mitkMultiLabelEventMacroDefinition(classname, super, IDType) \
47 classname::classname(const classname & s) \
49 classname::classname(IDType value): super(value) {} \
50 classname::~classname() {} \
51 const char * classname::GetEventName() const { return #classname; } \
52 bool classname::CheckEvent(const itk::EventObject * e) const \
54 if (!super::CheckEvent(e)) return false; \
55 return (dynamic_cast<const classname *>(e) != nullptr); \
57 itk::EventObject * classname::MakeObject() const { return new classname; } \
58 static_assert(true, "Compile time eliminated. Used to require a semi-colon at end of macro.")
77 const char * GetEventName()
const override;
78 bool CheckEvent(
const itk::EventObject * e)
const override;
79 itk::EventObject * MakeObject()
const override;
84 void operator=(
const Self &);
85 Label::PixelType m_LabelValue = std::numeric_limits<mitk::Label::PixelType>::max();
130 const char* GetEventName()
const override;
131 bool CheckEvent(
const itk::EventObject* e)
const override;
132 itk::EventObject* MakeObject()
const override;
134 void SetLabelValues(std::vector<Label::PixelType> labelValues);
135 std::vector<Label::PixelType> GetLabelValues()
const;
137 void operator=(
const Self&);
138 std::vector<Label::PixelType> m_LabelValues;
153 const static GroupIndexType ANY_GROUP = std::numeric_limits<GroupIndexType>::max();
159 const char* GetEventName()
const override;
160 bool CheckEvent(
const itk::EventObject* e)
const override;
161 itk::EventObject* MakeObject()
const override;
166 void operator=(
const Self&);
167 GroupIndexType m_GroupID = std::numeric_limits<GroupIndexType>::max();