PolygonList.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Softimage 3D Games & 3D Bridge team
00004 //
00005 // (c) Copyright 2001-2002 Avid Technology, Inc. . All rights reserved.
00006 //
00007 //***************************************************************************************
00008 
00009 /****************************************************************************************
00010 THIS CODE IS PUBLISHED AS A SAMPLE ONLY AND IS PROVIDED "AS IS".
00011 IN NO EVENT SHALL SOFTIMAGE, AVID TECHNOLOGY, INC. AND/OR THEIR RESPECTIVE
00012 SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
00013 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00014 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00015 CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE .
00016 
00017 COPYRIGHT NOTICE. Copyright © 1999-2002 Avid Technology Inc. . All rights reserved. 
00018 
00019 SOFTIMAGE is a registered trademark of Avid Technology Inc. or its subsidiaries 
00020 or divisions. Windows NT is a registered trademark of Microsoft Corp. All other
00021 trademarks contained herein are the property of their respective owners. 
00022 ****************************************************************************************/
00023 
00024 #ifndef _POLYGONLIST_H
00025 #define _POLYGONLIST_H
00026 
00027 #include "Template.h"
00028 
00029 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_
00030 #define _SL_INT_ARRAY_PROXY_EXPORT_
00031 
00032 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Int, SI_Int, 1>;
00033 
00034 #endif // _SL_INT_ARRAY_PROXY_EXPORT_
00035 
00036 class CSLBaseMaterial;
00037 
00039 
00051 class XSIEXPORT CSLPolygonList
00052     : public CSLTemplate
00053 {
00054 public:
00058     typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray;
00059 
00066     CSLPolygonList(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00067 
00070     virtual ~CSLPolygonList();
00071 
00075     SI_Int          GetPolygonCount () { return m_PolygonVertexCount.GetUsed(); }
00076 
00080     CSLIntArray*    GetPolygonVertexCountList() { return &m_PolygonVertexCount; };
00081 
00085     SI_Int*         GetPolygonVertexCountListPtr() { return m_PolygonVertexCount.ArrayPtr(); }
00086 
00090     SI_Int          GetVertexCount () { return m_VertexIndices.GetUsed(); }
00091 
00095     CSLIntArray*    GetVertexIndices() { return &m_VertexIndices; };
00096 
00100     SI_Int*         GetVertexIndicesPtr() { return m_VertexIndices.ArrayPtr(); }
00101 
00105     CSLIntArray*    CreateNormalIndices();
00106 
00110     CSLIntArray*    GetNormalIndices() { return m_NormalIndices; }
00111 
00115     SI_Int*         GetNormalIndicesPtr();
00116 
00120     SI_Error        DestroyNormalIndices();
00121 
00125     CSLIntArray*    CreateColorIndices();
00126 
00130     CSLIntArray*    GetColorIndices() { return m_ColorIndices; }
00131 
00135     SI_Int*         GetColorIndicesPtr();
00136 
00140     SI_Error        DestroyColorIndices();
00141 
00145     CSLIntArray*    AddUVArray();
00146 
00150     SI_Int          GetUVArrayCount();
00151 
00156     CSLIntArray*    GetUVIndices(SI_Int in_nId);
00157 
00162     SI_Int*         GetUVIndicesPtr(SI_Int in_nId);
00163 
00167     SI_Error        RemoveUVArray();
00168 
00172     SI_Error        ClearUVArrays();
00173 
00177     CSLBaseMaterial*    GetMaterial() { return m_pMaterial; }
00178 
00183     SI_Void             SetMaterial(CSLBaseMaterial *in_pNewMaterial) { m_pMaterial = in_pNewMaterial; }
00184 
00188     virtual SI_Error Synchronize();
00189 
00193     virtual ETemplateType Type() { return SI_POLYGON_LIST; };
00194 
00199     virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName);
00200 
00201 private:
00202     CSLBaseMaterial*        m_pMaterial;
00203     CSLIntArray             m_PolygonVertexCount;
00204     CSLIntArray             m_VertexIndices;
00205 
00206     CSLIntArray*            m_NormalIndices;
00207     CSLIntArray*            m_ColorIndices;
00208     CSIBCArray<CSLIntArray* >   m_UVIndices;
00209 
00210     SI_Bool                 m_bSingleUV;
00211     SI_Int                  m_iArrayCount;
00212 
00213     void *m_pReserved;  // reserved for future extension
00214 };
00215 
00216 #endif