XSIUserData.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 _XSIUSERDATA_H
00013 #define _XSIUSERDATA_H
00014 
00015 #include "Template.h"
00016 
00017 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_
00018 #define _SL_INT_ARRAY_PROXY_EXPORT_
00019 
00020 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Int, SI_Int, 1>;
00021 
00022 #endif // _SL_INT_ARRAY_PROXY_EXPORT_
00023 
00024 #ifndef _SL_UBYTE_ARRAY_PROXY_EXPORT_
00025 #define _SL_UBYTE_ARRAY_PROXY_EXPORT_
00026 
00027 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_UByte, SI_UByte, 1>;
00028 
00029 #endif // _SL_UBYTE_ARRAY_PROXY_EXPORT_
00030 
00031 class CSLUserDataList;
00032 
00037 class XSIEXPORT CSLUserData
00038     : public CSLTemplate
00039 {
00040 public:
00041 
00043     typedef CSLArrayProxy<SI_UByte, SI_UByte, 1> CSLUByteArray;
00044 
00046     typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray;
00047 
00053     CSLUserData(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00054 
00056     virtual ~CSLUserData();
00057 
00061     ETemplateType Type(){ return XSI_USER_DATA; }
00062 
00066     SI_Error Synchronize();
00067 
00069     // User data //////////////////////////////////////////////////////////////
00071 
00075     SI_UByte* GetUserDataListPtr();
00076 
00080     CSLUByteArray* GetUserDataList();
00081 
00085     SI_Int GetUserDataCount();
00086 
00088     // Sub element access /////////////////////////////////////////////////////
00090 
00094     SI_Int* GetSubElementListPtr();
00095 
00099     CSLIntArray* GetSubElementList();
00100 
00104     SI_Int GetSubElementCount();
00105 
00106 private:
00107     CSLIntProxy m_DataSize;
00108     CSLUByteArray m_UserData;
00109     CSLIntArray m_SubElements;
00110 
00111     SI_Void* m_pReserved;
00112 };
00113 
00119 class XSIEXPORT CSLUserDataBlob
00120     : public CSLTemplate
00121 {
00122 public:
00123 
00125     typedef CSLArrayProxy<SI_UByte, SI_UByte, 1> CSLUByteArray;
00126 
00132     CSLUserDataBlob(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, CSLTemplate* in_pAttachTo = NULL);
00133 
00135     virtual ~CSLUserDataBlob();
00136 
00140     ETemplateType Type(){ return XSI_USER_DATA_BLOB; }
00141 
00145     SI_Error Synchronize();
00146 
00148     // User data //////////////////////////////////////////////////////////////
00150 
00154     SI_UByte* GetUserDataPtr();
00155 
00159     CSLUByteArray* GetUserData();
00160 
00164     SI_Int GetUserDataSize();
00165 
00166 
00167 private:
00168     CSLIntProxy     m_DataSize;
00169     CSLUByteArray   m_UserData;
00170     CSLTemplate*        m_pOwner;
00171 
00172     SI_Void* m_pReserved;
00173 };
00174 
00175 
00176 #endif