Medical Imaging Interaction Toolkit  2023.12.00
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 (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 mitkTubeGraphDataInteractor_h
14 #define mitkTubeGraphDataInteractor_h
15 
16 #include <MitkTubeGraphExports.h>
17 
18 #include <mitkBaseRenderer.h>
19 #include <mitkDataInteractor.h>
20 
21 #include "mitkTubeGraph.h"
22 #include "mitkTubeGraphProperty.h"
23 
24 namespace mitk
25 {
26  // Define events for TubeGraph interaction notifications
27  itkEventMacroDeclaration(SelectionChangedTubeGraphEvent, itk::AnyEvent);
28 
34  // Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
36  {
37  public:
39  itkNewMacro(Self);
40 
53  {
54  None = 0,
59  Multiple
60  };
61 
63  {
64  AttributationMode = 0,
68  InformationMode
69  };
70 
71  void SetActivationMode(const ActivationMode &activationMode);
72  ActivationMode GetActivationMode();
73 
74  void SetActionMode(const ActionMode &actionMode);
75  ActionMode GetActionMode();
76 
77  void ResetPickedTubes();
78 
79  mitk::Point3D GetLastPickedPosition();
80 
81  protected:
83  ~TubeGraphDataInteractor() override;
84 
89  void ConnectActionsAndFunctions() override;
90 
94  void DataNodeChanged() override;
95 
99  virtual bool CheckOverTube(const InteractionEvent *);
100  virtual void SelectTube(StateMachineAction *, InteractionEvent *);
101  virtual void DeselectTube(StateMachineAction *, InteractionEvent *);
102 
103  void SelectTubesByActivationModus();
104  void UpdateActivation();
105 
106  private:
107  std::vector<TubeGraph::TubeDescriptorType> GetTubesToRoot();
108  std::vector<TubeGraph::TubeDescriptorType> GetTubesBetweenPoints();
109  std::vector<TubeGraph::TubeDescriptorType> GetPathToPeriphery();
110  std::vector<TubeGraph::TubeDescriptorType> GetPathBetweenTubes(const TubeGraph::TubeDescriptorType &start,
111  const TubeGraph::TubeDescriptorType &end);
112 
113  TubeGraph::Pointer m_TubeGraph;
114  TubeGraphProperty::Pointer m_TubeGraphProperty;
115  TubeGraph::TubeDescriptorType m_LastPickedTube;
116  TubeGraph::TubeDescriptorType m_SecondLastPickedTube;
117  ActivationMode m_ActivationMode;
118  ActionMode m_ActionMode;
119  mitk::TubeElement *m_LastPickedElement = nullptr;
120  };
121 }
122 #endif
mitk::TubeGraphDataInteractor::EditMode
@ EditMode
Definition: mitkTubeGraphDataInteractor.h:66
mitkTubeGraph.h
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::TubeGraphDataInteractor::Points
@ Points
Definition: mitkTubeGraphDataInteractor.h:58
mitk::TubeGraphDataInteractor::ActionMode
ActionMode
Definition: mitkTubeGraphDataInteractor.h:62
mitk::TubeGraph::TubeDescriptorType
std::pair< VertexDescriptorType, VertexDescriptorType > TubeDescriptorType
Definition: mitkTubeGraph.h:49
MITKTUBEGRAPH_EXPORT
#define MITKTUBEGRAPH_EXPORT
Definition: MitkTubeGraphExports.h:15
itk::SmartPointer< Self >
mitk::TubeElement
Abstract class for elements which describes tubular structur.
Definition: mitkTubeElement.h:25
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::AntiAliasing::None
@ None
mitk::TubeGraphDataInteractor::AnnotationMode
@ AnnotationMode
Definition: mitkTubeGraphDataInteractor.h:65
mitk::TubeGraphDataInteractor::RootMode
@ RootMode
Definition: mitkTubeGraphDataInteractor.h:67
mitk::Point< ScalarType, 3 >
mitk::TubeGraphDataInteractor::ToPeriphery
@ ToPeriphery
Definition: mitkTubeGraphDataInteractor.h:57
mitkTubeGraphProperty.h
mitkDataInteractor.h
mitk::StateMachineAction
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Definition: mitkStateMachineAction.h:30
mitk::TubeGraphDataInteractor::ToRoot
@ ToRoot
Definition: mitkTubeGraphDataInteractor.h:56
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::TubeGraphDataInteractor
Definition: mitkTubeGraphDataInteractor.h:35
mitk::TubeGraphDataInteractor::Single
@ Single
Definition: mitkTubeGraphDataInteractor.h:55
mitk::TubeGraphDataInteractor::ActivationMode
ActivationMode
Definition: mitkTubeGraphDataInteractor.h:52
mitk::DataInteractor
Base class from with interactors that handle DataNodes are to be derived.
Definition: mitkDataInteractor.h:48
mitkBaseRenderer.h
MitkTubeGraphExports.h
mitk::itkEventMacroDeclaration
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)