KFbxWriter Class Reference

#include <kfbxwriter.h>

List of all members.


Detailed Description

Base class of other writers used internally.

This class provides the interfaces for writing files.

The role of the writer is to effectively "write" specific file data vs the role of the exporter is to select a specific writer and launch the writing of a file through that writer.

See also:
KFbxExporter
ex:

A SDK user should - normally - not use this class, except if a custom writer must be created for plug-in extension, then KFbxWriter must be the base class for the new custom writer in that particular situation.

Definition at line 85 of file kfbxwriter.h.


Public Types

enum   EError {
   eFILE_CORRUPTED,
   eFILE_NOT_OPENED,
   eFILE_NOT_CREATED,
   eOUT_OF_DISK_SPACE,
   eINVALID_DOCUMENT_HANDLE,
   eDOCUMENT_NOT_SUPPORTED,
   eUNIDENTIFIED_ERROR,
   eEMBEDDED_OUT_OF_SPACE,
   eERROR_COUNT
}
  Error identifiers. More...
enum   KInfoRequest {
   eInfoExtension,
   eInfoDescriptions,
   eInfoVersions,
   eInfoCompatibleDesc,
   eInfoUILabel,
   eReserved1 = 0xFBFB
}
 
  • eInfoExtension // to get the file ext for a writer ex: "FBX"
    • eInfoDescriptions // to get the file description for a writer ex:"Autodesk FBX (*.fbx)"
    • eInfoVersions // to get the file version for a writer ex: 7100
    • eInfoCompatibleDesc // to get the file compatible description for a writer.
More...
typedef KFbxWriter *(*  CreateFuncType )(KFbxSdkManager &pManager, KFbxExporter &pExporter, int pSubID, int pPluginID)
  Helper typedef for passing KFbxWriter creator function as argument (used internally).
typedef void(*  IOSettingsFillerFuncType )(KFbxIOSettings &pIOS)
  Helper typedef for passing KFbxIOSettings creator function as argument (used internally).
typedef void *(*  GetInfoFuncType )(KInfoRequest pRequest, int pWriterTypeId)
  Helper typedef for passing KInfoRequest function as argument (used internally).

Public Member Functions

  KFbxWriter (KFbxSdkManager &pManager, int pID)
  Constructor.
virtual  ~KFbxWriter ()
  Destructor.
virtual bool  FileCreate (char *pFileName)=0
  Creates a new file.
virtual bool  FileClose ()=0
  Closes the file.
virtual bool  IsFileOpen ()=0
  Test if the file is open.
virtual void  GetWriteOptions ()=0
  Setup write options.
virtual bool  Write (KFbxDocument *pDocument)=0
  Writes content to the specified file with given stream options.
virtual bool  PreprocessScene (KFbxScene &pScene)=0
  Pre-processes the scene.
virtual bool  PostprocessScene (KFbxScene &pScene)=0
  Post-processes the scene.
virtual void  PluginWriteParameters (KFbxObject &pParams)
  Writes extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export.
virtual KFbxNode FindRootNode (KFbxScene &pScene)
  Finds the selected root node in the specified scene.
virtual bool  CheckSpaceInNodeNameRecursive (KFbxNode *pNode, KString &pNodeNameList)
  Checks if there are spaces in the names of specified node (and its children nodes), and writes the returned node's name in the specified string list.
bool  SetFileExportVersion (KString pVersion)
  Sets the file export version as specified.
void  SetRenamingMode (KFbxSceneRenamer::ERenamingMode pRenamingMode)
  Sets the renaming mode as specified.
void  SetResamplingRate (double pResamplingRate)
  Sets the resampling rate as specified.
bool  IsGenuine ()
  Test if file format is an internal plug-in .
KError GetError ()
  Returns error object(s).
EError  GetLastErrorID () const
  Returns the ID of the last error that occurred when the file was written.
const char *  GetLastErrorString () const
  Returns the error string that describes the last error that occurred when the file was written.
void  GetMessage (KString &pMessage) const
  Returns a warning message that describes what occurred when the file was written.
KString GetMessage ()
  Returns a warning message that describes what occurred when the file was written.
void  ClearMessage ()
  Empties the message string.
virtual KFbxIOSettings GetIOSettings ()
  Access to a IOSettings object.
