2025-02-28 15:14:18 +01:00
|
|
|
#ifndef ANGLESCUSTOMPLOT_H
|
|
|
|
|
#define ANGLESCUSTOMPLOT_H
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
2025-03-04 16:31:58 +01:00
|
|
|
#include <qcustomplot.h>
|
2025-02-28 15:14:18 +01:00
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class AnglesCustomPlot;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AnglesCustomPlot : public QCustomPlot
|
|
|
|
|
{
|
2025-03-04 16:31:58 +01:00
|
|
|
Q_OBJECT
|
2025-02-28 15:14:18 +01:00
|
|
|
public:
|
|
|
|
|
explicit AnglesCustomPlot(const QVector<double>& data, const QString& xLabel, int nbBins,
|
|
|
|
|
QWidget *parent = nullptr);
|
|
|
|
|
~AnglesCustomPlot();
|
|
|
|
|
|
|
|
|
|
bool computeHistogram(const QVector<double>& data);
|
|
|
|
|
|
|
|
|
|
void createQCPBars(const QString &xLabel);
|
|
|
|
|
|
|
|
|
|
void rescale();
|
|
|
|
|
|
|
|
|
|
QSharedPointer<QCPBarsDataContainer> dataContainer(){return m_bars->data();}
|
|
|
|
|
|
2025-03-04 16:31:58 +01:00
|
|
|
void emitCloseTab(){emit closeTab();}
|
|
|
|
|
|
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
|
|
|
|
|
|
|
|
|
void mousePressEvent(QMouseEvent* event) override;
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void closeTab();
|
|
|
|
|
|
2025-02-28 15:14:18 +01:00
|
|
|
private:
|
|
|
|
|
Ui::AnglesCustomPlot *ui;
|
|
|
|
|
|
|
|
|
|
QVector<double> m_axis;
|
|
|
|
|
|
|
|
|
|
QVector<double> m_histogram;
|
|
|
|
|
|
|
|
|
|
QString m_label;
|
|
|
|
|
|
|
|
|
|
QCPBars* m_bars;
|
|
|
|
|
|
|
|
|
|
int m_nbBins;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // ANGLESCUSTOMPLOT_H
|