Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Material.h

Go to the documentation of this file.
00001 
00037 #ifndef _AMIRE_COMMON_MATERIAL_H
00038 #define _AMIRE_COMMON_MATERIAL_H
00039 
00040 #include <amire/common/Defines.h>
00041 
00042 namespace amire {
00043   namespace common {
00047     class AMIRE_EXPORT_API Material : public virtual osg::Referenced {
00048     public:
00052       static const Material &red();
00053 
00057       static const Material &green();
00058 
00062       static const Material &blue();
00063 
00067       static const Material &white();
00068 
00072       static const Material &black();
00073 
00074     private:
00075       float ambient[4];
00076       float diffuse[4];
00077       float specular[4];
00078       float emission[4];
00079       float shininess;
00080 
00081     public:
00085       Material(bool fetchValues = false);
00086 
00090       Material(float color[4]);
00091 
00095       Material(float red, float green, float blue, float alpha);
00096 
00100       Material(float diffuse[4], float ambient[4], float specular[4], float emisson[4], float shininess);
00101 
00105       Material(const Material &material);
00106 
00107       virtual ~Material();
00108 
00112       void fetch(GLenum face = GL_FRONT);
00113 
00117       void apply(GLenum face = GL_FRONT) const;
00118 
00122       void reset();
00123 
00127       void setColor(const float color[4]);
00128 
00132       void setColor(float red, float green, float blue, float alpha);
00133 
00137       void setAmbient(const float ambient[4]);
00138 
00142       void setAmbient(float ambient0, float ambient1, float ambient2, float ambient3);
00143 
00147       const float *getAmbient() const;
00148 
00152       void setDiffuse(const float diffuse[4]);
00153 
00157       void setDiffuse(float diffuse0, float diffuse1, float diffuse2, float diffuse3);
00158 
00162       const float *getDiffuse() const;
00163 
00167       void setSpecular(const float specular[4]);
00168 
00172       void setSpecular(float specular0, float specular1, float specular2, float specular3);
00173 
00177       const float *getSpecular() const;
00178 
00182       void setEmission(const float emission[4]);
00183 
00187       void setEmission(float emission0, float emission1, float emission2, float emission3);
00188 
00192       const float *getEmission() const;
00193 
00197       void setShininess(float shininess);
00198 
00202       float getShininess() const;
00203     };
00204   }
00205 }
00206 
00207 #endif

Generated on Tue May 20 17:23:53 2003 for AMIRE-Framework by doxygen1.3