Material.h

Go to the documentation of this file.
00001 //***************************************************************************************
00002 // File supervisor: Crosswalk team
00012 //***************************************************************************************
00013 
00014 #ifndef _MATERIAL_H
00015 #define _MATERIAL_H
00016 
00017 #include "Template.h"
00018 
00019 // Forward declaration
00020 class CSLTexture2D;
00021 
00022 
00028 class XSIEXPORT CSLBaseMaterial
00029     : public CSLTemplate
00030 {
00031 public:
00032     virtual SI_Error Synchronize();
00033 
00034     virtual SI_Error GetCapabilities ( SI_Int in_iFeature, SI_Void* out_pValue );
00035 
00036 protected:
00037 
00043     CSLBaseMaterial(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00044 
00045 private:
00046     void *m_pReserved;  // reserved for future extension
00047 };
00048 
00054 class XSIEXPORT CSLMaterial
00055     : public CSLBaseMaterial
00056 {
00057 public:
00060     enum EShadingModel
00061     {
00062         CONSTANT,       
00063         LAMBERT,        
00064         PHONG,          
00065         BLINN,          
00066         SHADOW_OBJECT,  
00067         VERTEX_COLOR,   
00068     };
00069 
00075     CSLMaterial(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00076 
00079     virtual ~CSLMaterial();
00080 
00084     CSIBCColorf GetAmbientColor();
00085 
00089     SI_Void SetAmbientColor(CSIBCColorf &in_rColor);
00090 
00094     CSIBCColorf GetDiffuseColor();
00095 
00099     SI_Void SetDiffuseColor(CSIBCColorf &in_rColor);
00100 
00104     CSIBCColorf GetEmissiveColor();
00105 
00109     SI_Void SetEmissiveColor(CSIBCColorf &in_rColor);
00110 
00114     EShadingModel GetShadingModel();
00115 
00119     SI_Void SetShadingModel(EShadingModel in_Value);
00120 
00124     CSIBCColorf GetSpecularColor();
00125 
00129     SI_Void SetSpecularColor(CSIBCColorf &in_rColor);
00130 
00134     SI_Float GetSpecularDecay();
00135 
00139     SI_Void SetSpecularDecay(SI_Float in_fValue);
00140 
00144     CSLTexture2D* Texture2D();
00145 
00149     CSLTexture2D* CreateTexture2D();
00150 
00154     SI_Error DestroyTexture2D();
00155 
00156     CSLTexture2D* ConnectTexture2D(CSLTexture2D* in_pNewTexture2D);
00157 
00158     virtual SI_Error Synchronize();
00159 
00163     virtual ETemplateType Type();
00164     virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName);
00165     virtual CSLAnimatableType* ParameterFromType(EFCurveType in_Type, SI_Char *in_szParameterName);
00166 
00167     CSLColorRGBAProxy*                          GetDiffuseColorProxy(){ return  &m_DiffuseColor;};
00168     CSLFloatProxy*                              GetSpecularDecayProxy(){ return  &m_SpecularDecay;};
00169     CSLColorRGBProxy*                           GetSpecularColorProxy(){ return  &m_SpecularColor;};
00170     CSLColorRGBProxy*                           GetEmissiveColorProxy(){ return  &m_EmissiveColor;};
00171     CSLEnumProxy<EShadingModel, VERTEX_COLOR>*  GetShadingModelProxy(){ return  &m_ShadingModel;};
00172     CSLColorRGBProxy *                          GetAmbientColorProxy(){ return  &m_AmbientColor;};
00173 
00174 private:
00175     CSLColorRGBAProxy m_DiffuseColor;
00176     CSLFloatProxy m_SpecularDecay;
00177     CSLColorRGBProxy m_SpecularColor;
00178     CSLColorRGBProxy m_EmissiveColor;
00179     CSLEnumProxy<EShadingModel, VERTEX_COLOR> m_ShadingModel;
00180     CSLColorRGBProxy m_AmbientColor;
00181     CSLTexture2D *m_pTexture2D;
00182 
00183     void *m_pReserved;  // reserved for future extension
00184 };
00185 
00186 #endif