kfbxiopluginregistry.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002 
00003    Copyright (C) 2010 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 
00015 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00016 #define FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00017 
00018 
00019 #include <fbxfilesdk/fbxfilesdk_def.h>
00020 
00021 #include <fbxfilesdk/kfbxio/kfbxreader.h>
00022 #include <fbxfilesdk/kfbxio/kfbxwriter.h>
00023 
00024 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00025 
00026 class KFbxSdkManager;
00027 class KFbxIOPluginRegistry;
00028 class KFbxExporter;
00029 class KFbxImporter;
00030 class KFbxIOSettings;
00031 
00046 class KFBX_DLL KFbxIOPluginRegistry
00047 {
00048 public:
00049 
00052     KFbxIOPluginRegistry();
00053 
00056     virtual ~KFbxIOPluginRegistry();
00057 
00063     void RegisterReader(char const* pPluginPath,
00064                         int& pFirstPluginID,
00065                         int& pRegisteredCount);
00066 
00074     void RegisterReader(KFbxReader::CreateFuncType pCreateF, 
00075                         KFbxReader::GetInfoFuncType pInfoF,
00076                         int& pFirstPluginID,
00077                         int& pRegisteredCount,
00078                         KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerF = NULL
00079                        );
00080 
00081 
00087     void RegisterWriter(char const* pPluginPath,
00088                         int& pFirstPluginID,
00089                         int& pRegisteredCount);
00090 
00098     void RegisterWriter(KFbxWriter::CreateFuncType pCreateF, 
00099                         KFbxWriter::GetInfoFuncType pInfoF,
00100                         int& pFirstPluginID,
00101                         int& pRegisteredCount,
00102                         KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerF = NULL);
00103 
00109     KFbxReader* CreateReader(KFbxSdkManager& pManager, 
00110                              KFbxImporter& pImporter, 
00111                              int pPluginID) const;
00112 
00118     KFbxWriter* CreateWriter(KFbxSdkManager& pManager, 
00119                              KFbxExporter& pExporter,
00120                              int pPluginID) const;
00121 
00126     int FindReaderIDByExtension(char const* pExt) const;
00127 
00132     int FindWriterIDByExtension(char const* pExt) const;
00133     
00138     int FindReaderIDByDescription(char const* pDesc) const;
00139 
00144     int FindWriterIDByDescription(char const* pDesc) const;
00145     
00150     bool ReaderIsFBX(int pFileFormat) const;
00151 
00156     bool WriterIsFBX(int pFileFormat) const;
00157 
00162     bool ReaderIsGenuine(int pFileFormat) const;
00163 
00168     bool WriterIsGenuine(int pFileFormat) const;
00169 
00173     int GetReaderFormatCount() const;
00174 
00181     int GetWriterFormatCount() const;
00182 
00187     char const* GetReaderFormatDescription(int pFileFormat) const;
00188 
00193     char const* GetWriterFormatDescription(int pFileFormat) const;
00194 
00199     char const* GetReaderFormatExtension(int pFileFormat) const;
00200     
00205     char const* GetWriterFormatExtension(int pFileFormat) const;
00206 
00211     char const* const* GetWritableVersions(int pFileFormat) const;
00212 
00223     bool DetectReaderFileFormat(const char* pFileName, int& pFileFormat) const;
00224 
00235     bool DetectWriterFileFormat(const char* pFileName, int& pFileFormat) const;
00236     
00240     int GetNativeReaderFormat();
00241 
00245     int GetNativeWriterFormat();
00246 
00250     void FillIOSettingsForReadersRegistered(KFbxIOSettings & pIOS);
00251 
00255     void FillIOSettingsForWritersRegistered(KFbxIOSettings & pIOS);
00256 
00257 
00259 //
00260 //  WARNING!
00261 //
00262 //  Anything beyond these lines may not be documented accurately and is 
00263 //  subject to change without notice.
00264 //
00266 
00267 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00268 
00269 private:
00270     void RegisterInternalIOPlugins();
00271 
00272     struct ReaderPluginEntry
00273     {
00274         ReaderPluginEntry(char const* pExtension, char const* pDescription, KFbxReader::CreateFuncType pCreatorFunction, int pBaseID,
00275             KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00276         
00277         char const*                             mExtension;
00278         char const*                             mDescription;
00279         KFbxReader::CreateFuncType              mCreatorFunction;
00280         KFbxReader::IOSettingsFillerFuncType    mIOSettingsFillerFunction;
00281         int                                     mBaseID;
00282         bool                                    mIsFBX;
00283         bool                                    mIsInternalPlugin;
00284     };
00285     
00286     struct WriterPluginEntry
00287     {
00288         WriterPluginEntry(char const* pExtension, char const* pDescription, char const* const* pVersions, KFbxWriter::CreateFuncType pCreatorFunction, int pBaseID,
00289             KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00290         
00291         char const*                             mExtension;
00292         char const*                             mDescription;
00293         char const* const*                      mVersions;
00294         KFbxWriter::CreateFuncType              mCreatorFunction;
00295         KFbxWriter::IOSettingsFillerFuncType    mIOSettingsFillerFunction;
00296         int                                     mBaseID;
00297         bool                                    mIsFBX;
00298         bool                                    mIsInternalPlugin;
00299     };
00300 
00301     KArrayTemplate<ReaderPluginEntry*>  mReaders;
00302     KArrayTemplate<WriterPluginEntry*>  mWriters;
00303     int                                 mNativeReaderFormat;
00304     int                                 mNativeWriterFormat;
00305     bool                                mInternalPluginMode;
00306 
00307 #endif //DOXYGEN
00308 };
00309 
00310 
00311 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00312 
00313 #endif // FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00314