fbxiopluginregistry.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2013 Autodesk, Inc.
00004    All rights reserved.
00005  
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009  
00010 ****************************************************************************************/
00011 
00013 #ifndef _FBXSDK_FILEIO_IO_PLUGIN_REGISTRY_H_
00014 #define _FBXSDK_FILEIO_IO_PLUGIN_REGISTRY_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/fileio/fbxreader.h>
00019 #include <fbxsdk/fileio/fbxwriter.h>
00020 
00021 #include <fbxsdk/fbxsdk_nsbegin.h>
00022 
00037 class FBXSDK_DLL FbxIOPluginRegistry
00038 {
00039 public:
00040 
00043     FbxIOPluginRegistry();
00044 
00047     virtual ~FbxIOPluginRegistry();
00048 
00049 #ifndef FBXSDK_ENV_WINRT
00050 
00056     void RegisterReader(char const* pPluginPath,
00057                         int& pFirstPluginID,
00058                         int& pRegisteredCount,
00059                         bool pOverride = false);
00060 #endif /* !FBXSDK_ENV_WINRT */
00061 
00070     void RegisterReader(FbxReader::CreateFuncType pCreateF, 
00071                         FbxReader::GetInfoFuncType pInfoF,
00072                         int& pFirstPluginID,
00073                         int& pRegisteredCount,
00074                         FbxReader::IOSettingsFillerFuncType pIOSettingsFillerF = NULL,
00075                         bool pOverride = false);
00076 
00077 #ifndef FBXSDK_ENV_WINRT
00078 
00084     void RegisterWriter(char const* pPluginPath,
00085                         int& pFirstPluginID,
00086                         int& pRegisteredCount,
00087                         bool pOverride = false);
00088 #endif /* !FBXSDK_ENV_WINRT */
00089 
00098     void RegisterWriter(FbxWriter::CreateFuncType pCreateF, 
00099                         FbxWriter::GetInfoFuncType pInfoF,
00100                         int& pFirstPluginID,
00101                         int& pRegisteredCount,
00102                         FbxWriter::IOSettingsFillerFuncType pIOSettingsFillerF = NULL,
00103                         bool pOverride = false);
00104 
00110     FbxReader* CreateReader(FbxManager& pManager, 
00111                              FbxImporter& pImporter, 
00112                              int pPluginID) const;
00113 
00119     FbxWriter* CreateWriter(FbxManager& pManager, 
00120                              FbxExporter& pExporter,
00121                              int pPluginID) const;
00122 
00127     int FindReaderIDByExtension(char const* pExt) const;
00128 
00133     int FindWriterIDByExtension(char const* pExt) const;
00134     
00139     int FindReaderIDByDescription(char const* pDesc) const;
00140 
00145     int FindWriterIDByDescription(char const* pDesc) const;
00146     
00151     bool ReaderIsFBX(int pFileFormat) const;
00152 
00157     bool WriterIsFBX(int pFileFormat) const;
00158 
00163     bool ReaderIsGenuine(int pFileFormat) const;
00164 
00169     bool WriterIsGenuine(int pFileFormat) const;
00170 
00174     int GetReaderFormatCount() const;
00175 
00182     int GetWriterFormatCount() const;
00183 
00188     char const* GetReaderFormatDescription(int pFileFormat) const;
00189 
00194     char const* GetWriterFormatDescription(int pFileFormat) const;
00195 
00200     char const* GetReaderFormatExtension(int pFileFormat) const;
00201     
00206     char const* GetWriterFormatExtension(int pFileFormat) const;
00207 
00212     char const* const* GetWritableVersions(int pFileFormat) const;
00213 
00224     bool DetectReaderFileFormat(const char* pFileName, int& pFileFormat) const;
00225 
00236     bool DetectWriterFileFormat(const char* pFileName, int& pFileFormat) const;
00237     
00241     int GetNativeReaderFormat();
00242 
00246     int GetNativeWriterFormat();
00247 
00251     void FillIOSettingsForReadersRegistered(FbxIOSettings & pIOS);
00252 
00256     void FillIOSettingsForWritersRegistered(FbxIOSettings & pIOS);
00257 
00258 
00259 /*****************************************************************************************************************************
00260 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00261 *****************************************************************************************************************************/
00262 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00263 private:
00264     void RegisterInternalIOPlugins();
00265 
00266     struct ReaderPluginEntry
00267     {
00268         ReaderPluginEntry(char const* pExtension, char const* pDescription, FbxReader::CreateFuncType pCreatorFunction, int pBaseID,
00269             FbxReader::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00270         
00271         char const*                             mExtension;
00272         char const*                             mDescription;
00273         FbxReader::CreateFuncType               mCreatorFunction;
00274         FbxReader::IOSettingsFillerFuncType mIOSettingsFillerFunction;
00275         int                                     mBaseID;
00276         bool                                    mIsFBX;
00277         bool                                    mIsInternalPlugin;
00278     };
00279     
00280     struct WriterPluginEntry
00281     {
00282         WriterPluginEntry(char const* pExtension, char const* pDescription, char const* const* pVersions, FbxWriter::CreateFuncType pCreatorFunction, int pBaseID,
00283             FbxWriter::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00284         
00285         char const*                             mExtension;
00286         char const*                             mDescription;
00287         char const* const*                      mVersions;
00288         FbxWriter::CreateFuncType               mCreatorFunction;
00289         FbxWriter::IOSettingsFillerFuncType mIOSettingsFillerFunction;
00290         int                                     mBaseID;
00291         bool                                    mIsFBX;
00292         bool                                    mIsInternalPlugin;
00293     };
00294 
00295     FbxArray<ReaderPluginEntry*>    mReaders;
00296     FbxArray<WriterPluginEntry*>    mWriters;
00297     int                                 mNativeReaderFormat;
00298     int                                 mNativeWriterFormat;
00299     bool                                mInternalPluginMode;
00300 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00301 };
00302 
00303 #include <fbxsdk/fbxsdk_nsend.h>
00304 
00305 #endif /* _FBXSDK_FILEIO_IO_PLUGIN_REGISTRY_H_ */