Medical Imaging Interaction Toolkit  2018.4.99-7e02155b
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKDATAINTERACTOR_H_
14 #define MITKDATAINTERACTOR_H_
15 
16 #include <MitkCoreExports.h>
17 #include <mitkCommon.h>
18 #include <mitkEventStateMachine.h>
19 #include <mitkWeakPointer.h>
20 #include <string>
21 
22 namespace mitk
23 {
24  class DataNode;
25 
26  itkEventMacro(DataInteractorEvent, itk::AnyEvent);
27 
29  itkEventMacro(StartInteraction, DataInteractorEvent);
30 
32  itkEventMacro(ResultReady, DataInteractorEvent);
33 
35  REGULAR = 0,
36  GRABINPUT = 1,
39  };
40 
49  {
50  public:
51  // Predefined internal events/signals
52  static const std::string IntDeactivateMe;
53  static const std::string IntLeaveWidget;
54  static const std::string IntEnterWidget;
55 
57 
58  itkFactorylessNewMacro(Self);
59 
60  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  ~DataInteractor() override;
72 
86  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
itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent)
static const std::string IntLeaveWidget
DataCollection - Class to facilitate loading/accessing structured data.
Base class from with interactors that handle DataNodes are to be derived.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
static const std::string IntDeactivateMe
static const std::string IntEnterWidget
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
Super-class that provides the functionality of a StateMachine to DataInteractors. ...