00001 #ifndef FBXFILESDK_FBXCORE_FBXCOLLECTION_KFBXDOCUMENT_H
00002 #define FBXFILESDK_FBXCORE_FBXCOLLECTION_KFBXDOCUMENT_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 <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00040 #include <fbxfilesdk/fbxcore/fbxcollection/kfbxcollection.h>
00041
00042 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00043
00044
00045 class KFbxTakeInfo;
00046 class KFbxPeripheral;
00047 class KFbxDocumentInfo;
00048
00055 class KFBX_DLL KFbxDocument : public KFbxCollection
00056 {
00057 KFBXOBJECT_DECLARE(KFbxDocument,KFbxCollection);
00058
00059
00064 KFbxTypedProperty<fbxReference*> Roots;
00066
00071 public:
00073 virtual void Clear();
00077 inline void AddRootMember (KFbxObject *pMember) { AddMember(pMember); Roots.ConnectSrcObject(pMember); }
00081 inline void RootRootRemoveMember(KFbxObject *pMember) { RemoveMember(pMember); Roots.DisconnectSrcObject(pMember); }
00086 template <class T> inline T * FindRootMember(T const *pfbxType, char *pName) { return Roots.FindSrcObject(pfbxType, pName); }
00087
00089 inline int GetRootMemberCount () const { return Roots.GetSrcObjectCount(); }
00094 template < class T > inline int GetRootMemberCount (T const *pFBX_TYPE) const { return Roots.GetSrcObjectCount(T::ClassId); }
00099 int GetRootMemberCount( KFbxCriteria pCriteria ) const;
00100
00104 inline KFbxObject* GetRootMember (int pIndex=0) const { return Roots.GetSrcObject(pIndex); }
00109 template < class T > inline T* GetRootMember (T const *pFBX_TYPE, int pIndex=0) const { return (T *)Roots.GetSrcObject(T::ClassId,pIndex); }
00114 KFbxObject* GetRootMember (KFbxCriteria pCriteria, int pIndex=0) const;
00115
00120 virtual bool IsRootMember(KFbxObject *pMember) const;
00122
00123
00131 KFbxDocumentInfo* GetDocumentInfo() const;
00132
00136 void SetDocumentInfo(KFbxDocumentInfo* pSceneInfo);
00138
00148 public:
00152 void SetPeripheral(KFbxPeripheral* pPeripheral);
00153
00158 virtual KFbxPeripheral* GetPeripheral();
00159
00166 int UnloadContent();
00167
00174 int LoadContent();
00175
00177
00182
00189 int GetReferencingDocuments(KArrayTemplate<KFbxDocument*> & pReferencingDocuments) const;
00190
00199 int GetReferencingObjects(KFbxDocument const * pFromDoc, KArrayTemplate<KFbxObject*> & pReferencingObjects) const;
00200
00207 int GetReferencedDocuments(KArrayTemplate<KFbxDocument*> & pReferencedDocuments) const;
00208
00217 int GetReferencedObjects(KFbxDocument const * pToDoc, KArrayTemplate<KFbxObject*> & pReferencedObjects) const;
00218
00222 KString GetPathToRootDocument(void) const;
00228 void GetDocumentPathToRootDocument(KArrayTemplate<KFbxDocument*> & pDocumentPath, bool pFirstCall = true) const;
00229
00233 bool IsARootDocument(void) { return (NULL == GetDocument()); }
00235
00240
00254 bool CreateTake(char* pName);
00255
00267 bool RemoveTake(char* pName);
00268
00284 bool SetCurrentTake(char* pName);
00285
00292 char* GetCurrentTakeName();
00293
00301 void FillTakeNameArray(KArrayTemplate<KString*>& pNameArray);
00302
00304
00309
00315 bool SetTakeInfo(const KFbxTakeInfo& pTakeInfo);
00316
00322 KFbxTakeInfo* GetTakeInfo(const KString& pTakeName);
00323
00325
00331
00335 KError& GetError();
00336
00340 typedef enum
00341 {
00342 eTAKE_ERROR,
00343 eKFBX_OBJECT_IS_NULL,
00344 eKFBX_OBJECT_ALREADY_OWNED,
00345 eKFBX_OBJECT_UNKNOWN,
00346 eKFBX_MISSING_PERIPHERAL,
00347 eKFBX_OBJECT_PERIPHERAL_FAILURE,
00348 eERROR_COUNT
00349 } EError;
00350
00354 EError GetLastErrorID() const;
00355
00359 const char* GetLastErrorString() const;
00360
00362
00364
00365
00366
00368 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00369 public:
00370 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00371
00372
00373 protected:
00374
00375 KFbxDocument(KFbxSdkManager& pManager, char const* pName);
00376 ~KFbxDocument();
00377 virtual void Construct (const KFbxDocument* pFrom);
00378 virtual void Destruct (bool pRecursive, bool pDependents);
00379 bool ConstructProperties(bool pForceSet);
00380
00381 KFbxDocument& operator=(const KFbxDocument& pOther);
00382
00383
00384 protected:
00385 virtual bool ConnecNotify (KFbxConnectEvent const &pEvent);
00386 virtual void SetDocument(KFbxDocument* pDocument);
00387
00388
00389 public:
00390 void ConnectVideos();
00391
00392
00393 protected:
00394 bool FindTakeName(const KString& pTakeName);
00395
00396
00397 protected:
00398 KFbxSdkManager* mSdkManager;
00399 KFbxPeripheral* mPeripheral;
00400 KString mCurrentTakeName;
00401 KArrayTemplate<KFbxTakeInfo *> mTakeInfoArray;
00402 KError mError;
00403 KFbxDocumentInfo* mDocumentInfo;
00404
00405
00406
00407 friend class KFbxLayerContainer;
00408 friend class KFbxNodeFinderDuplicateName;
00409 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00410 };
00411
00412 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00413
00414 #endif // FBXFILESDK_FBXCORE_FBXCOLLECTION_KFBXDOCUMENT_H
00415