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
QmitkIGTLStreamingManagementWidget.h
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 #ifndef QMITKIGTLStreamingMANAGEMENTWIDGET_H
18 #define QMITKIGTLStreamingMANAGEMENTWIDGET_H
19 
20 //QT headers
21 #include <QWidget>
22 #include <QTimer>
23 
24 //mitk headers
25 #include "MitkOpenIGTLinkUIExports.h"
27 #include "mitkIGTLClient.h"
28 #include "mitkDataStorage.h"
29 
30 //itk
31 #include <itkCommand.h>
32 
33 //ui header
34 #include "ui_QmitkIGTLStreamingManagementWidgetControls.h"
35 
43 class MITKOPENIGTLINKUI_EXPORT QmitkIGTLStreamingManagementWidget : public QWidget
44 {
45  Q_OBJECT
46 
47  public:
48  static const std::string VIEW_ID;
49 
57  void LoadSource(mitk::IGTLMessageProvider::Pointer provider);
58 
59  QmitkIGTLStreamingManagementWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
61 
62 
63  protected slots:
64  void OnStartStreaming();
65  void OnStopStreaming();
66  void OnStreamingTimerTimeout();
67 
71  void SourceSelected(mitk::IGTLMessageSource::Pointer source);
72 
76  void AdaptGUIToState();
77 
81  void SelectSourceAndAdaptGUI();
82 
83  signals:
88  void AdaptGUIToStateSignal();
94  void SelectSourceAndAdaptGUISignal();
95 
96  protected:
97 
101  void OnMessageReceived();
102 
106  void OnCommandReceived();
107 
112  void OnLostConnection();
113 
117  void OnNewConnection();
118 
122  void OnStartStreamingTimer();
123 
127  void OnStopStreamingTimer();
128 
132  void OnDeviceStateChanged();
133 
135  void FillCommandsComboBox();
136 
138  virtual void CreateConnections();
139 
140  virtual void CreateQtPartControl(QWidget *parent);
141 
142  Ui::QmitkIGTLStreamingManagementWidgetControls* m_Controls;
143 
146 
149 
152 
155 
158 
166 
167  //############## private help methods #######################
168  void DisableSourceControls();
169  void RemoveObserver();
170 };
171 #endif
itk::SmartPointer< Self > Pointer
An object of this class offers an UI to manage the streaming of message sources.
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
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.
mitk::IGTLMessageProvider::Pointer m_IGTLMsgProvider
holds the IGTL Message Provider that will send the stream
Ui::QmitkIGTLStreamingManagementWidgetControls * m_Controls
bool m_IsClient
flag to indicate if the IGTL device is a client or a server