Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkUSAbstractCustomWidget_h
14 #define QmitkUSAbstractCustomWidget_h
15 
16 #include <QWidget>
17 
18 #include <MitkUSUIExports.h>
19 #include "mitkUSDevice.h"
20 
21 // Microservices
22 #include <mitkServiceInterface.h>
23 
66 {
67  Q_OBJECT
68 
69 public:
70  QmitkUSAbstractCustomWidget(QWidget* parent = nullptr);
71  ~QmitkUSAbstractCustomWidget() override;
72 
73  void SetDevice(mitk::USDevice::Pointer device);
74  mitk::USDevice::Pointer GetDevice() const;
75 
81  virtual void OnDeviceSet() = 0;
82 
88  virtual std::string GetDeviceClass() const = 0;
89 
93  virtual QmitkUSAbstractCustomWidget* Clone(QWidget* parent = nullptr) const = 0;
94 
101  virtual void Initialize() = 0;
102 
108  QmitkUSAbstractCustomWidget* CloneForQt(QWidget* parent = nullptr) const;
109 
115  us::ServiceProperties GetServiceProperties() const;
116 
127  void showEvent ( QShowEvent * event ) override;
128 
132  static std::string US_DEVICE_PROPKEY_CLASS();
133 
134 private:
135 
136  mitk::USDevice::Pointer m_Device;
137  bool m_IsClonedForQt;
138 };
139 
140 // This is the microservice declaration. Do not meddle!
141 MITK_DECLARE_SERVICE_INTERFACE(QmitkUSAbstractCustomWidget, "org.mitk.QmitkUSAbstractCustomWidget")
142 
143 #endif // QmitkUSAbstractCustomWidget_h
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
#define MITKUSUI_EXPORT
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)