Medical Imaging Interaction Toolkit  2022.04.99-2e1e005b
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 QmitkC3xyData_h
14 #define QmitkC3xyData_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 // QmitkC3xyData_h
Q_INVOKABLE QList< QVariant > GetYErrorDataMinus() const
QList< QVariant > m_PieLabels
void SignalMarkerSymbolChanged(const QVariant lineStyle)
Q_INVOKABLE QList< QVariant > GetXErrorDataPlus() const
Q_INVOKABLE QList< QVariant > GetYErrorDataPlus() const
void SignalErrorDataChanged(const QList< QVariant > errorData)
void SetData(const std::vector< std::pair< double, double > > &data)
Q_INVOKABLE QVariant GetMarkerSymbol() const
Q_INVOKABLE QList< QVariant > GetXData() const
void SignalDataChanged(const QList< QVariant > data)
Q_INVOKABLE void SetXData(const QList< QVariant > &xData)
Q_INVOKABLE QList< QVariant > GetYData() const
Q_INVOKABLE void SetXErrorDataMinus(const QList< QVariant > &errorData)
Q_INVOKABLE QVariant GetLineStyle() const
void ClearData()
Clears the Data.
Q_INVOKABLE QList< QVariant > GetPieLabels() const
Q_INVOKABLE void SetMarkerSymbol(const QVariant &markerSymbol)
Q_INVOKABLE void SetChartType(const QVariant &chartType)
Q_INVOKABLE void SetYErrorDataMinus(const QList< QVariant > &errorData)
void SignalLineStyleChanged(const QVariant lineStyle)
QVariant m_MarkerSymbolName
void SignalColorChanged(const QVariant color)
void SignalPieLabelsChanged(const QList< QVariant > pieLabels)
QList< QVariant > m_XData
Q_INVOKABLE void SetPieLabels(const QList< QVariant > &pieLabels)
Q_INVOKABLE QList< QVariant > GetXErrorDataMinus() const
void SignalLabelChanged(const QVariant label)
QVariant m_LineStyleName
QList< QVariant > m_YErrorDataMinus
QList< QVariant > m_XErrorDataPlus
Q_INVOKABLE void SetXErrorDataPlus(const QList< QVariant > &errorData)
Q_INVOKABLE QVariant GetLabel() const
Q_INVOKABLE void SetLineStyle(const QVariant &lineStyle)
Q_INVOKABLE void SetLabel(const QVariant &label)
void SignalDiagramTypeChanged(const QVariant diagramType)
QList< QVariant > m_YData
Q_INVOKABLE void SetYErrorDataPlus(const QList< QVariant > &errorData)
Q_INVOKABLE QVariant GetColor() const
QList< QVariant > m_YErrorDataPlus
QList< QVariant > m_XErrorDataMinus
Q_INVOKABLE void SetYData(const QList< QVariant > &yData)
Q_INVOKABLE QVariant GetChartType() const
Q_INVOKABLE QVariant GetLabelCount() const
Q_INVOKABLE void SetColor(const QVariant &color)