-
Notifications
You must be signed in to change notification settings - Fork 1
/
element.cpp
75 lines (64 loc) · 1016 Bytes
/
element.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
/**
* PGR 2013 project
* Abstract class used for all objects that can be drawn
*
* @author xskota05 Klara Vankova
* xsimet00 Vojtech Simetka
* @date 2013/11/25
* @version 1
* @file element.cpp
*/
#include "element.h"
/**
* @brief Element constructor
*/
Element::Element(ElementType::Type type)
: highlighted(false)
, selected(false)
, visible(true)
, type(type)
{
}
Element::~Element()
{
}
/**
* @brief Highlights element
*/
void Element::highlightMe()
{
highlighted = true;
}
/**
* @brief Dehighlights element
*/
void Element::deHighlightMe()
{
highlighted = false;
}
/**
* @brief Marks element as selected
*/
void Element::selectMe()
{
selected = true;
}
/**
* @brief Deselects element
*/
void Element::deSelectMe()
{
selected = false;
}
ElementType::Type Element::getType() const
{
return this->type;
}
bool Element::isSelected() const
{
return this->selected;
}
void Element::setVisible(bool val)
{
this->visible = val;
}