MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkNavigationToolStorageSelectionWidget.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
14
15//mitk headers
17#include <usGetModuleContext.h>
18#include <usServiceReference.h>
19
20
21
23: QWidget(parent, f)
24{
25 m_Controls = nullptr;
28
29}
30
31
36
38{
39 if (!m_Controls)
40 {
41 // create GUI widgets
42 m_Controls = new Ui::QmitkNavigationToolStorageSelectionWidgetControls;
43 m_Controls->setupUi(parent);
44 }
45}
46
48{
49 if ( m_Controls )
50 {
51 connect( (QObject*)(m_Controls->m_ServiceListWidget), SIGNAL(ServiceSelectionChanged(us::ServiceReferenceU)), this, SLOT(NavigationToolStorageSelected(us::ServiceReferenceU)) );
52 connect((QObject*)(m_Controls->m_ServiceListWidget), SIGNAL(ServiceModified(us::ServiceReferenceU)), this, SLOT(NavigationToolStorageSelected(us::ServiceReferenceU)));
53
54
55 }
56
57 //initialize service list widget
58 std::string empty = "";
60}
61
63 {
64 if (!s) //nothing selected
65 {
66 //reset everything
67 m_CurrentStorage = nullptr;
69 return;
70 }
71
72 // Get storage
73 us::ModuleContext* context = us::GetModuleContext();
74 m_CurrentStorage = context->GetService<mitk::NavigationToolStorage>(s);
76 }
77
79 {
80 return this->m_CurrentStorage;
81 }
mitk::NavigationToolStorage::Pointer GetSelectedNavigationToolStorage()
void NavigationToolStorageSelected(mitk::NavigationToolStorage::Pointer storage)
This signal is emitted when a new navigation tool storage is selected.
Ui::QmitkNavigationToolStorageSelectionWidgetControls * m_Controls
QmitkNavigationToolStorageSelectionWidget(QWidget *parent=nullptr, Qt::WindowFlags f={})
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