MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkIGTLStreamingManagementWidget.h
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
13#ifndef QmitkIGTLStreamingManagementWidget_h
14#define QmitkIGTLStreamingManagementWidget_h
15
16//QT headers
17#include <QWidget>
18#include <QTimer>
19
20//mitk headers
21#include "MitkOpenIGTLinkUIExports.h"
23#include "mitkIGTLClient.h"
24#include "mitkDataStorage.h"
25
26//itk
27#include <itkCommand.h>
28
29//ui header
30#include "ui_QmitkIGTLStreamingManagementWidgetControls.h"
31
39class MITKOPENIGTLINKUI_EXPORT QmitkIGTLStreamingManagementWidget : public QWidget
40{
41 Q_OBJECT
42
43 public:
44 static const std::string VIEW_ID;
45
53 void LoadSource(mitk::IGTLMessageProvider::Pointer provider);
54
55 QmitkIGTLStreamingManagementWidget(QWidget* parent = nullptr, Qt::WindowFlags f = {});
57
58
59 protected slots:
60 void OnStartStreaming();
61 void OnStopStreaming();
62 void OnStreamingTimerTimeout();
63
67 void SourceSelected(mitk::IGTLMessageSource::Pointer source);
68
72 void AdaptGUIToState();
73
77 void SelectSourceAndAdaptGUI();
78
79 signals:
91
92 protected:
93
97 void OnMessageReceived();
98
102 void OnCommandReceived();
103
108 void OnLostConnection();
109
113 void OnNewConnection();
114
118 void OnStartStreamingTimer();
119
123 void OnStopStreamingTimer();
124
128 void OnDeviceStateChanged();
129
132
134 virtual void CreateConnections();
135
136 virtual void CreateQtPartControl(QWidget *parent);
137
138 Ui::QmitkIGTLStreamingManagementWidgetControls* m_Controls;
139
141 mitk::IGTLDevice::Pointer m_IGTLDevice;
142
144 mitk::IGTLMessageProvider::Pointer m_IGTLMsgProvider;
145
147 mitk::IGTLMessageSource::Pointer m_IGTLMsgSource;
148
151
154
162
163 //############## private help methods #######################
164 void DisableSourceControls();
165 void RemoveObserver();
166};
167#endif
An object of this class offers an UI to manage the streaming of message sources.
QTimer m_StreamingTimer
the streaming timer that periodically calls the update method of the provider
mitk::IGTLMessageSource::Pointer m_IGTLMsgSource
holds the IGTLDeviceSource we are working with.
void FillCommandsComboBox()
Fills the commands combo box with available commands.
void AdaptGUIToStateSignal()
used for thread seperation, the worker thread must not call AdaptGUIToState directly....
Ui::QmitkIGTLStreamingManagementWidgetControls * m_Controls
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
mitk::IGTLMessageProvider::Pointer m_IGTLMsgProvider
holds the IGTL Message Provider that will send the stream
bool m_IsClient
flag to indicate if the IGTL device is a client or a server
void SelectSourceAndAdaptGUISignal()
used for thread seperation, the worker thread must not call SelectSourceAndAdaptGUI directly....