Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
Home
Manual
API Reference
Download
Bugzilla
Groups
Namespace List
Class List
File List
Examples
File List
File Members
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
17
#include "
QmitkNavigationToolStorageSelectionWidget.h
"
18
19
//mitk headers
20
#include <
mitkNavigationDataSource.h
>
21
#include <
usGetModuleContext.h
>
22
#include <
usServiceReference.h
>
23
24
25
26
QmitkNavigationToolStorageSelectionWidget::QmitkNavigationToolStorageSelectionWidget
(QWidget* parent, Qt::WindowFlags f)
27
: QWidget(parent, f)
28
{
29
m_Controls
= NULL;
30
CreateQtPartControl
(
this
);
31
CreateConnections
();
32
33
}
34
35
36
QmitkNavigationToolStorageSelectionWidget::~QmitkNavigationToolStorageSelectionWidget
()
37
{
38
39
}
40
41
void
QmitkNavigationToolStorageSelectionWidget::CreateQtPartControl
(QWidget *parent)
42
{
43
if
(!
m_Controls
)
44
{
45
// create GUI widgets
46
m_Controls
=
new
Ui::QmitkNavigationToolStorageSelectionWidgetControls;
47
m_Controls
->setupUi(parent);
48
}
49
}
50
51
void
QmitkNavigationToolStorageSelectionWidget::CreateConnections
()
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 =
""
;
61
m_Controls
->m_ServiceListWidget->Initialize<
mitk::NavigationToolStorage
>(
mitk::NavigationToolStorage::US_PROPKEY_STORAGE_NAME
,empty);
62
}
63
64
void
QmitkNavigationToolStorageSelectionWidget::NavigationToolStorageSelected
(
us::ServiceReferenceU
s)
65
{
66
if
(!s)
//nothing selected
67
{
68
//reset everything
69
m_CurrentStorage
= NULL;
70
emit
NavigationToolStorageSelected
(
m_CurrentStorage
);
71
return
;
72
}
73
74
// Get storage
75
us::ModuleContext* context =
us::GetModuleContext
();
76
m_CurrentStorage
= context->GetService<
mitk::NavigationToolStorage
>(s);
77
emit
NavigationToolStorageSelected
(
m_CurrentStorage
);
78
}
79
80
mitk::NavigationToolStorage::Pointer
QmitkNavigationToolStorageSelectionWidget::GetSelectedNavigationToolStorage
()
81
{
82
return
this->
m_CurrentStorage
;
83
}
QmitkNavigationToolStorageSelectionWidget::CreateConnections
virtual void CreateConnections()
Creation of the connections.
Definition:
QmitkNavigationToolStorageSelectionWidget.cpp:51
QmitkNavigationToolStorageSelectionWidget::QmitkNavigationToolStorageSelectionWidget
QmitkNavigationToolStorageSelectionWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Definition:
QmitkNavigationToolStorageSelectionWidget.cpp:26
mitk::Pointer
itk::SmartPointer< Self > Pointer
Definition:
mitkRenderingManager.h:389
QmitkNavigationToolStorageSelectionWidget.h
QmitkNavigationToolStorageSelectionWidget::m_CurrentStorage
mitk::NavigationToolStorage::Pointer m_CurrentStorage
Definition:
QmitkNavigationToolStorageSelectionWidget.h:77
QmitkNavigationToolStorageSelectionWidget::~QmitkNavigationToolStorageSelectionWidget
~QmitkNavigationToolStorageSelectionWidget()
Definition:
QmitkNavigationToolStorageSelectionWidget.cpp:36
usServiceReference.h
mitk::NavigationToolStorage
An object of this class represents a collection of navigation tools. You may add/delete navigation to...
Definition:
mitkNavigationToolStorage.h:43
mitk::NavigationToolStorage::US_PROPKEY_STORAGE_NAME
static const std::string US_PROPKEY_STORAGE_NAME
Definition:
mitkNavigationToolStorage.h:78
us::ServiceReference
Definition:
usModule.h:40
QmitkNavigationToolStorageSelectionWidget::m_Controls
Ui::QmitkNavigationToolStorageSelectionWidgetControls * m_Controls
Definition:
QmitkNavigationToolStorageSelectionWidget.h:75
QmitkNavigationToolStorageSelectionWidget::GetSelectedNavigationToolStorage
mitk::NavigationToolStorage::Pointer GetSelectedNavigationToolStorage()
Definition:
QmitkNavigationToolStorageSelectionWidget.cpp:80
QmitkNavigationToolStorageSelectionWidget::NavigationToolStorageSelected
void NavigationToolStorageSelected(mitk::NavigationToolStorage::Pointer storage)
This signal is emitted when a new navigation tool storage is selected.
QmitkNavigationToolStorageSelectionWidget::CreateQtPartControl
virtual void CreateQtPartControl(QWidget *parent)
Definition:
QmitkNavigationToolStorageSelectionWidget.cpp:41
mitkNavigationDataSource.h
usGetModuleContext.h
us::GetModuleContext
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
Definition:
usGetModuleContext.h:50
git
MITK
Modules
IGTUI
Qmitk
QmitkNavigationToolStorageSelectionWidget.cpp
Generated on Fri Feb 3 2017 20:52:14 for Medical Imaging Interaction Toolkit by
1.8.9.1