XSIUserData.h

00001 /****************************************************************************************
00002 THIS CODE IS PUBLISHED AS A SAMPLE ONLY AND IS PROVIDED "AS IS".
00003 IN NO EVENT SHALL SOFTIMAGE, AVID TECHNOLOGY, INC. AND/OR THEIR RESPECTIVE 
00004 SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
00005 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00006 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00007 CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE . 
00008  
00009 COPYRIGHT NOTICE. Copyright © 1999-2002 Avid Technology Inc. . All rights reserved. 
00010 
00011 SOFTIMAGE is a registered trademark of Avid Technology Inc. or its subsidiaries 
00012 or divisions. Windows NT is a registered trademark of Microsoft Corp. All other
00013 trademarks contained herein are the property of their respective owners. 
00014 ****************************************************************************************/
00015 
00016 #ifndef _XSIUSERDATA_H
00017 #define _XSIUSERDATA_H
00018 
00019 #include "Template.h"
00020 
00021 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_
00022 #define _SL_INT_ARRAY_PROXY_EXPORT_
00023 
00024 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Int, SI_Int, 1>;
00025 
00026 #endif // _SL_INT_ARRAY_PROXY_EXPORT_
00027 
00028 #ifndef _SL_UBYTE_ARRAY_PROXY_EXPORT_
00029 #define _SL_UBYTE_ARRAY_PROXY_EXPORT_
00030 
00031 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_UByte, SI_UByte, 1>;
00032 
00033 #endif // _SL_UBYTE_ARRAY_PROXY_EXPORT_
00034 
00035 class CSLUserDataList;
00036 
00044 class XSIEXPORT CSLUserData
00045     : public CSLTemplate
00046 {
00047 public:
00048 
00050     typedef CSLArrayProxy<SI_UByte, SI_UByte, 1> CSLUByteArray;
00051 
00053     typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray;
00054 
00060     CSLUserData(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00061 
00063     virtual ~CSLUserData();
00064 
00068     ETemplateType Type(){ return XSI_USER_DATA; }
00069 
00073     SI_Error Synchronize();
00074 
00076     // User data //////////////////////////////////////////////////////////////
00078     
00082     SI_UByte* GetUserDataListPtr();
00083 
00087     CSLUByteArray* GetUserDataList();
00088 
00092     SI_Int GetUserDataCount();
00093 
00095     // Sub element access /////////////////////////////////////////////////////
00097 
00101     SI_Int* GetSubElementListPtr();
00102 
00106     CSLIntArray* GetSubElementList();
00107 
00111     SI_Int GetSubElementCount();
00112     
00113 private:
00114     CSLIntProxy m_DataSize;
00115     CSLUByteArray m_UserData;
00116     CSLIntArray m_SubElements;
00117 
00118     SI_Void* m_pReserved;
00119 };
00120 
00128 class XSIEXPORT CSLUserDataBlob
00129     : public CSLTemplate
00130 {
00131 public:
00132 
00134     typedef CSLArrayProxy<SI_UByte, SI_UByte, 1> CSLUByteArray;
00135 
00141     CSLUserDataBlob(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, CSLTemplate* in_pAttachTo = NULL);
00142 
00144     virtual ~CSLUserDataBlob();
00145 
00149     ETemplateType Type(){ return XSI_USER_DATA_BLOB; }
00150 
00154     SI_Error Synchronize();
00155 
00157     // User data //////////////////////////////////////////////////////////////
00159     
00163     SI_UByte* GetUserDataPtr();
00164 
00168     CSLUByteArray* GetUserData();
00169 
00173     SI_Int GetUserDataSize();
00174 
00175     
00176 private:
00177     CSLIntProxy     m_DataSize;
00178     CSLUByteArray   m_UserData;
00179     CSLTemplate*        m_pOwner;
00180 
00181     SI_Void* m_pReserved;
00182 };
00183 
00184 
00185 #endif