virtual void  SetIOSettings (KFbxIOSettings *pIOSettings)
  Set the IOSettings pointer to be used for this writer instance.
virtual void  SetProgressHandler (KFbxProgress *pProgress)
  Pass a progress handler to the writer.

Protected Member Functions

void  PluginsWriteBegin (KFbxScene &pScene)
void  PluginsWrite (KFbx &pFbx, bool pWriteObjectId)
void  PluginsWriteEnd (KFbxScene &pScene)
KFbxWriter operator= (KFbxWriter const &)

Protected Attributes

KFbxSdkManager mManager
KString  mFileVersion
double  mResamplingRate
KFbxSceneRenamer::ERenamingMode  mRenamingMode

Friends

struct  KFbxWriterFbx7Impl

Member Typedef Documentation

typedef KFbxWriter*(* CreateFuncType)(KFbxSdkManager &pManager, KFbxExporter &pExporter, int pSubID, int pPluginID)

Helper typedef for passing KFbxWriter creator function as argument (used internally).

typedef void(* IOSettingsFillerFuncType)(KFbxIOSettings &pIOS)

Helper typedef for passing KFbxIOSettings creator function as argument (used internally).

typedef void*(* GetInfoFuncType)(KInfoRequest pRequest, int pWriterTypeId)

Helper typedef for passing KInfoRequest function as argument (used internally).


Member Enumeration Documentation

enum EError

Error identifiers.

  • eFILE_CORRUPTED
  • eFILE_NOT_OPENED
  • eFILE_NOT_CREATED
  • eOUT_OF_DISK_SPACE
  • eINVALID_DOCUMENT_HANDLE
  • eDOCUMENT_NOT_SUPPORTED
  • eUNIDENTIFIED_ERROR
  • eEMBEDDED_OUT_OF_SPACE
  • eERROR_COUNT
Enumerator:
eFILE_CORRUPTED 
eFILE_NOT_OPENED 
eFILE_NOT_CREATED 
eOUT_OF_DISK_SPACE 
eINVALID_DOCUMENT_HANDLE 
eDOCUMENT_NOT_SUPPORTED 
eUNIDENTIFIED_ERROR 
eEMBEDDED_OUT_OF_SPACE 
eERROR_COUNT 

Definition at line 108 of file kfbxwriter.h.

  • eInfoExtension // to get the file ext for a writer ex: "FBX"
    • eInfoDescriptions // to get the file description for a writer ex:"Autodesk FBX (*.fbx)"
    • eInfoVersions // to get the file version for a writer ex: 7100
    • eInfoCompatibleDesc // to get the file compatible description for a writer.
  • eInfoUILabel // to get the file UI label to show for a writer ex: file labels shown in "Open file dialog"
  • eReserved1
    Remarks:
    Used internally to get writer file information.
Enumerator:
eInfoExtension 
eInfoDescriptions 
eInfoVersions 
eInfoCompatibleDesc 
eInfoUILabel 
eReserved1 

Definition at line 130 of file kfbxwriter.h.


Constructor & Destructor Documentation

KFbxWriter ( KFbxSdkManager pManager,
int  pID  
)

Constructor.

Parameters:
pManager  The KFbxSdkManager Object
pID  Id for current writer

