Aperture/mycanvas.h
2023-05-24 03:04:44 +03:00

48 lines
1 KiB
C++

#ifndef MYCANVAS_H
#define MYCANVAS_H
#include <QChart>
#include <QChartView>
#include <QPaintEvent>
#include <QPainter>
#include <QScatterSeries>
#include <QValueAxis>
#include <QWidget>
#include <qwidget.h>
#include "RadarExt.h"
struct TColPoint {
double x, y, amp;
QColor col;
};
class ToPaintState {
public:
ToPaintState() {}
ToPaintState(int type) : type(type) {}
int type = 0;
double pointSize = 5;
double axisX = 1;
double axisY = 1;
};
class MyCanvas : public QWidget {
Q_OBJECT
public:
explicit MyCanvas(QWidget *parent = nullptr);
TRadar radar = TRadar();
QVector<QVector<TColPoint>> FDNMass;
void drawState(ToPaintState);
void ColorAxis(QPaintEvent *event, QPainter *painter, double step, double max);
private:
ToPaintState state = ToPaintState();
QRectF transposeRect(double x, double y, double x2, double y2, double axisX, double axisY);
QPointF transposePoint(double x, double y, double axisX, double axisY);
protected:
void paintEvent(QPaintEvent *event);
};
#endif // MYCANVAS_H