TriangleList.h

Go to the documentation of this file.
00001 //***************************************************************************************
00002 // File supervisor: Crosswalk team
00012 //***************************************************************************************
00013 
00014 #ifndef _TRIANGLELIST_H
00015 #define _TRIANGLELIST_H
00016 
00017 #include "Template.h"
00018 
00019 class CSLBaseMaterial;
00020 
00021 struct SLTriangle
00022 {
00023     SI_Int  m_iVtx1;
00024     SI_Int  m_iVtx2;
00025     SI_Int  m_iVtx3;
00026 };
00027 
00041 class XSIEXPORT CSLTriangleList
00042     : public CSLTemplate
00043 {
00044 public:
00047     typedef CSLArrayProxy<SLTriangle, SI_Int, 3> CSLTriangleArray;
00048 
00049     CSLTriangleList(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00050     virtual ~CSLTriangleList();
00051 
00055     SI_Int                  GetTriangleCount() { return m_VertexIndices.GetUsed(); };
00056 
00060     SI_Int*                 GetVertexIndicesPtr() { return (SI_Int *) m_VertexIndices.ArrayPtr(); }
00061 
00065     CSLTriangleArray*       GetVertexIndices() { return &m_VertexIndices; }
00066 
00070     CSLTriangleArray*       CreateNormalIndices();
00071 
00075     CSLTriangleArray*       GetNormalIndices() { return m_NormalIndices; }
00076 
00080     SI_Int*                 GetNormalIndicesPtr();
00081 
00085     SI_Error                DestroyNormalIndices();
00086 
00090     CSLTriangleArray*       CreateColorIndices();
00091 
00095     CSLTriangleArray*       GetColorIndices() { return m_ColorIndices; }
00096 
00100     SI_Int*                 GetColorIndicesPtr();
00101 
00105     SI_Error                DestroyColorIndices();
00106 
00110     CSLTriangleArray*       AddUVArray();
00111 
00115     SI_Int                  GetUVArrayCount();
00116 
00121     SI_Int*                 GetUVIndicesPtr(SI_Int in_nId);
00122 
00127     CSLTriangleArray*       GetUVIndices(SI_Int in_nId);
00128 
00132     SI_Error                RemoveUVArray();
00133 
00137     SI_Error                ClearUVArrays();
00138 
00142     CSLBaseMaterial*        GetMaterial() { return m_pMaterial; }
00143 
00147     SI_Void                 SetMaterial(CSLBaseMaterial *in_pNewMaterial) { m_pMaterial = in_pNewMaterial; }
00148 
00152     virtual ETemplateType   Type() { return SI_TRIANGLE_LIST; }
00153     virtual SI_Error        Synchronize();
00154     virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName);
00155 
00156 private:
00157     CSLBaseMaterial*        m_pMaterial;
00158     CSLTriangleArray        m_VertexIndices;
00159 
00160     CSLTriangleArray*       m_NormalIndices;
00161     CSIBCArray<CSLTriangleArray* >  m_UVIndices;
00162     CSLTriangleArray*       m_ColorIndices;
00163 
00164     SI_Bool                 m_bSingleUV;
00165     SI_Int                  m_iArrayCount;
00166 
00167     void *m_pReserved;  // reserved for future extension
00168 };
00169 
00170 #endif