00001
00002
00003
00005
00006
00011
00016
00021
00023
00024 #ifndef MATERIAL_H
00025 #define MATERIAL_H
00026
00027 #include "X3DTypes.h"
00028 #include "X3DMaterialNode.h"
00029
00030 namespace X3DTK {
00031 namespace X3D {
00032
00037
00038 class Material : public X3DMaterialNode
00039 {
00040 public:
00042 Material();
00044 Material(SFFloat ambientIntensity,
00045 const SFColor &diffuseColor,
00046 const SFColor &emissiveColor,
00047 SFFloat shininess,
00048 const SFColor &specularColor,
00049 SFFloat transparency);
00051 virtual SFNode clone() const;
00053 virtual ~Material();
00054
00056 void setAmbientIntensity(SFFloat ambientIntensity);
00058 void setDiffuseColor(const SFColor &diffuseColor);
00060 void setEmissiveColor(const SFColor &emissiveColor);
00062 void setShininess(SFFloat shininess);
00064 void setSpecularColor(const SFColor &specularColor);
00066 void setTransparency(SFFloat transparency);
00067
00069 inline SFFloat getAmbientIntensity() const {return _ambientIntensity;};
00071 inline SFColor getDiffuseColor() const {return _diffuseColor;};
00073 inline SFColor getEmissiveColor() const {return _emissiveColor; };
00075 inline SFFloat getShininess() const {return _shininess;};
00077 inline SFColor getSpecularColor() const {return _specularColor;};
00079 inline SFFloat getTransparency() const {return _transparency;};
00080
00082 virtual void load(const X3DFileElement *element);
00084 virtual SFString write() const;
00085
00086 protected:
00088 Material(const Material &M);
00089
00090 private:
00092 SFFloat _ambientIntensity;
00094 SFColor _diffuseColor;
00096 SFColor _emissiveColor;
00098 SFFloat _shininess;
00100 SFColor _specularColor;
00102 SFFloat _transparency;
00103 };
00104
00105 }
00106 }
00107
00108 #endif