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 
24 
25 namespace core
26 {
30 enum class LightType
31 {
32  SPHERE,
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 
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 
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 
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 
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 
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
AmbientLight()=default
Vector3d _direction
Definition: Light.h:72
double _angularDiameter
Definition: Light.h:73
The Light class defines the common base class for all lights.
Definition: Light.h:43
Vector3d _color
Definition: Light.h:50
bool _isVisible
Definition: Light.h:52
Light()=default
double _intensity
Definition: Light.h:51
LightType _type
Definition: Light.h:49
virtual ~Light()=default
Vector3d _position
Definition: Light.h:115
Vector3d _edge1
Definition: Light.h:116
QuadLight()=default
Vector3d _edge2
Definition: Light.h:117
SphereLight()=default
double _radius
Definition: Light.h:93
Vector3d _position
Definition: Light.h:92
double _openingAngle
Definition: Light.h:145
Vector3d _direction
Definition: Light.h:144
double _penumbraAngle
Definition: Light.h:146
Vector3d _position
Definition: Light.h:143
SpotLight()=default
double _radius
Definition: Light.h:147
glm::vec< 3, double > Vector3d
Definition: MathTypes.h:143
LightType
The LightType enum defines the different types of light.
Definition: Light.h:31