NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkToolKeyPressStateMachine.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkToolKeyPressStateMachine_h
16 #define niftkToolKeyPressStateMachine_h
17 
18 #include "niftkMIDASExports.h"
19 
20 #include <mitkInteractionEventObserver.h>
21 #include <mitkStateMachine.h>
22 
23 #include <usServiceRegistration.h>
24 
27 
28 namespace niftk
29 {
30 
36 class NIFTKMIDAS_EXPORT ToolKeyPressStateMachine : public mitk::EventStateMachine, public mitk::InteractionEventObserver, public FilteringStateMachine
37 {
38 
39 public:
40  mitkClassMacro(ToolKeyPressStateMachine, mitk::EventStateMachine) // this creates the Self typedef
41  mitkNewMacro1Param(Self, ToolKeyPressResponder*)
42 
43 
49  virtual void Notify(mitk::InteractionEvent* interactionEvent, bool isHandled) override;
50 
51 protected:
52 
55 
57  virtual ~ToolKeyPressStateMachine();
58 
60  virtual void ConnectActionsAndFunctions() override;
61 
70  virtual bool FilterEvents(mitk::InteractionEvent* event, mitk::DataNode* dataNode) override;
71 
73  bool SelectSeedTool(mitk::StateMachineAction* action, mitk::InteractionEvent* event);
74 
76  bool SelectDrawTool(mitk::StateMachineAction* action, mitk::InteractionEvent* event);
77 
79  bool UnselectTools(mitk::StateMachineAction* action, mitk::InteractionEvent* event);
80 
82  bool SelectPolyTool(mitk::StateMachineAction* action, mitk::InteractionEvent* event);
83 
85  bool SelectViewMode(mitk::StateMachineAction* action, mitk::InteractionEvent* event);
86 
88  bool CleanSlice(mitk::StateMachineAction* action, mitk::InteractionEvent* event);
89 
90 private:
91 
93  ToolKeyPressResponder* m_Responder;
94 
99  us::ServiceRegistration<mitk::InteractionEventObserver> m_ServiceRegistration;
100 
101 };
102 
103 }
104 
105 #endif
Pure Virtual Interface to be implemented by classes that want to respond to MIDAS key events relevant...
Definition: niftkToolKeyPressResponder.h:34
Definition: niftkToolKeyPressStateMachine.h:36
cl_event event
Definition: glew.h:3231
Definition: niftkExceptionObject.h:21
Common base class for segmentor tools and interactors.
Definition: niftkFilteringStateMachine.h:49