XSIMaterial.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Crosswalk team
00004 //
00005 // Copyright 2008 Autodesk, Inc.  All rights reserved.
00006 // Use of this software is subject to the terms of the Autodesk license agreement
00007 // provided at the time of installation or download, or which otherwise accompanies
00008 // this software in either electronic or hard copy form.
00009 //
00010 //***************************************************************************************
00011 
00012 #ifndef _XSIMATERIAL_H
00013 #define _XSIMATERIAL_H
00014 
00015 #include "Material.h"
00016 
00017 class CSLConnectionPoint;
00018 class CSLXSIShader;
00019 class CSLXSIMaterialInfo;
00020 class CSLXSIShaderMultiPortConnection;
00021 class CSLXSITextureLayer;
00022 
00033 class XSIEXPORT CSLXSIMaterial
00034     : public CSLBaseMaterial
00035 {
00036 public:
00042     CSLXSIMaterial(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00043 
00045     virtual ~CSLXSIMaterial();
00046 
00050     CSLTemplate::ETemplateType Type(){ return XSI_MATERIAL; }
00051 
00055     SI_Error Synchronize();
00056 
00061     virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName);
00062 
00064     // Connection points functionality ////////////////////////////////////////
00066 
00070     CSLConnectionPoint* AddConnectionPoint();
00071 
00076     SI_Error RemoveConnectionPoint( SI_Int in_nIndex );
00077 
00082     SI_Error RemoveConnectionPoint( CSLConnectionPoint* in_pToRemove );
00083 
00087     SI_Error ClearConnectionPoints();
00088 
00093     CSLConnectionPoint* ConnectConnectionPoint( CSLConnectionPoint* in_pToConnect );
00094 
00098     CSLConnectionPoint** GetConnectionPointList();
00099 
00103     SI_Int GetConnectionPointCount();
00104 
00106     // Shaders functionality //////////////////////////////////////////////////
00108 
00112     CSLXSIShader* AddShader();
00113 
00118     SI_Error RemoveShader( SI_Int in_nIndex );
00119 
00124     SI_Error RemoveShader( CSLXSIShader* in_pToRemove );
00125 
00129     SI_Error ClearShaders();
00130 
00135     CSLXSIShader* ConnectShader( CSLXSIShader* in_pToConnect );
00136 
00140     CSLXSIShader** GetShaderList();
00141 
00145     SI_Int GetShaderCount();
00146 
00151     CSLXSIShader* FindShader( SI_Char* in_szShaderName );
00152 
00154     // Material Info functionality ////////////////////////////////////////////
00156 
00160     CSLXSIMaterialInfo* CreateMaterialInfo();
00161 
00165     SI_Error DestroyMaterialInfo();
00166 
00171     CSLXSIMaterialInfo* ConnectMaterialInfo( CSLXSIMaterialInfo* in_pToConnect );
00172 
00176     CSLXSIMaterialInfo* GetMaterialInfo();
00177 
00179     // Multi Port Connection functionality ////////////////////////////////
00181 
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 
00210     CSLXSIShaderMultiPortConnection* GetMultiPortConnectionByParameter(SI_Char* in_pParameter);
00211 
00215     SI_Int GetMultiPortConnectionCount();
00216 
00219     SI_Error ClearMultiPortConnections();
00220 
00224     CSLXSIShaderMultiPortConnection** GetMultiPortConnectionList();
00225 
00230     CSLXSIShaderMultiPortConnection* ConnectMultiPortConnection( CSLXSIShaderMultiPortConnection* in_pToConnect );
00231 
00236     CSLXSIShaderMultiPortConnection* FindMultiPortConnectionByParameterName(SI_Char *in_pName);
00237 
00239     // Texture Layer functionality ////////////////////////////////////////
00241 
00245     CSLXSITextureLayer* AddTextureLayer();
00246 
00250     SI_Error RemoveTextureLayer(SI_Int in_nIndex);
00251 
00255     SI_Error RemoveTextureLayer(CSLXSITextureLayer* in_pToRemove);
00256 
00261     CSLXSITextureLayer* GetTextureLayer(SI_Int in_nIndex);
00262 
00267     CSLXSITextureLayer* FindTextureLayerByOrder(SI_Int in_nOrder);
00268 
00272     SI_Int GetTextureLayerCount();
00273 
00276     SI_Error ClearTextureLayers();
00277 
00281     CSLXSITextureLayer** GetTextureLayerList();
00282 
00287     CSLXSITextureLayer* ConnectTextureLayer( CSLXSITextureLayer* in_pToConnect );
00288 
00289 // Members
00290 private:
00291     CSIBCArray<CSLConnectionPoint*> m_ConnectionPoints;
00292     CSIBCArray<CSLXSIShader*> m_Shaders;
00293     CSLXSIMaterialInfo *m_pMaterialInfo;
00294     CSIBCArray<CSLXSIShaderMultiPortConnection *> m_MultiPortConnections;
00295     CSIBCArray<CSLXSITextureLayer*> m_TextureLayers;
00296 
00297     SI_Void *m_pReserved;   // reserved for future use
00298 };
00299 
00300 #endif // _XSIMATERIAL_H