Spline class for histogram display using QPainter.
More...
#include <spline.h>
|
| void | borderChanged (double leftThreshold, double middleThreshold, double rightThreshold) |
|
| | Spline (QWidget *parent=nullptr, const QString &title="Spline Histogram") |
| template<typename T> |
| void | setData (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &matClassLimitData, const Eigen::Matrix< int, Eigen::Dynamic, 1 > &matClassFrequencyData) |
| template<typename T> |
| void | setData (const Eigen::Matrix< T, 1, Eigen::Dynamic > &matClassLimitData, const Eigen::Matrix< int, 1, Eigen::Dynamic > &matClassFrequencyData) |
| template<typename T> |
| void | updatePlot (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matClassLimitData, const Eigen::VectorXi &matClassFrequencyData) |
| void | mousePressEvent (QMouseEvent *event) override |
| template<typename T> |
| void | splitCoefficientAndExponent (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &matClassLimitData, int iClassAmount, Eigen::VectorXd &vecCoefficientResults, Eigen::VectorXi &vecExponentValues) |
| void | setThreshold (const QVector3D &vecThresholdValues) |
| const QVector3D & | getThreshold () |
| QVector3D | correctionDisplayTrueValue (QVector3D vecOriginalValues, QString upOrDown) |
| void | setColorMap (const QString &colorMap) |
Spline class for histogram display using QPainter.
Histogram display using QPainter with spline interpolation
Definition at line 78 of file spline.h.
◆ ConstSPtr
Const shared pointer type for Spline class.
Definition at line 84 of file spline.h.
◆ SPtr
◆ Spline()
| Spline::Spline |
( |
QWidget * | parent = nullptr, |
|
|
const QString & | title = "Spline Histogram" ) |
The constructor for Spline
- Parameters
-
| [in] | parent | sets the behaviour of Spline as an object, defaults to no parent QWidget. |
| [in] | title | string to specify the title displayed on the histogram, defaults to "Spline Histogram". |
Definition at line 68 of file spline.cpp.
◆ borderChanged
| void DISPLIB::Spline::borderChanged |
( |
double | leftThreshold, |
|
|
double | middleThreshold, |
|
|
double | rightThreshold ) |
|
signal |
emit signal consisting of three threshold lines x-axis value if any one of them is changed
- Parameters
-
| [out] | leftThreshold | value of the left threshold line. |
| [out] | middleThreshold | value of the middle threshold line. |
| [out] | rightThreshold | value of the right threshold line. |
◆ bottomMargin()
| int DISPLIB::Spline::bottomMargin |
( |
| ) |
const |
|
inlineprotected |
Returns the bottom margin in pixels.
Definition at line 231 of file spline.h.
◆ correctionDisplayTrueValue()
| QVector3D Spline::correctionDisplayTrueValue |
( |
QVector3D | vecOriginalValues, |
|
|
QString | upOrDown ) |
correctionDisplayTrueValue creates necessary adjustment of exponential multiplication with base 10
- Parameters
-
| [in] | vecOriginalValues | QVector3D consisting of 3 original values. |
| [in] | upOrDown | Choice between "up" or "down" conversion direction. |
- Returns
- returns QVector3D after necessary adjustment.
Definition at line 343 of file spline.cpp.
◆ dataToPixelX()
| double Spline::dataToPixelX |
( |
double | dataX | ) |
const |
|
protected |
Converts data X coordinate to pixel X coordinate.
Definition at line 87 of file spline.cpp.
◆ dataToPixelY()
| double Spline::dataToPixelY |
( |
double | dataY | ) |
const |
|
protected |
Converts data Y coordinate to pixel Y coordinate.
Definition at line 97 of file spline.cpp.
◆ getThreshold()
| const QVector3D & Spline::getThreshold |
( |
| ) |
|
getThreshold retrieves the current threshold values
- Returns
- returns QVector3D corresponding to the x-axis value of the threshold lines.
Definition at line 331 of file spline.cpp.
◆ leftMargin()
| int DISPLIB::Spline::leftMargin |
( |
| ) |
const |
|
inlineprotected |
Returns the left margin in pixels.
Definition at line 213 of file spline.h.
◆ mousePressEvent()
| void Spline::mousePressEvent |
( |
QMouseEvent * | event | ) |
|
|
override |
constructor for mouse press event behaviour to create threshold lines and signal emit
- Parameters
-
| [in] | event | mouse press input. |
Definition at line 248 of file spline.cpp.
◆ paintEvent()
| void Spline::paintEvent |
( |
QPaintEvent * | event | ) |
|
|
overrideprotected |
Paints the spline chart.
- Parameters
-
| [in] | event | The paint event. |
Definition at line 116 of file spline.cpp.
◆ pixelToDataX()
| double Spline::pixelToDataX |
( |
double | pixelX | ) |
const |
|
protected |
Converts pixel X coordinate to data X coordinate.
Definition at line 106 of file spline.cpp.
◆ rightMargin()
| int DISPLIB::Spline::rightMargin |
( |
| ) |
const |
|
inlineprotected |
Returns the right margin in pixels.
Definition at line 219 of file spline.h.
◆ setColorMap()
| void Spline::setColorMap |
( |
const QString & | colorMap | ) |
|
setColorMap sets the color mapping on the histogram background
- Parameters
-
| [in] | colorMap | qstring of the color gradient from user input. |
Definition at line 323 of file spline.cpp.
◆ setData() [1/2]
template<typename T>
| void DISPLIB::Spline::setData |
( |
const Eigen::Matrix< T, 1, Eigen::Dynamic > & | matClassLimitData, |
|
|
const Eigen::Matrix< int, 1, Eigen::Dynamic > & | matClassFrequencyData ) |
◆ setData() [2/2]
template<typename T>
| void DISPLIB::Spline::setData |
( |
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | matClassLimitData, |
|
|
const Eigen::Matrix< int, Eigen::Dynamic, 1 > & | matClassFrequencyData ) |
creates a spline histogram from 2 vectors: class limits and class frequency
- Parameters
-
| [in] | matClassLimitData | vector input filled with class limits. |
| [in] | matClassFrequencyData | vector input filled with class frequency to the corresponding class. |
Definition at line 260 of file spline.h.
◆ setThreshold()
| void Spline::setThreshold |
( |
const QVector3D & | vecThresholdValues | ) |
|
setThreshold takes in QVector3D value and creates the corresponding lines in the histogram
- Parameters
-
| [in] | vecThresholdValues | QVector3D consisting of 3 values corresponding to the threshold lines. |
Definition at line 289 of file spline.cpp.
◆ splitCoefficientAndExponent()
template<typename T>
| void DISPLIB::Spline::splitCoefficientAndExponent |
( |
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | matClassLimitData, |
|
|
int | iClassAmount, |
|
|
Eigen::VectorXd & | vecCoefficientResults, |
|
|
Eigen::VectorXi & | vecExponentValues ) |
splitCoefficientAndExponent takes in QVector value of coefficient and exponent and normalizes them.
- Parameters
-
| [in] | matClassLimitData | vector input filled with values of class limits. |
| [in] | iClassAmount | amount of classes in the histogram. |
| [out] | vecCoefficientResults | vector filled with values of coefficient only. |
| [out] | vecExponentValues | vector filled with values of exponent only. |
Definition at line 317 of file spline.h.
◆ topMargin()
| int DISPLIB::Spline::topMargin |
( |
| ) |
const |
|
inlineprotected |
Returns the top margin in pixels.
Definition at line 225 of file spline.h.
◆ updatePlot()
template<typename T>
| void DISPLIB::Spline::updatePlot |
( |
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | matClassLimitData, |
|
|
const Eigen::VectorXi & | matClassFrequencyData ) |
Updates the spline with new data
- Parameters
-
| [in] | matClassLimitData | vector input filled with class limits. |
| [in] | matClassFrequencyData | vector input filled with class frequency to the corresponding class. |
Definition at line 282 of file spline.h.
◆ m_bHasData
| bool DISPLIB::Spline::m_bHasData |
|
protected |
Whether data has been loaded.
Definition at line 237 of file spline.h.
◆ m_bHasThresholds
| bool DISPLIB::Spline::m_bHasThresholds |
|
protected |
Whether thresholds have been set.
Definition at line 238 of file spline.h.
◆ m_colorMap
| QString DISPLIB::Spline::m_colorMap |
|
protected |
Color map name for background gradient.
Definition at line 240 of file spline.h.
◆ m_dLeftThreshold
| double DISPLIB::Spline::m_dLeftThreshold |
|
protected |
X-axis value of the left threshold line.
Definition at line 234 of file spline.h.
◆ m_dMaxAxisX
| double DISPLIB::Spline::m_dMaxAxisX |
Display value of the largest point on the series in x-axis.
Definition at line 180 of file spline.h.
◆ m_dMiddleThreshold
| double DISPLIB::Spline::m_dMiddleThreshold |
|
protected |
X-axis value of the middle threshold line.
Definition at line 235 of file spline.h.
◆ m_dMinAxisX
| double DISPLIB::Spline::m_dMinAxisX |
Display value of the smallest point of the series in x-axis.
Definition at line 179 of file spline.h.
◆ m_dRightThreshold
| double DISPLIB::Spline::m_dRightThreshold |
|
protected |
X-axis value of the right threshold line.
Definition at line 236 of file spline.h.
◆ m_iMaximumFrequency
| int DISPLIB::Spline::m_iMaximumFrequency |
|
protected |
Highest value of frequency (y-axis).
Definition at line 239 of file spline.h.
◆ m_seriesData
| QList<QPointF> DISPLIB::Spline::m_seriesData |
|
protected |
◆ m_vecResultExponentValues
| Eigen::VectorXi DISPLIB::Spline::m_vecResultExponentValues |
Common exponent values for the entire histogram
Definition at line 178 of file spline.h.
◆ m_vecReturnVector
| QVector3D DISPLIB::Spline::m_vecReturnVector |
|
protected |
Cached return value for getThreshold.
Definition at line 241 of file spline.h.
The documentation for this class was generated from the following files: