-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvertex.cpp
93 lines (73 loc) · 1.12 KB
/
vertex.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include <string>
#include "vertex.h"
using namespace std;
void Vertex::setValues (string tag, enum Color color, double dist, Vertex* pred, int index)
{
this->tag = tag;
this->color = color;
this->dist = dist;
this->pred = pred;
this->index = index;
this->start = 0;
this->stop = 0;
}
void Vertex::setIndex(int index)
{
this->index = index;
}
bool Vertex::compareTo(Vertex v)
{
return this->getIndex() - v.getIndex();
}
int Vertex::getIndex()
{
return this->index;
}
string Vertex::getTag()
{
return this->tag;
}
void Vertex::setTag(string tag)
{
this->tag.assign(tag);
}
enum Color Vertex::getColor()
{
return this->color;
}
void Vertex::setColor(enum Color color)
{
this->color = color;
}
double Vertex::getDist()
{
return this->dist;
}
void Vertex::setDist(double dist)
{
this->dist = dist;
}
Vertex* Vertex::getPred()
{
return this->pred;
}
void Vertex::setPred(Vertex* v)
{
this->pred = v;
}
int Vertex::getStart()
{
return this->start;
}
void Vertex::setStart(int start)
{
this->start = start;
}
int Vertex::getStop()
{
return this->stop;
}
void Vertex::setStop(int stop)
{
this->stop = stop;
}