Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkUSAbstractCustomWidget.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 QmitkUSAbstractCustomWidget_h
18 #define QmitkUSAbstractCustomWidget_h
19 
20 #include <QWidget>
21 
22 #include <MitkUSUIExports.h>
23 #include "mitkUSDevice.h"
24 
25 // Microservices
26 #include <mitkServiceInterface.h>
27 #include <usServiceRegistration.h>
28 #include <usServiceProperties.h>
29 
30 #include <usModuleContext.h>
31 
32 namespace us {
33  struct PrototypeServiceFactory;
34  class ModuleContext;
35 }
36 
78 class MITKUSUI_EXPORT QmitkUSAbstractCustomWidget : public QWidget
79 {
80  Q_OBJECT
81 
82 public:
83  QmitkUSAbstractCustomWidget(QWidget* parent = 0);
84  virtual ~QmitkUSAbstractCustomWidget();
85 
86  void SetDevice(mitk::USDevice::Pointer device);
87  mitk::USDevice::Pointer GetDevice() const;
88 
94  virtual void OnDeviceSet() = 0;
95 
101  virtual std::string GetDeviceClass() const = 0;
102 
106  virtual QmitkUSAbstractCustomWidget* Clone(QWidget* parent = 0) const = 0;
107 
114  virtual void Initialize() = 0;
115 
121  QmitkUSAbstractCustomWidget* CloneForQt(QWidget* parent = 0) const;
122 
128  us::ServiceProperties GetServiceProperties() const;
129 
140  void showEvent ( QShowEvent * event ) override;
141 
145  static std::string US_DEVICE_PROPKEY_CLASS();
146 
147 private:
148 
149  mitk::USDevice::Pointer m_Device;
150  us::PrototypeServiceFactory* m_PrototypeServiceFactory;
151  bool m_IsClonedForQt;
152 };
153 
154 // This is the microservice declaration. Do not meddle!
155 MITK_DECLARE_SERVICE_INTERFACE(QmitkUSAbstractCustomWidget, "org.mitk.QmitkUSAbstractCustomWidget")
156 
157 #endif // QmitkUSAbstractCustomWidget_h
Abstract superclass for all custom control widgets of mitk::USDevice classes.
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
static mitk::PlanarFigure::Pointer Clone(mitk::PlanarFigure::Pointer original)
MITK_DECLARE_SERVICE_INTERFACE(mitk::ISimulationService,"org.mitk.ISimulationService")