Blue Brain BioExplorer
Light.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-2024, EPFL/Blue Brain Project
3
* All rights reserved. Do not distribute without permission.
4
*
5
* This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
6
*
7
* This library is free software; you can redistribute it and/or modify it under
8
* the terms of the GNU Lesser General Public License version 3.0 as published
9
* by the Free Software Foundation.
10
*
11
* This library is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14
* details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this library; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
*/
20
21
#pragma once
22
23
#include <
platform/core/common/Types.h
>
24
25
namespace
core
26
{
30
enum class
LightType
31
{
32
SPHERE
,
33
DIRECTIONAL
,
34
QUAD
,
35
SPOTLIGHT
,
36
AMBIENT
37
};
38
42
class
Light
43
{
44
public
:
45
Light
(
LightType
type,
const
Vector3d
& color,
double
intensity,
bool
isVisible);
46
Light
() =
default
;
47
virtual
~Light
() =
default
;
48
49
LightType
_type
;
50
Vector3d
_color
;
51
double
_intensity
;
52
bool
_isVisible
;
53
};
54
55
class
DirectionalLight
:
public
Light
56
{
57
public
:
68
DirectionalLight
(
const
Vector3d
& direction,
double
angularDiameter,
const
Vector3d
& color,
double
intensity,
69
bool
isVisible);
70
DirectionalLight
() =
default
;
71
72
Vector3d
_direction
;
73
double
_angularDiameter
;
74
};
75
76
class
SphereLight
:
public
Light
77
{
78
public
:
89
SphereLight
(
const
Vector3d
& position,
double
radius,
const
Vector3d
& color,
double
intensity,
bool
isVisible);
90
SphereLight
() =
default
;
91
92
Vector3d
_position
;
93
double
_radius
;
94
};
95
96
class
QuadLight
:
public
Light
97
{
98
public
:
111
QuadLight
(
const
Vector3d
& position,
const
Vector3d
& edge1,
const
Vector3d
& edge2,
const
Vector3d
& color,
112
double
intensity,
bool
isVisible);
113
QuadLight
() =
default
;
114
115
Vector3d
_position
;
116
Vector3d
_edge1
;
117
Vector3d
_edge2
;
118
};
119
120
class
SpotLight
:
public
Light
121
{
122
public
:
139
SpotLight
(
const
Vector3d
& position,
const
Vector3d
& direction,
const
double
openingAngle,
140
const
double
penumbraAngle,
const
double
radius,
const
Vector3d
& color,
double
intensity,
bool
isVisible);
141
SpotLight
() =
default
;
142
143
Vector3d
_position
;
144
Vector3d
_direction
;
145
double
_openingAngle
;
146
double
_penumbraAngle
;
147
double
_radius
;
148
};
149
150
class
AmbientLight
:
public
Light
151
{
152
public
:
161
AmbientLight
(
const
Vector3d
& color,
double
intensity,
bool
isVisible);
162
AmbientLight
() =
default
;
163
};
164
165
}
// namespace core
core::AmbientLight
Definition:
Light.h:151
core::AmbientLight::AmbientLight
AmbientLight()=default
core::DirectionalLight
Definition:
Light.h:56
core::DirectionalLight::_direction
Vector3d _direction
Definition:
Light.h:72
core::DirectionalLight::_angularDiameter
double _angularDiameter
Definition:
Light.h:73
core::DirectionalLight::DirectionalLight
DirectionalLight()=default
core::Light
The Light class defines the common base class for all lights.
Definition:
Light.h:43
core::Light::_color
Vector3d _color
Definition:
Light.h:50
core::Light::_isVisible
bool _isVisible
Definition:
Light.h:52
core::Light::Light
Light()=default
core::Light::_intensity
double _intensity
Definition:
Light.h:51
core::Light::_type
LightType _type
Definition:
Light.h:49
core::Light::~Light
virtual ~Light()=default
core::QuadLight
Definition:
Light.h:97
core::QuadLight::_position
Vector3d _position
Definition:
Light.h:115
core::QuadLight::_edge1
Vector3d _edge1
Definition:
Light.h:116
core::QuadLight::QuadLight
QuadLight()=default
core::QuadLight::_edge2
Vector3d _edge2
Definition:
Light.h:117
core::SphereLight
Definition:
Light.h:77
core::SphereLight::SphereLight
SphereLight()=default
core::SphereLight::_radius
double _radius
Definition:
Light.h:93
core::SphereLight::_position
Vector3d _position
Definition:
Light.h:92
core::SpotLight
Definition:
Light.h:121
core::SpotLight::_openingAngle
double _openingAngle
Definition:
Light.h:145
core::SpotLight::_direction
Vector3d _direction
Definition:
Light.h:144
core::SpotLight::_penumbraAngle
double _penumbraAngle
Definition:
Light.h:146
core::SpotLight::_position
Vector3d _position
Definition:
Light.h:143
core::SpotLight::SpotLight
SpotLight()=default
core::SpotLight::_radius
double _radius
Definition:
Light.h:147
core
Definition:
BaseWindow.cpp:53
core::Vector3d
glm::vec< 3, double > Vector3d
Definition:
MathTypes.h:143
core::LightType
LightType
The LightType enum defines the different types of light.
Definition:
Light.h:31
core::LightType::SPHERE
@ SPHERE
core::LightType::SPOTLIGHT
@ SPOTLIGHT
core::LightType::DIRECTIONAL
@ DIRECTIONAL
core::LightType::QUAD
@ QUAD
core::LightType::AMBIENT
@ AMBIENT
Types.h
platform
core
common
light
Light.h
Generated by
1.9.1