virtual ~KFbxWriter (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool FileCreate ( char *  pFileName  )  [pure virtual]

Creates a new file.

Parameters:
pFileName  The name of the newly created file.

virtual bool FileClose (  )  [pure virtual]

Closes the file.

virtual bool IsFileOpen (  )  [pure virtual]

Test if the file is open.

virtual void GetWriteOptions (  )  [pure virtual]

Setup write options.

virtual bool Write ( KFbxDocument pDocument  )  [pure virtual]

Writes content to the specified file with given stream options.

Parameters:
pDocument  KFbxDocument to write file data to.

virtual bool PreprocessScene ( KFbxScene pScene  )  [pure virtual]

Pre-processes the scene.

Parameters:
pScene  The scene needs to be pre-processed.

virtual bool PostprocessScene ( KFbxScene pScene  )  [pure virtual]

Post-processes the scene.

Parameters:
pScene  The scene needs to be post-processed.

virtual void PluginWriteParameters ( KFbxObject pParams  )  [virtual]

Writes extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export.

This is especially useful for extension plug-ins that modify the scene and also to warn users during import if an extension plug-in was used that could be missing.

Parameters:
pParams  The parameters of the extension plug-in. The properties of the objects are used as the parameters of the extension plug-in.
Remarks:
This function has no implementation in this class. Only sub-class should implement it as needed. For example, FBX 6 and FBX 7 does implement it.

virtual KFbxNode* FindRootNode ( KFbxScene pScene  )  [virtual]

Finds the selected root node in the specified scene.

Parameters:
pScene  The scene in which the selected root node is found.
Returns:
The located root node.NULL if the selected root node cannot be found.

virtual bool CheckSpaceInNodeNameRecursive ( KFbxNode pNode,
KString pNodeNameList  
) [virtual]

Checks if there are spaces in the names of specified node (and its children nodes), and writes the returned node's name in the specified string list.

Parameters:
pNode  Specifies the node to check.
pNodeNameList  Specifies the string list where the node name that has spaces in it is recorded.
Returns:
true If there are no spaces in the name of specified node (and its children nodes), false If spaces are found.

bool SetFileExportVersion ( KString  pVersion  ) 

Sets the file export version as specified.

Parameters:
pVersion  The specified file export version.

void SetRenamingMode ( KFbxSceneRenamer::ERenamingMode  pRenamingMode  )  [inline]

Sets the renaming mode as specified.

Parameters:
pRenamingMode  The specified renaming mode.

Definition at line 213 of file kfbxwriter.h.

void SetResamplingRate ( double  pResamplingRate  )  [inline]

Sets the resampling rate as specified.

Parameters:
pResamplingRate  The specified resampling rate.

Definition at line 218 of file kfbxwriter.h.

bool IsGenuine (  ) 

Test if file format is an internal plug-in .

A non genuine plug-in is a plug-in made by someone external to Autodesk FBX SDK group.

Returns:
true If the file format is an internal plug-in ,false Otherwise .

KError& GetError (  ) 

Returns error object(s).

Returns:
References to the error object(s).

EError GetLastErrorID (  )  const

Returns the ID of the last error that occurred when the file was written.

Returns:
The last error ID.

const char* GetLastErrorString (  )  const

Returns the error string that describes the last error that occurred when the file was written.

Returns:
A textual description of the last error.

void GetMessage ( KString pMessage  )  const

Returns a warning message that describes what occurred when the file was written.

Parameters:
pMessage  The returned warning message.

KString& GetMessage (  ) 

Returns a warning message that describes what occurred when the file was written.

Returns:
The returned warning message.

void ClearMessage (  ) 

Empties the message string.

virtual KFbxIOSettings* GetIOSettings (  )  [virtual]

Access to a IOSettings object.

Returns:
The pointer to IOSettings or NULL if the object has not been allocated.

virtual void SetIOSettings ( KFbxIOSettings pIOSettings  )  [virtual]

Set the IOSettings pointer to be used for this writer instance.

Parameters:
pIOSettings 

virtual void SetProgressHandler ( KFbxProgress pProgress  )  [inline, virtual]

Pass a progress handler to the writer.

Parameters:
pProgress  KFbxProgress to store the progress information.

Definition at line 269 of file kfbxwriter.h.

void PluginsWriteBegin ( KFbxScene pScene  )  [protected]

void PluginsWrite ( KFbx pFbx,
bool  pWriteObjectId  
) [protected]

void PluginsWriteEnd ( KFbxScene pScene  )  [protected]

KFbxWriter& operator= ( KFbxWriter const &   )  [inline, protected]

Definition at line 276 of file kfbxwriter.h.


Friends And Related Function Documentation

friend struct KFbxWriterFbx7Impl [friend]

Definition at line 289 of file kfbxwriter.h.


Member Data Documentation

KFbxSdkManager& mManager [protected]

Definition at line 278 of file kfbxwriter.h.

KString mFileVersion [protected]

Definition at line 279 of file kfbxwriter.h.

double mResamplingRate [protected]

Definition at line 280 of file kfbxwriter.h.

Definition at line 281 of file kfbxwriter.h.

KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter
KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter KFbxWriter