anatomist  5.1.2
3D neuroimaging data viewer
Light.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef ANA_COLOR_LIGHT_H
36 #define ANA_COLOR_LIGHT_H
37 
40 
41 
42 namespace anatomist
43 {
44 
47  class Light
48  {
49  public:
50  Light();
51  virtual ~Light();
52 
53  GLfloat *Ambient() { return(_ambient); }
54  GLfloat Ambient(int i) { return(_ambient[i]); }
55 
56  GLfloat *Diffuse() { return(_diffuse); }
57  GLfloat Diffuse(int i) { return(_diffuse[i]); }
58 
59  GLfloat *Specular() { return(_specular); }
60  GLfloat Specular(int i) { return(_specular[i]); }
61 
62  GLfloat *Background() { return(_background); }
63  GLfloat Background(int i) { return(_background[i]); }
64 
65  GLfloat *ModelAmbient() { return(_modelAmbient); }
66  GLfloat ModelAmbient(int i) { return(_modelAmbient[i]); }
67 
68  GLfloat *Position() { return(_position); }
69  GLfloat Position(int i) { return(_position[i]); }
70 
71  GLfloat *SpotDirection() { return(_spotDirection); }
72  GLfloat SpotDirection(int i) { return(_spotDirection[i]); }
73 
74  GLfloat SpotExponent() { return(_spotExponent); }
75  GLfloat SpotCutoff() { return(_spotCutoff); }
77  GLfloat LinearAttenuation() { return(_linearAttenuation); }
79  GLfloat ModelLocalViewer() { return(_modelLocalViewer); }
80  GLfloat ModelTwoSide() { return(_modelTwoSide); }
81 
83  void SetSpotExponent(float val);
85  void SetSpotCutoff(float val);
87  void SetConstantAttenuation(float val);
89  void SetLinearAttenuation(float val);
91  void SetQuadraticAttenuation(float val);
93  void SetModelLocalViewer(float val);
95  void SetModelTwoSide(float val);
96 
98  void SetPosition(float, float, float, float);
100  void SetPositionX(float val);
102  void SetPositionY(float val);
104  void SetPositionZ(float val);
106  void SetPositionW(float val);
107 
109  void SetSpotDirection(float, float, float);
111  void SetSpotDirectionX(float val);
113  void SetSpotDirectionY(float val);
115  void SetSpotDirectionZ(float val);
116 
118  void SetModelAmbient(float, float, float, float);
120  void SetModelAmbientR(float val);
122  void SetModelAmbientG(float val);
124  void SetModelAmbientB(float val);
126  void SetModelAmbientA(float val);
127 
129  void SetAmbient(float, float, float, float);
131  void SetAmbientR(float val);
133  void SetAmbientG(float val);
135  void SetAmbientB(float val);
137  void SetAmbientA(float val);
138 
140  void SetDiffuse(float, float, float, float);
142  void SetDiffuseR(float val);
144  void SetDiffuseG(float val);
146  void SetDiffuseB(float val);
148  void SetDiffuseA(float val);
149 
151  void SetSpecular(float, float, float, float);
153  void SetSpecularR(float val);
155  void SetSpecularG(float val);
157  void SetSpecularB(float val);
159  void SetSpecularA(float val);
160 
162  void SetBackground(float, float, float, float);
164  void SetBackgroundR(float val);
166  void SetBackgroundG(float val);
168  void SetBackgroundB(float val);
170  void SetBackgroundA(float val);
171 
172  GLuint getGLList();
174  void setChanged( bool=true );
175 
176  void set( const carto::GenericObject & );
177  void set( const carto::Object & );
179 
180  protected:
181  GLfloat _ambient[4];
182  GLfloat _diffuse[4];
183  GLfloat _specular[4];
184  GLfloat _background[4];
185  GLfloat _position[4];
186  GLfloat _spotDirection[3];
187  GLfloat _spotExponent;
188  GLfloat _spotCutoff;
192  GLfloat _modelAmbient[4];
194  GLfloat _modelTwoSide;
195  GLuint _GLList;
197  };
198 
199 }
200 
201 
202 #endif
Light used for OpenGL in 3D windows.
Definition: Light.h:48
void SetQuadraticAttenuation(float val)
Set the light spot quadratic attenuation.
void SetSpecularB(float val)
Set the specular blue component of the light.
GLfloat ModelTwoSide()
Definition: Light.h:80
void SetModelAmbientA(float val)
Set the light ambient model alpha coefficient.
GLfloat _ambient[4]
Definition: Light.h:181
GLuint _GLList
Definition: Light.h:195
GLfloat Specular(int i)
Definition: Light.h:60
GLfloat Ambient(int i)
Definition: Light.h:54
GLfloat * Ambient()
Definition: Light.h:53
GLfloat SpotExponent()
Definition: Light.h:74
void SetBackgroundG(float val)
Set the specular green component of the light.
GLfloat SpotDirection(int i)
Definition: Light.h:72
void SetDiffuseB(float val)
Set the diffuse blue component of the light.
GLfloat _position[4]
Definition: Light.h:185
void SetPositionZ(float val)
Set the Z position of the spot light.
void SetSpotCutoff(float val)
Set the light spot cutoff angle.
void SetSpecularG(float val)
Set the specular green component of the light.
void SetSpotExponent(float val)
Set the light spot attenuation exponent.
GLfloat ConstantAttenuation()
Definition: Light.h:76
void SetSpecular(float, float, float, float)
Set the four specular components of the light.
void SetAmbientA(float val)
Set the ambient alpha coefficient of the light.
void SetDiffuseG(float val)
Set the diffuse green component of the light.
GLfloat ModelLocalViewer()
Definition: Light.h:79
GLfloat * SpotDirection()
Definition: Light.h:71
GLfloat Position(int i)
Definition: Light.h:69
void set(const carto::Object &)
void SetConstantAttenuation(float val)
Set the light spot constant attenuation.
void SetModelTwoSide(float val)
Set the light two side model.
void SetAmbientB(float val)
Set the ambient blue component of the light.
void SetPositionW(float val)
Set the W position of the spot light.
void SetAmbientG(float val)
Set the ambient green component of the light.
void SetDiffuseA(float val)
Set the diffuse alpha coefficient of the light.
void SetPositionY(float val)
Set the Y position of the spot light.
GLfloat Background(int i)
Definition: Light.h:63
GLuint getGLList()
void SetDiffuseR(float val)
Set the diffuse red component of the light.
GLfloat _modelTwoSide
Definition: Light.h:194
void SetSpotDirectionX(float val)
Set the X spot light direction.
void SetSpotDirectionZ(float val)
Set the Z spot light direction.
void SetBackground(float, float, float, float)
Set the four background components of the light.
GLfloat _specular[4]
Definition: Light.h:183
GLfloat _modelAmbient[4]
Definition: Light.h:192
void SetSpecularA(float val)
Set the specular alpha coefficient of the light.
void SetModelAmbientR(float val)
Set the light ambient model red component.
GLfloat Diffuse(int i)
Definition: Light.h:57
void SetAmbient(float, float, float, float)
Set the four ambient components of the light.
GLfloat * Specular()
Definition: Light.h:59
void SetSpotDirectionY(float val)
Set the Y spot ligth direction.
GLfloat * Position()
Definition: Light.h:68
GLfloat _quadraticAttenuation
Definition: Light.h:191
GLfloat * Background()
Definition: Light.h:62
GLfloat _diffuse[4]
Definition: Light.h:182
GLfloat _spotExponent
Definition: Light.h:187
void SetModelLocalViewer(float val)
Set the light local viewer model.
GLfloat * Diffuse()
Definition: Light.h:56
void set(const carto::GenericObject &)
GLfloat _spotDirection[3]
Definition: Light.h:186
void SetPosition(float, float, float, float)
Set the four position coordinates of the light.
void SetBackgroundA(float val)
Set the specular alpha coefficient of the light.
GLfloat ModelAmbient(int i)
Definition: Light.h:66
GLfloat LinearAttenuation()
Definition: Light.h:77
GLfloat _modelLocalViewer
Definition: Light.h:193
GLfloat _linearAttenuation
Definition: Light.h:190
void SetBackgroundB(float val)
Set the specular blue component of the light.
carto::Object genericDescription() const
GLfloat * ModelAmbient()
Definition: Light.h:65
void SetModelAmbientG(float val)
Set the light ambient model green component.
bool _GLLRefreshFlag
Definition: Light.h:196
void SetModelAmbientB(float val)
Set the light ambient model blue component.
virtual ~Light()
void SetLinearAttenuation(float val)
Set the light spot linear attenuation.
void SetModelAmbient(float, float, float, float)
Set the four ambient model components of the light.
GLfloat QuadraticAttenuation()
Definition: Light.h:78
GLfloat SpotCutoff()
Definition: Light.h:75
GLfloat _spotCutoff
Definition: Light.h:188
void SetSpotDirection(float, float, float)
Set the three spot direction components of the light.
void setChanged(bool=true)
GLfloat _constantAttenuation
Definition: Light.h:189
void SetAmbientR(float val)
Set the ambient red component of the light.
void SetDiffuse(float, float, float, float)
Set the four diffuse components of the light .
GLfloat _background[4]
Definition: Light.h:184
void SetBackgroundR(float val)
Set the specular red component of the light.
void SetSpecularR(float val)
Set the specular red component of the light.
void SetPositionX(float val)
Set the X position of the spot light.