00001 //*************************************************************************************** 00002 // File supervisor: Crosswalk team 00012 //*************************************************************************************** 00013 00014 #ifndef _XSIMATERIAL_H 00015 #define _XSIMATERIAL_H 00016 00017 #include "Material.h" 00018 00019 class CSLConnectionPoint; 00020 class CSLXSIShader; 00021 class CSLXSIMaterialInfo; 00022 class CSLXSIShaderMultiPortConnection; 00023 class CSLXSITextureLayer; 00024 00035 class XSIEXPORT CSLXSIMaterial 00036 : public CSLBaseMaterial 00037 { 00038 public: 00044 CSLXSIMaterial(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate); 00045 00047 virtual ~CSLXSIMaterial(); 00048 00052 CSLTemplate::ETemplateType Type(){ return XSI_MATERIAL; } 00053 00057 SI_Error Synchronize(); 00058 00063 virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName); 00064 00066 // Connection points functionality //////////////////////////////////////// 00068 00072 CSLConnectionPoint* AddConnectionPoint(); 00073 00078 SI_Error RemoveConnectionPoint( SI_Int in_nIndex ); 00079 00084 SI_Error RemoveConnectionPoint( CSLConnectionPoint* in_pToRemove ); 00085 00089 SI_Error ClearConnectionPoints(); 00090 00095 CSLConnectionPoint* ConnectConnectionPoint( CSLConnectionPoint* in_pToConnect ); 00096 00100 CSLConnectionPoint** GetConnectionPointList(); 00101 00105 SI_Int GetConnectionPointCount(); 00106 00108 // Shaders functionality ////////////////////////////////////////////////// 00110 00114 CSLXSIShader* AddShader(); 00115 00120 SI_Error RemoveShader( SI_Int in_nIndex ); 00121 00126 SI_Error RemoveShader( CSLXSIShader* in_pToRemove ); 00127 00131 SI_Error ClearShaders(); 00132 00137 CSLXSIShader* ConnectShader( CSLXSIShader* in_pToConnect ); 00138 00142 CSLXSIShader** GetShaderList(); 00143 00147 SI_Int GetShaderCount(); 00148 00153 CSLXSIShader* FindShader( SI_Char* in_szShaderName ); 00154 00156 // Material Info functionality //////////////////////////////////////////// 00158 00162 CSLXSIMaterialInfo* CreateMaterialInfo(); 00163 00167 SI_Error DestroyMaterialInfo(); 00168 00173 CSLXSIMaterialInfo* ConnectMaterialInfo( CSLXSIMaterialInfo* in_pToConnect ); 00174 00178 CSLXSIMaterialInfo* GetMaterialInfo(); 00179 00181 // Multi Port Connection functionality //////////////////////////////// 00183 00187 CSLXSIShaderMultiPortConnection* AddMultiPortConnection(); 00188 00192 SI_Error RemoveMultiPortConnection(SI_Int in_nIndex); 00193 00197 SI_Error RemoveMultiPortConnection(CSLXSIShaderMultiPortConnection* in_pToRemove); 00198 00203 CSLXSIShaderMultiPortConnection* GetMultiPortConnection(SI_Int in_nIndex); 00204 00209 CSLXSIShaderMultiPortConnection* GetMultiPortConnectionByParameter(SI_Char* in_pParameter); 00210 00214 SI_Int GetMultiPortConnectionCount(); 00215 00218 SI_Error ClearMultiPortConnections(); 00219 00223 CSLXSIShaderMultiPortConnection** GetMultiPortConnectionList(); 00224 00229 CSLXSIShaderMultiPortConnection* ConnectMultiPortConnection( CSLXSIShaderMultiPortConnection* in_pToConnect ); 00230 00235 CSLXSIShaderMultiPortConnection* FindMultiPortConnectionByParameterName(SI_Char *in_pName); 00236 00238 // Texture Layer functionality //////////////////////////////////////// 00240 00244 CSLXSITextureLayer* AddTextureLayer(); 00245 00249 SI_Error RemoveTextureLayer(SI_Int in_nIndex); 00250 00254 SI_Error RemoveTextureLayer(CSLXSITextureLayer* in_pToRemove); 00255 00260 CSLXSITextureLayer* GetTextureLayer(SI_Int in_nIndex); 00261 00266 CSLXSITextureLayer* FindTextureLayerByOrder(SI_Int in_nOrder); 00267 00271 SI_Int GetTextureLayerCount(); 00272 00275 SI_Error ClearTextureLayers(); 00276 00280 CSLXSITextureLayer** GetTextureLayerList(); 00281 00286 CSLXSITextureLayer* ConnectTextureLayer( CSLXSITextureLayer* in_pToConnect ); 00287 00288 // Members 00289 private: 00290 CSIBCArray<CSLConnectionPoint*> m_ConnectionPoints; 00291 CSIBCArray<CSLXSIShader*> m_Shaders; 00292 CSLXSIMaterialInfo *m_pMaterialInfo; 00293 CSIBCArray<CSLXSIShaderMultiPortConnection *> m_MultiPortConnections; 00294 CSIBCArray<CSLXSITextureLayer*> m_TextureLayers; 00295 00296 SI_Void *m_pReserved; // reserved for future use 00297 }; 00298 00299 #endif // _XSIMATERIAL_H