anatomist  5.0.5
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();
173  void refreshGLList();
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
GLfloat * Diffuse()
Definition: Light.h:56
GLfloat _modelAmbient[4]
Definition: Light.h:192
virtual ~Light()
GLfloat SpotDirection(int i)
Definition: Light.h:72
GLfloat _spotCutoff
Definition: Light.h:188
GLfloat Diffuse(int i)
Definition: Light.h:57
Light used for OpenGL in 3D windows.
Definition: Light.h:47
GLfloat _quadraticAttenuation
Definition: Light.h:191
void SetAmbientR(float val)
Set the ambient red component of the light.
GLfloat _spotExponent
Definition: Light.h:187
void SetDiffuseA(float val)
Set the diffuse alpha coefficient of the light.
GLfloat SpotCutoff()
Definition: Light.h:75
GLfloat ModelLocalViewer()
Definition: Light.h:79
GLfloat * Ambient()
Definition: Light.h:53
GLfloat _spotDirection[3]
Definition: Light.h:186
void SetModelLocalViewer(float val)
Set the light local viewer model.
void SetLinearAttenuation(float val)
Set the light spot linear attenuation.
void SetSpotDirectionZ(float val)
Set the Z spot light direction.
GLfloat _modelTwoSide
Definition: Light.h:194
void SetAmbientG(float val)
Set the ambient green component of the light.
void SetPositionW(float val)
Set the W position of the spot light.
GLfloat * Background()
Definition: Light.h:62
void SetSpecularB(float val)
Set the specular blue component of the light.
void SetDiffuseB(float val)
Set the diffuse blue component of the light.
GLfloat QuadraticAttenuation()
Definition: Light.h:78
void SetModelAmbientA(float val)
Set the light ambient model alpha coefficient.
void SetModelAmbientB(float val)
Set the light ambient model blue component.
void SetDiffuseG(float val)
Set the diffuse green component of the light.
void SetSpotDirectionY(float val)
Set the Y spot ligth direction.
void SetSpecular(float, float, float, float)
Set the four specular components of the light.
void SetModelTwoSide(float val)
Set the light two side model.
GLfloat _modelLocalViewer
Definition: Light.h:193
GLfloat _diffuse[4]
Definition: Light.h:182
void SetSpecularG(float val)
Set the specular green component of the light.
void SetPositionX(float val)
Set the X position of the spot light.
GLuint _GLList
Definition: Light.h:195
void SetModelAmbientR(float val)
Set the light ambient model red component.
void setChanged(bool=true)
void SetModelAmbientG(float val)
Set the light ambient model green component.
void SetSpecularR(float val)
Set the specular red component of the light.
GLfloat * Position()
Definition: Light.h:68
void SetAmbient(float, float, float, float)
Set the four ambient components of the light.
GLfloat _linearAttenuation
Definition: Light.h:190
void SetDiffuseR(float val)
Set the diffuse red component of the light.
bool _GLLRefreshFlag
Definition: Light.h:196
void SetBackground(float, float, float, float)
Set the four background components of the light.
GLfloat Position(int i)
Definition: Light.h:69
carto::Object genericDescription() const
void SetQuadraticAttenuation(float val)
Set the light spot quadratic attenuation.
void SetSpotDirectionX(float val)
Set the X spot light direction.
GLfloat ModelAmbient(int i)
Definition: Light.h:66
GLfloat ConstantAttenuation()
Definition: Light.h:76
void SetSpotCutoff(float val)
Set the light spot cutoff angle.
void SetModelAmbient(float, float, float, float)
Set the four ambient model components of the light.
GLfloat SpotExponent()
Definition: Light.h:74
GLfloat _background[4]
Definition: Light.h:184
void SetPositionZ(float val)
Set the Z position of the spot light.
GLfloat _position[4]
Definition: Light.h:185
GLfloat _constantAttenuation
Definition: Light.h:189
void SetSpecularA(float val)
Set the specular alpha coefficient of the light.
GLfloat ModelTwoSide()
Definition: Light.h:80
void SetAmbientA(float val)
Set the ambient alpha coefficient of the light.
GLfloat _ambient[4]
Definition: Light.h:181
GLfloat * Specular()
Definition: Light.h:59
void SetBackgroundG(float val)
Set the specular green component of the light.
GLfloat LinearAttenuation()
Definition: Light.h:77
GLfloat _specular[4]
Definition: Light.h:183
void SetAmbientB(float val)
Set the ambient blue component of the light.
GLfloat * SpotDirection()
Definition: Light.h:71
GLfloat * ModelAmbient()
Definition: Light.h:65
GLuint getGLList()
void SetSpotDirection(float, float, float)
Set the three spot direction components of the light.
void SetSpotExponent(float val)
Set the light spot attenuation exponent.
GLfloat Specular(int i)
Definition: Light.h:60
void SetBackgroundA(float val)
Set the specular alpha coefficient of the light.
void SetPosition(float, float, float, float)
Set the four position coordinates of the light.
void SetDiffuse(float, float, float, float)
Set the four diffuse components of the light .
void SetPositionY(float val)
Set the Y position of the spot light.
void SetConstantAttenuation(float val)
Set the light spot constant attenuation.
GLfloat Ambient(int i)
Definition: Light.h:54
void SetBackgroundR(float val)
Set the specular red component of the light.
void SetBackgroundB(float val)
Set the specular blue component of the light.
GLfloat Background(int i)
Definition: Light.h:63