Go to the
documentation of this file.
00001
00004 #ifndef FBXFILESDK_FBXCORE_FBXCOLLECTION_KFBXDOCUMENT_H
00005 #define FBXFILESDK_FBXCORE_FBXCOLLECTION_KFBXDOCUMENT_H
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
00040
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042
00043 #include <fbxfilesdk/fbxcore/fbxcollection/kfbxcollection.h>
00044
00045 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00046
00047
00048 class KFbxTakeInfo;
00049 class KFbxPeripheral;
00050 class KFbxDocumentInfo;
00051
00071 class KFBX_DLL KFbxDocument : public KFbxCollection
00072 {
00073 KFBXOBJECT_DECLARE(KFbxDocument,KFbxCollection);
00074
00075 public:
00080 KFbxTypedProperty<fbxReference*> Roots;
00082
00087
00088 virtual void Clear();
00092 inline void AddRootMember (KFbxObject *pMember) { AddMember(pMember); Roots.ConnectSrcObject(pMember); }
00096 inline void RootRootRemoveMember(KFbxObject *pMember) { RemoveMember(pMember); Roots.DisconnectSrcObject(pMember); }
00101 template <class T> inline T * FindRootMember(T const *pfbxType, char *pName) { return Roots.FindSrcObject(pfbxType, pName); }
00102
00104 inline int GetRootMemberCount () const { return Roots.GetSrcObjectCount(); }
00109 template < class T > inline int GetRootMemberCount (T const *pFBX_TYPE) const { return Roots.GetSrcObjectCount(T::ClassId); }
00114 int GetRootMemberCount( KFbxCriteria pCriteria ) const;
00115
00119 inline KFbxObject* GetRootMember (int pIndex=0) const { return Roots.GetSrcObject(pIndex); }
00124 template < class T > inline T* GetRootMember (T const *pFBX_TYPE, int pIndex=0) const { return (T *)Roots.GetSrcObject(T::ClassId,pIndex); }
00129 KFbxObject* GetRootMember (KFbxCriteria pCriteria, int pIndex=0) const;
00130
00135 virtual bool IsRootMember(KFbxObject *pMember) const;
00137
00138
00146 KFbxDocumentInfo* GetDocumentInfo() const;
00147
00151 void SetDocumentInfo(KFbxDocumentInfo* pSceneInfo);
00153
00168 public:
00172 void SetPeripheral(KFbxPeripheral* pPeripheral);
00173
00177 virtual KFbxPeripheral* GetPeripheral();
00178
00185 int UnloadContent();
00186
00193 int LoadContent();
00194
00196
00201
00208 int GetReferencingDocuments(KArrayTemplate<KFbxDocument*> & pReferencingDocuments) const;
00209
00218 int GetReferencingObjects(KFbxDocument const * pFromDoc, KArrayTemplate<KFbxObject*> & pReferencingObjects) const;
00219
00226 int GetReferencedDocuments(KArrayTemplate<KFbxDocument*> & pReferencedDocuments) const;
00227
00236 int GetReferencedObjects(KFbxDocument const * pToDoc, KArrayTemplate<KFbxObject*> & pReferencedObjects) const;
00237
00242 KString GetPathToRootDocument(void) const;
00248 void GetDocumentPathToRootDocument(KArrayTemplate<KFbxDocument*> & pDocumentPath, bool pFirstCall = true) const;
00249
00254 bool IsARootDocument(void) { return (NULL == GetDocument()); }
00256
00264 KFbxTypedProperty<fbxString> ActiveAnimStackName;
00265
00274 bool CreateAnimStack(const char* pName);
00275
00280 bool RemoveAnimStack(const char* pName);
00281
00286 void FillAnimStackNameArray(KArrayTemplate<KString*>& pNameArray);
00287
00289
00296
00302 bool SetTakeInfo(const KFbxTakeInfo& pTakeInfo);
00303
00309 KFbxTakeInfo* GetTakeInfo(const KString& pTakeName) const;
00310
00312
00318
00322 KError& GetError();
00323
00327 typedef enum
00328 {
00330 eTAKE_ERROR,
00332 eKFBX_OBJECT_IS_NULL,
00334 eKFBX_OBJECT_ALREADY_OWNED,
00336 eKFBX_OBJECT_UNKNOWN,
00338 eKFBX_MISSING_PERIPHERAL,
00340 eKFBX_OBJECT_PERIPHERAL_FAILURE,
00342 eERROR_COUNT
00343 } EError;
00344
00348 EError GetLastErrorID() const;
00349
00353 const char* GetLastErrorString() const;
00354
00356
00358
00359
00360
00362 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00363
00364 virtual KFbxObject& Copy(const KFbxObject& pObject);
00365
00366
00367 protected:
00368
00369 KFbxDocument(KFbxSdkManager& pManager, char const* pName);
00370 virtual void Construct (const KFbxDocument* pFrom);
00371 virtual void Destruct (bool pRecursive, bool pDependents);
00372 bool ConstructProperties(bool pForceSet);
00373
00374
00375 protected:
00376 virtual bool ConnecNotify (KFbxConnectEvent const &pEvent);
00377 virtual void SetDocument(KFbxDocument* pDocument);
00378
00379
00380 public:
00381 void ConnectVideos();
00382
00383
00384 protected:
00385 bool FindTakeName(const KString& pTakeName);
00386
00387
00388 protected:
00389 KFbxSdkManager* mSdkManager;
00390 KFbxPeripheral* mPeripheral;
00391 KArrayTemplate<KFbxTakeInfo *> mTakeInfoArray;
00392 KError mError;
00393 KFbxDocumentInfo* mDocumentInfo;
00394
00395
00396
00397 friend class KFbxLayerContainer;
00398 friend class KFbxNodeFinderDuplicateName;
00399 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00400 };
00401
00402 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00403
00404 #endif // FBXFILESDK_FBXCORE_FBXCOLLECTION_KFBXDOCUMENT_H
00405