FBX SDK Reference Guide: kfbxiopluginregistry.h Source File
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  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 <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 //  WARNING!
00256 //
00257 //  Anything beyond these lines may not be documented accurately and is 
00258 //  subject to change without notice.
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