Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmlMitkProperties.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 __QmlMitkProperties_h
18 #define __QmlMitkProperties_h
19 
20 #include "MitkQmlItemsExports.h"
21 
22 #include <QObject>
23 #include <QQuickItem>
24 
25 #include <mitkDataNode.h>
26 #include <mitkWeakPointer.h>
27 
29 {
35 };
36 
37 class MITKQMLITEMS_EXPORT QmlMitkProperties : public QQuickItem
38 {
39  Q_OBJECT
40  Q_ENUMS(RenderMode)
41  Q_PROPERTY(bool rendering READ getRendering WRITE setRendering NOTIFY renderingChanged);
42  Q_PROPERTY(bool lod READ getLod WRITE setLod NOTIFY lodChanged);
43  Q_PROPERTY(int mode READ getMode WRITE setMode NOTIFY modeChanged);
44  Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged);
45 
46 private:
47  bool m_rendering;
48  bool m_lod;
49  int m_mode;
50  bool m_enabled;
51  mitk::WeakPointer<mitk::DataNode> m_node;
52 
53 public:
54  static QmlMitkProperties* instance;
55 
56  void setRendering(bool state);
57  void setLod(bool state);
58  void setMode(int mode);
59  void setEnabled(bool enabled);
60 
61  bool isEnabled();
62  bool getRendering();
63  bool getLod();
64  int getMode();
65 
66  void notify(mitk::DataNode::Pointer node);
67 
70 
71  static void create(QQmlEngine &engine);
72 
73 signals:
74  void renderingChanged();
75  void lodChanged();
76  void modeChanged();
77  void enabledChanged();
78  void sync();
79 };
80 
81 #endif
itk::SmartPointer< Self > Pointer
RenderMode
#define MITKQMLITEMS_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.