Newer
Older
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "graphobj.h"
GraphObj::GraphObj(){
}
//GraphObj::GraphObj(const GraphObj &graph)
//{
// this->startPoint = graph.startPoint ;
// this->stopPoint = graph.stopPoint ;
// this->color = graph.color ;
// this->outline = graph.outline ;
//}
//GraphObj &GraphObj::operator=(const GraphObj &graph) {
// // check if the Operation is a = a then do nothing ;
// //but a = b ; is okey
// if (this != &graph) {
// // we dont need to do that because there are no pointer
// this->startPoint = graph.startPoint ;
// this->stopPoint = graph.stopPoint ;
// this->color = graph.color ;
// this->outline = graph.outline ;
// }
// return *this;
//}
//GraphObj::~GraphObj(){
//}
QPoint GraphObj::getStopPoint() const
{
return stopPoint;
}
void GraphObj::setStopPoint(QPoint newStopPoint)
{
stopPoint = newStopPoint;
}
QPoint GraphObj::getStartPoint() const
{
return startPoint;
}
void GraphObj::setStartPoint(QPoint newStartPoint)
{
startPoint = newStartPoint;
}
bool GraphObj::getOutline() const{
return outline;
}
void GraphObj::setOutline(bool newOutline){
outline = newOutline;
}
QColor GraphObj::getColor() const
{
return color;
}
void GraphObj::setColor(const QColor &newColor)
{
color = newColor;
}
void GraphObj::setBrushForTheObject(QPainter &painter)
{
// Set brush color using hexadecimal value
painter.setPen(QPen(getColor(), FONTSIZE , Qt::SolidLine));
if(!getOutline()){
painter.setBrush(Qt::NoBrush);
}else{
painter.setBrush(getColor());
}
}
bool GraphObj::getDoneDrawing() const
{
return doneDrawing;
}
void GraphObj::setDoneDrawing(bool newDoneDrawing)
{
doneDrawing = newDoneDrawing;
}