KFbxDocument Class Reference

#include <kfbxdocument.h>
Inheritance diagram for KFbxDocument:
Inheritance graph
[legend]

List of all members.


Detailed Description

This class contains objects.
This class also provides access to take information.

Definition at line 58 of file kfbxdocument.h.


Error Management

The same error object is shared among instances of this class.

enum   EError {
   eTAKE_ERROR,
   eKFBX_OBJECT_IS_NULL,
   eKFBX_OBJECT_ALREADY_OWNED,
   eKFBX_OBJECT_UNKNOWN,
   eKFBX_MISSING_PERIPHERAL,
   eKFBX_OBJECT_PERIPHERAL_FAILURE,
   eERROR_COUNT
}
  Error identifiers. More...
KError GetError ()
  Retrieve error object.
EError  GetLastErrorID () const
  Get last error code.
const char *  GetLastErrorString () const
  Get last error string.

Properties

KFbxTypedProperty< fbxReference * >  Roots

Animation Stack Management

KFbxTypedProperty< fbxString ActiveAnimStackName
  Holds the name of the KFbxAnimStack that the application has decided to use for the animation.
bool  CreateAnimStack (const char *pName)
  Adds a new AnimStack object to this document.
K_DEPRECATED bool  CreateTake (const char *pName)
  Create a take.
bool  RemoveAnimStack (const char *pName)
  Destroy the AnimStack object identified by pName from this document.
K_DEPRECATED bool  RemoveTake (const char *pName)
  Remove a take.
K_DEPRECATED bool  SetCurrentTake (const char *pName)
  Set the current take.
K_DEPRECATED char *  GetCurrentTakeName ()
  Get current take name.
K_DEPRECATED void  FillTakeNameArray (KArrayTemplate< KString * > &pNameArray)
  Fill a string array with all existing take names.
void  FillAnimStackNameArray (KArrayTemplate< KString * > &pNameArray)
  Fill a string array with all existing animation stack names.

Document Member Manager

virtual void  Clear ()
  Delete the scene information.
void  AddRootMember (KFbxObject *pMember)
  Add a member.
void  RootRootRemoveMember (KFbxObject *pMember)
  Remove a member.
template<class T>
T *  FindRootMember (T const *pfbxType, char *pName)
  Find a member.
int  GetRootMemberCount () const
  Return the number of objects in the collection.
template<class T>
int  GetRootMemberCount (T const *pFBX_TYPE) const
  Return the number of objects of class T in the collection.
int  GetRootMemberCount (KFbxCriteria pCriteria) const
  Return the number of objects satisfying given criteria in the collection.
KFbxObject GetRootMember (int pIndex=0) const
  Return the index'th member of the collection.
template<class T>
T *  GetRootMember (T const *pFBX_TYPE, int pIndex=0) const
  Return the index'th member of class T of the collection.
KFbxObject GetRootMember (KFbxCriteria pCriteria, int pIndex=0) const
  Return the index'th member of the collection which satisfies given criteria.
virtual bool  IsRootMember (KFbxObject *pMember) const
  Is an object part of the collection.

Scene information

KFbxDocumentInfo GetDocumentInfo () const
  Get the scene information.
void  SetDocumentInfo (KFbxDocumentInfo *pSceneInfo)
  Set the scene information.

Offloading management

NOTE: The document does not own the peripheral therefore it will not attempt to delete it at destruction time.

Also, cloning the document will share the pointer to the peripheral across the cloned objects. And so will do the assignment operator.

void  SetPeripheral (KFbxPeripheral *pPeripheral)
  Set the current peripheral.
virtual KFbxPeripheral GetPeripheral ()
  Retrieve the peripheral of that object.
int  UnloadContent ()
  Offload all the unloadable objects contained in the document using the currently set offload peripheral.
int  LoadContent ()
  Load all the objects contained in the document with the data from the currently set offload peripheral.

Referencing management

int  GetReferencingDocuments (KArrayTemplate< KFbxDocument * > &pReferencingDocuments) const
  Fills an array of pointers to documents that reference objects in this document.
int  GetReferencingObjects (KFbxDocument const *pFromDoc, KArrayTemplate< KFbxObject * > &pReferencingObjects) const
  Fills an array of pointers to objects in a given document (pFromDoc) that reference objects in this document.
int  GetReferencedDocuments (KArrayTemplate< KFbxDocument * > &pReferencedDocuments) const
  Fills an array of pointers to documents that are referenced by objects in this document.
int  GetReferencedObjects (KFbxDocument const *pToDoc, KArrayTemplate< KFbxObject * > &pReferencedObjects) const
  Fills an array of pointers to objects in a given document (pToDoc) that are referenced by objects in this document.
KString  GetPathToRootDocument (void) const
  Gets the path string to the root document, if it exists.
void  GetDocumentPathToRootDocument (KArrayTemplate< KFbxDocument * > &pDocumentPath, bool pFirstCall=true) const
  Gets the document path to the root document, if it exists.
