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
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
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
00058 class KFBX_DLL KFbxDocument : public KFbxCollection
00059 {
00060 KFBXOBJECT_DECLARE(KFbxDocument,KFbxCollection);
00061
00062
00067 KFbxTypedProperty<fbxReference*> Roots;
00069
00074 public:
00076 virtual void Clear();
00080 inline void AddRootMember (KFbxObject *pMember) { AddMember(pMember); Roots.ConnectSrcObject(pMember); }
00084 inline void RootRootRemoveMember(KFbxObject *pMember) { RemoveMember(pMember); Roots.DisconnectSrcObject(pMember); }
00089 template <class T> inline T * FindRootMember(T const *pfbxType, char *pName) { return Roots.FindSrcObject(pfbxType, pName); }
00090
00092 inline int GetRootMemberCount () const { return Roots.GetSrcObjectCount(); }
00097 template < class T > inline int GetRootMemberCount (T const *pFBX_TYPE) const { return Roots.GetSrcObjectCount(T::ClassId); }
00102 int GetRootMemberCount( KFbxCriteria pCriteria ) const;
00103
00107 inline KFbxObject* GetRootMember (int pIndex=0) const { return Roots.GetSrcObject(pIndex); }
00112 template < class T > inline T* GetRootMember (T const *pFBX_TYPE, int pIndex=0) const { return (T *)Roots.GetSrcObject(T::ClassId,pIndex); }
00117 KFbxObject* GetRootMember (KFbxCriteria pCriteria, int pIndex=0) const;
00118
00123 virtual bool IsRootMember(KFbxObject *pMember) const;
00125
00126
00134 KFbxDocumentInfo* GetDocumentInfo() const;
00135
00139 void SetDocumentInfo(KFbxDocumentInfo* pSceneInfo);
00141
00151 public:
00155 void SetPeripheral(KFbxPeripheral* pPeripheral);
00156
00161 virtual KFbxPeripheral* GetPeripheral();
00162
00169 int UnloadContent();
00170
00177 int LoadContent();
00178
00180
00185
00192 int GetReferencingDocuments(KArrayTemplate<KFbxDocument*> & pReferencingDocuments) const;
00193
00202 int GetReferencingObjects(KFbxDocument const * pFromDoc, KArrayTemplate<KFbxObject*> & pReferencingObjects) const;
00203
00210 int GetReferencedDocuments(KArrayTemplate<KFbxDocument*> & pReferencedDocuments) const;
00211
00220 int GetReferencedObjects(KFbxDocument const * pToDoc, KArrayTemplate<KFbxObject*> & pReferencedObjects) const;
00221
00225 KString GetPathToRootDocument(void) const;
00231 void GetDocumentPathToRootDocument(KArrayTemplate<KFbxDocument*> & pDocumentPath, bool pFirstCall = true) const;
00232
00236 bool IsARootDocument(void) { return (NULL == GetDocument()); }
00238
00243
00257 bool CreateTake(char* pName);
00258
00270 bool RemoveTake(char* pName);
00271
00287 bool SetCurrentTake(char* pName);
00288
00295 char* GetCurrentTakeName();
00296
00304 void FillTakeNameArray(KArrayTemplate<KString*>& pNameArray);
00305
00307
00312
00318 bool SetTakeInfo(const KFbxTakeInfo& pTakeInfo);
00319
00325 KFbxTakeInfo* GetTakeInfo(const KString& pTakeName);
00326
00328
00334
00338 KError& GetError();
00339
00343 typedef enum
00344 {
00345 eTAKE_ERROR,
00346 eKFBX_OBJECT_IS_NULL,
00347 eKFBX_OBJECT_ALREADY_OWNED,
00348 eKFBX_OBJECT_UNKNOWN,
00349 eKFBX_MISSING_PERIPHERAL,
00350 eKFBX_OBJECT_PERIPHERAL_FAILURE,
00351 eERROR_COUNT
00352 } EError;
00353
00357 EError GetLastErrorID() const;
00358
00362 const char* GetLastErrorString() const;
00363
00365
00367
00368
00369
00371 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00372 public:
00373 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00374
00375
00376 protected:
00377
00378 KFbxDocument(KFbxSdkManager& pManager, char const* pName);
00379 virtual void Construct (const KFbxDocument* pFrom);
00380 virtual void Destruct (bool pRecursive, bool pDependents);
00381 bool ConstructProperties(bool pForceSet);
00382
00383 KFbxDocument& operator=(const KFbxDocument& pOther);
00384
00385
00386 protected:
00387 virtual bool ConnecNotify (KFbxConnectEvent const &pEvent);
00388 virtual void SetDocument(KFbxDocument* pDocument);
00389
00390
00391 public:
00392 void ConnectVideos();
00393
00394
00395 protected:
00396 bool FindTakeName(const KString& pTakeName);
00397
00398
00399 protected:
00400 KFbxSdkManager* mSdkManager;
00401 KFbxPeripheral* mPeripheral;
00402 KString mCurrentTakeName;
00403 KArrayTemplate<KFbxTakeInfo *> mTakeInfoArray;
00404 KError mError;
00405 KFbxDocumentInfo* mDocumentInfo;
00406
00407
00408
00409 friend class KFbxLayerContainer;
00410 friend class KFbxNodeFinderDuplicateName;
00411 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00412 };
00413
00414 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00415
00416 #endif // FBXFILESDK_FBXCORE_FBXCOLLECTION_KFBXDOCUMENT_H
00417