/////////////////////////////////////////////////////////////////////////////// // 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 _DWG2IGES_IMPORTER_H_ #define _DWG2IGES_IMPORTER_H_ #include "IgesImport.h" #include "IgesImportProperties.h" #include "Core/IgesFile.h" #include "daiAuditInfo.h" #include "IgesEntities.h" class OdGiDrawable; class OdDb3dSolid; class OdDbBody; class OdDbSurface; class OdDbRegion; class OdDbPolyline; class OdDbCurve; class OdDbLayerTable; class OdDbBlockTableRecord; class OdDbBlockReference; class OdDbDimension; class OdDbRadialDimension; class OdDbDiametricDimension; class OdDbSolid; class OdDbMText; class OdDbViewport; class OdBrBrep; class OdDb3dPolyline; class OdDbText; class OdDbHatch; /** \details Contains declarations related to the functionality of converting data from the .dwg to the IGES format. */ namespace DWG_IGES_IMPORT { /** \details A class that implements .dwg to .iges conversion functionality. */ class OdIgesImporter : public OdIgesImport { //DOM-IGNORE-BEGIN OdIgesImportPropertiesPtr _properties; OdDAI::ModelPtr m_pModel; OdDAIObjectId m_geometryUnitsContextId; OdDAIObjectId m_mechanicRepresentationPresentationId; //For AP242 only OdDAIObjectId m_globalDraughtingModel; std::map m_referencedObjects; std::map m_objectContexts; std::map m_objectRepresentations; std::map m_layersObjects; std::map, OdDAIObjectId> m_objectsDraughtingModels; OdDAIObjectIds m_geometricUsage; OdDbObjectIdArray m_dimensions; std::map m_colorMap; std::map m_loadedFiles; OdDAI::AuditInfoPtr m_pLogger; Iges::views_visiblePtr m_viewsVisible; //DOM-IGNORE-END public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdIgesImporter); //DOM-IGNORE-END /** \details Creates a new instance of the .dwg-.iges converter with default parameters. */ OdIgesImporter(); /** \details Converts an input .dwg drawing to an IGES file. \returns The ImportResult::success value if the conversion process was successfully finished; otherwise, the method returns an appropriate error code. */ virtual ImportResult import() ODRX_OVERRIDE; /** \details Retrieves the properties of the .dwg to IGES conversion process. \returns A smart pointer to an Rx dictionary object that contains the conversion properties values. */ virtual OdRxDictionaryPtr properties() ODRX_OVERRIDE; /** \details A method that writes converted IGES model into a file with defined file name. \returns eOk if writing is successful; appropriate error code otherwise. */ virtual OdResult writeIgesFile(const OdString &fileName) ODRX_OVERRIDE; private: OdResult initIgesFile(IgesFilePtr pDb); ImportResult importGeometry(); //OdDAIObjectIds importLayerTableEntity(OdDbLayerTable* pTable); OdDAIObjectIds importBlockTableRecordEntity(OdDbBlockTableRecord* pEnt); void appendToViewsVisible(Iges::directory_entry* igesInstance); void appendToViewsVisible(Iges::geometric* igesInstance); void appendToViewsVisible(Iges::annotation* igesInstance); OdDAIObjectId importBlockReferenceEntity(OdDbBlockReference* pBlockReference); }; } #endif // _DWG2IGES_IMPORTER_H_