NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Member Functions | Protected Member Functions | List of all members
niftk::ToolKeyPressStateMachine Class Reference
Inheritance diagram for niftk::ToolKeyPressStateMachine:
Inheritance graph
[legend]
Collaboration diagram for niftk::ToolKeyPressStateMachine:
Collaboration graph
[legend]

Public Member Functions

 mitkClassMacro (ToolKeyPressStateMachine, mitk::EventStateMachine) mitkNewMacro1Param(Self
 
ToolKeyPressResponder *virtual void Notify (mitk::InteractionEvent *interactionEvent, bool isHandled) override
 
- Public Member Functions inherited from niftk::FilteringStateMachine
 FilteringStateMachine ()
 Constructs a FilteringStateMachine object. More...
 
virtual ~FilteringStateMachine ()
 Destructs the FilteringStateMachine object. More...
 
float CanHandleEvent (const mitk::StateEvent *event) const
 This function is to replace the original CanHandleEvent function to support event filtering. More...
 
bool CanHandleEvent (mitk::InteractionEvent *event)
 
virtual void InstallEventFilter (StateMachineEventFilter *eventFilter)
 Installs an event filter that can reject a state machine event or let it pass through. More...
 
virtual void RemoveEventFilter (StateMachineEventFilter *eventFilter)
 Removes an event filter that can reject a state machine event or let it pass through. More...
 
std::vector
< StateMachineEventFilter * > 
GetEventFilters () const
 Gets the list of the installed event filters. More...
 
bool IsFiltered (const mitk::StateEvent *stateEvent) const
 Tells if the event is rejected by the installed event filters or they let it pass through. More...
 
bool IsFiltered (mitk::InteractionEvent *event)
 Tells if the event is rejected by the installed event filters or they let it pass through. More...
 

Protected Member Functions

 ToolKeyPressStateMachine (ToolKeyPressResponder *responder)
 Purposely hidden, protected constructor, so class is instantiated via static ::New() macro, where we pass in the state machine pattern name, and also the object to pass the data onto. More...
 
virtual ~ToolKeyPressStateMachine ()
 Purposely hidden, destructor. More...
 
virtual void ConnectActionsAndFunctions () override
 Connects state machine actions to functions. More...
 
virtual bool FilterEvents (mitk::InteractionEvent *event, mitk::DataNode *dataNode) override
 Tells if this tool can handle the given event. More...
 
bool SelectSeedTool (mitk::StateMachineAction *action, mitk::InteractionEvent *event)
 
bool SelectDrawTool (mitk::StateMachineAction *action, mitk::InteractionEvent *event)
 
bool UnselectTools (mitk::StateMachineAction *action, mitk::InteractionEvent *event)
 
bool SelectPolyTool (mitk::StateMachineAction *action, mitk::InteractionEvent *event)
 
bool SelectViewMode (mitk::StateMachineAction *action, mitk::InteractionEvent *event)
 
bool CleanSlice (mitk::StateMachineAction *action, mitk::InteractionEvent *event)
 
- Protected Member Functions inherited from niftk::FilteringStateMachine
virtual float CanHandle (const mitk::StateEvent *stateEvent) const
 
virtual bool CanHandle (mitk::InteractionEvent *event)
 

Constructor & Destructor Documentation

niftk::ToolKeyPressStateMachine::ToolKeyPressStateMachine ( ToolKeyPressResponder responder)
protected

Purposely hidden, protected constructor, so class is instantiated via static ::New() macro, where we pass in the state machine pattern name, and also the object to pass the data onto.

niftk::ToolKeyPressStateMachine::~ToolKeyPressStateMachine ( )
protectedvirtual

Purposely hidden, destructor.

Member Function Documentation

bool niftk::ToolKeyPressStateMachine::CleanSlice ( mitk::StateMachineAction *  action,
mitk::InteractionEvent *  event 
)
protected
void niftk::ToolKeyPressStateMachine::ConnectActionsAndFunctions ( )
overrideprotectedvirtual

Connects state machine actions to functions.

bool niftk::ToolKeyPressStateMachine::FilterEvents ( mitk::InteractionEvent *  event,
mitk::DataNode *  dataNode 
)
overrideprotectedvirtual

Tells if this tool can handle the given event.

This implementation delegates the call to FilteringStateMachine::CanHandleEvent(), that checks if the event is filtered by one of the installed event filters and if not, calls CanHandle() and returns with its result.

Note that this function is purposefully not virtual. Eventual subclasses should override the CanHandle function.

niftk::ToolKeyPressStateMachine::mitkClassMacro ( ToolKeyPressStateMachine  ,
mitk::EventStateMachine   
)
void niftk::ToolKeyPressStateMachine::Notify ( mitk::InteractionEvent *  interactionEvent,
bool  isHandled 
)
overridevirtual

By this function the Observer gets notified about new events. Here it is adapted to pass the events to the state machine in order to use its infrastructure. It also checks if event is to be accepted when it already has been processed by a DataInteractor.

bool niftk::ToolKeyPressStateMachine::SelectDrawTool ( mitk::StateMachineAction *  action,
mitk::InteractionEvent *  event 
)
protected
bool niftk::ToolKeyPressStateMachine::SelectPolyTool ( mitk::StateMachineAction *  action,
mitk::InteractionEvent *  event 
)
protected
bool niftk::ToolKeyPressStateMachine::SelectSeedTool ( mitk::StateMachineAction *  action,
mitk::InteractionEvent *  event 
)
protected
bool niftk::ToolKeyPressStateMachine::SelectViewMode ( mitk::StateMachineAction *  action,
mitk::InteractionEvent *  event 
)
protected
bool niftk::ToolKeyPressStateMachine::UnselectTools ( mitk::StateMachineAction *  action,
mitk::InteractionEvent *  event 
)
protected

The documentation for this class was generated from the following files: