Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Material.h

00001 /*
00002   File: Material.h
00003 
00004   Copyright(C) C. Kotterink, Computed Graphics
00005 */
00006 #ifndef MATERIAL_H
00007 #define MATERIAL_H
00008 
00009 #include<Shade.h>
00010 #include<RefCount.h>
00011 
00012 #include<map>
00013 
00014 class WDFFile;
00015 
00034 class Material : public Shade
00035 {
00036     DYNAMIC_OBJECT;
00037 public:
00038     Material();
00039 
00040     const Color4 &getEmission() {
00041         return emission;
00042     }
00043     const Color4 &getAmbient() {
00044         return ambient;
00045     }
00046     const Color4 &getDiffuse() {
00047         return diffuse;
00048     }
00049     const Color4 &getSpecular() {
00050         return specular;
00051     }
00052     float getShininess() {
00053         return shininess;
00054     }
00055     void setEmission(const Color4 &color) {
00056         emission = color;
00057     }
00058     void setAmbient(const Color4 &color) {
00059         ambient = color;
00060     }
00061     void setDiffuse(const Color4 &color) {
00062         diffuse = color;
00063     }
00064     void setSpecular(const Color4 &color) {
00065         specular = color;
00066     }
00067     void setShininess(float s) {
00068         shininess = s;
00069     }
00070 
00071     void render();
00072     
00073     void read(WDFFile &f);
00074     void write(WDFFile &f) const;
00075 
00076     // Inherited from Shade
00077     Color4 calculateColor(const SurfaceInfo &s, Scene &scene);
00078 
00079     // Inherited from DynamicObject
00080     void parseSymbol(Token &t, ObjectFile &file);
00081     void writeParams(ostream &stream);
00082 
00083 protected:
00084     void createSymbols();
00085 
00086     Color4 emission;
00087     Color4 ambient;
00088     Color4 diffuse;
00089     Color4 specular;
00090     float shininess;
00091 
00092 private:
00093     typedef Shade super;
00094 };
00095 
00096 typedef RefCount<Material> RefMaterial;
00097 
00098 #endif

This documentation was generated using doxygen. If you have any comments or additions please mail me.