anatomist 6.0.4
3D neuroimaging data viewer
Material.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_MATERIAL_H
36#define ANA_COLOR_MATERIAL_H
37
39#include <cartobase/object/object.h>
40
41
42namespace anatomist
43{
44
48 {
49 public:
79
89
97
104
111
114
115 virtual ~Material();
116
117 GLfloat *Ambient() { return(_ambient); }
118 GLfloat *Diffuse() { return(_diffuse); }
119 GLfloat *Specular() { return(_specular); }
120 GLfloat Shininess() const { return(_shininess); }
121 GLfloat *Emission() { return(_emission); }
122
123 GLfloat Ambient(int i) const { return(_ambient[i]); }
124 GLfloat Diffuse(int i) const { return(_diffuse[i]); }
125 GLfloat Specular(int i) const { return(_specular[i]); }
126 GLfloat Emission(int i) const { return(_emission[i]); }
127
128 void SetAmbient(float, float, float, float);
129 void SetDiffuse(float, float, float, float);
130 void SetSpecular(float, float, float, float);
131 void SetShininess(float val);
132 void SetEmission(float, float, float, float);
133
134 void SetAmbientR(float val);
135 void SetAmbientG(float val);
136 void SetAmbientB(float val);
137 void SetAmbientA(float val);
138 void SetDiffuseR(float val);
139 void SetDiffuseG(float val);
140 void SetDiffuseB(float val);
141 void SetDiffuseA(float val);
142 void SetSpecularR(float val);
143 void SetSpecularG(float val);
144 void SetSpecularB(float val);
145 void SetSpecularA(float val);
146 void SetEmissionR(float val);
147 void SetEmissionG(float val);
148 void SetEmissionB(float val);
149 void SetEmissionA(float val);
151 GLfloat *unlitColor() const;
152 GLfloat unlitColor( int i ) const;
153 void setUnlitColor( float, float, float, float );
154 float lineWidth() const;
155 void setLineWidth( float w );
156
162 void setGLMaterial() const;
166 void popGLState() const;
167
168 bool IsBlended() const;
172
174 friend std::istream &operator >> (std::istream &, anatomist::Material &);
175 friend std::ostream &operator << (std::ostream &,
176 const anatomist::Material &);
177 bool operator != ( const Material & ) const;
178 bool operator == ( const Material & mat ) const
179 { return( !operator != ( mat ) ); }
180
181 void set( const carto::GenericObject & );
183
184 protected:
185 GLfloat _ambient[4];
186 GLfloat _diffuse[4];
187 GLfloat _specular[4];
188 GLfloat _shininess;
189 GLfloat _emission[4];
190
191 private:
192 struct Private;
193 Private *d;
194 };
195
196 std::istream &operator >> (std::istream &, anatomist::Material &);
197 std::ostream &operator << (std::ostream &, const anatomist::Material &);
198
199}
200
201#endif
This class has to be rewritten, it's really really a shame.......
Definition Material.h:48
GLfloat unlitColor(int i) const
friend std::istream & operator>>(std::istream &, anatomist::Material &)
void setGLMaterial() const
setup OpenGL properties.
float lineWidth() const
bool operator!=(const Material &) const
GLfloat * unlitColor() const
color used without lighting (filar meshes, wireframe)
void SetSpecularG(float val)
void SetDiffuseA(float val)
void SetSpecularR(float val)
void set(const carto::GenericObject &)
friend std::ostream & operator<<(std::ostream &, const anatomist::Material &)
bool IsBlended() const
GLfloat * Ambient()
Definition Material.h:117
void setLineWidth(float w)
void setUnlitColor(float, float, float, float)
void SetEmissionG(float val)
GLfloat Shininess() const
Definition Material.h:120
void SetAmbientB(float val)
void SetSpecular(float, float, float, float)
GLfloat _ambient[4]
Definition Material.h:185
void SetDiffuseR(float val)
GLfloat Ambient(int i) const
Definition Material.h:123
void SetAmbientA(float val)
@ SelectableWhenNotTotallyTransparent
Definition Material.h:95
bool operator==(const Material &mat) const
Definition Material.h:178
void setRenderProperty(RenderProperty, int)
int renderProperty(RenderProperty) const
a property set to -1 is neutral (use window or app default)
void SetDiffuseG(float val)
void SetEmissionA(float val)
GLfloat _diffuse[4]
Definition Material.h:186
void SetEmissionR(float val)
carto::Object genericDescription() const
GLfloat Diffuse(int i) const
Definition Material.h:124
void SetSpecularB(float val)
Material(const Material &)
void SetAmbientR(float val)
GLfloat _emission[4]
Definition Material.h:189
void SetSpecularA(float val)
GLfloat Emission(int i) const
Definition Material.h:126
void SetEmission(float, float, float, float)
void SetEmissionB(float val)
void SetDiffuse(float, float, float, float)
Material & operator=(const Material &)
void SetAmbientG(float val)
GLfloat _specular[4]
Definition Material.h:187
RenderProperty
Rendering properties flags.
Definition Material.h:52
@ RenderFaceCulling
filter back side polygons
Definition Material.h:62
@ FrontFace
specify which is the front face (normally CW in our indirect referentials): 0 is CW,...
Definition Material.h:65
@ RenderLighting
lighting effect according to vertices normals
Definition Material.h:54
@ RenderFiltering
line/polygon filtering
Definition Material.h:58
@ RenderMode
wireframe rendering
Definition Material.h:67
@ Ghost
ghost mode (invisible to clicks)
Definition Material.h:69
@ NormalIsDirection
if set, the normal in a mesh is actually its wireframe direction, and interpreted as if the wireframe...
Definition Material.h:77
@ RenderZBuffer
print in Z-buffer
Definition Material.h:60
@ RenderSmoothShading
polygons color interpolation
Definition Material.h:56
GLfloat * Specular()
Definition Material.h:119
GLfloat * Emission()
Definition Material.h:121
void popGLState() const
Pops previous OpenGL state.
GLfloat Specular(int i) const
Definition Material.h:125
void SetShininess(float val)
void SetAmbient(float, float, float, float)
GLfloat * Diffuse()
Definition Material.h:118
void SetDiffuseB(float val)
std::ostream & operator<<(std::ostream &, const anatomist::Material &)
std::istream & operator>>(std::istream &, anatomist::Material &)