fbxsdk/fileio/fbxiopluginregistry.h Source File

fbxiopluginregistry.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_IO_PLUGIN_REGISTRY_H_
14 #define _FBXSDK_FILEIO_IO_PLUGIN_REGISTRY_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
38 {
39 public:
40 
44 
47  virtual ~FbxIOPluginRegistry();
48 
49 #ifndef FBXSDK_ENV_WINSTORE
50 
56  void RegisterReader(const char* pPluginPath,
57  int& pFirstPluginID,
58  int& pRegisteredCount,
59  bool pOverride = false);
60 #endif /* !FBXSDK_ENV_WINSTORE */
61 
70  void RegisterReader(FbxReader::CreateFuncType pCreateF,
72  int& pFirstPluginID,
73  int& pRegisteredCount,
74  FbxReader::IOSettingsFillerFuncType pIOSettingsFillerF = NULL,
75  bool pOverride = false);
76 
77 #ifndef FBXSDK_ENV_WINSTORE
78 
84  void RegisterWriter(const char* pPluginPath,
85  int& pFirstPluginID,
86  int& pRegisteredCount,
87  bool pOverride = false);
88 #endif /* !FBXSDK_ENV_WINSTORE */
89 
98  void RegisterWriter(FbxWriter::CreateFuncType pCreateF,
100  int& pFirstPluginID,
101  int& pRegisteredCount,
102  FbxWriter::IOSettingsFillerFuncType pIOSettingsFillerF = NULL,
103  bool pOverride = false);
104 
110  FbxReader* CreateReader(FbxManager& pManager,
111  FbxImporter& pImporter,
112  int pPluginID) const;
113 
119  FbxWriter* CreateWriter(FbxManager& pManager,
120  FbxExporter& pExporter,
121  int pPluginID) const;
122 
127  int FindReaderIDByExtension(const char* pExt) const;
128 
133  int FindWriterIDByExtension(const char* pExt) const;
134 
139  int FindReaderIDByDescription(const char* pDesc) const;
140 
145  int FindWriterIDByDescription(const char* pDesc) const;
146 
151  bool ReaderIsFBX(int pFileFormat) const;
152 
157  bool WriterIsFBX(int pFileFormat) const;
158 
163  bool ReaderIsGenuine(int pFileFormat) const;
164 
169  bool WriterIsGenuine(int pFileFormat) const;
170 
174  int GetReaderFormatCount() const;
175 
182  int GetWriterFormatCount() const;
183 
188  const char* GetReaderFormatDescription(int pFileFormat) const;
189 
194  const char* GetWriterFormatDescription(int pFileFormat) const;
195 
200  const char* GetReaderFormatExtension(int pFileFormat) const;
201 
206  const char* GetWriterFormatExtension(int pFileFormat) const;
207 
212  char const* const* GetWritableVersions(int pFileFormat) const;
213 
224  bool DetectReaderFileFormat(const char* pFileName, int& pFileFormat) const;
225 
236  bool DetectWriterFileFormat(const char* pFileName, int& pFileFormat) const;
237 
241  int GetNativeReaderFormat();
242 
246  int GetNativeWriterFormat();
247 
251  void FillIOSettingsForReadersRegistered(FbxIOSettings & pIOS);
252 
256  void FillIOSettingsForWritersRegistered(FbxIOSettings & pIOS);
257 
258 
259 /*****************************************************************************************************************************
260 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
261 *****************************************************************************************************************************/
262 #ifndef DOXYGEN_SHOULD_SKIP_THIS
263 private:
264  void RegisterInternalIOPlugins();
265 
266  struct ReaderPluginEntry
267  {
268  ReaderPluginEntry(const char* pExtension, const char* pDescription, FbxReader::CreateFuncType pCreatorFunction, int pBaseID,
269  FbxReader::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
270 
271  const char* mExtension;
272  const char* mDescription;
273  FbxReader::CreateFuncType mCreatorFunction;
274  FbxReader::IOSettingsFillerFuncType mIOSettingsFillerFunction;
275  int mBaseID;
276  bool mIsFBX;
277  bool mIsInternalPlugin;
278  };
279 
280  struct WriterPluginEntry
281  {
282  WriterPluginEntry(const char* pExtension, const char* pDescription, char const* const* pVersions, FbxWriter::CreateFuncType pCreatorFunction, int pBaseID,
283  FbxWriter::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
284 
285  const char* mExtension;
286  const char* mDescription;
287  char const* const* mVersions;
288  FbxWriter::CreateFuncType mCreatorFunction;
289  FbxWriter::IOSettingsFillerFuncType mIOSettingsFillerFunction;
290  int mBaseID;
291  bool mIsFBX;
292  bool mIsInternalPlugin;
293  };
294 
297  int mNativeReaderFormat;
298  int mNativeWriterFormat;
299  bool mInternalPluginMode;
300 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
301 };
302 
303 #include <fbxsdk/fbxsdk_nsend.h>
304 
305 #endif /* _FBXSDK_FILEIO_IO_PLUGIN_REGISTRY_H_ */
This class serves as the registrar for file formats.
FbxReader *(* CreateFuncType)(FbxManager &pManager, FbxImporter &pImporter, int pSubID, int pPluginID)
Definition: fbxreader.h:98
FBX SDK environment definition.
SDK object manager.
Definition: fbxmanager.h:56
#define NULL
Definition: fbxarch.h:210
Base class of other readers used internally.
Definition: fbxreader.h:64
void(* IOSettingsFillerFuncType)(FbxIOSettings &pIOS)
Helper typedef for passing FbxIOSettings creator function as argument (used internally).
Definition: fbxwriter.h:88
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
FbxWriter *(* CreateFuncType)(FbxManager &pManager, FbxExporter &pExporter, int pSubID, int pPluginID)
Helper typedef for passing FbxWriter creator function as argument (used internally).
Definition: fbxwriter.h:85
void *(* GetInfoFuncType)(EInfoRequest pRequest, int pReaderTypeId)
Definition: fbxreader.h:104
Class to export SDK objects into an FBX file.
Definition: fbxexporter.h:89
Base class of other writers used internally.
Definition: fbxwriter.h:58
void(* IOSettingsFillerFuncType)(FbxIOSettings &pIOS)
Definition: fbxreader.h:101
void *(* GetInfoFuncType)(EInfoRequest pRequest, int pWriterTypeId)
Helper typedef for passing EInfoRequest function as argument (used internally).
Definition: fbxwriter.h:91
#define FBXSDK_DLL
Definition: fbxarch.h:173
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23
Class to import an FBX file into SDK objects.
Definition: fbximporter.h:90