fbxsdk/fileio/fbxreader.h Source File

fbxreader.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 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;
40 
65 {
66 public:
72  FbxReader(FbxManager& pManager, int pID, FbxStatus& pStatus);
73 
76  virtual ~FbxReader();
77 
82  {
85  eReserved1 = 0xFBFB,
86  };
87 
92  {
93  eParseForGlobalSettings = 1,
94  eParseForStatistics = 2
95  };
96 
98  typedef FbxReader* (*CreateFuncType)(FbxManager& pManager, FbxImporter& pImporter, int pSubID, int pPluginID);
99 
101  typedef void (*IOSettingsFillerFuncType)(FbxIOSettings& pIOS);
102 
104  typedef void* (*GetInfoFuncType)(EInfoRequest pRequest, int pReaderTypeId);
105 
111  virtual void GetVersion(int& pMajor, int& pMinor, int& pRevision){ pMajor = pMinor = pRevision = 0; }
112 
117  virtual bool FileOpen(char* pFileName) = 0;
118 
124  virtual bool FileOpen(FbxStream* pStream, void* pStreamData);
125 
129  virtual bool FileClose() = 0;
130 
134  virtual bool IsFileOpen() = 0;
135 
140  virtual bool GetReadOptions(bool pParseFileAsNeeded = true) = 0;
141 
146  virtual bool Read(FbxDocument* pDocument) = 0;
147 
148 #ifndef FBXSDK_ENV_WINSTORE
149 
157  virtual void PluginReadParameters(FbxObject& pParams);
158 #endif /* !FBXSDK_ENV_WINSTORE */
159 
165  virtual bool FileOpen(char* pFileName, EFileOpenSpecialFlags /*pFlags*/){ return FileOpen(pFileName); }
166 
172  virtual bool GetAxisInfo(FbxAxisSystem* /*pAxisSystem*/, FbxSystemUnit* /*pSystemUnits*/){ return false; }
173 
178  virtual bool GetStatistics(FbxStatistics* /*pStats*/){ return false; }
179 
186  virtual bool GetFrameRate(FbxTime::EMode& pTimeMode) { pTimeMode = FbxTime::eDefaultMode; return false; }
187 
188 
192  virtual FbxDocumentInfo* GetSceneInfo(){return NULL;}
193 
198 
206  virtual bool GetDefaultRenderResolution(FbxString& pCamName, FbxString& pResolutionMode, double& pW, double& pH);
207 
212  bool IsGenuine();
213 
218  virtual FbxIOSettings * GetIOSettings();
219 
223  virtual void SetIOSettings(FbxIOSettings * pIOSettings);
224 
228  virtual void SetProgressHandler(FbxProgress* /*pProgress*/){}
229 
230  virtual void SetEmbeddingExtractionFolder(const char* /*pExtractFolder*/){}
231 
233  virtual bool SupportsStreams() const;
234 
235 /*****************************************************************************************************************************
236 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
237 *****************************************************************************************************************************/
238 #ifndef DOXYGEN_SHOULD_SKIP_THIS
239  virtual bool FileOpen(FbxFile * pFile);
240 
241  FbxStatus& GetStatus() { return mStatus; }
242 
243 protected:
244  void SetDefaultRenderResolution(const char* pCamName, const char* pResolutionMode, double pW, double pH);
245 #ifndef FBXSDK_ENV_WINSTORE
246  void PluginsReadBegin(FbxScene& pScene);
247  void PluginsRead(const char* pName, const char* pVersion);
248  void PluginsReadEnd(FbxScene& pScene);
249 #endif /* !FBXSDK_ENV_WINSTORE */
250  FbxReader& operator=(FbxReader const&) { return *this; }
251  virtual bool CheckDuplicateNodeNames(FbxNode* pRootNode, FbxString& pDuplicateNodeNameList);
252 
253  FbxStatus& mStatus;
254  FbxManager& mManager;
256 
257 private:
258  int mInternalID;
259  FbxIOSettings* mIOSettings;
260 
261  friend struct FbxReaderFbx7_Impl;
262 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
263 };
264 
266 #define IOS_REF (*GetIOSettings())
267 
268 #include <fbxsdk/fbxsdk_nsend.h>
269 
270 #endif /* _FBXSDK_FILEIO_READER_H_ */
EFileOpenSpecialFlags
Flags for reading parts of file.
Definition: fbxreader.h:91
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:111
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:84
#define NULL
Definition: fbxarch.h:210
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:83
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:64
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
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:172
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:81
Render and resolution information.
Definition: fbxio.h:188
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:228
virtual FbxArray< FbxTakeInfo * > * GetTakeInfo()
Returns the list of take infos from the file.
Definition: fbxreader.h:197
EMode
Time modes.
Definition: fbxtime.h:90
Class for progress reporting.
Definition: fbxprogress.h:31
virtual bool GetStatistics(FbxStatistics *)
Returns statistics from the file.
Definition: fbxreader.h:178
virtual bool FileOpen(char *pFileName, EFileOpenSpecialFlags)
Opens the file with specific EFileOpenSpecialFlags.
Definition: fbxreader.h:165
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:192
#define FBXSDK_DLL
Definition: fbxarch.h:173
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:186
virtual void SetEmbeddingExtractionFolder(const char *)
Definition: fbxreader.h:230
Class to import an FBX file into SDK objects.
Definition: fbximporter.h:90