-
Notifications
You must be signed in to change notification settings - Fork 1
/
MyQPoint.cpp
68 lines (58 loc) · 966 Bytes
/
MyQPoint.cpp
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
#include"MyQPoint.h"
MyQPoint::MyQPoint(){
color_ = Qt::red;
index_ = 0;
showQ_ = false;
}
MyQPoint::MyQPoint(QPoint point){
this->setX(point.x());
this->setY(point.y());
this->color_ = Qt::red;
this->index_ = 0;
showQ_ = false;
}
MyQPoint::MyQPoint(QColor color, long long index){
color_ = color;
index_ = index;
}
void MyQPoint::setColor(QColor color){
color_ = color;
}
void MyQPoint::setIndex(long long index){
index_ = index;
}
long long MyQPoint::getIndex(){
return index_;
}
QColor MyQPoint::getColor(){
return color_;
}
vector<int> MyQPoint::getQ()
{
return Q_;
}
void MyQPoint::setQ(vector<int> Q)
{
Q_.clear();
Q_ = Q;
}
void MyQPoint::setQ(deque<Vertex*> Q)
{
Q_.clear();
Vertex * temp_v;
deque<Vertex*>::iterator it_v = Q.begin();
while (it_v != Q.end())
{
temp_v = *it_v;
Q_.push_back(temp_v->index());
it_v++;
}
}
bool MyQPoint::showQ()
{
return showQ_;
}
void MyQPoint::setShowQ(bool showQ)
{
showQ_ = showQ;
}