|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Test helper class for QmitkChartWidget unit tests. More...
#include <mitkChartExampleTestHelper.h>

Public Member Functions | |
Predefined Test Data Sets | |
| std::unique_ptr< QmitkChartxyData > | GetDataOne () |
| Create test data set #1 (x=0..9, y=0..9, bar, red, solid). More... | |
| std::unique_ptr< QmitkChartxyData > | GetDataTwo () |
| Create test data set #2 (x=10..19, y=10..19, bar, green, solid). More... | |
| std::unique_ptr< QmitkChartxyData > | GetDataThree () |
| Create test data set #3 (x=20..29, y=20..29, bar, blue, solid). More... | |
| std::unique_ptr< QmitkChartxyData > | GetDataFour () |
| Create test data set #4 (x=30..39, y=30..39, bar, yellow, solid). More... | |
| std::unique_ptr< QmitkChartxyData > | GetDataFive () |
| Create test data set #5 (x=40..49, y=40..49, bar, black, solid). More... | |
Utility Functions | |
| QmitkChartWidget::ChartType | ReturnChartTypeByString (std::string chartTypeString) |
| Convert a chart type string to the corresponding enum value. More... | |
| QmitkChartWidget::ChartColor | ReturnChartColorByString (std::string chartColorString) |
| Convert a color name string to the corresponding enum value. More... | |
| QmitkChartWidget::LineStyle | ReturnChartStyleByString (std::string chartStyleString) |
| Convert a line style string to the corresponding enum value. More... | |
| void | Add (int dataSet) |
| Add a predefined data set to the chart widget. More... | |
| std::vector< std::pair< double, double > > | ToStdPairList (QVariantList xData, QVariantList yData) |
| Convert QVariantLists of x and y data to a vector of std::pair. More... | |
| void | ClearMemory () |
| Clear all chart data and reset the widget. More... | |
Public Attributes | |
| QmitkChartWidget | qmitkChartWidget |
| The QmitkChartWidget instance used for testing. More... | |
Test helper class for QmitkChartWidget unit tests.
Provides predefined data sets and utility functions to facilitate unit testing of the QmitkChartWidget charting framework. Each data set is a simple linear sequence of (x, y) pairs with preconfigured chart type, color, and line style.
Definition at line 41 of file mitkChartExampleTestHelper.h.
| void mitk::ChartExampleTestHelper::Add | ( | int | dataSet | ) |
Add a predefined data set to the chart widget.
Retrieves the data set corresponding to the given number (1-5), extracts its properties, and adds it to qmitkChartWidget.
| [in] | dataSet | The data set number (1 through 5). |
| void mitk::ChartExampleTestHelper::ClearMemory | ( | ) |
Clear all chart data and reset the widget.
| std::unique_ptr<QmitkChartxyData> mitk::ChartExampleTestHelper::GetDataFive | ( | ) |
Create test data set #5 (x=40..49, y=40..49, bar, black, solid).
| std::unique_ptr<QmitkChartxyData> mitk::ChartExampleTestHelper::GetDataFour | ( | ) |
Create test data set #4 (x=30..39, y=30..39, bar, yellow, solid).
| std::unique_ptr<QmitkChartxyData> mitk::ChartExampleTestHelper::GetDataOne | ( | ) |
Create test data set #1 (x=0..9, y=0..9, bar, red, solid).
| std::unique_ptr<QmitkChartxyData> mitk::ChartExampleTestHelper::GetDataThree | ( | ) |
Create test data set #3 (x=20..29, y=20..29, bar, blue, solid).
| std::unique_ptr<QmitkChartxyData> mitk::ChartExampleTestHelper::GetDataTwo | ( | ) |
Create test data set #2 (x=10..19, y=10..19, bar, green, solid).
| QmitkChartWidget::ChartColor mitk::ChartExampleTestHelper::ReturnChartColorByString | ( | std::string | chartColorString | ) |
Convert a color name string to the corresponding enum value.
Supported strings include "red", "orange", "yellow", "green", "blue", "purple", "brown", "magenta", etc. Unknown strings default to ChartColor::red.
| [in] | chartColorString | The color name as a string. |
| QmitkChartWidget::LineStyle mitk::ChartExampleTestHelper::ReturnChartStyleByString | ( | std::string | chartStyleString | ) |
Convert a line style string to the corresponding enum value.
Supported strings: "solid", "dashed". Unknown strings default to LineStyle::solid.
| [in] | chartStyleString | The line style as a string. |
| QmitkChartWidget::ChartType mitk::ChartExampleTestHelper::ReturnChartTypeByString | ( | std::string | chartTypeString | ) |
Convert a chart type string to the corresponding enum value.
Supported strings: "bar", "line", "spline", "pie", "area", "area_spline", "scatter". Unknown strings default to ChartType::bar.
| [in] | chartTypeString | The chart type as a string. |
| std::vector<std::pair<double, double> > mitk::ChartExampleTestHelper::ToStdPairList | ( | QVariantList | xData, |
| QVariantList | yData | ||
| ) |
Convert QVariantLists of x and y data to a vector of std::pair.
| [in] | xData | The x values as a QVariantList. |
| [in] | yData | The y values as a QVariantList. |
| QmitkChartWidget mitk::ChartExampleTestHelper::qmitkChartWidget |
The QmitkChartWidget instance used for testing.
Definition at line 81 of file mitkChartExampleTestHelper.h.