-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.h
47 lines (39 loc) · 970 Bytes
/
Node.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
#pragma once
#include <string>
#include <vector>
#include "Edge.h"
using namespace std;
class Node
{
private:
string name;
const int reference;
const double x;
const double y;
vector<Edge*> edges;
//used for Dijkstras algorithm
bool visited;
double distanceFromStart;
int previousNodeRef;
//nodes are unique and shouldn't be copied
Node* operator=(const Node& rhs);
Node(const Node& rhs);
public:
bool inQueue;
Node(const string &pName, const int &pReference, const double &pX, const double &pY);
void addEdge(Edge *pEdge);
void visitNode();
void resetVisited();
void distanceFromStartZero();
void setDistanceFromStart(const double &pDistance);
void setPreviousNodeRef(const int& pPreviousNodeRef);
int getPreviousNodeRef();
double getX();
double getY();
int getReference();
bool isVisited();
double getDistanceFromStart() const;
string getName();
vector<Edge*> getEdges();
~Node();
};