-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathellipse.h
49 lines (36 loc) · 1.05 KB
/
ellipse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef ELLIPSE_H
#define ELLIPSE_H
#include "item.h"
#include <vector>
using std::vector;
class Scene;
class Ellipse : public Item
{
public:
Ellipse(int x, int y, int xRadius, int yRadius, Scene *scene, QGraphicsItem *parent = nullptr);
Type getType() const override;
QColor getFillColor() const override;
void reDraw() override;
QPoint getPoint() const;
void setPoint(const QPoint &point);
int getX() const;
void setX(int value);
int getY() const;
void setY(int value);
int getXRadius() const;
void setXRadius(int value);
int getYRadius() const;
void setYRadius(int value);
void setFillColor(const QColor &value);
protected:
void fillEllipse();
void drawEllipse();
QRectF boundingRect() const override;
QPainterPath shape() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
private:
QPainterPath fillPath;
QColor fillColor = Qt::color0;
int x, y, xRadius, yRadius;
};
#endif // ELLIPSE_H