#ifndef CIRCULAR_H #define CIRCULAR_H //Qt #include #include #include #include #include #include #include #include #include #include #include #include class Circular { public: Circular(){ _scalex = 1; _scaley = 1; } Circular(const QPointF& center){ _center = center; _scalex = 1; _scaley = 1; } void paint(QPixmap& w, QPaintEvent* event=nullptr){ QPainter painter; painter.begin(&w); painter.setRenderHint(QPainter::Antialiasing, true); painter.scale(_scalex,_scaley); painter.setPen(QPen(Qt::black, 0.8)); painter.drawEllipse(_center,_radius,_radius); painter.end(); } QPointF center() const { return _center; } void setCenter(const QPointF ¢er) { _center = center; } QColor color() const { return _color; } void setColor(const QColor &color) { _color = color; } double radius() const { return _radius; } void setRadius(double radius) { _radius = radius; } private: QPointF _center; double _radius; double _scalex; double _scaley; QColor _color; }; #endif // CIRCULAR_H