TriangleStrip.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 _TRIANGLESTRIP_H
00013 #define _TRIANGLESTRIP_H
00014 
00015 #include "Template.h"
00016 
00017 class CSLTriangleStripList;
00018 
00019 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_
00020 #define _SL_INT_ARRAY_PROXY_EXPORT_
00021 #endif
00022 
00033 class XSIEXPORT CSLTriangleStrip
00034     : public CSLTemplate
00035 {
00036 public:
00040     typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray;
00041 
00042     CSLTriangleStrip(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, CSLTriangleStripList* in_pTriStripList);
00043     virtual ~CSLTriangleStrip();
00044 
00048     SI_Int                  GetVertexCount () { return m_VertexIndices.GetUsed(); }
00049 
00053     CSLIntArray*            GetVertexIndices() { return &m_VertexIndices; }
00054 
00058     SI_Int*                 GetVertexIndicesPtr() { return m_VertexIndices.ArrayPtr(); }
00059 
00063     CSLIntArray*            CreateNormalIndices();
00064 
00068     CSLIntArray*            GetNormalIndices() { return m_NormalIndices; }
00069 
00073     SI_Int*                 GetNormalIndicesPtr();
00074 
00078     SI_Error                DestroyNormalIndices();
00079 
00083     CSLIntArray*            CreateColorIndices();
00084 
00088     CSLIntArray*            GetColorIndices() { return m_ColorIndices; }
00089 
00093     SI_Int*                 GetColorIndicesPtr();
00094 
00098     SI_Error                DestroyColorIndices();
00099 
00103     CSLIntArray*            AddUVArray();
00104 
00108     CSLIntArray*            GetUVIndices(SI_Int in_nId);
00109 
00114     SI_Int*                 GetUVIndicesPtr(SI_Int in_nId);
00115 
00120     SI_Error                RemoveUVArray();
00121 
00125     SI_Error                ClearUVArrays();
00126 
00130     SI_Int                  GetUVArrayCount();
00131 
00132     virtual ETemplateType   Type() { return SI_TRIANGLE_STRIP; }
00133     virtual SI_Error        Synchronize();
00134 
00135 private:
00136     CSLIntArray             m_VertexIndices;
00137 
00138     CSLIntArray*            m_NormalIndices;
00139     CSIBCArray<CSLIntArray* >   m_UVIndices;
00140     CSLIntArray*            m_ColorIndices;
00141 
00142     SI_Bool                 m_bSingleUV;
00143     SI_Int                  m_iArrayCount;
00144 
00145     void *m_pReserved;  // reserved for future extension
00146 };
00147 
00148 #endif