Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkChartExampleTestHelper.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 mitkChartExampleTestHelper_h
14 #define mitkChartExampleTestHelper_h
15 
16 #include <MitkChartExports.h>
17 
18 // mitk core
19 #include <QmitkChartxyData.h>
20 #include <QmitkChartWidget.h>
21 
22 // std includes
23 #include <map>
24 #include <memory>
25 #include <vector>
26 #include <string>
27 
28 namespace mitk
29 {
42  {
43 
44  public:
47 
52  std::unique_ptr<QmitkChartxyData> GetDataOne();
53 
58  std::unique_ptr<QmitkChartxyData> GetDataTwo();
59 
64  std::unique_ptr<QmitkChartxyData> GetDataThree();
65 
70  std::unique_ptr<QmitkChartxyData> GetDataFour();
71 
76  std::unique_ptr<QmitkChartxyData> GetDataFive();
77 
79 
82 
85 
96 
107 
117 
126  void Add(int dataSet);
127 
136  std::vector<std::pair<double, double> > ToStdPairList(QVariantList xData, QVariantList yData);
137 
141  void ClearMemory();
142 
144 
145  }; // end ChartExampleTestHelper
146 } // end mitk
147 
148 #endif
#define MITKCHART_EXPORT
Qt widget for displaying interactive charts based on the plotly.js library.
ChartColor
Enumeration of named chart colors.
LineStyle
Enumeration of line drawing styles.
ChartType
Enumeration of supported chart types.
Test helper class for QmitkChartWidget unit tests.
void ClearMemory()
Clear all chart data and reset the widget.
void Add(int dataSet)
Add a predefined data set to the chart widget.
std::unique_ptr< QmitkChartxyData > GetDataTwo()
Create test data set #2 (x=10..19, y=10..19, bar, green, solid).
QmitkChartWidget::ChartColor ReturnChartColorByString(std::string chartColorString)
Convert a color name string to the corresponding enum value.
QmitkChartWidget::ChartType ReturnChartTypeByString(std::string chartTypeString)
Convert a chart type string to the corresponding enum value.
QmitkChartWidget::LineStyle ReturnChartStyleByString(std::string chartStyleString)
Convert a line style string to the corresponding enum value.
std::unique_ptr< QmitkChartxyData > GetDataOne()
Create test data set #1 (x=0..9, y=0..9, bar, red, solid).
std::unique_ptr< QmitkChartxyData > GetDataFive()
Create test data set #5 (x=40..49, y=40..49, bar, black, solid).
std::vector< std::pair< double, double > > ToStdPairList(QVariantList xData, QVariantList yData)
Convert QVariantLists of x and y data to a vector of std::pair.
std::unique_ptr< QmitkChartxyData > GetDataFour()
Create test data set #4 (x=30..39, y=30..39, bar, yellow, solid).
QmitkChartWidget qmitkChartWidget
The QmitkChartWidget instance used for testing.
std::unique_ptr< QmitkChartxyData > GetDataThree()
Create test data set #3 (x=20..29, y=20..29, bar, blue, solid).
Find image slices visible on a given plane.