/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _COLLADA_IMPORT_INCLUDED_ #define _COLLADA_IMPORT_INCLUDED_ #include "RxModule.h" #include "RxDictionary.h" #include "DynamicLinker.h" class OdDbDatabase; /** \details */ namespace TD_COLLADA_IMPORT{ /** \details This class implements the Collada importer. */ class OdColladaImport : public OdRxObject { public: /** \details Represents the result of import success - Import finished successfully fail - Import failed: Internal import error bad_file - Import failed: Wrong format of the imported .dae file bad_database - Import failed: Invalid database pointer or corrupted database */ enum ImportResult { success, fail, bad_file, bad_database }; /** \details Performs import of a Collada file according to the settings specified via properties() */ virtual ImportResult import() = 0; /** \details Retrieves a dictionary object that contains the set of Collada import properties. \returns A smart pointer to the dictionary object that contains properties used for the import of a Collada file's content to a drawing database. \remarks The list of supported properties for the Collada import operation is represented below. // Documented properties are: // "Database" - OdDbDatabase object, where dae is imported // "ColladaPath" - string, path to the imported dae file // "ImportTextures" - bool, defines whether textures are imported. If set to "false", only geometry is imported // "ConsoleInfo" - bool, enables or disables the output of import progress information to the console */ virtual OdRxDictionaryPtr properties() = 0; /** \details Returns a text string describing the import result. \param res [in] Enumerated import result type. */ static OdString getResultDescription(ImportResult res) { OdString strResMsg; switch (res) { case success: strResMsg = OD_T("Import finished successfully"); break; case fail: strResMsg = OD_T("Internal import error"); break; case bad_file: strResMsg = OD_T("Wrong format of the imported .dae file"); break; case bad_database: strResMsg = OD_T("Invalid database pointer or corrupted database"); break; default: strResMsg = OD_T("Undefined error"); break; } return strResMsg; } }; typedef OdSmartPtr OdColladaImportPtr; /** \details This class implements the Collada import module. */ class ColladaImportModule : public OdRxModule { public: virtual OdColladaImportPtr create() = 0; }; typedef OdSmartPtr ColladaImportModulePtr; inline OdColladaImportPtr createImporter() { ColladaImportModulePtr pModule = ::odrxDynamicLinker()->loadModule(OdColladaImportModuleName, false); if ( !pModule.isNull() ) return pModule->create (); return (OdColladaImport*)0; } } #endif // _COLLADA_IMPORT_INCLUDED_