MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkAbstractTrackingDeviceWidget.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 QmitkAbstractTrackingDeviceWidget_h
14#define QmitkAbstractTrackingDeviceWidget_h
15
16#include <QWidget>
17#include "MitkIGTUIExports.h"
18#include "mitkTrackingDevice.h"
19
20#include <mitkIPersistenceService.h>
21
23
24//itk headers
25
52class MITKIGTUI_EXPORT QmitkAbstractTrackingDeviceWidget : public QWidget
53{
54 Q_OBJECT
55
56public:
57 static const std::string VIEW_ID;
58
59 QmitkAbstractTrackingDeviceWidget(QWidget* parent = nullptr, Qt::WindowFlags f = {});
60
62
68 QmitkAbstractTrackingDeviceWidget* CloneForQt(QWidget* parent = nullptr) const;
69
74 virtual void Initialize() = 0;
75
76 bool IsInitialized() const { return isInitialized; }
77
78signals:
79 void ConnectionTested(bool connected, QString output);
80
81 protected slots:
82 void TestConnectionFinished(bool connected, QString output);
83
84 /* @brief This method is called when the user presses the button "test connection". The method will then create a temporary tracking device,
85 * try to open a connection and start tracking. The user can see the result of the connection test on the small output window.
86 */
87 void TestConnection();
88
89private:
91 void CreateConnections();
92
93protected:
94 PERSISTENCE_GET_SERVICE_METHOD_MACRO
95 void InitializeSuperclassWidget();
96
99
104 virtual QmitkAbstractTrackingDeviceWidget* Clone(QWidget* parent = nullptr) const = 0;
105
106public:
110 virtual void ResetOutput() {}
114 virtual void AddOutput(std::string) {}
115 virtual mitk::TrackingDevice::Pointer GetTrackingDevice() = 0;
116
120 virtual void StoreUISettings() {}
121
125 virtual void LoadUISettings() {}
126
132 virtual bool IsDeviceInstalled() { return true; }
133
138 virtual void OnConnected(bool) {}
143 virtual void OnDisconnected(bool) {}
144
149 virtual void OnStartTracking(bool) {}
154 virtual void OnStopTracking(bool) {}
159 virtual void OnToolStorageChanged() {}
160
161
162 std::string m_ErrorMessage;
163
164private:
168 bool isInitialized;
169};
170
171#endif
Abstract class to configure a tracking device. Inherited widgets should be registered in the Microser...
virtual mitk::TrackingDevice::Pointer GetTrackingDevice()=0
virtual bool IsDeviceInstalled()
Optional method to investigate if drivers etc for your device are installed. The default value is "tr...
virtual void OnStartTracking(bool)
This function is called, when in the TrackingToolboxView "Start Tracking" was clicked and the device ...
virtual void OnStopTracking(bool)
This function is called, when in the TrackingToolboxView "Stop Tracking" was clicked and the device s...
virtual QmitkAbstractTrackingDeviceWidget * Clone(QWidget *parent=nullptr) const =0
Subclass must implement this method to return a pointer to a copy of the object. Please don't forget ...
virtual void OnDisconnected(bool)
This function is called, when in the TrackingToolboxView "Disconnect" was clicked and the device is s...
virtual void OnConnected(bool)
This function is called, when in the TrackingToolboxView "Connect" was clicked and the device is succ...
void ConnectionTested(bool connected, QString output)
virtual void StoreUISettings()
Optional method to store and load settings of your widget (see QmitkNDIPolarisWidget)
std::string m_ErrorMessage
current problem description
QmitkTrackingDeviceConfigurationWidgetConnectionWorker * m_TestConnectionWorker
virtual void LoadUISettings()
Optional method to store and load settings of your widget (see QmitkNDIPolarisWidget)
virtual void AddOutput(std::string)
Optional method to add output to a small screen in the trackingToolbox (see QmitkNDIPolarisWidget)
virtual void OnToolStorageChanged()
This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool....
virtual void ResetOutput()
Optional method to add output to a small screen in the trackingToolbox (see QmitkNDIPolarisWidget)
virtual void Initialize()=0
Subclass must implement this method to return a pointer to a copy of the object. Please don't forget ...