MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
eventgroup.cpp
Go to the documentation of this file.
1//=============================================================================================================
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
40#include "eventgroup.h"
41#include "event.h"
42
43#include <stdlib.h>
44#include <ctime>
45
46//=============================================================================================================
47// QT INCLUDES
48//=============================================================================================================
49
50//=============================================================================================================
51// EIGEN INCLUDES
52//=============================================================================================================
53
54//=============================================================================================================
55// USED NAMESPACES
56//=============================================================================================================
57
58using namespace EVENTSLIB;
59
60//=============================================================================================================
61// INIT STATIC MEMBERS
62//=============================================================================================================
63
64constexpr static const unsigned char defaultGroupColor[] = { 0xC0, 0xFF, 0xEE };
65constexpr static const unsigned char defaultGroupTransparency = 0xFF;
67//=============================================================================================================
68// DEFINE MEMBER METHODS
69//=============================================================================================================
70
72: RgbColor(defaultGroupColor[0], defaultGroupColor[1], defaultGroupColor[2])
73{ };
74
75//=============================================================================================================
76
77RgbColor::RgbColor(const uchar rRhs, const uchar gRhs, const uchar bRhs)
78: RgbColor(rRhs, gRhs, bRhs, defaultGroupTransparency)
79{ };
80
81//=============================================================================================================
82
83RgbColor::RgbColor(const uchar rRhs, const uchar gRhs,
84 const uchar bRhs, const uchar aRhs)
85: r(rRhs)
86, g(gRhs)
87, b(bRhs)
88, a(aRhs)
89{ };
90
91//=============================================================================================================
92
94: id(g.id)
95, name(g.name)
96, color(g.color)
97, order(g.order)
98{
99
100}
101
102//=============================================================================================================
103
105: id(g.getId())
106, name(g.getName())
107, color(g.getColor())
108, order(g.getOrder())
109{
110
111}
112
113//=============================================================================================================
114
116: EventGroupINT(std::string(name))
117{
118
119}
120
121//=============================================================================================================
122
124: m_sName(std::move(name))
125, m_Id(0)
126, m_order(0)
127{
128 std::srand(std::time(NULL));
129
131}
132
133//=============================================================================================================
134
135EVENTSINTERNAL::EventGroupINT::EventGroupINT(idNum id, const std::string& name)
136: m_sName(name)
137, m_Id(id)
138, m_order(0)
139{
140 std::srand(std::time(NULL));
141
143}
144
145//=============================================================================================================
146
147EVENTSINTERNAL::EventGroupINT::EventGroupINT(idNum id, const std::string& name,
148 const RgbColor& color)
149: m_sName(name)
150, m_Id(id)
151, m_order(0)
152{
153 std::srand(std::time(NULL));
154
155 setColor(color);
156}
157
158//=============================================================================================================
159
161{
162 m_Color = color;
163}
164
165//=============================================================================================================
166
168{
169 return m_Color;
170}
171
172//=============================================================================================================
173
175{
176 m_Color.r = rand() % 256;
177 m_Color.g = rand() % 256;
178 m_Color.b = rand() % 256;
179}
180
181//=============================================================================================================
182
184{
185 return m_sName;
186}
187
188//=============================================================================================================
189
190void EVENTSINTERNAL::EventGroupINT::setName(const std::string &sName)
191{
192 m_sName = sName;
193}
194
195//=============================================================================================================
196
198{
199 return m_Id;
200}
201
202//=============================================================================================================
203
205{
206 return m_sDescription;
207}
208
209//=============================================================================================================
210
212{
213 return m_order;
214}
215
216//=============================================================================================================
217
219{
220 m_order = order;
221}
222
223//=============================================================================================================
224
226{
227 return m_Id < groupRHS.getId();
228}
229
EventGroup declaration.
Event declaration.
Definition event.h:282
EventGroup class is designed as a data holder for a group. It is designed towards ease of use for a c...
Definition eventgroup.h:117
the class stores the concept of an event group internally in the Event library.
Definition eventgroup.h:155
EVENTSLIB::RgbColor getColor() const
void setColor(const EVENTSLIB::RgbColor &color)
void setName(const std::string &sName)
const std::string & getName() const
bool operator<(const EventGroupINT &groupRHS) const