00001
00004 #ifndef _KFBX_IO_PLUGIN_REGISTRY_H_
00005 #define _KFBX_IO_PLUGIN_REGISTRY_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
00042 #include <kaydaradef.h>
00043 #ifndef KFBX_DLL
00044 #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046
00047 #include <kaydara.h>
00048
00049 #include <kfbxio/kfbxreader.h>
00050 #include <kfbxio/kfbxwriter.h>
00051
00052 #include <kbaselib_forward.h>
00053
00054 #ifndef MB_FBXSDK
00055 #include <kbaselib_nsuse.h>
00056 #endif
00057
00058 #include <fbxfilesdk_nsbegin.h>
00059
00060 class KFbxSdkManager;
00061 class KFbxIOPluginRegistry;
00062 class KFbxExporter;
00063 class KFbxImporter;
00064 class KFbxIOSettings;
00065
00071 class KFBX_DLL KFbxIOPluginRegistry
00072 {
00073 public:
00074
00077 KFbxIOPluginRegistry();
00078
00081 virtual ~KFbxIOPluginRegistry();
00082
00088 void RegisterReader(char const* pPluginPath,
00089 int& pFirstPluginID,
00090 int& pRegisteredCount);
00091
00099 void RegisterReader(KFbxReader::CreateFuncType pCreateF,
00100 KFbxReader::GetInfoFuncType pInfoF,
00101 int& pFirstPluginID,
00102 int& pRegisteredCount,
00103 KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerF = NULL
00104 );
00105
00106
00112 void RegisterWriter(char const* pPluginPath,
00113 int& pFirstPluginID,
00114 int& pRegisteredCount);
00115
00123 void RegisterWriter(KFbxWriter::CreateFuncType pCreateF,
00124 KFbxWriter::GetInfoFuncType pInfoF,
00125 int& pFirstPluginID,
00126 int& pRegisteredCount,
00127 KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerF = NULL);
00128
00134 KFbxReader* CreateReader(KFbxSdkManager& pManager,
00135 KFbxImporter& pImporter,
00136 int pPluginID) const;
00137
00143 KFbxWriter* CreateWriter(KFbxSdkManager& pManager,
00144 KFbxExporter& pExporter,
00145 int pPluginID) const;
00146
00150 int FindReaderIDByExtension(char const* pExt) const;
00151
00155 int FindWriterIDByExtension(char const* pExt) const;
00156
00160 int FindReaderIDByDescription(char const* pDesc) const;
00161
00165 int FindWriterIDByDescription(char const* pDesc) const;
00166
00170 bool ReaderIsFBX(int pFileFormat) const;
00171
00175 bool WriterIsFBX(int pFileFormat) const;
00176
00180 int GetReaderFormatCount() const;
00181
00188 int GetWriterFormatCount() const;
00189
00194 char const* GetReaderFormatDescription(int pFileFormat) const;
00195
00200 char const* GetWriterFormatDescription(int pFileFormat) const;
00201
00206 char const* GetReaderFormatExtension(int pFileFormat) const;
00207
00212 char const* GetWriterFormatExtension(int pFileFormat) const;
00213
00218 char const* const* GetWritableVersions(int pFileFormat) const;
00219
00230 bool DetectFileFormat(const char* pFileName, int& pFileFormat) const;
00231
00235 int GetNativeReaderFormat();
00236
00240 int GetNativeWriterFormat();
00241
00245 void FillIOSettingsForReadersRegistered(KFbxIOSettings & pIOS);
00246
00250 void FillIOSettingsForWritersRegistered(KFbxIOSettings & pIOS);
00251
00252
00254
00255
00256
00257
00258
00259
00261
00262 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00263
00264 void RegisterInternalIOPlugins();
00265 protected:
00266 struct ReaderPluginEntry
00267 {
00268 ReaderPluginEntry(char const* pExtension,
00269 char const* pDescription,
00270 KFbxReader::CreateFuncType pCreatorFunction,
00271 int pBaseID,
00272 KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerFunction = NULL
00273 );
00274
00275 char const* mExtension;
00276 char const* mDescription;
00277 KFbxReader::CreateFuncType mCreatorFunction;
00278 KFbxReader::IOSettingsFillerFuncType mIOSettingsFillerFunction;
00279 int mBaseID;
00280 bool mIsFBX;
00281 };
00282
00283 struct WriterPluginEntry
00284 {
00285 WriterPluginEntry(char const* pExtension,
00286 char const* pDescription,
00287 char const* const* pVersions,
00288 KFbxWriter::CreateFuncType pCreatorFunction,
00289 int pBaseID,
00290 KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerFunction = NULL
00291 );
00292
00293 char const* mExtension;
00294 char const* mDescription;
00295 char const* const* mVersions;
00296 KFbxWriter::CreateFuncType mCreatorFunction;
00297 KFbxWriter::IOSettingsFillerFuncType mIOSettingsFillerFunction;
00298 int mBaseID;
00299 bool mIsFBX;
00300 };
00301
00302
00303 KArrayTemplate<ReaderPluginEntry*> mReaders;
00304 KArrayTemplate<WriterPluginEntry*> mWriters;
00305
00306 int mNativeReaderFormat;
00307 int mNativeWriterFormat;
00308
00309 #endif //DOXYGEN
00310 };
00311
00312
00313 #include <fbxfilesdk_nsend.h>
00314
00315 #endif // _KFbxIOPluginRegistry_h
00316