-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlightscontext.cpp
More file actions
50 lines (41 loc) · 859 Bytes
/
lightscontext.cpp
File metadata and controls
50 lines (41 loc) · 859 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
#include "lightscontext.h"
#include "light.h"
LightsContext::LightsContext() :
ambient(Qt::white)
{
}
LightsContext::LightsContext(LightsContext *l) :
ambient(l->ambient)
{
for (unsigned i=0; i<l->lights.size(); i++)
lights.push_back(new Light(l->lights.at(i)));
}
void LightsContext::setAmbient(QColor c)
{
ambient = c;
}
QColor LightsContext::getAmbient() const
{
return ambient;
}
unsigned LightsContext::addLight(Light *l)
{
lights.push_back(l);
return lights.size() - 1;
}
void LightsContext::deleteLight(unsigned i)
{
lights.erase(lights.begin()+i);
}
Light LightsContext::getLightAt(unsigned pos) const
{
return Light(lights.at(pos));
}
Light *LightsContext::getLightPtrAt(unsigned pos)
{
return lights.at(pos);
}
unsigned LightsContext::getLightsCount() const
{
return lights.size();
}