FBX SDK Reference Guide: kfbxiopluginregistry.h Source File
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 © 2001 - 2008 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 
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #include <fbxfilesdk/components/kbaselib/kaydara.h>
00044 
00045 #include <fbxfilesdk/kfbxio/kfbxreader.h>
00046 #include <fbxfilesdk/kfbxio/kfbxwriter.h>
00047 
00048 #include <fbxfilesdk/components/kbaselib/kbaselib_forward.h>
00049 
00050 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00051 
00052 class KFbxSdkManager;
00053 class KFbxIOPluginRegistry;
00054 class KFbxExporter;
00055 class KFbxImporter;
00056 class KFbxIOSettings;
00057 
00063 class KFBX_DLL KFbxIOPluginRegistry
00064 {
00065 public:
00066 
00069     KFbxIOPluginRegistry();
00070 
00073     virtual ~KFbxIOPluginRegistry();
00074 
00080     void RegisterReader(char const* pPluginPath,
00081                         int& pFirstPluginID,
00082                         int& pRegisteredCount);
00083 
00091     void RegisterReader(KFbxReader::CreateFuncType pCreateF, 
00092                         KFbxReader::GetInfoFuncType pInfoF,
00093                         int& pFirstPluginID,
00094                         int& pRegisteredCount,
00095                         KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerF = NULL
00096                        );
00097 
00098 
00104     void RegisterWriter(char const* pPluginPath,
00105                         int& pFirstPluginID,
00106                         int& pRegisteredCount);
00107 
00115     void RegisterWriter(KFbxWriter::CreateFuncType pCreateF, 
00116                         KFbxWriter::GetInfoFuncType pInfoF,
00117                         int& pFirstPluginID,
00118                         int& pRegisteredCount,
00119                         KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerF = NULL);
00120 
00126     KFbxReader* CreateReader(KFbxSdkManager& pManager, 
00127                              KFbxImporter& pImporter, 
00128                              int pPluginID) const;
00129 
00135     KFbxWriter* CreateWriter(KFbxSdkManager& pManager, 
00136                              KFbxExporter& pExporter,
00137                              int pPluginID) const;
00138 
00143     int FindReaderIDByExtension(char const* pExt) const;
00144 
00149     int FindWriterIDByExtension(char const* pExt) const;
00150     
00155     int FindReaderIDByDescription(char const* pDesc) const;
00156 
00161     int FindWriterIDByDescription(char const* pDesc) const;
00162     
00167     bool ReaderIsFBX(int pFileFormat) const;
00168 
00173     bool WriterIsFBX(int pFileFormat) const;
00174 
00179     bool ReaderIsGenuine(int pFileFormat) const;
00180 
00185     bool WriterIsGenuine(int pFileFormat) const;
00186 
00190     int GetReaderFormatCount() const;
00191 
00198     int GetWriterFormatCount() const;
00199 
00204     char const* GetReaderFormatDescription(int pFileFormat) const;
00205 
00210     char const* GetWriterFormatDescription(int pFileFormat) const;
00211 
00216     char const* GetReaderFormatExtension(int pFileFormat) const;
00217     
00222     char const* GetWriterFormatExtension(int pFileFormat) const;
00223 
00228     char const* const* GetWritableVersions(int pFileFormat) const;
00229 
00240     bool DetectFileFormat(const char* pFileName, int& pFileFormat) const;
00241     
00245     int GetNativeReaderFormat();
00246 
00250     int GetNativeWriterFormat();
00251 
00255     void FillIOSettingsForReadersRegistered(KFbxIOSettings & pIOS);
00256 
00260     void FillIOSettingsForWritersRegistered(KFbxIOSettings & pIOS);
00261 
00262 
00264 //
00265 //  WARNING!
00266 //
00267 //  Anything beyond these lines may not be documented accurately and is 
00268 //  subject to change without notice.
00269 //
00271 
00272 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00273 
00274 private:
00275     void RegisterInternalIOPlugins();
00276 
00277     struct ReaderPluginEntry
00278     {
00279         ReaderPluginEntry(char const* pExtension, char const* pDescription, KFbxReader::CreateFuncType pCreatorFunction, int pBaseID,
00280             KFbxReader::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00281         
00282         char const*                             mExtension;
00283         char const*                             mDescription;
00284         KFbxReader::CreateFuncType              mCreatorFunction;
00285         KFbxReader::IOSettingsFillerFuncType    mIOSettingsFillerFunction;
00286         int                                     mBaseID;
00287         bool                                    mIsFBX;
00288         bool                                    mIsInternalPlugin;
00289     };
00290     
00291     struct WriterPluginEntry
00292     {
00293         WriterPluginEntry(char const* pExtension, char const* pDescription, char const* const* pVersions, KFbxWriter::CreateFuncType pCreatorFunction, int pBaseID,
00294             KFbxWriter::IOSettingsFillerFuncType pIOSettingsFillerFunction=NULL);
00295         
00296         char const*                             mExtension;
00297         char const*                             mDescription;
00298         char const* const*                      mVersions;
00299         KFbxWriter::CreateFuncType              mCreatorFunction;
00300         KFbxWriter::IOSettingsFillerFuncType    mIOSettingsFillerFunction;
00301         int                                     mBaseID;
00302         bool                                    mIsFBX;
00303         bool                                    mIsInternalPlugin;
00304     };
00305 
00306     KArrayTemplate<ReaderPluginEntry*>  mReaders;
00307     KArrayTemplate<WriterPluginEntry*>  mWriters;
00308     int                                 mNativeReaderFormat;
00309     int                                 mNativeWriterFormat;
00310     bool                                mInternalPluginMode;
00311 
00312 #endif //DOXYGEN
00313 };
00314 
00315 
00316 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00317 
00318 #endif // FBXFILESDK_KFBXPLUGINS_KFBXIOPLUGINREGISTRY_H
00319