/////////////////////////////////////////////////////////////////////////////// // 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 _IGES_EXPORT_H_ #define _IGES_EXPORT_H_ #include "OdPlatformSettings.h" //#include "Sdai2DwgCommon.h" #include "RxModule.h" #include "RxDictionary.h" #include "DynamicLinker.h" #include "DbObjectId.h" #include "daiStepFile.h" #define OdIges2DwgModuleName L"Iges2Dwg" #ifdef IGES2DWG_EXPORTS #define IGES2DWG_EXPORT OD_TOOLKIT_EXPORT #define IGES2DWG_EXPORT_STATIC OD_STATIC_EXPORT #else #define IGES2DWG_EXPORT OD_TOOLKIT_IMPORT #define IGES2DWG_EXPORT_STATIC OD_STATIC_IMPORT #endif #define ODRX_DECLARE_IGES2DWG_STATIC_MODULES_ENTRY_POINTS() \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdSDAIModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdIgesModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdIgesSolidModelerModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdIges2DwgModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(ModelerModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdIgesIOModule); \ // end of ODRX_DECLARE_IGES2DWG_STATIC_MODULES_ENTRY_POINTS macro #define ODRX_DEFINE_IGES2DWG_STATIC_APPMODULES() \ ODRX_DEFINE_STATIC_APPMODULE(OdSDAIModuleName, OdSDAIModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdIgesSchemaModuleName, OdIgesModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdIgesSolidModelerModuleName, OdIgesSolidModelerModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdIges2DwgModuleName, OdIges2DwgModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdModelerGeometryModuleName, ModelerModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdIgesIoModuleName, OdIgesIOModule) \ // end of ODRX_DEFINE_IGES2DWG_STATIC_APPMODULES macro class OdDbDatabase; class IgesFile; /** \details A data type that represents a smart pointer to an IgesFile object. */ typedef OdSmartPtr IgesFilePtr; /** \details Contains declarations related to the functionality of conversion data from the IGES format to a .dwg file. */ namespace TD_IGES_EXPORT { /** \details Contains declarations, which represents the .iges to .dwg conversion modes. */ enum ExportMode { /**Export 3D geometry as subDMeshes. If not - as polyface mesh.*/ kAsSubDMesh = 0x0001, /**Generate 3d solid bodies from manifold_solid_brep entities.*/ kGenerateSolidBodies = 0x0002, /**Convert related IGES objects as block insertion.*/ kSaveAsBlockInsertion = 0x0004, /**Make validation of generated solid bodies.*/ kEnableDwgBodiesValidation = 0x0008, /**Errors handling during conversion.*/ kEnableErrorsHandling = 0x0010, /**Output conversion log data to the console.*/ kEnableConsoleLog = 0x0020, /**Output conversion log data to the file.*/ kEnableFileLog = 0x0040, }; /** \details The class that implements a connection map between .dwg entities and appropriate objects in the IGES model. This map contains information about data storages in the IGES and .dwg formats used for the data exchange. */ class IGES2DWG_EXPORT OdIgesConnectionMap : public OdRxObject { public: /** \details Searches the corresponding source IGES instance(s) for the object identifier of the converted OdDb object in destination OdDbDatabase. \param id [in] An identifier of the entity in the destination OdDbDatabase. \returns A chain of corresponding OdDAIObjectId identifiers of appropriate IGES instances of source IGES model. */ virtual const OdDAIObjectIds& find(const OdDbObjectId& id) = 0; /** \details Retrieves the attached IGES file object that contains the source IGES model. \returns A smart pointer to the attached instance of the OdIgesFile class. */ virtual IgesFilePtr getIgesFile() = 0; }; /** \details A data type that represents a smart pointer to an object of the OdIgesConnectionMap class. */ typedef OdSmartPtr OdIgesConnectionMapPtr; /** \details An abstract class that provides the interface for IGES to .dwg format data conversion. */ class OdIgesExport : public OdRxObject { public: /** \details Contains IGES to .dwg format conversion results. */ enum ExportResult { /**The conversion is successfully done.*/ success, /**The conversion is failed.*/ fail, /**The password is incorrect.*/ bad_password, /**The file is invalid.*/ bad_file, /**The input IGES file schema is not supported.*/ schema_not_supported, /**The output .dwg database is invalid.*/ bad_database, /**The conversion failed because of a file internal error.*/ file_internal_error }; /** \details A pure virtual method that provides an interface for the conversion of an input IGES file to a .dwg file. \returns The ExportResult::success value if the conversion process is successful; otherwise, the method returns an appropriate error code. \remarks Use the properties() method to set the conversion process options. */ virtual ExportResult run() = 0; /** \details A pure virtual method that provides an interface for access to the properties of the IGES to .dwg conversion process. \returns A smart pointer to an Rx dictionary object that contains the conversion properties values. \remarks See topic for the list of possible parameters. */ virtual OdRxDictionaryPtr properties() = 0; }; /** \details A data type that represents a smart pointer to an object that is derived from the OdIgesExport class. */ typedef OdSmartPtr OdIgesExportPtr; /** \details An abstract class that provides the interface for the .iges to .dwg format data conversion module. */ class OdIges2DwgModule : public OdRxModule { public: /** \details A pure virtual method that provides an interface for the creation of a new .iges to .dwg converter instance. \returns A smart pointer to the created object. */ virtual OdIgesExportPtr create () = 0; }; /** \details A data type that represents a smart pointer to an object that is derived from the OdIges2DwgModule class. */ typedef OdSmartPtr OdIges2DwgModulePtr; /** \details Creates an instance of the .iges to .dwg format converter. \returns A smart pointer to an object derived from the OdIges2DwgModule class. */ inline OdIgesExportPtr createIgesExporter() { OdIges2DwgModulePtr pModule = ::odrxDynamicLinker()->loadApp(OdIges2DwgModuleName); if (!pModule.isNull()) return pModule->create(); return OdIgesExportPtr(); } } #endif // _IGES_EXPORT_H_