-
Notifications
You must be signed in to change notification settings - Fork 3
/
Shape.h
51 lines (34 loc) · 1.07 KB
/
Shape.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
50
51
#ifndef SHAPE_H
#define SHAPE_H
#include <QGraphicsItem>
#include <QPainter>
#include <QString>
#include <QColor>
#include <QPair>
class Shape
{
public:
QGraphicsRectItem* rect;
QGraphicsEllipseItem* circ;
QGraphicsPolygonItem* triangle;
QGraphicsLineItem* line;
QPen pen;
Shape(int x1,int y1,QColor color,QBrush brush,int linewidth, QGraphicsScene* scene);
~Shape();
virtual void setParemeters(int x2,int y2);
virtual void setPerimeter();
virtual void addShape();
virtual void deleteShape();
virtual QString getname();
virtual QString getshapeType();
void setname(QString name);
float get_perimeter() const;
void updateInfoTable();
protected:
QString name; // The Shape name.
float perimeter; // The perimiter of the Shape.
QString shapeType; // The type of the Shape.
int x1,y1; // The points which we make our drawing with.
QGraphicsScene* scene; // The scene pointer which make all the attributes of the Shape Class accessible to the MainWindow.
};
#endif // SHAPE_H