Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDataInteractor.h
Go to the documentation of this file.
1 /*===================================================================
2 
3  The Medical Imaging Interaction Toolkit (MITK)
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics.
7  All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without
10  even the implied warranty of MERCHANTABILITY or FITNESS FOR
11  A PARTICULAR PURPOSE.
12 
13  See LICENSE.txt or http://www.mitk.org for details.
14 
15  ===================================================================*/
16 
17 #ifndef MITKDATAINTERACTOR_H_
18 #define MITKDATAINTERACTOR_H_
19 
20 #include <MitkCoreExports.h>
21 #include <mitkCommon.h>
22 #include <mitkEventStateMachine.h>
23 #include <mitkWeakPointer.h>
24 #include <string>
25 
26 namespace mitk
27 {
28  class DataNode;
29 
30  itkEventMacro(DataInteractorEvent, itk::AnyEvent)
31 
32 
33  itkEventMacro(StartInteraction, DataInteractorEvent)
34 
36  itkEventMacro(ResultReady, DataInteractorEvent)
37 
38  enum ProcessEventMode {
39  REGULAR = 0,
40  GRABINPUT = 1,
41  PREFERINPUT = 2,
42  CONNECTEDMOUSEACTION = 3
43  };
44 
53  {
54  public:
55  // Predefined internal events/signals
56  static const std::string IntDeactivateMe;
57  static const std::string IntLeaveWidget;
58  static const std::string IntEnterWidget;
59 
60  mitkClassMacro(DataInteractor, EventStateMachine) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
61 
62  DataNode *GetDataNode() const;
63  virtual void SetDataNode(DataNode *dataNode); // TODO: Remove virtual, use DataNodeChanged instead in subclasses
64 
65  int GetLayer() const;
66 
67  ProcessEventMode GetMode() const;
68 
69  protected:
71  virtual ~DataInteractor();
72 
86  virtual void ConnectActionsAndFunctions() override;
87 
95  virtual void DataNodeChanged();
96 
100  void virtual NotifyStart();
101 
107  void virtual NotifyResultReady();
108 
109  private:
110  WeakPointer<DataNode> m_DataNode;
111  };
112 }
113 #endif
#define MITKCORE_EXPORT
static const std::string IntLeaveWidget
virtual void DataNodeChanged() override
Called when a DataNode has been set/changed.
DataCollection - Class to facilitate loading/accessing structured data.
Base class from with interactors that handle DataNodes are to be derived.
virtual void ConnectActionsAndFunctions() override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
static const std::string IntDeactivateMe
Implements a weak reference to an object.
itkEventMacro(ContourModelEvent, itk::AnyEvent)
virtual void SetDataNode(DataNode *dataNode) override
static const std::string IntEnterWidget
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
Super-class that provides the functionality of a StateMachine to DataInteractors. ...