Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
QmitkChartxyData.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 QmitkChartxyData_h
14 #define QmitkChartxyData_h
15 
16 #include <QVariant>
17 
22 class QmitkChartxyData : public QObject
23 {
24  Q_OBJECT
25 
26  Q_PROPERTY(QVariant m_LabelCount READ GetLabelCount CONSTANT);
27  Q_PROPERTY(QList<QVariant> m_YData READ GetYData WRITE SetYData NOTIFY SignalDataChanged);
28  Q_PROPERTY(QList<QVariant> m_XData READ GetXData WRITE SetXData NOTIFY SignalDataChanged);
29  Q_PROPERTY(
31  Q_PROPERTY(
33  Q_PROPERTY(
35  Q_PROPERTY(
37  Q_PROPERTY(
38  QList<QVariant> m_PieLabels READ GetPieLabels WRITE SetPieLabels NOTIFY SignalPieLabelsChanged);
39  Q_PROPERTY(QVariant m_ChartType READ GetChartType WRITE SetChartType NOTIFY SignalDiagramTypeChanged);
40  Q_PROPERTY(QVariant m_Color READ GetColor WRITE SetColor NOTIFY SignalColorChanged);
41  Q_PROPERTY(QVariant m_Label READ GetLabel WRITE SetLabel NOTIFY SignalLabelChanged);
42  Q_PROPERTY(QVariant m_LineStyleName READ GetLineStyle WRITE SetLineStyle NOTIFY SignalLineStyleChanged);
43  Q_PROPERTY(QVariant m_MarkerSymbolName READ GetMarkerSymbol WRITE SetMarkerSymbol NOTIFY SignalMarkerSymbolChanged);
44 
45 public:
46  explicit QmitkChartxyData(const std::vector< std::pair<double, double> > &data,
47  const QVariant &label,
48  const QVariant &diagramType,
49  const QVariant &position); // Constructor for Data2D (x:y=1:2, 2:6, 3:7)
50 
51  void SetData(const std::vector< std::pair<double, double> > &data);
52 
53  Q_INVOKABLE QVariant GetLabelCount() const { return m_LabelCount; }
54 
55  Q_INVOKABLE QList<QVariant> GetYData() const { return m_YData; };
56  Q_INVOKABLE void SetYData(const QList<QVariant> &yData)
57  {
58  m_YData = yData;
59  emit SignalDataChanged(yData);
60  };
61 
62  Q_INVOKABLE QList<QVariant> GetXData() const { return m_XData; };
63  Q_INVOKABLE void SetXData(const QList<QVariant> &xData)
64  {
65  m_XData = xData;
66  emit SignalDataChanged(xData);
67  };
68 
69  Q_INVOKABLE QList<QVariant> GetXErrorDataPlus() const { return m_XErrorDataPlus; };
70  Q_INVOKABLE void SetXErrorDataPlus(const QList<QVariant> &errorData)
71  {
72  m_XErrorDataPlus = errorData;
73  emit SignalErrorDataChanged(errorData);
74  };
75 
76  Q_INVOKABLE QList<QVariant> GetXErrorDataMinus() const { return m_XErrorDataMinus; };
77  Q_INVOKABLE void SetXErrorDataMinus(const QList<QVariant> &errorData)
78  {
79  m_XErrorDataMinus = errorData;
80  emit SignalErrorDataChanged(errorData);
81  };
82 
83  Q_INVOKABLE QList<QVariant> GetYErrorDataPlus() const { return m_YErrorDataPlus; };
84  Q_INVOKABLE void SetYErrorDataPlus(const QList<QVariant> &errorData)
85  {
86  m_YErrorDataPlus = errorData;
87  emit SignalErrorDataChanged(errorData);
88  };
89 
90  Q_INVOKABLE QList<QVariant> GetYErrorDataMinus() const { return m_YErrorDataMinus; };
91  Q_INVOKABLE void SetYErrorDataMinus(const QList<QVariant> &errorData)
92  {
93  m_YErrorDataMinus = errorData;
94  emit SignalErrorDataChanged(errorData);
95  };
96 
97  Q_INVOKABLE QVariant GetChartType() const { return m_ChartType; };
98  Q_INVOKABLE void SetChartType(const QVariant &chartType)
99  {
100  m_ChartType = chartType;
101  emit SignalDiagramTypeChanged(chartType);
102  };
103 
104  Q_INVOKABLE QVariant GetLabel() const { return m_Label; };
105  Q_INVOKABLE void SetLabel(const QVariant &label)
106  {
107  m_Label = label;
108  emit SignalLabelChanged(label);
109  };
110 
111  Q_INVOKABLE QList<QVariant> GetPieLabels() const { return m_PieLabels; };
112  Q_INVOKABLE void SetPieLabels(const QList<QVariant> &pieLabels) { m_PieLabels = pieLabels; };
113 
114  Q_INVOKABLE QVariant GetColor() const { return m_Color; };
115  Q_INVOKABLE void SetColor(const QVariant &color)
116  {
117  m_Color = color;
118  emit SignalColorChanged(color);
119  };
120 
121  Q_INVOKABLE QVariant GetMarkerSymbol() const { return m_MarkerSymbolName; };
122  Q_INVOKABLE void SetMarkerSymbol(const QVariant &markerSymbol)
123  {
124  m_MarkerSymbolName = markerSymbol;
125  emit SignalMarkerSymbolChanged(markerSymbol);
126  };
127 
128  Q_INVOKABLE QVariant GetLineStyle() const { return m_LineStyleName; };
129  Q_INVOKABLE void SetLineStyle(const QVariant &lineStyle)
130  {
131  m_LineStyleName = lineStyle;
132  emit SignalLineStyleChanged(lineStyle);
133  };
134 
140  void ClearData();
141 
143 
144 signals:
145  void SignalDataChanged(const QList<QVariant> data);
146  void SignalErrorDataChanged(const QList<QVariant> errorData);
147  void SignalDiagramTypeChanged(const QVariant diagramType);
148  void SignalColorChanged(const QVariant color);
149  void SignalLabelChanged(const QVariant label);
150  void SignalPieLabelsChanged(const QList<QVariant> pieLabels);
151  void SignalLineStyleChanged(const QVariant lineStyle);
152  void SignalMarkerSymbolChanged(const QVariant lineStyle);
153 
154 private:
156  const QVariant m_LabelCount;
157  QList<QVariant> m_YData;
158  QList<QVariant> m_XData;
159  QList<QVariant> m_XErrorDataPlus;
160  QList<QVariant> m_XErrorDataMinus;
161  QList<QVariant> m_YErrorDataPlus;
162  QList<QVariant> m_YErrorDataMinus;
163  QVariant m_Label;
164  QList<QVariant> m_PieLabels;
165  QVariant m_ChartType;
166  QVariant m_Color;
167  QVariant m_LineStyleName;
168  QVariant m_MarkerSymbolName;
169 };
170 
171 #endif
QmitkChartxyData::ClearData
void ClearData()
Clears the Data.
QmitkChartxyData::SetLineStyle
Q_INVOKABLE void SetLineStyle(const QVariant &lineStyle)
Definition: QmitkChartxyData.h:129
QmitkChartxyData::GetXErrorDataPlus
Q_INVOKABLE QList< QVariant > GetXErrorDataPlus() const
Definition: QmitkChartxyData.h:69
QmitkChartxyData::SignalErrorDataChanged
void SignalErrorDataChanged(const QList< QVariant > errorData)
QmitkChartxyData::m_MarkerSymbolName
QVariant m_MarkerSymbolName
Definition: QmitkChartxyData.h:42
QmitkChartxyData::SetMarkerSymbol
Q_INVOKABLE void SetMarkerSymbol(const QVariant &markerSymbol)
Definition: QmitkChartxyData.h:122
QmitkChartxyData::GetXErrorDataMinus
Q_INVOKABLE QList< QVariant > GetXErrorDataMinus() const
Definition: QmitkChartxyData.h:76
QmitkChartxyData::SetXErrorDataMinus
Q_INVOKABLE void SetXErrorDataMinus(const QList< QVariant > &errorData)
Definition: QmitkChartxyData.h:77
QmitkChartxyData::SignalMarkerSymbolChanged
void SignalMarkerSymbolChanged(const QVariant lineStyle)
QmitkChartxyData::SetPieLabels
Q_INVOKABLE void SetPieLabels(const QList< QVariant > &pieLabels)
Definition: QmitkChartxyData.h:112
QmitkChartxyData::m_ChartType
QVariant m_ChartType
Definition: QmitkChartxyData.h:38
QmitkChartxyData::GetLineStyle
Q_INVOKABLE QVariant GetLineStyle() const
Definition: QmitkChartxyData.h:128
QmitkChartxyData::GetYErrorDataMinus
Q_INVOKABLE QList< QVariant > GetYErrorDataMinus() const
Definition: QmitkChartxyData.h:90
QmitkChartxyData::SignalLineStyleChanged
void SignalLineStyleChanged(const QVariant lineStyle)
QmitkChartxyData::GetYData
Q_INVOKABLE QList< QVariant > GetYData() const
Definition: QmitkChartxyData.h:55
QmitkChartxyData::m_PieLabels
QList< QVariant > m_PieLabels
Definition: QmitkChartxyData.h:36
QmitkChartxyData::SetXErrorDataPlus
Q_INVOKABLE void SetXErrorDataPlus(const QList< QVariant > &errorData)
Definition: QmitkChartxyData.h:70
QmitkChartxyData::GetLabel
Q_INVOKABLE QVariant GetLabel() const
Definition: QmitkChartxyData.h:104
QmitkChartxyData::SignalLabelChanged
void SignalLabelChanged(const QVariant label)
QmitkChartxyData::GetMarkerSymbol
Q_INVOKABLE QVariant GetMarkerSymbol() const
Definition: QmitkChartxyData.h:121
QmitkChartxyData::SignalPieLabelsChanged
void SignalPieLabelsChanged(const QList< QVariant > pieLabels)
QmitkChartxyData::m_XErrorDataPlus
QList< QVariant > m_XErrorDataPlus
Definition: QmitkChartxyData.h:28
QmitkChartxyData::GetYErrorDataPlus
Q_INVOKABLE QList< QVariant > GetYErrorDataPlus() const
Definition: QmitkChartxyData.h:83
QmitkChartxyData::GetXData
Q_INVOKABLE QList< QVariant > GetXData() const
Definition: QmitkChartxyData.h:62
QmitkChartxyData::SetLabel
Q_INVOKABLE void SetLabel(const QVariant &label)
Definition: QmitkChartxyData.h:105
QmitkChartxyData::SignalDataChanged
void SignalDataChanged(const QList< QVariant > data)
QmitkChartxyData::SetYErrorDataPlus
Q_INVOKABLE void SetYErrorDataPlus(const QList< QVariant > &errorData)
Definition: QmitkChartxyData.h:84
QmitkChartxyData::m_YData
QList< QVariant > m_YData
Definition: QmitkChartxyData.h:26
QmitkChartxyData::SetYErrorDataMinus
Q_INVOKABLE void SetYErrorDataMinus(const QList< QVariant > &errorData)
Definition: QmitkChartxyData.h:91
QmitkChartxyData::m_YErrorDataMinus
QList< QVariant > m_YErrorDataMinus
Definition: QmitkChartxyData.h:34
QmitkChartxyData::GetColor
Q_INVOKABLE QVariant GetColor() const
Definition: QmitkChartxyData.h:114
QmitkChartxyData::GetLabelCount
Q_INVOKABLE QVariant GetLabelCount() const
Definition: QmitkChartxyData.h:53
QmitkChartxyData::SetXData
Q_INVOKABLE void SetXData(const QList< QVariant > &xData)
Definition: QmitkChartxyData.h:63
QmitkChartxyData::SignalDiagramTypeChanged
void SignalDiagramTypeChanged(const QVariant diagramType)
QmitkChartxyData::m_XErrorDataMinus
QList< QVariant > m_XErrorDataMinus
Definition: QmitkChartxyData.h:30
QmitkChartxyData::GetChartType
Q_INVOKABLE QVariant GetChartType() const
Definition: QmitkChartxyData.h:97
QmitkChartxyData::m_LabelCount
QVariant m_LabelCount
Definition: QmitkChartxyData.h:26
QmitkChartxyData::SignalColorChanged
void SignalColorChanged(const QVariant color)
QmitkChartxyData::m_XData
QList< QVariant > m_XData
Definition: QmitkChartxyData.h:27
QmitkChartxyData::SetColor
Q_INVOKABLE void SetColor(const QVariant &color)
Definition: QmitkChartxyData.h:115
QmitkChartxyData::QmitkChartxyData
QmitkChartxyData()
Definition: QmitkChartxyData.h:142
QmitkChartxyData::m_YErrorDataPlus
QList< QVariant > m_YErrorDataPlus
Definition: QmitkChartxyData.h:32
QmitkChartxyData::m_LineStyleName
QVariant m_LineStyleName
Definition: QmitkChartxyData.h:41
QmitkChartxyData
Definition: QmitkChartxyData.h:22
QmitkChartxyData::m_Label
QVariant m_Label
Definition: QmitkChartxyData.h:40
QmitkChartxyData::m_Color
QVariant m_Color
Definition: QmitkChartxyData.h:39
QmitkChartxyData::SetYData
Q_INVOKABLE void SetYData(const QList< QVariant > &yData)
Definition: QmitkChartxyData.h:56
QmitkChartxyData::GetPieLabels
Q_INVOKABLE QList< QVariant > GetPieLabels() const
Definition: QmitkChartxyData.h:111
QmitkChartxyData::SetData
void SetData(const std::vector< std::pair< double, double > > &data)
QmitkChartxyData::SetChartType
Q_INVOKABLE void SetChartType(const QVariant &chartType)
Definition: QmitkChartxyData.h:98