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.")
99 bool CheckEvent(
const itk::EventObject * e)
const override;
116 void operator=(
const Self &);
117 Label::PixelType m_LabelValue = std::numeric_limits<mitk::Label::PixelType>::max();
198 void operator=(
const Self&);
199 std::vector<Label::PixelType> m_LabelValues;
220 const static GroupIndexType ANY_GROUP = std::numeric_limits<GroupIndexType>::max();
260 void operator=(
const Self&);
261 GroupIndexType m_GroupID = std::numeric_limits<GroupIndexType>::max();
#define MITKMULTILABEL_EXPORT
Base event class for all group-related events in a MultiLabelSegmentation.
~AnyGroupEvent() override
itk::ModifiedEvent Superclass
bool CheckEvent(const itk::EventObject *e) const override
Checks if a given event matches this event type and group index.
const char * GetEventName() const override
Returns the name of this event class.
AnyGroupEvent(GroupIndexType groupID)
Constructor with a specific group index.
itk::EventObject * MakeObject() const override
Creates a copy of this event.
AnyGroupEvent(const Self &s)
Copy constructor.
void SetGroupID(GroupIndexType groupID)
Sets the group index this event refers to.
GroupIndexType GetGroupID() const
Returns the group index this event refers to.
std::size_t GroupIndexType
Type for group indices.
Base event class for all label-related events in a MultiLabelSegmentation.
Label::PixelType GetLabelValue() const
Returns the label value this event refers to.
itk::EventObject * MakeObject() const override
Creates a copy of this event.
~AnyLabelEvent() override
bool CheckEvent(const itk::EventObject *e) const override
Checks if a given event matches this event type and label value.
AnyLabelEvent(const Self &s)
Copy constructor.
void SetLabelValue(Label::PixelType labelValue)
Sets the label value this event refers to.
AnyLabelEvent(Label::PixelType labelValue)
Constructor with a specific label value.
const char * GetEventName() const override
Returns the name of this event class.
itk::ModifiedEvent Superclass
unsigned short PixelType
Pixel type used for label values (unsigned short).
Event emitted once after a batch of label changes in a MultiLabelSegmentation.
const char * GetEventName() const override
Returns the name of this event class.
LabelsChangedEvent()=default
std::vector< Label::PixelType > GetLabelValues() const
Returns the label values this event refers to.
~LabelsChangedEvent() override
itk::ModifiedEvent Superclass
LabelsChangedEvent(std::vector< Label::PixelType > labelValues)
Constructor with a vector of affected label values.
LabelsChangedEvent(const Self &s)
Copy constructor.
itk::EventObject * MakeObject() const override
Creates a copy of this event.
bool CheckEvent(const itk::EventObject *e) const override
Checks if a given event matches this event type.
void SetLabelValues(std::vector< Label::PixelType > labelValues)
Sets the label values this event refers to.
#define mitkMultiLabelEventMacroDeclaration(classname, super, IDType)
Find image slices visible on a given plane.