Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkAbstractTrackingDeviceWidget.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 QmitkAbstractTrackingDeviceWidget_H
18 #define QmitkAbstractTrackingDeviceWidget_H
19 
20 #include <QWidget>
21 #include "MitkIGTUIExports.h"
22 #include "mitkTrackingDevice.h"
23 
25 
27 
28 //itk headers
29 
52 class MITKIGTUI_EXPORT QmitkAbstractTrackingDeviceWidget : public QWidget
53 {
54  Q_OBJECT
55 
56 public:
57  static const std::string VIEW_ID;
58 
59  QmitkAbstractTrackingDeviceWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
60 
62 
68  QmitkAbstractTrackingDeviceWidget* CloneForQt(QWidget* parent = 0) const;
69 
74  virtual void Initialize() = 0;
75 
76  bool IsInitialized() const { return isInitialized; }
77 
78 signals:
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 
89 private:
91  void CreateConnections();
92 
93 protected:
95  void InitializeSuperclassWidget();
96 
99 
104  virtual QmitkAbstractTrackingDeviceWidget* Clone(QWidget* parent = 0) const = 0;
105 
106 public:
110  virtual void ResetOutput() {}
114  virtual void AddOutput(std::string) {}
115  virtual mitk::TrackingDevice::Pointer ConstructTrackingDevice() = 0;
116 
120  virtual void StoreUISettings() {}
121 
125  virtual void LoadUISettings() {}
126 
132  virtual bool IsDeviceInstalled() { return true; }
133 
134  std::string m_ErrorMessage;
135 
136 private:
140  bool isInitialized;
141 };
142 
143 #endif
itk::SmartPointer< Self > Pointer
virtual void StoreUISettings()
Optional method to store and load settings of your widget (see QmitkNDIPolarisWidget) ...
virtual void ResetOutput()
Optional method to add output to a small screen in the trackingToolbox (see QmitkNDIPolarisWidget) ...
QmitkTrackingDeviceConfigurationWidgetConnectionWorker * m_TestConnectionWorker
virtual void LoadUISettings()
Optional method to store and load settings of your widget (see QmitkNDIPolarisWidget) ...
std::string m_ErrorMessage
current problem description
virtual void AddOutput(std::string)
Optional method to add output to a small screen in the trackingToolbox (see QmitkNDIPolarisWidget) ...
#define PERSISTENCE_GET_SERVICE_METHOD_MACRO
Abstract class to configure a tracking device. Inherited widgets should be registered in the Microser...
virtual bool IsDeviceInstalled()
Optional method to investigate if drivers etc for your device are installed. The default value is "tr...
static mitk::PlanarFigure::Pointer Clone(mitk::PlanarFigure::Pointer original)