00001 #ifndef _FBXSDK_DOCUMENT_H_
00002 #define _FBXSDK_DOCUMENT_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <kaydaradef.h>
00040 #ifndef KFBX_DLL
00041 #define KFBX_DLL K_DLLIMPORT
00042 #endif
00043
00044 #include <fbxcore/fbxcollection/kfbxcollection.h>
00045
00046 #include <fbxfilesdk_nsbegin.h>
00047
00048
00049 class KFbxTakeInfo;
00050 class KFbxPeripheral;
00051 class KFbxDocumentInfo;
00052
00059 class KFBX_DLL KFbxDocument : public KFbxCollection
00060 {
00061 KFBXOBJECT_DECLARE(KFbxDocument,KFbxCollection);
00062
00063
00068 KFbxTypedProperty<fbxReference*> Roots;
00070
00075 public:
00077 virtual void Clear();
00079 inline void AddRootMember (KFbxObject *pMember) { AddMember(pMember); Roots.ConnectSrcObject(pMember); }
00081 inline void RootRootRemoveMember(KFbxObject *pMember) { RemoveMember(pMember); Roots.DisconnectSrcObject(pMember); }
00083 template <class T> inline T * FindRootMember(T const *pfbxType, char *pName) { return Roots.FindSrcObject(pfbxType, pName); }
00084
00086 inline int GetRootMemberCount () const { return Roots.GetSrcObjectCount(); }
00088 template < class T > inline int GetRootMemberCount (T const *pFBX_TYPE) const { return Roots.GetSrcObjectCount(T::ClassId); }
00089 int GetRootMemberCount( KFbxCriteria pCriteria ) const;
00090
00092 inline KFbxObject* GetRootMember (int pIndex=0) const { return Roots.GetSrcObject(pIndex); }
00094 template < class T > inline T* GetRootMember (T const *pFBX_TYPE, int pIndex=0) const { return (T *)Roots.GetSrcObject(T::ClassId,pIndex); }
00095 KFbxObject* GetRootMember (KFbxCriteria pCriteria, int pIndex=0) const;
00097
00098 virtual bool IsRootMember(KFbxObject *pMember) const;
00100
00101
00109 KFbxDocumentInfo* GetDocumentInfo() const;
00110
00114 void SetDocumentInfo(KFbxDocumentInfo* pSceneInfo);
00116
00126 public:
00129 void SetPeripheral(KFbxPeripheral* pPeripheral);
00130
00135 virtual KFbxPeripheral* GetPeripheral();
00136
00143 int UnloadContent();
00144
00151 int LoadContent();
00152
00154
00159
00166 int GetReferencingDocuments(KArrayTemplate<KFbxDocument*> & pReferencingDocuments) const;
00167
00176 int GetReferencingObjects(KFbxDocument const * pFromDoc, KArrayTemplate<KFbxObject*> & pReferencingObjects) const;
00177
00184 int GetReferencedDocuments(KArrayTemplate<KFbxDocument*> & pReferencedDocuments) const;
00185
00194 int GetReferencedObjects(KFbxDocument const * pToDoc, KArrayTemplate<KFbxObject*> & pReferencedObjects) const;
00195
00196
00197 KString GetPathToRootDocument(void) const;
00198
00199
00200 void GetDocumentPathToRootDocument(KArrayTemplate<KFbxDocument*> & pDocumentPath, bool pFirstCall = true) const;
00201
00202
00203 bool IsARootDocument(void) { return (NULL == GetDocument()); }
00205
00210
00224 bool CreateTake(char* pName);
00225
00237 bool RemoveTake(char* pName);
00238
00254 bool SetCurrentTake(char* pName);
00255
00262 char* GetCurrentTakeName();
00263
00271 void FillTakeNameArray(KArrayTemplate<KString*>& pNameArray);
00272
00274
00279
00285 bool SetTakeInfo(const KFbxTakeInfo& pTakeInfo);
00286
00292 KFbxTakeInfo* GetTakeInfo(const KString& pTakeName);
00293
00295
00301
00305 KError& GetError();
00306
00310 typedef enum
00311 {
00312 eTAKE_ERROR,
00313 eKFBX_OBJECT_IS_NULL,
00314 eKFBX_OBJECT_ALREADY_OWNED,
00315 eKFBX_OBJECT_UNKNOWN,
00316 eKFBX_MISSING_PERIPHERAL,
00317 eKFBX_OBJECT_PERIPHERAL_FAILURE,
00318 eERROR_COUNT
00319 } EError;
00320
00324 EError GetLastErrorID() const;
00325
00329 const char* GetLastErrorString() const;
00330
00332
00334
00335
00336
00338 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00339 public:
00340 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00341
00342
00343 protected:
00344
00345 KFbxDocument(KFbxSdkManager& pManager, char const* pName);
00346 ~KFbxDocument();
00347 virtual void Construct (const KFbxDocument* pFrom);
00348 virtual void Destruct (bool pRecursive, bool pDependents);
00349 bool ConstructProperties(bool pForceSet);
00350
00351 KFbxDocument& operator=(const KFbxDocument& pOther);
00352
00353
00354 protected:
00355 virtual bool ConnecNotify (KFbxConnectEvent const &pEvent);
00356 virtual void SetDocument(KFbxDocument* pDocument);
00357
00358
00359 protected:
00360 void ConnectVideos();
00361
00362
00363 protected:
00364 bool FindTakeName(const KString& pTakeName);
00365
00366
00367 protected:
00368 KFbxSdkManager* mSdkManager;
00369 KFbxPeripheral* mPeripheral;
00370 KString mCurrentTakeName;
00371 KArrayTemplate<KFbxTakeInfo *> mTakeInfoArray;
00372 KError mError;
00373 KFbxDocumentInfo* mDocumentInfo;
00374
00375
00376
00377 friend class KFbxLayerContainer;
00378 friend class KFbxNodeFinderDuplicateName;
00379
00380 friend class KFbxWriterFbx;
00381 friend class KFbxWriterFbx6;
00382 friend class KFbxWriterFbx7;
00383 friend struct KFbxWriterFbx7Impl;
00384 friend class KFbxReaderFbx;
00385 friend class KFbxReaderFbx6;
00386 friend class KFbxReaderFbx7;
00387 friend struct KFbxReaderFbx7Impl;
00388
00389 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00390
00391 };
00392
00393 #include <fbxfilesdk_nsend.h>
00394
00395 #endif // #ifndef _FBXSDK_Document_H_
00396
00397