FBX C++ API Reference
FbxReader Class Referenceabstract

#include <fbxreader.h>

Class Description

Base class of other readers used internally.

This class provides the interfaces for reading files.

The role of the reader is to effectively "read" specific file data vs the role of the importer is to select a specific reader and launch the reading of a file through that reader.

See also
FbxImporter

ex:

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

Examples:
MyOwnWriterReader/MyOwnReader.cxx, MyOwnWriterReader/MyOwnReader.h, MyOwnWriterReader/MyOwnWriterReader.cxx, and MyOwnWriterReader/MyOwnWriterReader.h.

Definition at line 64 of file fbxreader.h.

+ Inheritance diagram for FbxReader:

Public Types

enum  EInfoRequest { eInfoExtension, eInfoDescriptions, eReserved1 = 0xFBFB }
 Information type to request. More...
 
enum  EFileOpenSpecialFlags { eParseForGlobalSettings = 1, eParseForStatistics = 2 }
 Flags for reading parts of file. More...
 
typedef FbxReader *(* CreateFuncType) (FbxManager &pManager, FbxImporter &pImporter, int pSubID, int pPluginID)
 
typedef void(* IOSettingsFillerFuncType) (FbxIOSettings &pIOS)
 
typedef void *(* GetInfoFuncType) (EInfoRequest pRequest, int pReaderTypeId)
 

Public Member Functions

 FbxReader (FbxManager &pManager, int pID, FbxStatus &pStatus)
 Constructor. More...
 
virtual ~FbxReader ()
 Destructor. More...
 
virtual void GetVersion (int &pMajor, int &pMinor, int &pRevision)
 Returns the file version. More...
 
virtual bool FileOpen (char *pFileName)=0
 Opens the file with default flag. More...
 
virtual bool FileOpen (FbxStream *pStream, void *pStreamData)
 Opens the stream with default flag. More...
 
virtual bool FileClose ()=0
 Closes the file stream. More...
 
virtual bool IsFileOpen ()=0
 Checks if the file stream is open. More...
 
virtual bool GetReadOptions (bool pParseFileAsNeeded=true)=0
 Returns file stream options. More...
 
virtual bool Read (FbxDocument *pDocument)=0
 Reads file with stream options. More...
 
virtual void PluginReadParameters (FbxObject &pParams)
 Reads extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export. More...
 
virtual bool FileOpen (char *pFileName, EFileOpenSpecialFlags)
 Opens the file with specific EFileOpenSpecialFlags. More...
 
virtual bool GetAxisInfo (FbxAxisSystem *, FbxSystemUnit *)
 Returns the system axis information and file system units from the file. More...
 
virtual bool GetStatistics (FbxStatistics *)
 Returns statistics from the file. More...
 
virtual bool GetFrameRate (FbxTime::EMode &pTimeMode)
 Get FBX file time mode read from GlobalSettings in FBX 6.n and FBX 7.n. More...
 
virtual FbxDocumentInfoGetSceneInfo ()
 Returns the scene info from the file. More...
 
virtual FbxArray< FbxTakeInfo * > * GetTakeInfo ()
 Returns the list of take infos from the file. More...
 
virtual bool GetDefaultRenderResolution (FbxString &pCamName, FbxString &pResolutionMode, double &pW, double &pH)
 If default camera resolution is OK, returns information about the resolution of the render. More...
 
bool IsGenuine ()
 Judges if the format of the file is was created by an Autodesk plug-in. More...
 
virtual FbxIOSettingsGetIOSettings ()
 Access to a IOSettings object. More...
 
virtual void SetIOSettings (FbxIOSettings *pIOSettings)
 Set the IOSettings pointer to be used for this reader instance. More...
 
virtual void SetProgressHandler (FbxProgress *)
 Pass a progress handler to the reader. More...
 
virtual void SetEmbeddingExtractionFolder (const char *)
 
virtual bool SupportsStreams () const
 Returns true if this reader supports FbxStream I/O. More...
 

Member Typedef Documentation

◆ CreateFuncType

typedef FbxReader*(* CreateFuncType) (FbxManager &pManager, FbxImporter &pImporter, int pSubID, int pPluginID)

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

Definition at line 98 of file fbxreader.h.

◆ IOSettingsFillerFuncType

typedef void(* IOSettingsFillerFuncType) (FbxIOSettings &pIOS)

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

Definition at line 101 of file fbxreader.h.

◆ GetInfoFuncType

typedef void*(* GetInfoFuncType) (EInfoRequest pRequest, int pReaderTypeId)

Helper typedef for passing EInfoRequest function as argument (used internally)

Definition at line 104 of file fbxreader.h.

Member Enumeration Documentation

◆ EInfoRequest

Information type to request.

