Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkInteractionSchemeSwitcher.cpp
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 
14 
15 // us
16 #include <usGetModuleContext.h>
17 #include <usModuleContext.h>
18 
19 // mitk core
21 #include <mitkExceptionMacro.h>
22 
24  : m_InteractionScheme(MITKStandard)
25 {
26  // nothing here
27 }
28 
30 {
31  // nothing here
32 }
33 
35 {
36  if (nullptr == interactionEventHandler)
37  {
38  mitkThrow() << "Not a valid interaction event handler to set the interaction scheme.";
39  }
40 
41  switch (interactionScheme)
42  {
43  // MITK MODE
44  case MITKStandard:
45  {
46  interactionEventHandler->SetEventConfig("DisplayConfigMITK.xml");
47  break;
48  }
50  {
51  interactionEventHandler->SetEventConfig("DisplayConfigMITKRotationUnCoupled.xml");
52  break;
53  }
55  {
56  interactionEventHandler->SetEventConfig("DisplayConfigMITKRotation.xml");
57  break;
58  }
59  case MITKSwivel:
60  {
61  interactionEventHandler->SetEventConfig("DisplayConfigMITKSwivel.xml");
62  break;
63  }
64  // PACS MODE
65  case PACSStandard:
66  {
67  interactionEventHandler->SetEventConfig("DisplayConfigPACS.xml");
68  break;
69  }
70  case PACSLevelWindow:
71  {
72  interactionEventHandler->SetEventConfig("DisplayConfigPACS.xml");
73  interactionEventHandler->AddEventConfig("DisplayConfigPACSLevelWindow.xml");
74  break;
75  }
76  case PACSPan:
77  {
78  interactionEventHandler->SetEventConfig("DisplayConfigPACS.xml");
79  interactionEventHandler->AddEventConfig("DisplayConfigPACSPan.xml");
80  break;
81  }
82  case PACSScroll:
83  {
84  interactionEventHandler->SetEventConfig("DisplayConfigPACS.xml");
85  interactionEventHandler->AddEventConfig("DisplayConfigPACSScroll.xml");
86  break;
87  }
88  case PACSZoom:
89  {
90  interactionEventHandler->SetEventConfig("DisplayConfigPACS.xml");
91  interactionEventHandler->AddEventConfig("DisplayConfigPACSZoom.xml");
92  break;
93  }
94  default:
95  {
96  interactionEventHandler->SetEventConfig("DisplayConfigMITK.xml");
97  }
98  }
99 
100  m_InteractionScheme = interactionScheme;
101  InvokeEvent(InteractionSchemeChangedEvent());
102 }
void SetInteractionScheme(mitk::InteractionEventHandler *interactionEventHandler, InteractionScheme interactionScheme)
Set the current interaction scheme of the given interaction event handler.
#define mitkThrow()
bool AddEventConfig(const std::string &filename, const us::Module *module=nullptr)
This method extends the configuration.
bool SetEventConfig(const std::string &filename, const us::Module *module=nullptr)
Loads a configuration from an XML resource.