FBX C++ API Reference
fbxreader.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2019 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_FILEIO_READER_H_
14 #define _FBXSDK_FILEIO_READER_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
22 
23 #include <fbxsdk/fbxsdk_nsbegin.h>
24 
25 class FbxManager;
26 class FbxFile;
27 class FbxStream;
28 class FbxObject;
29 class FbxDocument;
30 class FbxDocumentInfo;
31 class FbxScene;
32 class FbxImporter;
33 class FbxIOSettings;
34 class FbxAxisSystem;
35 class FbxStatistics;
36 class FbxSystemUnit;
37 class FbxNode;
38 class FbxProgress;
39 class FbxTakeInfo;
41 
66 {
67 public:
73  FbxReader(FbxManager& pManager, int pID, FbxStatus& pStatus);
74 
77  virtual ~FbxReader();
78 
83  {
86  eReserved1 = 0xFBFB,
87  };
88 
93  {
94  eParseForGlobalSettings = 1,
95  eParseForStatistics = 2
96  };
97 
99  typedef FbxReader* (*CreateFuncType)(FbxManager& pManager, FbxImporter& pImporter, int pSubID, int pPluginID);
100 
102  typedef void (*IOSettingsFillerFuncType)(FbxIOSettings& pIOS);
103 
105  typedef void* (*GetInfoFuncType)(EInfoRequest pRequest, int pReaderTypeId);
106 
112  virtual void GetVersion(int& pMajor, int& pMinor, int& pRevision){ pMajor = pMinor = pRevision = 0; }
113 
118  virtual bool FileOpen(char* pFileName) = 0;
119 
125  virtual bool FileOpen(FbxStream* pStream, void* pStreamData);
126 
130  virtual bool FileClose() = 0;
131 
135  virtual bool IsFileOpen() = 0;
136 
141  virtual bool GetReadOptions(bool pParseFileAsNeeded = true) = 0;
142 
147  virtual bool Read(FbxDocument* pDocument) = 0;
148 
149 #ifndef FBXSDK_ENV_WINSTORE
150 
158  virtual void PluginReadParameters(FbxObject& pParams);
159 #endif /* !FBXSDK_ENV_WINSTORE */
160 
166  virtual bool FileOpen(char* pFileName, EFileOpenSpecialFlags /*pFlags*/){ return FileOpen(pFileName); }
167 
173  virtual bool GetAxisInfo(FbxAxisSystem* /*pAxisSystem*/, FbxSystemUnit* /*pSystemUnits*/){ return false; }
174 
179  virtual bool GetStatistics(FbxStatistics* /*pStats*/){ return false; }
180 
187  virtual bool GetFrameRate(FbxTime::EMode& pTimeMode) { pTimeMode = FbxTime::eDefaultMode; return false; }
188 
189 
193  virtual FbxDocumentInfo* GetSceneInfo(){return NULL;}
194 
199 
207  virtual bool GetDefaultRenderResolution(FbxString& pCamName, FbxString& pResolutionMode, double& pW, double& pH);
208 
213  bool IsGenuine();
214 
219  virtual FbxIOSettings * GetIOSettings();
220 
224  virtual void SetIOSettings(FbxIOSettings * pIOSettings);
225 
229  virtual void SetProgressHandler(FbxProgress* /*pProgress*/){}
230 
231  virtual void SetEmbeddingExtractionFolder(const char* /*pExtractFolder*/){}
232 
233  virtual void SetEmbeddedFileCallback(FbxEmbeddedFileCallback* /*pCallback*/) {}
234 
236  virtual bool SupportsStreams() const;
237 
238 /*****************************************************************************************************************************
239 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
240 *****************************************************************************************************************************/
241 #ifndef DOXYGEN_SHOULD_SKIP_THIS
242  virtual bool FileOpen(FbxFile * pFile);
243 
244  FbxStatus& GetStatus() { return mStatus; }
245 
246 protected:
247  void SetDefaultRenderResolution(const char* pCamName, const char* pResolutionMode, double pW, double pH);
248 #ifndef FBXSDK_ENV_WINSTORE
249  void PluginsReadBegin(FbxScene& pScene);
250  void PluginsRead(const char* pName, const char* pVersion);
251  void PluginsReadEnd(FbxScene& pScene);
252 #endif /* !FBXSDK_ENV_WINSTORE */
253  FbxReader& operator=(FbxReader const&) { return *this; }
254  virtual bool CheckDuplicateNodeNames(FbxNode* pRootNode, FbxString& pDuplicateNodeNameList);
255 
256  FbxStatus& mStatus;
257  FbxManager& mManager;
259 
260 private:
261  int mInternalID;
262  FbxIOSettings* mIOSettings;
263 
264  friend struct FbxReaderFbx7_Impl;
265 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
266 };
267 
269 #define IOS_REF (*GetIOSettings())
270 
271 #include <fbxsdk/fbxsdk_nsend.h>
272 
273 #endif /* _FBXSDK_FILEIO_READER_H_ */
EFileOpenSpecialFlags
Flags for reading parts of file.
Definition: fbxreader.h:92
Callback to operate on the embedded data while it is processed.
Definition: fbxcallbacks.h:166
FBX SDK environment definition.
SDK object manager.
Definition: fbxmanager.h:56
virtual void GetVersion(int &pMajor, int &pMinor, int &pRevision)
Returns the file version.
Definition: fbxreader.h:112
This class represents the coordinate system of the scene and can convert scenes to other coordinate s...
Definition: fbxaxissystem.h:97
Abstract class for implementing I/O operations through a stream of data.
Definition: fbxstream.h:26
To get the file description for a reader ex: "Autodesk FBX (*.fbx)".
Definition: fbxreader.h:85
#define NULL
Definition: fbxarch.h:213
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxDocument is a base class for FbxScene and FbxLibrary classes.
Definition: fbxdocument.h:46
To get the file ext for a reader ex: "FBX".
Definition: fbxreader.h:84
This class is a basic class to get the quantity of items.
Definition: fbxstatistics.h:62
Base class of other readers used internally.
Definition: fbxreader.h:65
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:29
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
virtual bool GetAxisInfo(FbxAxisSystem *, FbxSystemUnit *)
Returns the system axis information and file system units from the file.
Definition: fbxreader.h:173
This class contains scene thumbnails and user-defined summary data.
The base class of most FBX objects.
Definition: fbxobject.h:157
EInfoRequest
Information type to request.
Definition: fbxreader.h:82
Render and resolution information.
Definition: fbxio.h:207
Represents an element in the scene graph.
Definition: fbxnode.h:72
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
virtual void SetProgressHandler(FbxProgress *)
Pass a progress handler to the reader.
Definition: fbxreader.h:229
virtual FbxArray< FbxTakeInfo * > * GetTakeInfo()
Returns the list of take infos from the file.
Definition: fbxreader.h:198
EMode
Time modes.
Definition: fbxtime.h:91
Class for progress reporting.
Definition: fbxprogress.h:31
virtual bool GetStatistics(FbxStatistics *)
Returns statistics from the file.
Definition: fbxreader.h:179
virtual bool FileOpen(char *pFileName, EFileOpenSpecialFlags)
Opens the file with specific EFileOpenSpecialFlags.
Definition: fbxreader.h:166
This class describes the units of measurement used within a particular scene.
Definition: fbxsystemunit.h:31
This class contains take information from an imported file or exported to an output file...
Definition: fbxtakeinfo.h:56
virtual FbxDocumentInfo * GetSceneInfo()
Returns the scene info from the file.
Definition: fbxreader.h:193
#define FBXSDK_DLL
Definition: fbxarch.h:176
Class for interfacing with files, providing a similar interface for files independant of the OS or fi...
Definition: fbxfile.h:27
virtual bool GetFrameRate(FbxTime::EMode &pTimeMode)
Get FBX file time mode read from GlobalSettings in FBX 6.n and FBX 7.n.
Definition: fbxreader.h:187
virtual void SetEmbeddedFileCallback(FbxEmbeddedFileCallback *)
Definition: fbxreader.h:233
virtual void SetEmbeddingExtractionFolder(const char *)
Definition: fbxreader.h:231
Class to import an FBX file into SDK objects.
Definition: fbximporter.h:91