bool  IsARootDocument (void)
  Tells if this document is a root document.

Take Information Management

bool  SetTakeInfo (const KFbxTakeInfo &pTakeInfo)
  Set take information about an available take.
KFbxTakeInfo GetTakeInfo (const KString &pTakeName) const
  Get take information about an available take.

Member Enumeration Documentation

enum EError

Error identifiers.

Most of these are only used internally.

Enumerator:
eTAKE_ERROR 
eKFBX_OBJECT_IS_NULL 
eKFBX_OBJECT_ALREADY_OWNED 
eKFBX_OBJECT_UNKNOWN 
eKFBX_MISSING_PERIPHERAL 
eKFBX_OBJECT_PERIPHERAL_FAILURE 
eERROR_COUNT 

Definition at line 344 of file kfbxdocument.h.


Member Function Documentation

virtual void Clear (  )  [virtual]

Delete the scene information.

Reimplemented from KFbxCollection.

Reimplemented in KFbxScene.

void AddRootMember ( KFbxObject pMember  )  [inline]

Add a member.

Parameters:
pMember  The member to be added.

Definition at line 79 of file kfbxdocument.h.

References KFbxCollection::AddMember().

void RootRootRemoveMember ( KFbxObject pMember  )  [inline]

Remove a member.

Parameters:
pMember  The member to be removed.

Definition at line 83 of file kfbxdocument.h.

References KFbxCollection::RemoveMember().

T* FindRootMember ( T const *  pfbxType,
char *  pName  
) [inline]

Find a member.

Parameters:
pfbxType  Type information.
pName  Member name.

Definition at line 88 of file kfbxdocument.h.

int GetRootMemberCount (  )  const [inline]

Return the number of objects in the collection.

Definition at line 91 of file kfbxdocument.h.

int GetRootMemberCount ( T const *  pFBX_TYPE  )  const [inline]

Return the number of objects of class T in the collection.

Parameters:
pFBX_TYPE  Type information.
Returns:
The number of objects of class T in the collection.

Definition at line 96 of file kfbxdocument.h.

int GetRootMemberCount ( KFbxCriteria  pCriteria  )  const

Return the number of objects satisfying given criteria in the collection.

Parameters:
pCriteria  The given criteria.
Returns:
The number of objects satisfying given criteria

KFbxObject* GetRootMember ( int  pIndex = 0  )  const [inline]

Return the index'th member of the collection.

Parameters:
pIndex  The member index.

Definition at line 106 of file kfbxdocument.h.

T* GetRootMember ( T const *  pFBX_TYPE,
int  pIndex = 0  
) const [inline]

Return the index'th member of class T of the collection.

Parameters:
pFBX_TYPE  Type information.
pIndex  The member index.

Definition at line 111 of file kfbxdocument.h.

KFbxObject* GetRootMember ( KFbxCriteria  pCriteria,
int  pIndex = 0  
) const

Return the index'th member of the collection which satisfies given criteria.

Parameters:
pCriteria  The given criteria.
pIndex  The member index.

virtual bool IsRootMember ( KFbxObject pMember  )  const [virtual]

Is an object part of the collection.

Parameters:
pMember 
Returns:
True if pMember is an object part of the collection, false otherwise.

KFbxDocumentInfo* GetDocumentInfo (  )  const

Get the scene information.

Returns:
Pointer to the scene information object.

Referenced by KFbxScene::GetSceneInfo().

void SetDocumentInfo ( KFbxDocumentInfo pSceneInfo  ) 

Set the scene information.

Parameters:
pSceneInfo  Pointer to the scene information object.

Referenced by KFbxScene::SetSceneInfo().

void SetPeripheral ( KFbxPeripheral pPeripheral  ) 

Set the current peripheral.

Parameters:
pPeripheral  The peripheral to be set.

virtual KFbxPeripheral* GetPeripheral (  )  [virtual]

Retrieve the peripheral of that object.

Returns:
Return the current peripheral for that object
Remarks:
A peripheral manipulates the content of an object for instance, a peripheral can load the connections of an object on demand.

Reimplemented from KFbxObject.

int UnloadContent (  ) 

Offload all the unloadable objects contained in the document using the currently set offload peripheral.

Returns:
The number of objects that the document have been able to unload.
Remarks:
Errors that occurred during the operation can be inspected using the GetError() method.

int LoadContent (  ) 

Load all the objects contained in the document with the data from the currently set offload peripheral.

Returns:
The number of objects reloaded.
Remarks:
Errors that occurred during the operation can be inspected using the GetError() method.

int GetReferencingDocuments ( KArrayTemplate< KFbxDocument * > &  pReferencingDocuments  )  const

Fills an array of pointers to documents that reference objects in this document.

Parameters:
pReferencingDocuments  array of pointers to documents
Returns:
number of documents that reference objects in this document.

int GetReferencingObjects ( KFbxDocument const *  pFromDoc,
KArrayTemplate< KFbxObject * > &  pReferencingObjects  
) const

