Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkTubeGraphDataInteractor.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 mitkTubeGraphDataInteractor3D_h_
18 #define mitkTubeGraphDataInteractor3D_h_
19 
20 #include <MitkTubeGraphExports.h>
21 
22 #include <mitkBaseRenderer.h>
23 #include <mitkDataInteractor.h>
24 
25 #include "mitkTubeGraph.h"
26 #include "mitkTubeGraphProperty.h"
27 
28 namespace mitk
29 {
30  // Define events for TubeGraph interaction notifications
31  itkEventMacro(SelectionChangedTubeGraphEvent, itk::AnyEvent);
32 
38  // Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
40  {
41  public:
43  itkNewMacro(Self);
44 
57  {
58  None = 0,
63  Multiple
64  };
65 
67  {
68  AttributationMode = 0,
72  InformationMode
73  };
74 
75  void SetActivationMode(const ActivationMode &activationMode);
76  ActivationMode GetActivationMode();
77 
78  void SetActionMode(const ActionMode &actionMode);
79  ActionMode GetActionMode();
80 
81  void ResetPickedTubes();
82 
83  protected:
85  virtual ~TubeGraphDataInteractor();
86 
91  virtual void ConnectActionsAndFunctions() override;
92 
96  virtual void DataNodeChanged() override;
97 
101  virtual bool CheckOverTube(const InteractionEvent *);
102  virtual void SelectTube(StateMachineAction *, InteractionEvent *);
103  virtual void DeselectTube(StateMachineAction *, InteractionEvent *);
104 
105  void SelectTubesByActivationModus();
106  void UpdateActivation();
107 
108  private:
109  std::vector<TubeGraph::TubeDescriptorType> GetTubesToRoot();
110  std::vector<TubeGraph::TubeDescriptorType> GetTubesBetweenPoints();
111  std::vector<TubeGraph::TubeDescriptorType> GetPathToPeriphery();
112  std::vector<TubeGraph::TubeDescriptorType> GetPathBetweenTubes(const TubeGraph::TubeDescriptorType &start,
113  const TubeGraph::TubeDescriptorType &end);
114 
115  TubeGraph::Pointer m_TubeGraph;
116  TubeGraphProperty::Pointer m_TubeGraphProperty;
117  TubeGraph::TubeDescriptorType m_LastPickedTube;
118  TubeGraph::TubeDescriptorType m_SecondLastPickedTube;
119  ActivationMode m_ActivationMode;
120  ActionMode m_ActionMode;
121  };
122 }
123 #endif
#define MITKTUBEGRAPH_EXPORT
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.
std::pair< VertexDescriptorType, VertexDescriptorType > TubeDescriptorType
Definition: mitkTubeGraph.h:43
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
virtual void ConnectActionsAndFunctions() override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
itkEventMacro(ContourModelEvent, itk::AnyEvent)