/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// // StepImport.h: interface for the OdStepImport class. // ////////////////////////////////////////////////////////////////////// #if !defined(ODA_ODSTEPIMPORT_H_INCLUDED_) #define ODA_ODSTEPIMPORT_H_INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "OdPlatformSettings.h" #include "RxModule.h" #include "Gs/Gs.h" #ifdef DWG2STEP_EXPORTS #define DWG2STEP_EXPORT OD_TOOLKIT_EXPORT #define DWG2STEP_EXPORT_STATIC OD_STATIC_EXPORT #else #define DWG2STEP_EXPORT OD_TOOLKIT_IMPORT #define DWG2STEP_EXPORT_STATIC OD_STATIC_IMPORT #endif // DWG2STEP_IMPORTS #define ODRX_DECLARE_DWG2STEP_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(OdDwg2StepModuleImpl); \ ODRX_DECLARE_STATIC_MODULE_ENTRY_POINT(ModelerModule); \ // end of ODRX_DECLARE_DWG2STEP_STATIC_MODULES_ENTRY_POINTS macro #define ODRX_DEFINE_DWG2STEP_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(OdDwg2StepModuleName, OdDwg2StepModuleImpl) \ ODRX_DEFINE_STATIC_APPMODULE(OdModelerGeometryModuleName, ModelerModule) \ // end of ODRX_DEFINE_DWG2STEP_STATIC_APPMODULES macro class OdGiDrawable; /** \details Contains declarations related to the functionality of converting data from the .dwg to the STEP format. */ namespace DWG_STEP_IMPORT { /** \details Contains the supported schema versions. */ enum SchemaVersion { /**AP203 schema type.*/ kAP203 = 0, /**AP214 schema type.*/ kAP214, /**AP242 schema type.*/ kAP242, }; /** \details Contains declarations, which represents the .dwg to .step conversion modes. */ enum ConversionMode { /**Convert PMI dimensions.*/ kPMIConversion = 0x0001, /**Convert dwg paper views as empty dimension with camera viewports.*/ kCameraFromPaperViews = 0x0002, /**Output conversion log data to the console.*/ kEnableConsoleLog = 0x0004, /**Output conversion log data to the file.*/ kEnableFileLog = 0x0008, }; /** \details An abstract class that provides the interface for .dwg to .step format data conversion. */ class OdStepImport : public OdRxObject { public: /** \details Contains .dwg to .step format conversion results. */ enum ImportResult { /**The conversion is successfully done.*/ success, /**The conversion is failed.*/ fail, /**The password is incorrect.*/ bad_password, /**The file is invalid.*/ bad_file, /**The output .step file schema is not supported.*/ schema_not_supported, /**The input .dwg database is invalid.*/ bad_database, /**The input file is encrypted.*/ encrypted_file }; /** \details A pure virtual method that provides an interface for conversion from a .dwg drawing to an .step file. \returns The ImportResult::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 ImportResult import() = 0; /** \details A pure virtual method that provides an interface for the access to the properties of the .dwg to .step conversion process. \returns A smart pointer to an Rx dictionary object that contains the conversion properties values. */ virtual OdRxDictionaryPtr properties() = 0; /** \details A pure virtual method that provides an interface for method which writes converted STEP model into a file with defined file name. \returns eOk if writing is successful; appropriate error code otherwise. */ virtual OdResult writeStepFile(const OdString &fileName) = 0; }; /** \details A data type that represents a smart pointer to an object that is derived from the OdStepImport class. */ typedef OdSmartPtr OdStepImportPtr; /** \details An abstract class that provides the interface for the .dwg to .step format data conversion module. */ class OdDwg2StepModule : public OdRxModule { public: /** \details A pure virtual method that provides an interface for the creation of a new .dwg to .step converter instance. \returns A smart pointer to the created object. */ virtual OdStepImportPtr create() = 0; }; /** \details A data type that represents a smart pointer to an object that is derived from the OdDwg2StepModule class. */ typedef OdSmartPtr OdDwg2StepModulePtr; } #endif // !defined(ODA_ODSTEPIMPORT_H_INCLUDED_)