Aperture/mycanvas.h
2023-05-18 02:08:48 +03:00

49 lines
962 B
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);
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