/////////////////////////////////////////////////////////////////////////////// // 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 _STEP_EXPORT_H_ #define _STEP_EXPORT_H_ #include "OdPlatformSettings.h" #include "OdModuleNames.h" #include "RxModule.h" #include "RxDictionary.h" #include "DynamicLinker.h" #include "DbObjectId.h" #include "daiObjectId.h" #ifdef STEP2DWG_EXPORTS #define STEP2DWG_EXPORT OD_TOOLKIT_EXPORT #define STEP2DWG_EXPORT_STATIC OD_STATIC_EXPORT #else #define STEP2DWG_EXPORT OD_TOOLKIT_IMPORT #define STEP2DWG_EXPORT_STATIC OD_STATIC_IMPORT #endif #if(XMLIO_ENABLED) #define ODRX_DECLARE_STEP2DWG_STATIC_MODULES_ENTRY_POINTS() \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdSDAIModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepCoreModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepGeomModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepBrepBuilderModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepSolidModelerModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStep2DwgModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStpXGeomModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(ModelerModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdXMLIOModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(EulerMdBrepBuilderModule); \ // end of ODRX_DECLARE_STEP2DWG_STATIC_MODULES_ENTRY_POINTS macro #define ODRX_DEFINE_STEP2DWG_STATIC_APPMODULES() \ ODRX_DEFINE_STATIC_APPMODULE(OdSDAIModuleName, OdSDAIModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepCoreModuleName, OdStepCoreModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepGeomModuleName, OdStepGeomModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepBrepBuilderModuleName, OdStepBrepBuilderModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepSolidModelerModuleName, OdStepSolidModelerModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStep2DwgModuleName, OdStep2DwgModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdStpXGeomModuleName, OdStpXGeomModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdModelerGeometryModuleName, ModelerModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdEulerMdBrepBuilderName, EulerMdBrepBuilderModule) \ // end of ODRX_DEFINE_STEP2DWG_STATIC_APPMODULES macro #else #define ODRX_DECLARE_STEP2DWG_STATIC_MODULES_ENTRY_POINTS() \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdSDAIModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepCoreModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepGeomModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepBrepBuilderModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStepSolidModelerModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStep2DwgModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdStpXGeomModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(ModelerModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(OdXMLIOModule); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(EulerMdBrepBuilderModule); \ // end of ODRX_DECLARE_STEP2DWG_STATIC_MODULES_ENTRY_POINTS macro #define ODRX_DEFINE_STEP2DWG_STATIC_APPMODULES() \ ODRX_DEFINE_STATIC_APPMODULE(OdSDAIModuleName, OdSDAIModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepCoreModuleName, OdStepCoreModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepGeomModuleName, OdStepGeomModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepBrepBuilderModuleName, OdStepBrepBuilderModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStepSolidModelerModuleName, OdStepSolidModelerModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdStep2DwgModuleName, OdStep2DwgModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdStpXGeomModuleName, OdStpXGeomModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdModelerGeometryModuleName, ModelerModule) \ ODRX_DEFINE_STATIC_APPMODULE(OdEulerMdBrepBuilderName, EulerMdBrepBuilderModule) \ // end of ODRX_DEFINE_STEP2DWG_STATIC_APPMODULES macro #endif class OdDbDatabase; class OdStepFile; /** \details A data type that represents a smart pointer to an OdStepFile object. */ typedef OdSmartPtr OdStepFilePtr; /** \details Contains declarations related to the functionality of conversion data from the STEP format to a .dwg file. */ namespace TD_STEP_EXPORT { /** \details Contains declarations, which represents the .step 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 STEP 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 Contains declarations, which represents the .step to .dwg geometry types conversion objects. */ enum ExportEntityTypes { /**PMI dimensions conversion.*/ kDimensions = 0x0001, /**Supplemental geometry conversion.*/ kSupplementalGeometry = 0x0002, /**Holes highlight conversion.*/ kHolesSemantics = 0x0004, /**Full geometry conversion.*/ kAllSubGeomery = kDimensions | kSupplementalGeometry | kHolesSemantics, }; /** \details The class that implements a connection map between .dwg entities and appropriate objects in the STEP model. This map contains information about data storages in the .step and .dwg formats used for the data exchange. */ class STEP2DWG_EXPORT OdStepConnectionMap : public OdRxObject { public: /** \details Searches the corresponding source STEP 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 STEP instances of source STEP model. */ virtual const OdDAIObjectIds& find(const OdDbObjectId& id) = 0; /** \details Retrieves the attached STEP file object that contains the source STEP model. \returns A smart pointer to the attached instance of the OdStepFile class. */ virtual OdStepFilePtr getStepFile() = 0; }; /** \details A data type that represents a smart pointer to an object of the OdStepConnectionMap class. */ typedef OdSmartPtr OdStepConnectionMapPtr; /** \details An abstract class that provides the interface for .step to .dwg format data conversion. */ class OdStepExport : public OdRxObject { public: /** \details Contains .step 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 .step 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 .step 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 .step 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 OdStepExport class. */ typedef OdSmartPtr OdStepExportPtr; /** \details An abstract class that provides the interface for the .step to .dwg format data conversion module. */ class OdStep2DwgModule : public OdRxModule { public: /** \details A pure virtual method that provides an interface for the creation of a new .step to .dwg converter instance. \returns A smart pointer to the created object. */ virtual OdStepExportPtr create () = 0; }; /** \details A data type that represents a smart pointer to an object that is derived from the OdStep2DwgModule class. */ typedef OdSmartPtr OdStep2DwgModulePtr; /** \details Creates an instance of the .step to .dwg format converter. \returns A smart pointer to an object derived from the OdStep2DwgModule class. */ inline OdStepExportPtr createStepExporter() { OdStep2DwgModulePtr pModule = ::odrxDynamicLinker()->loadApp(OdStep2DwgModuleName); if (!pModule.isNull()) return pModule->create(); return OdStepExportPtr(); } } #endif // _STEP_EXPORT_H_