00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfMaterial_h_
00026 #define _CIvfMaterial_h_
00027
00028 #include <ivf/IvfObject.h>
00029
00030 IvfSmartPointer(CIvfMaterial);
00031
00040 class IVF_API CIvfMaterial : public CIvfObject {
00041 public:
00042 bool getColorMaterial();
00043 void setColorMaterial(bool flag);
00045 CIvfMaterial ();
00046
00048 virtual ~CIvfMaterial ();
00049
00050 IvfClassInfo("CIvfMaterial",CIvfObject);
00051
00058 void setShininess(float shininess);
00059
00061 void getShininess(float &shininess);
00062
00073 void setEmissionColor(const float red, const float green, const float blue, const float alfa);
00075 void getEmissionColor(float &red, float &green, float &blue, float &alfa);
00076
00087 void setDiffuseColor (const float red, const float green, const float blue, const float alfa);
00088
00090 void getDiffuseColor (float &red, float &green, float &blue, float &alfa);
00091
00102 void setSpecularColor (const float red, const float green, const float blue, const float alfa);
00103
00105 void getSpecularColor (float &red, float &green, float &blue, float &alfa);
00106
00117 void setAmbientColor (const float red, const float green, const float blue, const float alfa);
00118
00120 void getAmbientColor (float &red, float &green, float &blue, float &alfa);
00121
00123 void setAlphaValue(float alpha);
00124
00125 void multiplyColor(double factor);
00126 void multiplyEmission(double factor);
00127 void multiplyAmbient(double factor);
00128 void multiplyDiffuse(double factor);
00129 void multiplySpecular(double factor);
00130 void assignFrom(CIvfMaterial* material);
00131 void brightnessEmission(double factor);
00132 void brightnessAmbient(double factor);
00133 void brightnessDiffuse(double factor);
00134 void brightnessSpecular(double factor);
00135
00136 private:
00137 float m_shininess;
00138 float m_diffuseColor[4];
00139 float m_specularColor[4];
00140 float m_ambientColor[4];
00141 float m_emissionColor[4];
00142
00143 bool m_colorMaterial;
00144
00145 void modifyBrightness(float* color, double factor);
00146 void toGreyscale(float* color, float* grey);
00147 protected:
00148 virtual void createMaterial();
00149 };
00150 #endif