/* * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright The KiCad Developers, see AUTHORS.txt for contributors. * Author: SYSUEric . * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef _PCB_IO_ODBPP_H_ #define _PCB_IO_ODBPP_H_ #include #include #include #include #include // PCB_LAYER_ID #include #include #include #include #include "odb_entity.h" class BOARD; class BOARD_ITEM; class EDA_TEXT; class FOOTPRINT; class PROGRESS_REPORTER; class NETINFO_ITEM; class PAD; class PCB_SHAPE; class PCB_VIA; class PROGRESS_REPORTER; class SHAPE_POLY_SET; class SHAPE_SEGMENT; class EDA_DATA; class PCB_IO_ODBPP : public PCB_IO { public: PCB_IO_ODBPP() : PCB_IO( wxS( "ODBPlusPlus" ) ) { m_board = nullptr; } ~PCB_IO_ODBPP() override; void SaveBoard( const wxString& aFileName, BOARD* aBoard, const std::map* aProperties = nullptr ) override; const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override { return IO_BASE::IO_FILE_DESC( _HKI( "ODB++ Production File" ), { "ZIP" }, {}, true, false, true ); } const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override { // No library description for this plugin return IO_BASE::IO_FILE_DESC( wxEmptyString, {} ); } std::vector GetImportedCachedLibraryFootprints() override; long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override { return 0; } // Reading currently disabled bool CanReadBoard( const wxString& aFileName ) const override { return false; } // Reading currently disabled bool CanReadFootprint( const wxString& aFileName ) const override { return false; } // Reading currently disabled bool CanReadLibrary( const wxString& aFileName ) const override { return false; } public: inline std::vector>& GetLayerNameList() { return m_layer_name_list; } inline std::map>>& GetLayerElementsMap() { return m_layer_elements; } inline std::vector>& GetLoadedFootprintList() { return m_loaded_footprints; } inline std::map, std::vector>& GetDrillLayerItemsMap() { return m_drill_layers; } inline std::map, std::vector>& GetAuxilliaryLayerItemsMap() { return m_auxilliary_layers; } inline std::map, std::vector>& GetSlotHolesMap() { return m_slot_holes; } inline std::map& GetPadSubnetMap() { return m_topeprint_subnets; } inline std::map, EDA_DATA::SUB_NET_PLANE*>& GetPlaneSubnetMap() { return m_plane_subnets; } inline std::map& GetViaTraceSubnetMap() { return m_via_trace_subnets; } std::shared_ptr m_writer; bool GenerateFiles( ODB_TREE_WRITER& writer ); bool ExportODB( const wxString& aFileName ); void CreateEntity(); bool CreateDirectories( ODB_TREE_WRITER& writer ); // Frees the memory allocated for the loaded footprints in #m_loaded_footprints. void ClearLoadedFootprints(); static double m_scale; static double m_symbolScale; static int m_sigfig; static std::string m_unitsStr; private: template void Make( Args&&... args ) { std::shared_ptr entity = std::make_shared( std::forward( args )... ); if( entity ) m_entities.push_back( entity ); } BOARD* m_board; std::vector> m_loaded_footprints; std::vector> m_layer_name_list; //, std::vector> m_drill_layers; //, std::vector> m_auxilliary_layers; //, std::vector> m_slot_holes; //>> m_layer_elements; // m_topeprint_subnets; std::map, EDA_DATA::SUB_NET_PLANE*> m_plane_subnets; std::map m_via_trace_subnets; std::vector> m_entities; }; #endif // _PCB_IO_ODBPP_H_