Fills an array of pointers to objects in a given document (pFromDoc) that reference objects in this document.

Parameters:
pFromDoc  pointer to the document containing referencing objects.
pReferencingObjects  array of pointers to referencing objects.
Returns:
number of objects that reference objects in this document.

int GetReferencedDocuments ( KArrayTemplate< KFbxDocument * > &  pReferencedDocuments  )  const

Fills an array of pointers to documents that are referenced by objects in this document.

Parameters:
pReferencedDocuments  array of pointers to documents
Returns:
number of documents that are referenced by objects in this document.

int GetReferencedObjects ( KFbxDocument const *  pToDoc,
KArrayTemplate< KFbxObject * > &  pReferencedObjects  
) const

Fills an array of pointers to objects in a given document (pToDoc) that are referenced by objects in this document.

Parameters:
pToDoc  pointer to the document containing referenced objects.
pReferencedObjects  array of pointers to referenced objects.
Returns:
number of objects that are referenced by objects in this document.

KString GetPathToRootDocument ( void   )  const

Gets the path string to the root document, if it exists.

void GetDocumentPathToRootDocument ( KArrayTemplate< KFbxDocument * > &  pDocumentPath,
bool  pFirstCall = true  
) const

Gets the document path to the root document, if it exists.

Parameters:
pDocumentPath  array of KFbxDocument to store the document path.
pFirstCall 

bool IsARootDocument ( void   )  [inline]

Tells if this document is a root document.

Definition at line 235 of file kfbxdocument.h.

References KFbxObject::GetDocument(), and NULL.

bool CreateAnimStack ( const char *  pName  ) 

Adds a new AnimStack object to this document.

Parameters:
pName  Created AnimStack name.
Returns:
true if a new KFbxAnimStack has been successfully created

false if an error occurred or the specified name defines an existing KFbxAnimStack.

In case of an error, KFbxDocument::GetLastErrorID() will return eTAKE_ERROR.

K_DEPRECATED bool CreateTake ( const char *  pName  ) 

Create a take.

This method is deprecated an should be replaced with calls to CreateAnimStack().

Parameters:
pName  Name of the animation take.

bool RemoveAnimStack ( const char *  pName  ) 

Destroy the AnimStack object identified by pName from this document.

Parameters:
pName  Name of the AnimStack object to be deleted.
Returns:
true if the KFbxAnimStack has been destroyed and false otherwise.

K_DEPRECATED bool RemoveTake ( const char *  pName  ) 

Remove a take.

This method is deprecated and should be replaced with calls to RemoveAnimStack().

Parameters:
pName  Name of the animation take.

K_DEPRECATED bool SetCurrentTake ( const char *  pName  ) 

Set the current take.

Parameters:
pName  Name of the take to set.
Returns:
true if pName identify an existing animation stack and false otherwise. This method only stores the received name for Animation Stack selection There is no more the concept of "Current" in the SDK therefore the method has been marked as deprecated and its usage should be avoided. The property ActiveAnimStackName can be used to store/retrieve the name of the AnimStack that the application consider as "current". This property may be used when calling the FindMember() to get a pointer to the animation stack.

K_DEPRECATED char* GetCurrentTakeName (  ) 

Get current take name.

This method returns the stored name whether it refers to an existing animation stack or not. There is no more the concept of "Current" in the SDK therefore the method has been marked as deprecated because from now on, the desired animation stack should be passed to the functions that require it. The property ActiveAnimStackName replaces this method.

K_DEPRECATED void FillTakeNameArray ( KArrayTemplate< KString * > &  pNameArray  ) 

Fill a string array with all existing take names.

This method is deprecated and should be replaced with calls to FillAnimStackNameArray().

Parameters:
pNameArray  An array of string objects.
Remarks:
The array of string is cleared before it's used

void FillAnimStackNameArray ( KArrayTemplate< KString * > &  pNameArray  ) 

Fill a string array with all existing animation stack names.

Parameters:
pNameArray  An array of string objects.
Remarks:
The array of string is cleared before it's used

bool SetTakeInfo ( const KFbxTakeInfo pTakeInfo  ) 

Set take information about an available take.

Parameters:
pTakeInfo  Take information, field KFbxTakeInfo::mName specifies the targeted take.
Returns:
true if take is found and take information set.

KFbxTakeInfo* GetTakeInfo ( const KString pTakeName  )  const

Get take information about an available take.

Parameters:
pTakeName  Take name.
Returns:
Pointer to take information or NULL if take isn't found or has no information set.

KError& GetError (  ) 

Retrieve error object.

Returns:
Reference to error object.

EError GetLastErrorID (  )  const

Get last error code.

Returns:
Last error code.

const char* GetLastErrorString (  )  const

Get last error string.

Returns:
Textual description of the last error.

Member Data Documentation

Definition at line 67 of file kfbxdocument.h.

Holds the name of the KFbxAnimStack that the application has decided to use for the animation.

Definition at line 244 of file kfbxdocument.h.

KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument
KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument KFbxDocument