Remarks
Used internally to get reader file information.
Enumerator
eInfoExtension 

To get the file ext for a reader ex: "FBX".

eInfoDescriptions 

To get the file description for a reader ex: "Autodesk FBX (*.fbx)".

eReserved1 

Definition at line 81 of file fbxreader.h.

82  {
85  eReserved1 = 0xFBFB,
86  };
To get the file description for a reader ex: "Autodesk FBX (*.fbx)".
Definition: fbxreader.h:84
To get the file ext for a reader ex: "FBX".
Definition: fbxreader.h:83

◆ EFileOpenSpecialFlags

Flags for reading parts of file.

Remarks
Used internally when an importer is initialized to get some information very fast.
Enumerator
eParseForGlobalSettings 

Used for reading the Global settings section when an importer is initialized.

eParseForStatistics 

Used for reading a group of statistics when an importer is initialized.

Definition at line 91 of file fbxreader.h.

92  {
95  };
Used for reading the Global settings section when an importer is initialized.
Definition: fbxreader.h:93
Used for reading a group of statistics when an importer is initialized.
Definition: fbxreader.h:94

Constructor & Destructor Documentation

◆ FbxReader()

FbxReader ( FbxManager pManager,
int  pID,
FbxStatus pStatus 
)

Constructor.

Parameters
pManagerThe FbxManager Object.
pIDId for current reader.
pStatusThe FbxStatus object to hold error codes.

◆ ~FbxReader()

virtual ~FbxReader ( )
virtual

Destructor.

Member Function Documentation

◆ GetVersion()

virtual void GetVersion ( int &  pMajor,
int &  pMinor,
int &  pRevision 
)
inlinevirtual

Returns the file version.

Parameters
pMajorMajor version.
pMinorMinor version.
pRevisionRevision version.

Reimplemented in FbxReaderFbx6, FbxReaderFbx7, and FbxReaderFbx5.

Examples:
MyOwnWriterReader/MyOwnReader.h.

Definition at line 111 of file fbxreader.h.

111 { pMajor = pMinor = pRevision = 0; }

◆ FileOpen() [1/3]

virtual bool FileOpen ( char *  pFileName)
pure virtual

Opens the file with default flag.

Parameters
pFileNameName of the File to open
Returns
If the file opens successfully return true, otherwise return false.

Implemented in FbxReaderFbx6, FbxReaderCollada, FbxReaderFbx7, and FbxReaderFbx5.

Examples:
MyOwnWriterReader/MyOwnReader.h.

◆ FileOpen() [2/3]

virtual bool FileOpen ( FbxStream pStream,
void *  pStreamData 
)
virtual

Opens the stream with default flag.

Parameters
pStreamstream to open
pStreamDatauser-defined stream data
Returns
If the stream opens successfully return true, otherwise return false.

Reimplemented in FbxReaderFbx6, FbxReaderFbx7, and FbxReaderFbx5.

◆ FileClose()

virtual bool FileClose ( )
pure virtual

Closes the file stream.

Returns
false

Implemented in FbxReaderFbx6, FbxReaderCollada, FbxReaderFbx7, and FbxReaderFbx5.

Examples:
MyOwnWriterReader/MyOwnReader.h.

◆ IsFileOpen()

virtual bool IsFileOpen ( )
pure virtual

Checks if the file stream is open.

Returns
false.

Implemented in FbxReaderFbx6, FbxReaderCollada, FbxReaderFbx7, and FbxReaderFbx5.

Examples:
MyOwnWriterReader/MyOwnReader.h.

◆ GetReadOptions()

virtual bool GetReadOptions ( bool  pParseFileAsNeeded = true)
pure virtual

Returns file stream options.

Parameters
pParseFileAsNeededSets whether to parse file as read options
Returns
true on success, otherwise return false.

Implemented in FbxReaderFbx6, FbxReaderFbx7, FbxReaderCollada, and FbxReaderFbx5.

Examples:
MyOwnWriterReader/MyOwnReader.h.

◆ Read()

virtual bool Read ( FbxDocument pDocument)
pure virtual

Reads file with stream options.

Parameters
pDocumentFbxDocument to store the file data
Returns
false.

Implemented in FbxReaderFbx6, FbxReaderFbx7, FbxReaderCollada, and FbxReaderFbx5.

Examples:
MyOwnWriterReader/MyOwnReader.h.

◆ PluginReadParameters()

virtual void PluginReadParameters ( FbxObject pParams)
virtual

Reads 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
pParamsThe 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.

Reimplemented in FbxReaderFbx6, and FbxReaderFbx7.

◆ FileOpen() [3/3]

virtual bool FileOpen ( char *  pFileName,
EFileOpenSpecialFlags   
)
inlinevirtual

Opens the file with specific EFileOpenSpecialFlags.

