kfbxiopluginregistry.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
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 //  WARNING!
00274 //
00275 //  Anything beyond these lines may not be documented accurately and is 
00276 //  subject to change without notice.
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