-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode.h
43 lines (35 loc) · 793 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
#ifndef DEF_NODE
#define DEF_NODE
#include <vector>
#include <iostream>
using namespace std;
class Edge;
class Node
{
public:
//Node();
Node(Node* n);
Node(int x=10000, int y=10000, float error = 0.0f);
virtual ~Node();
Node* maxErrorNeighbour();
Node & operator= (const Node & other);
float getX();
float getY();
float getError();
void addEdge(Edge* e);
float distanceWith(Node* n);
void setClosests(vector<Node*> nodes);
Node* getClosest(int index);
void addError(int d);
Node* getNeighbourNode(Edge* e);
void moveForward(Node* n, float coef);
vector<Edge*> _edges;
private:
float _x,_y;
float _error;
Node* firstClosest;
Node* secondClosest;
};
Node* between(Node* n1, Node* n2);
Node* findNode(vector<Node*> nodes, int x, int y);
#endif