fbxsdk/scene/fbxdocument.h Source File

fbxdocument.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2014 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_SCENE_DOCUMENT_H_
14 #define _FBXSDK_SCENE_DOCUMENT_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
22 class FbxStatus;
23 class FbxTakeInfo;
24 class FbxPeripheral;
25 class FbxDocumentInfo;
26 
47 {
49 
50 public:
57 
62  virtual void Clear();
64 
68  inline void AddRootMember(FbxObject* pMember){ AddMember(pMember); Roots.ConnectSrcObject(pMember); }
69 
73  inline void RootRootRemoveMember(FbxObject* pMember){ RemoveMember(pMember); Roots.DisconnectSrcObject(pMember); }
74 
77  template <class T> inline T* FindRootMember(char* pName){ return Roots.FindSrcObject<T>(pName); }
78 
80  inline int GetRootMemberCount () const { return Roots.GetSrcObjectCount(); }
81 
84  template <class T> inline int GetRootMemberCount() const { return Roots.GetSrcObjectCount<T>(); }
85 
90  int GetRootMemberCount(FbxCriteria pCriteria) const;
91 
95  inline FbxObject* GetRootMember(int pIndex=0) const { return Roots.GetSrcObject(pIndex); }
96 
99  template <class T> inline T* GetRootMember(int pIndex=0) const { return Roots.GetSrcObject<T>(pIndex); }
100 
105  FbxObject* GetRootMember(FbxCriteria pCriteria, int pIndex=0) const;
106 
111  virtual bool IsRootMember(FbxObject* pMember) const;
113 
114 
122  FbxDocumentInfo* GetDocumentInfo() const;
123 
127  void SetDocumentInfo(FbxDocumentInfo* pSceneInfo);
129 
147  void SetPeripheral(FbxPeripheral* pPeripheral);
148 
152  virtual FbxPeripheral* GetPeripheral();
153 
158  int UnloadContent(FbxStatus* pStatus = NULL);
159 
164  int LoadContent(FbxStatus* pStatus = NULL);
165 
167 
172 
179  int GetReferencingDocuments(FbxArray<FbxDocument*>& pReferencingDocuments) const;
180 
189  int GetReferencingObjects(const FbxDocument* pFromDoc, FbxArray<FbxObject*>& pReferencingObjects) const;
190 
197  int GetReferencedDocuments(FbxArray<FbxDocument*>& pReferencedDocuments) const;
198 
207  int GetReferencedObjects(const FbxDocument* pToDoc, FbxArray<FbxObject*>& pReferencedObjects) const;
208 
213  FbxString GetPathToRootDocument(void) const;
219  void GetDocumentPathToRootDocument(FbxArray<FbxDocument*>& pDocumentPath, bool pFirstCall = true) const;
220 
225  bool IsARootDocument(void) { return (NULL == GetDocument()); }
227 
236 
246  bool CreateAnimStack(const char* pName, FbxStatus* pStatus = NULL);
247 
252  bool RemoveAnimStack(const char* pName);
253 
258  void FillAnimStackNameArray(FbxArray<FbxString*>& pNameArray);
259 
261 
273  bool SetTakeInfo(const FbxTakeInfo& pTakeInfo);
274 
280  FbxTakeInfo* GetTakeInfo(const FbxString& pTakeName) const;
281 
283 
284 /*****************************************************************************************************************************
285 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
286 *****************************************************************************************************************************/
287 #ifndef DOXYGEN_SHOULD_SKIP_THIS
288  virtual FbxObject& Copy(const FbxObject& pObject);
289  virtual void Compact();
290  void ConnectVideos();
291 
292 protected:
293  virtual void Construct(const FbxObject* pFrom);
294  virtual void ConstructProperties(bool pForceSet);
295  virtual void Destruct(bool pRecursive);
296 
297  virtual bool ConnectNotify(const FbxConnectEvent& pEvent);
298  virtual void SetDocument(FbxDocument* pDocument);
299 
300  bool FindTakeName(const FbxString& pTakeName);
301 
302  FbxArray<FbxTakeInfo*> mTakeInfoArray;
303 
304 private:
305  FbxPeripheral* mPeripheral;
306  FbxDocumentInfo* mDocumentInfo;
307 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
308 };
309 
310 #include <fbxsdk/fbxsdk_nsend.h>
311 
312 #endif /* _FBXSDK_SCENE_DOCUMENT_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FBX SDK environment definition.
virtual void Compact()
Compact the memory used by this object.
virtual void Clear()
Deletes all objects in the container.
bool IsARootDocument(void)
Tells if this document is a root document.
Definition: fbxdocument.h:225
int GetRootMemberCount() const
Return the number of objects in the document.
Definition: fbxdocument.h:80
#define NULL
Definition: fbxarch.h:207
virtual FbxObject & Copy(const FbxObject &pObject)
Copy an object content into this object.
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxObject * GetRootMember(int pIndex=0) const
Return the member of the document at given index.
Definition: fbxdocument.h:95
FbxDocument is a base class for FbxScene and FbxLibrary classes.
Definition: fbxdocument.h:46
virtual FbxPeripheral * GetPeripheral()
Retrieves the peripheral of that object.
void AddRootMember(FbxObject *pMember)
Add a member object and connect it to Roots.
Definition: fbxdocument.h:68
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
This class contains scene thumbnails and user-defined summary data.
The base class of most FBX objects.
Definition: fbxobject.h:157
FbxPropertyT< FbxReference > Roots
Definition: fbxdocument.h:55
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
Defines a filtering criteria for a query of objects, connections and properties, so that only those s...
Definition: fbxquery.h:104
FbxObject * GetSrcObject(int pIndex=0) const
Returns the source object with which this object connects at the specified index. ...
Definition: fbxobject.h:480
virtual bool AddMember(FbxObject *pMember)
Adds a member.
Definition: fbxcollection.h:43
int GetRootMemberCount() const
Return the number of objects of class T in the document.
Definition: fbxdocument.h:84
A FbxObject derived container for FbxObject.
Definition: fbxcollection.h:28
This class contains take information from an imported file or exported to an output file...
Definition: fbxtakeinfo.h:56
#define FBXSDK_DLL
Definition: fbxarch.h:170
void RootRootRemoveMember(FbxObject *pMember)
Remove a member object from the document.
Definition: fbxdocument.h:73
virtual bool RemoveMember(FbxObject *pMember)
Removes a member.
Definition: fbxcollection.h:48
virtual void Destruct(bool pRecursive)
Optional destructor override, automatically called by default destructor.
FbxDocument * GetDocument() const
Returns a const pointer to the document that contains this object.
FbxPeripheral is an interface to load/unload content of FbxObject from memory to somewhere you define...
Definition: fbxperipheral.h:31
T * FindRootMember(char *pName)
Find a member object in the document, that has the given type and name.
Definition: fbxdocument.h:77
FbxPropertyT< FbxString > ActiveAnimStackName
Holds the name of the FbxAnimStack that the application uses for animation in this document...
Definition: fbxdocument.h:235
This template class is used to contain user properties of specific data types.
Definition: fbxproperty.h:1150
virtual void ConstructProperties(bool pForceSet)
Optional property constructor override, automatically called by default constructor.
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23
T * GetRootMember(int pIndex=0) const
Return the member of class T of the document at given index.
Definition: fbxdocument.h:99