EnergySpectrumAnalyer/src/CustomQwtPlot.h

34 lines
898 B
C
Raw Normal View History

#ifndef CUSTOMQWTPLOT_H
#define CUSTOMQWTPLOT_H
2026-03-12 20:23:55 +08:00
#include <QMap>
#include <QwtPlot>
class QwtPlotCurve;
2026-03-12 20:23:55 +08:00
class QwtPlotMarker;
class CustomQwtPlot : public QwtPlot
{
public:
explicit CustomQwtPlot(QWidget* parent = nullptr);
2026-03-12 20:23:55 +08:00
QwtPlotCurve* GetCurve(const QString& curve_name);
QList<QwtPlotCurve*> GetCurveList() const;
void AddCurve(QwtPlotCurve* curve);
2026-03-12 20:23:55 +08:00
QwtPlotMarker* GetMarker(const QString& marker_name, const QString& postion);
QList<QwtPlotMarker*> GetMarkerList() const;
void AddMarker(QwtPlotMarker *marker, const QString &marker_name, const QString &postion);
void RemoveMarker(const QString& marker_name, const QString& postion);
void CleanMarkers();
private:
2026-03-12 20:23:55 +08:00
QMap<QString, QwtPlotCurve*> _curves;
QMap<QString, QMap<QString, QwtPlotMarker*> > _markers;
};
2026-03-12 20:23:55 +08:00
QColor getDistinctColorForManyCurves(int curve_index);
#endif // CUSTOMQWTPLOT_H