NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkFilteringStateMachine.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 niftkFilteringStateMachine_h
16 #define niftkFilteringStateMachine_h
17 
18 #include "niftkMIDASExports.h"
19 
20 #include <vector>
21 
22 #include <mitkInteractionEvent.h>
23 #include <mitkStateEvent.h>
24 
25 namespace niftk
26 {
27 
28 class StateMachineEventFilter;
29 
49 class NIFTKMIDAS_EXPORT FilteringStateMachine
50 {
51 
52 public:
53 
56 
58  virtual ~FilteringStateMachine();
59 
76  float CanHandleEvent(const mitk::StateEvent* event) const;
77 
78  bool CanHandleEvent(mitk::InteractionEvent* event);
79 
81  virtual void InstallEventFilter(StateMachineEventFilter* eventFilter);
82 
84  virtual void RemoveEventFilter(StateMachineEventFilter* eventFilter);
85 
87  std::vector<StateMachineEventFilter*> GetEventFilters() const;
88 
90  bool IsFiltered(const mitk::StateEvent* stateEvent) const;
91 
93  bool IsFiltered(mitk::InteractionEvent* event);
94 
95 protected:
96 
101  virtual float CanHandle(const mitk::StateEvent* stateEvent) const
102  {
103  return 1.0;
104  }
105 
106  virtual bool CanHandle(mitk::InteractionEvent* event)
107  {
108  return true;
109  }
110 
111 private:
112 
114  std::vector<StateMachineEventFilter*> m_EventFilters;
115 
116 };
117 
118 }
119 
120 #endif
virtual bool CanHandle(mitk::InteractionEvent *event)
Definition: niftkFilteringStateMachine.h:106
StateMachineEventFilter represents a condition that has to be fulfilled so that an event is processed...
Definition: niftkStateMachineEventFilter.h:41
virtual float CanHandle(const mitk::StateEvent *stateEvent) const
Definition: niftkFilteringStateMachine.h:101
cl_event event
Definition: glew.h:3231
Definition: niftkExceptionObject.h:21
Common base class for segmentor tools and interactors.
Definition: niftkFilteringStateMachine.h:49