00001
00002
00012
00013
00014
00015
00016
00017 #ifndef __DOTXSITEMPLATE_H
00018 #define __DOTXSITEMPLATE_H
00019
00020
00021
00022
00023 #include "SIBCArray.h"
00024 #include "SIBCNode.h"
00025 #include "SIBCString.h"
00026 #include "dotXSIParams.h"
00027
00028
00029
00030
00031 class CdotXSITemplate;
00032 class CXSIParser;
00033
00034
00035 typedef SI_Error ( *DOTXSIREADCALLBACK ) ( CXSIParser *in_pParser, CdotXSITemplate *i_pCurrentTemplate, CdotXSITemplate *i_pNewTemplate );
00036 typedef SI_Error ( *DOTXSIWRITECALLBACK ) ( CXSIParser *in_pParser, CdotXSITemplate *i_pCurrentTemplate, CdotXSITemplate *i_pNewTemplate, SI_Int i_nLevel );
00037
00038
00039
00040
00041
00047 class XSIEXPORT CdotXSITemplates
00048 {
00049 public:
00050
00054 CdotXSITemplates();
00055
00060 CdotXSITemplates( SI_Bool in_bDeleteOnExit);
00061
00064 virtual ~CdotXSITemplates();
00065
00066
00070 SI_Int GetCount();
00071
00075 SI_Int GetTotalCount();
00076
00081 SI_Void Add( CdotXSITemplate *i_Template, SI_Int i_nPosition = -1 );
00082
00090 SI_Void Item( SI_Int i_nPosition, CdotXSITemplate **o_Template );
00091
00098 CdotXSITemplate *Item( SI_Int i_nPosition );
00099
00103 SI_Void Remove( SI_Int i_nPosition );
00104
00107 SI_Void Clear();
00108
00116 SI_Bool IsSupported( CSIBCString *i_sName, SI_Int &o_nInd );
00117
00127 SI_Bool Find( CSIBCString *i_sTemplateName, CSIBCString *i_sInstanceName, CdotXSITemplate **o_pTemplate );
00128
00134 CdotXSITemplate * FindByType( CSIBCString in_name );
00135
00140 CdotXSITemplates *ChildrenOfType( CSIBCString in_type );
00141
00142 CdotXSITemplate** ArrayPtr() { return m_Templates.ArrayPtr();} ;
00143
00144
00149 SI_Void MoveChild ( int in_iTemplate, int in_iNewPos );
00150
00151 private:
00152 SI_Int m_nCount;
00153 SI_Bool m_bDeleteMembers;
00154 CSIBCArray< CdotXSITemplate * > m_Templates;
00155 };
00156
00157
00158
00159
00160
00161
00178 class XSIEXPORT CdotXSITemplate : public CSIBCNode
00179 {
00180 public:
00181
00182 enum eCOLLADATemplateType
00183 {
00184 NORMAL = 0,
00185 LIBRARY,
00186 NODE,
00187 URL
00188 };
00189
00195 CdotXSITemplate();
00196
00202 CdotXSITemplate( CSIBCString *i_sName );
00203
00217 CdotXSITemplate( CSIBCString i_sName,
00218 DOTXSIREADCALLBACK i_ReadCallback,
00219 DOTXSIWRITECALLBACK i_WriteCallback,
00220 SI_Int i_lVersionMajor, SI_Int i_lVersionMinor,
00221 SI_Int i_nNbParams,
00222 CdotXSIParam *i_Param1, ... );
00223
00237 CdotXSITemplate( CSIBCString i_sName,
00238 DOTXSIREADCALLBACK i_ReadCallback,
00239 DOTXSIWRITECALLBACK i_WriteCallback,
00240 SI_Int i_nNbParams,
00241 CdotXSIParam *i_Param1, ... );
00242
00243
00246 virtual ~CdotXSITemplate();
00247
00251 virtual SI_Void SetInstanceName( CSIBCString i_sInstanceName );
00252
00256 CSIBCString &InstanceName() { return m_sInstanceName; }
00257
00261 SI_Void SetUserDataType( CSIBCString i_sUserDataType );
00262
00266 CSIBCString &UserDataType() { return m_sUserDataType; }
00267
00271 CdotXSITemplates &Children() { return m_ChildrenCol; }
00272
00276 SI_Void SetParent( CdotXSITemplate *i_Parent );
00277
00281 SI_Void Reparent( CdotXSITemplate *i_Parent );
00282
00286 CdotXSITemplate *Parent() { return m_Parent; }
00287
00295 SI_Void SetSystemFlags( SI_Int i_nSystemFlags );
00296
00297
00303 SI_Void GetSystemFlags( SI_Int *o_nSystemFlags );
00304
00312 SI_Void SetUserFlags( SI_Int i_nUserFlags );
00313
00319 SI_Void GetUserFlags( SI_Int *o_nUserFlags );
00320
00324 CdotXSIParams &Params() { return m_ParamsCol; }
00325
00330 virtual SI_Void InitializeFromName( SI_Char *i_pChar, CXSIParser *in_pParser );
00331
00338 CdotXSITemplates *ChildrenOfType( CSIBCString in_type );
00339
00346 CdotXSITemplate *ChildrenOfTypeNamed( CSIBCString in_type, CSIBCString in_name );
00347
00348 virtual CdotXSITemplate *Clone();
00349
00353 eCOLLADATemplateType GetTemplateType() { return m_eType; };
00354
00358 SI_Void SetTemplateType (eCOLLADATemplateType in_etype) { m_eType = in_etype; };
00359
00360 virtual bool IsCOLLADATemplate() { return false; }
00361
00362 private:
00363 CSIBCString m_sInstanceName;
00364 CSIBCString m_sUserDataType;
00365 CdotXSITemplates m_ChildrenCol;
00366 CdotXSITemplate *m_Parent;
00367 SI_Int m_nSystemFlags;
00368 SI_Int m_nUserFlags;
00369 CdotXSIParams m_ParamsCol;
00370 SI_Int m_nVersionMajor, m_nVersionMinor;
00371 eCOLLADATemplateType m_eType;
00372
00373 public:
00375 DOTXSIREADCALLBACK m_ReadCallback;
00376
00378 DOTXSIWRITECALLBACK m_WriteCallback;
00379
00381 DOTXSIWRITECALLBACK m_WritePostCallback;
00382
00383 };
00384
00385
00386
00387
00388
00396 XSIEXPORT CdotXSITemplate* CreatedotXSITemplate();
00397
00401 XSIEXPORT CdotXSITemplates* CreatedotXSITemplates();
00402
00403
00404
00405
00406
00407
00408
00409 typedef CdotXSITemplate* (*TemplateCreation)();
00410
00411 #endif // __DOTXSITEMPLATE_H