MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkIGTLDeviceSourceSelectionWidget.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
16#include <usGetModuleContext.h>
17#include <usServiceReference.h>
18
19
20
22: QWidget(parent, f)
23{
24 m_Controls = nullptr;
26}
27
28
33
35{
36 if ( !m_Controls )
37 {
38 // create GUI widgets
39 m_Controls = new Ui::QmitkIGTLDeviceSourceSelectionWidgetControls;
40 // setup GUI widgets
41 m_Controls->setupUi(parent);
42 }
43
45}
46
48{
49 if ( m_Controls )
50 {
51 connect( m_Controls->m_ServiceListWidget,
52 SIGNAL(ServiceSelectionChanged(us::ServiceReferenceU)),
53 this, SLOT(IGTLDeviceSourceSelected(us::ServiceReferenceU)) );
54
55 //initialize service list widget
56 std::string empty = "";
57 m_Controls->m_ServiceListWidget->Initialize<mitk::IGTLDeviceSource>(
59 }
60}
61
63 {
64 if (!s) //nothing selected
65 {
66 //reset everything
67 this->m_CurrentIGTLDeviceSource = nullptr;
69 return;
70 }
71
72 // Get storage
73 us::ModuleContext* context = us::GetModuleContext();
75 context->GetService<mitk::IGTLDeviceSource>(s);
77 }
78
80 {
81 return this->m_CurrentIGTLDeviceSource;
82 }
virtual void CreateConnections()
Creation of the connections.
QmitkIGTLDeviceSourceSelectionWidget(QWidget *parent=nullptr, Qt::WindowFlags f={})
void IGTLDeviceSourceSelected(mitk::IGTLDeviceSource::Pointer source)
This signal is emitted when a new OpenIGTLink device source is selected.
Ui::QmitkIGTLDeviceSourceSelectionWidgetControls * m_Controls
mitk::IGTLDeviceSource::Pointer GetSelectedIGTLDeviceSource()
Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline.
static const std::string US_PROPKEY_IGTLDEVICENAME
These Constants are used in conjunction with Microservices.