Parameters
pFileNameName of the File to open.
pFlagsThe EFileOpenSpecialFlags to open with
Returns
If the file opens successfully return true, otherwise return false.

Reimplemented in FbxReaderFbx6, FbxReaderFbx7, and FbxReaderFbx5.

Definition at line 165 of file fbxreader.h.

165 { return FileOpen(pFileName); }
virtual bool FileOpen(char *pFileName)=0
Opens the file with default flag.

◆ GetAxisInfo()

virtual bool GetAxisInfo ( FbxAxisSystem ,
FbxSystemUnit  
)
inlinevirtual

Returns the system axis information and file system units from the file.

Parameters
pAxisSystemAxis system in file
pSystemUnitsSystem unit in file
Returns
false.

Reimplemented in FbxReaderFbx6, FbxReaderCollada, and FbxReaderFbx7.

Definition at line 172 of file fbxreader.h.

172 { return false; }

◆ GetStatistics()

virtual bool GetStatistics ( FbxStatistics )
inlinevirtual

Returns statistics from the file.

Parameters
pStatsStatistics in the file.
Returns
false.

Reimplemented in FbxReaderFbx6, and FbxReaderFbx7.

Definition at line 178 of file fbxreader.h.

178 { return false; }

◆ GetFrameRate()

virtual bool GetFrameRate ( FbxTime::EMode pTimeMode)
inlinevirtual

Get FBX file time mode read from GlobalSettings in FBX 6.n and FBX 7.n.

Parameters
pTimeModeref to a FbxTime::EMode enum
Returns
true on success, false otherwise.
Remarks
This function must be called after FbxImporter::Initialize(). Can be used for statistics (via GlobalSettings) before loading the whole scene from the file.

Reimplemented in FbxReaderFbx6, and FbxReaderFbx7.

Definition at line 186 of file fbxreader.h.

186 { pTimeMode = FbxTime::eDefaultMode; return false; }

◆ GetSceneInfo()

virtual FbxDocumentInfo* GetSceneInfo ( )
inlinevirtual

Returns the scene info from the file.

Returns
NULL.

Reimplemented in FbxReaderFbx6, FbxReaderFbx7, and FbxReaderFbx5.

Definition at line 192 of file fbxreader.h.

192 {return NULL;}
#define NULL
Definition: fbxarch.h:210

◆ GetTakeInfo()

virtual FbxArray<FbxTakeInfo*>* GetTakeInfo ( )
inlinevirtual

Returns the list of take infos from the file.

Returns
NULL

Reimplemented in FbxReaderFbx6, FbxReaderFbx7, FbxReaderCollada, and FbxReaderFbx5.

Definition at line 197 of file fbxreader.h.

197 {return NULL;}
#define NULL
Definition: fbxarch.h:210

◆ GetDefaultRenderResolution()

virtual bool GetDefaultRenderResolution ( FbxString pCamName,
FbxString pResolutionMode,
double &  pW,
double &  pH 
)
virtual

If default camera resolution is OK, returns information about the resolution of the render.

Parameters
pCamNameDefault camera name.
pResolutionModeDefault resolution mode.
pWDefault resolution width.
pHDefault resolution height.
Returns
true If default camera resolution is OK, false Otherwise.

◆ IsGenuine()

bool IsGenuine ( )

Judges if the format of the file is was created by an Autodesk plug-in.

An internal (genuine) plug-in is one created by the Autodesk FBX product team.

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

◆ GetIOSettings()

virtual FbxIOSettings* GetIOSettings ( )
virtual

Access to a IOSettings object.

Returns
A pointer to IOSettings used for this reader or NULL if the object has not been allocated.

◆ SetIOSettings()

virtual void SetIOSettings ( FbxIOSettings pIOSettings)
virtual

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

Parameters
pIOSettings

◆ SetProgressHandler()

virtual void SetProgressHandler ( FbxProgress )
inlinevirtual

Pass a progress handler to the reader.

Parameters
pProgressFbxProgress to store the progress information.

Reimplemented in FbxReaderFbx6, and FbxReaderFbx7.

Definition at line 228 of file fbxreader.h.

228 {}

◆ SetEmbeddingExtractionFolder()

virtual void SetEmbeddingExtractionFolder ( const char *  )
inlinevirtual

Reimplemented in FbxReaderFbx6, FbxReaderFbx7, and FbxReaderFbx5.

Definition at line 230 of file fbxreader.h.

230 {}

◆ SupportsStreams()

virtual bool SupportsStreams ( ) const
virtual

Returns true if this reader supports FbxStream I/O.

Default value is false.

Reimplemented in FbxReaderFbx6, FbxReaderFbx7, and FbxReaderFbx5.


The documentation for this class was generated from the following file: