00001
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042
00043 #include <fbxfilesdk/kfbxio/kfbxreader.h>
00044 #include <fbxfilesdk/kfbxio/kfbxwriter.h>
00045
00046 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00047
00048 class KFbxSdkManager;
00049 class KFbxIOPluginRegistry;
00050 class KFbxExporter;
00051 class KFbxImporter;
00052 class KFbxIOSettings;
00053
00059 class KFBX_DLL KFbxIOPluginRegistry
00060 {
00061 public:
00062
00065 KFbxIOPluginRegistry();
00066
00069 virtual ~KFbxIOPluginRegistry();
00070
00076 void RegisterReader(char const* pPluginPath,
00077 int& pFirstPluginID,
00078 int& pRegisteredCount);
00079
00087 void RegisterReader(KFbxReader::CreateFuncType pCreateF,
00088 KFbxReader::GetInfoFuncType pInfoF,
00089 int& pFirstPluginID,
00090 int& pRegisteredCount,
00091 KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerF = NULL
00092 );
00093
00094
00100 void RegisterWriter(char const* pPluginPath,
00101 int& pFirstPluginID,
00102 int& pRegisteredCount);
00103
00111 void RegisterWriter(KFbxWriter::CreateFuncType pCreateF,
00112 KFbxWriter::GetInfoFuncType pInfoF,
00113 int& pFirstPluginID,
00114 int& pRegisteredCount,
00115 KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerF = NULL);
00116
00122 KFbxReader* CreateReader(KFbxSdkManager& pManager,
00123 KFbxImporter& pImporter,
00124 int pPluginID) const;
00125
00131 KFbxWriter* CreateWriter(KFbxSdkManager& pManager,
00132 KFbxExporter& pExporter,
00133 int pPluginID) const;
00134
00139 int FindReaderIDByExtension(char const* pExt) const;
00140
00145 int FindWriterIDByExtension(char const* pExt) const;
00146
00151 int FindReaderIDByDescription(char const* pDesc) const;
00152
00157 int FindWriterIDByDescription(char const* pDesc) const;
00158
00163 bool ReaderIsFBX(int pFileFormat) const;
00164
00169 bool WriterIsFBX(int pFileFormat) const;
00170
00175 bool ReaderIsGenuine(int pFileFormat) const;
00176
00181 bool WriterIsGenuine(int pFileFormat) const;
00182
00186 int GetReaderFormatCount() const;
00187
00194 int GetWriterFormatCount() const;
00195
00200 char const* GetReaderFormatDescription(int pFileFormat) const;
00201
00206 char const* GetWriterFormatDescription(int pFileFormat) const;
00207
00212 char const* GetReaderFormatExtension(int pFileFormat) const;
00213
00218 char const* GetWriterFormatExtension(int pFileFormat) const;
00219
00224 char const* const* GetWritableVersions(int pFileFormat) const;
00225
00236 bool DetectReaderFileFormat(const char* pFileName, int& pFileFormat) const;
00237
00248 bool DetectWriterFileFormat(const char* pFileName, int& pFileFormat) const;
00249
00253 int GetNativeReaderFormat();
00254
00258 int GetNativeWriterFormat();
00259
00263 void FillIOSettingsForReadersRegistered(KFbxIOSettings & pIOS);
00264
00268 void FillIOSettingsForWritersRegistered(KFbxIOSettings & pIOS);
00269
00270
00272
00273
00274
00275
00276
00277
00279
00280 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00281
00282 private:
00283 void RegisterInternalIOPlugins();
00284
00285 struct ReaderPluginEntry
00286 {
00287 ReaderPluginEntry(char const* pExtension, char const* pDescription, KFbxReader::CreateFuncType pCreatorFunction, int pBaseID,
00288 KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00289
00290 char const* mExtension;
00291 char const* mDescription;
00292 KFbxReader::CreateFuncType mCreatorFunction;
00293 KFbxReader::IOSettingsFillerFuncType mIOSettingsFillerFunction;
00294 int mBaseID;
00295 bool mIsFBX;
00296 bool mIsInternalPlugin;
00297 };
00298
00299 struct WriterPluginEntry
00300 {
00301 WriterPluginEntry(char const* pExtension, char const* pDescription, char const* const* pVersions, KFbxWriter::CreateFuncType pCreatorFunction, int pBaseID,
00302 KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00303
00304 char const* mExtension;
00305 char const* mDescription;
00306 char const* const* mVersions;
00307 KFbxWriter::CreateFuncType mCreatorFunction;
00308 KFbxWriter::IOSettingsFillerFuncType mIOSettingsFillerFunction;
00309 int mBaseID;
00310 bool mIsFBX;
00311 bool mIsInternalPlugin;
00312 };
00313
00314 KArrayTemplate<ReaderPluginEntry*> mReaders;
00315 KArrayTemplate<WriterPluginEntry*> mWriters;
00316 int mNativeReaderFormat;
00317 int mNativeWriterFormat;
00318 bool mInternalPluginMode;
00319
00320 #endif //DOXYGEN
00321 };
00322
00323
00324 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00325
00326 #endif // FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00327