-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.cpp
80 lines (66 loc) · 1.05 KB
/
Node.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
#include "Node.h"
Node::Node(const int& nr) : m_number(nr)
{
}
Node::Node() :
m_number(-1),
m_type(Type::EDefault)
{
}
Node::Node(const QPointF& point, const int& nr) :m_point(point), m_number(nr),
m_type(Type::EDefault)
{}
Node::Node(const Node& other)
{
m_number = other.m_number;
m_point = other.m_point;
m_type = other.m_type;
}
Node::Node(Node&& node)
{
*this = std::move(node);
}
Node& Node::operator=(const Node& node)
{
if (this != &node)
{
m_number =node.m_number;
m_point =node.m_point;
m_type = node.m_type;
}
return *this;
}
Node& Node::operator=(Node&& node)
{
if (this != &node)
{
m_number = node.m_number;
m_point = std::move(node.m_point);
m_type = node.m_type;
}
return *this;
}
QPointF Node::GetPoint() const
{
return m_point;
}
void Node::SetPoint(const QPointF& point)
{
m_point = point;
}
void Node::SetNumber(const int& newNumber)
{
m_number = newNumber;
}
int Node::GetNumber() const
{
return m_number;
}
void Node::SetType(Type type)
{
m_type = type;
}
Node::Type Node::GetType() const
{
return m_type;
}