13 #ifndef mitkStdFunctionCommand_h
14 #define mitkStdFunctionCommand_h
19 #include <itkCommand.h>
58 m_StdFilterFunction = stdFunctionFilter;
68 m_StdActionFunction = stdFunctionAction;
77 void Execute(Object*,
const itk::EventObject& event)
override
79 if (m_StdFilterFunction && m_StdActionFunction)
81 if (m_StdFilterFunction(event))
83 m_StdActionFunction(event);
94 void Execute(
const Object*,
const itk::EventObject& event)
override
96 if (m_StdFilterFunction && m_StdActionFunction)
98 if (m_StdFilterFunction(event))
100 m_StdActionFunction(event);
110 : m_StdFilterFunction(nullptr)
111 , m_StdActionFunction(nullptr)
ITK command that uses std::function objects as filter and action callbacks.
void Execute(const Object *, const itk::EventObject &event) override
Execute the command for a const caller.
void SetCommandFilter(FilterFunction stdFunctionFilter)
Set the filter function that decides whether to handle an event.
std::function< void(const itk::EventObject &)> ActionFunction
Function type for the action to execute when the filter passes.
~StdFunctionCommand() override
FilterFunction m_StdFilterFunction
void Execute(Object *, const itk::EventObject &event) override
Execute the command for a non-const caller.
std::function< bool(const itk::EventObject &)> FilterFunction
Function type for filtering events. Returns true if the event should be handled.
ActionFunction m_StdActionFunction
void SetCommandAction(ActionFunction stdFunctionAction)
Set the action function to execute when the filter passes.
Find image slices visible on a given plane.