-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.cpp
More file actions
54 lines (40 loc) · 823 Bytes
/
Copy pathNode.cpp
File metadata and controls
54 lines (40 loc) · 823 Bytes
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
#include "Node.h"
int node_LastId = -1;
// Constructor
Node::Node(){
this->id = ++node_LastId;
this->marked = false;
this->position = CoordSet();
Logger::getInstance().log("New node constructed");
}
// Destructor
Node::~Node(){
}
// get id
int Node::getId(){
return this->id;
}
// get&add Line
void Node::addLine(class Line* line){
if(lines.size() < MAX_LINES_PER_NODE)
lines.fill(line);
}
class Line* Node::getLine(int index){
if(index < MAX_LINES_PER_NODE)
return this->lines[index];
return this->lines[0];
}
// get&set marked
void Node::setMarked(bool marked){
this->marked = marked;
}
bool Node::getMarked(){
return this->marked;
}
void Node::setPosition(CoordSet position){
this->position.x = position.x;
this->position.y = position.y;
}
CoordSet Node::getPosition(){
return position;
}