PolygonList.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 _POLYGONLIST_H
00013 #define _POLYGONLIST_H
00014 
00015 #include "Template.h"
00016 
00017 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_
00018 #define _SL_INT_ARRAY_PROXY_EXPORT_
00019 
00020 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Int, SI_Int, 1>;
00021 
00022 #endif // _SL_INT_ARRAY_PROXY_EXPORT_
00023 
00024 class CSLBaseMaterial;
00025 
00038 class XSIEXPORT CSLPolygonList
00039     : public CSLTemplate
00040 {
00041 public:
00045     typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray;
00046 
00053     CSLPolygonList(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00054 
00057     virtual ~CSLPolygonList();
00058 
00062     SI_Int          GetPolygonCount () { return m_PolygonVertexCount.GetUsed(); }
00063 
00067     CSLIntArray*    GetPolygonVertexCountList() { return &m_PolygonVertexCount; };
00068 
00072     SI_Int*         GetPolygonVertexCountListPtr() { return m_PolygonVertexCount.ArrayPtr(); }
00073 
00077     SI_Int          GetVertexCount () { return m_VertexIndices.GetUsed(); }
00078 
00082     CSLIntArray*    GetVertexIndices() { return &m_VertexIndices; };
00083 
00087     SI_Int*         GetVertexIndicesPtr() { return m_VertexIndices.ArrayPtr(); }
00088 
00092     CSLIntArray*    CreateNormalIndices();
00093 
00097     CSLIntArray*    GetNormalIndices() { return m_NormalIndices; }
00098 
00102     SI_Int*         GetNormalIndicesPtr();
00103 
00107     SI_Error        DestroyNormalIndices();
00108 
00112     CSLIntArray*    CreateColorIndices();
00113 
00117     CSLIntArray*    GetColorIndices() { return m_ColorIndices; }
00118 
00122     SI_Int*         GetColorIndicesPtr();
00123 
00127     SI_Error        DestroyColorIndices();
00128 
00132     CSLIntArray*    AddUVArray();
00133 
00137     SI_Int          GetUVArrayCount();
00138 
00143     CSLIntArray*    GetUVIndices(SI_Int in_nId);
00144 
00149     SI_Int*         GetUVIndicesPtr(SI_Int in_nId);
00150 
00154     SI_Error        RemoveUVArray();
00155 
00159     SI_Error        ClearUVArrays();
00160 
00164     CSLBaseMaterial*    GetMaterial() { return m_pMaterial; }
00165 
00170     SI_Void             SetMaterial(CSLBaseMaterial *in_pNewMaterial) { m_pMaterial = in_pNewMaterial; }
00171 
00175     virtual SI_Error Synchronize();
00176 
00180     virtual ETemplateType Type() { return SI_POLYGON_LIST; };
00181 
00186     virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName);
00187 
00188 private:
00189     CSLBaseMaterial*        m_pMaterial;
00190     CSLIntArray             m_PolygonVertexCount;
00191     CSLIntArray             m_VertexIndices;
00192 
00193     CSLIntArray*            m_NormalIndices;
00194     CSLIntArray*            m_ColorIndices;
00195     CSIBCArray<CSLIntArray* >   m_UVIndices;
00196 
00197     SI_Bool                 m_bSingleUV;
00198     SI_Int                  m_iArrayCount;
00199 
00200     void *m_pReserved;  // reserved for future extension
00201 };
00202 
00203 #endif