kfbxiopluginregistry.h
Go to the documentation of this file.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
00061 class KFbxSdkManager;
00062 class KFbxIOPluginRegistry;
00063 class KFbxExporter;
00064 class KFbxImporter;
00065
00066
00067
00068
00071 class KFbxIOPluginRegistryAccessor
00072 {
00073 public:
00074
00078 static KFbxIOPluginRegistry* Get();
00079
00081
00082
00083
00084
00085
00086
00088
00089 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00090 private:
00091 friend class KFbxSdkManager;
00092
00093 static void Acquire();
00094 static void Release();
00095
00096 static KFbxIOPluginRegistry* mRegistry;
00097 static int mAcquireCount;
00098 #endif //DOXYGEN
00099 };
00100
00101
00102
00108 class KFbxIOPluginRegistry
00109 {
00110 public:
00111
00117 void RegisterReader(char const* pPluginPath,
00118 int& pFirstPluginID,
00119 int& pRegisteredCount);
00120
00127 void RegisterReader(KFbxReader::CreateFuncType pCreateF,
00128 KFbxReader::GetInfoFuncType pInfoF,
00129 int& pFirstPluginID,
00130 int& pRegisteredCount);
00131
00132
00138 void RegisterWriter(char const* pPluginPath,
00139 int& pFirstPluginID,
00140 int& pRegisteredCount);
00141
00148 void RegisterWriter(KFbxWriter::CreateFuncType pCreateF,
00149 KFbxWriter::GetInfoFuncType pInfoF,
00150 int& pFirstPluginID,
00151 int& pRegisteredCount);
00152
00157 KFbxReader* CreateReader(KFbxSdkManager& pManager,
00158 KFbxImporter& pImporter,
00159 int pPluginID) const;
00160
00166 KFbxWriter* CreateWriter(KFbxSdkManager& pManager,
00167 KFbxExporter& pExporter,
00168 int pPluginID) const;
00169
00173 int FindReaderIDByExtension(char const* pExt) const;
00174
00178 int FindWriterIDByExtension(char const* pExt) const;
00179
00183 int FindReaderIDByDescription(char const* pDesc) const;
00184
00188 int FindWriterIDByDescription(char const* pDesc) const;
00189
00193 bool ReaderIsFBX(int pFileFormat) const;
00194
00198 bool WriterIsFBX(int pFileFormat) const;
00199
00203 int GetReaderFormatCount() const;
00204
00211 int GetWriterFormatCount() const;
00212
00217 char const* GetReaderFormatDescription(int pFileFormat) const;
00218
00223 char const* GetWriterFormatDescription(int pFileFormat) const;
00224
00229 char const* GetReaderFormatExtension(int pFileFormat) const;
00230
00235 char const* GetWriterFormatExtension(int pFileFormat) const;
00236
00241 char const* const* GetWritableVersions(int pFileFormat) const;
00242
00253 bool DetectFileFormat(const char* pFileName, int& pFileFormat) const;
00254
00258 int GetNativeReaderFormat();
00259
00263 int GetNativeWriterFormat();
00264
00266
00267
00268
00269
00270
00271
00273
00274 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00275
00276 void RegisterInternalIOPlugins();
00277 protected:
00278 struct ReaderPluginEntry
00279 {
00280 ReaderPluginEntry(char const* pExtension,
00281 char const* pDescription,
00282 KFbxReader::CreateFuncType pCreatorFunction,
00283 int pBaseID);
00284
00285 char const* mExtension;
00286 char const* mDescription;
00287 KFbxReader::CreateFuncType mCreatorFunction;
00288 int mBaseID;
00289 bool mIsFBX;
00290 };
00291
00292 struct WriterPluginEntry
00293 {
00294 WriterPluginEntry(char const* pExtension,
00295 char const* pDescription,
00296 char const* const* pVersions,
00297 KFbxWriter::CreateFuncType pCreatorFunction,
00298 int pBaseID);
00299
00300 char const* mExtension;
00301 char const* mDescription;
00302 char const* const* mVersions;
00303 KFbxWriter::CreateFuncType mCreatorFunction;
00304 int mBaseID;
00305 bool mIsFBX;
00306 };
00307
00308
00309 KArrayTemplate<ReaderPluginEntry*> mReaders;
00310 KArrayTemplate<WriterPluginEntry*> mWriters;
00311
00312 int mNativeReaderFormat;
00313 int mNativeWriterFormat;
00314
00315 private:
00316 friend class KFbxIOPluginRegistryAccessor;
00317 KFbxIOPluginRegistry();
00318 ~KFbxIOPluginRegistry();
00319 #endif //DOXYGEN
00320 };
00321
00322
00323 #include <fbxfilesdk_nsend.h>
00324
00325 #endif // _KFbxIOPluginRegistry_h
00326