Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
QmitkNavigationToolStorageSelectionWidget.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,
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 
18 
19 //mitk headers
21 #include <usGetModuleContext.h>
22 #include <usServiceReference.h>
23 
24 
25 
27 : QWidget(parent, f)
28 {
29  m_Controls = NULL;
30  CreateQtPartControl(this);
32 
33 }
34 
35 
37 {
38 
39 }
40 
42 {
43  if (!m_Controls)
44  {
45  // create GUI widgets
46  m_Controls = new Ui::QmitkNavigationToolStorageSelectionWidgetControls;
47  m_Controls->setupUi(parent);
48  }
49 }
50 
52 {
53  if ( m_Controls )
54  {
55  connect( (QObject*)(m_Controls->m_ServiceListWidget), SIGNAL(ServiceSelectionChanged(us::ServiceReferenceU)), this, SLOT(NavigationToolStorageSelected(us::ServiceReferenceU)) );
56 
57  }
58 
59  //initialize service list widget
60  std::string empty = "";
62 }
63 
65  {
66  if (!s) //nothing selected
67  {
68  //reset everything
69  m_CurrentStorage = NULL;
71  return;
72  }
73 
74  // Get storage
75  us::ModuleContext* context = us::GetModuleContext();
76  m_CurrentStorage = context->GetService<mitk::NavigationToolStorage>(s);
78  }
79 
81  {
82  return this->m_CurrentStorage;
83  }
virtual void CreateConnections()
Creation of the connections.
QmitkNavigationToolStorageSelectionWidget(QWidget *parent=0, Qt::WindowFlags f=0)
itk::SmartPointer< Self > Pointer
An object of this class represents a collection of navigation tools. You may add/delete navigation to...
static const std::string US_PROPKEY_STORAGE_NAME
Ui::QmitkNavigationToolStorageSelectionWidgetControls * m_Controls
mitk::NavigationToolStorage::Pointer GetSelectedNavigationToolStorage()
void NavigationToolStorageSelected(mitk::NavigationToolStorage::Pointer storage)
This signal is emitted when a new navigation tool storage is selected.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.