XSIShape.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Softimage 3D Games & 3D Bridge team
00004 //
00005 // (c) Copyright 2001-2005 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 _XSISHAPE_H
00025 #define _XSISHAPE_H
00026 
00027 #include "Template.h"
00028 #include "Scene.h"
00029 #include "Model.h"
00030 #include "XSISubComponentAttributeList.h"
00031 
00032 
00033 
00035 
00043 class XSIEXPORT CSLXSIShape
00044     : public CSLTemplate
00045 {
00046 public:
00047     enum EXSIShapeType
00048     {
00049         XSI_ORDERED,    
00050         XSI_INDEXED,    
00051     };
00052 
00060     CSLXSIShape(CSLScene *in_pScene, CSLModel *in_pModel, CdotXSITemplate *in_pTemplate, EXSIShapeType in_Type);
00061 
00064     virtual ~CSLXSIShape();
00065 
00069     virtual CSLXSISubComponentAttributeList*    AddAttributeList(CSLXSISubComponentAttributeList::EAttributeType in_AttributeType);
00070 
00074     SI_Int                              GetAttributeListCount();
00075 
00079     SI_Int                              GetAttributeListCountBySemantic(SI_Char* in_pSemantic);
00080 
00084     CSIBCArray<CSLXSISubComponentAttributeList*>*   AttributeLists();
00085 
00089     SI_Error                            RemoveAttributeList();
00090 
00094     SI_Error    RemoveAttributeList( CSLXSISubComponentAttributeList* in_pAttributeList );
00095 
00099     SI_Error    RemoveAttributeList( SI_Int in_iIndex );
00100 
00104     SI_Error                            ClearAttributeLists();
00105 
00109     SI_Error                            ClearAttributeListsBySemantic(SI_Char *in_pSemantic);
00110 
00114     CSLXSISubComponentAttributeList*    ConnectAttributeList( CSLXSISubComponentAttributeList* in_pNewXSISubComponentAttributeList );
00115 
00119     CSLXSISubComponentAttributeList* GetFirstAttributeListBySemantic( SI_Char* in_pSemantic );
00120 
00124     CSLXSISubComponentAttributeList* GetNextAttributeListBySemantic( SI_Char* in_pSemantic );
00125 
00126     //**********************************************************************************
00127     // Vertex position attribute helper (always only one vertex position attibute list)
00128     //**********************************************************************************
00129 
00133     CSLXSISubComponentAttributeList*    AddVertexPositionList();
00134 
00138     CSLXSISubComponentAttributeList*    GetVertexPositionList();
00139 
00143     SI_Error                            RemoveVertexPositionList();
00144 
00145     //**********************************************************************************
00146     // Normal attribute helper
00147     //**********************************************************************************
00148 
00152     CSLXSISubComponentAttributeList*    AddNormalList();
00153 
00157     CSLXSISubComponentAttributeList*    GetFirstNormalList();
00158 
00162     CSLXSISubComponentAttributeList*    GetNextNormalList();
00163 
00167     SI_Int                              GetNormalListCount();
00168 
00172     SI_Error                            RemoveNormalList();
00173 
00177     SI_Error                            ClearNormalLists();
00178 
00179     //**********************************************************************************
00180     // Color attribute helper
00181     //**********************************************************************************
00182 
00186     CSLXSISubComponentAttributeList*    AddColorList();
00187 
00191     CSLXSISubComponentAttributeList*    GetFirstColorList();
00192 
00196     CSLXSISubComponentAttributeList*    GetNextColorList();
00197 
00201     SI_Int                              GetColorListCount();
00202 
00206     SI_Error                            RemoveColorList();
00207 
00211     SI_Error                            ClearColorLists();
00212 
00213     //**********************************************************************************
00214     // TexCoord attribute helper
00215     //**********************************************************************************
00216 
00220     CSLXSISubComponentAttributeList*    AddTexCoordList();
00221 
00225     CSLXSISubComponentAttributeList*    GetFirstTexCoordList();
00226 
00230     CSLXSISubComponentAttributeList*    GetNextTexCoordList();
00231 
00235     SI_Int                              GetTexCoordListCount();
00236 
00240     SI_Error                            RemoveTexCoordList();
00241 
00245     SI_Error                            ClearTexCoordLists();
00246 
00247     //**********************************************************************************
00248     // WeightMap attribute helper
00249     //**********************************************************************************
00250 
00254     CSLXSISubComponentAttributeList*    AddWeightMapList();
00255 
00259     CSLXSISubComponentAttributeList*    GetFirstWeightMapList();
00260 
00264     CSLXSISubComponentAttributeList*    GetNextWeightMapList();
00265 
00269     SI_Int                              GetWeightMapListCount();
00270 
00274     SI_Error                            RemoveWeightMapList();
00275 
00279     SI_Error                            ClearWeightMapLists();
00280 
00281     //**********************************************************************************
00282     // Tangent attribute helper
00283     //**********************************************************************************
00284 
00288     CSLXSISubComponentAttributeList*    AddTangentList();
00289 
00293     CSLXSISubComponentAttributeList*    GetFirstTangentList();
00294 
00298     CSLXSISubComponentAttributeList*    GetNextTangentList();
00299 
00303     SI_Int                              GetTangentListCount();
00304 
00308     SI_Error                            RemoveTangentList();
00309 
00313     SI_Error                            ClearTangentLists();
00314 
00315     //**********************************************************************************
00316     // Binormal attribute helper
00317     //**********************************************************************************
00318 
00322     CSLXSISubComponentAttributeList*    AddBinormalList();
00323 
00327     CSLXSISubComponentAttributeList*    GetFirstBinormalList();
00328 
00332     CSLXSISubComponentAttributeList*    GetNextBinormalList();
00333 
00337     SI_Int                              GetBinormalListCount();
00338 
00342     SI_Error                            RemoveBinormalList();
00343 
00347     SI_Error                            ClearBinormalLists();
00348 
00352     virtual ETemplateType               Type() { return XSI_SHAPE; };
00353 
00357     EXSIShapeType                       GetShapeType() { return m_eShapeType; }
00358 
00362     void                                SetShapeType(EXSIShapeType in_eShapeType) { m_eShapeType = in_eShapeType; }
00363 
00367     virtual SI_Error Synchronize();
00368 
00369 protected:
00370     CSIBCArray<CSLXSISubComponentAttributeList *>   m_AttributeLists;
00371     SI_Int                                          m_iCurrentAttributeListIndex;
00372 
00373     EXSIShapeType                                   m_eShapeType;
00374 
00375     void *m_pReserved;  // reserved for future extension
00376 };
00377 
00378 #endif