KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_io_easyeda_parser.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2023 Alex Shvartzkop <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef PCB_IO_EASYEDA_PARSER_H_
22#define PCB_IO_EASYEDA_PARSER_H_
23
25
26#include <cstdint>
27#include <cstring>
28#include <memory>
29#include <vector>
30#include <map>
31#include <optional>
32
33#include <wx/string.h>
34#include <wx/arrstr.h>
35
36#include <json_common.h>
38
39class BOARD;
41
43{
44public:
45 explicit PCB_IO_EASYEDA_PARSER( PROGRESS_REPORTER* aProgressReporter );
47
48 PCB_LAYER_ID LayerToKi( const wxString& aLayer );
49
50 double ScaleSize( double aValue ) override
51 { //
52 return KiROUND( ( aValue * 254000.0 ) / 100.0 ) * 100;
53 }
54
55 void ParseBoard( BOARD* aBoard, const VECTOR2D& aOrigin,
56 std::map<wxString, std::unique_ptr<FOOTPRINT>>& aFootprintMap,
57 wxArrayString aShapes );
58
59 FOOTPRINT* ParseFootprint( const VECTOR2D& aOrigin, const EDA_ANGLE& aOrientation, int aLayer,
60 BOARD* aParent, std::map<wxString, wxString> aParams,
61 std::map<wxString, std::unique_ptr<FOOTPRINT>>& aFootprintMap,
62 wxArrayString aShapes );
63
64 void ParseToBoardItemContainer( BOARD_ITEM_CONTAINER* aContainer, BOARD* aParent,
65 std::map<wxString, wxString> paramMap,
66 std::map<wxString, std::unique_ptr<FOOTPRINT>>& aFootprintMap,
67 wxArrayString shapes );
68};
69
70
71#endif // PCB_IO_EASYEDA_PARSER_H_
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:986
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
PCB_IO_EASYEDA_PARSER(PROGRESS_REPORTER *aProgressReporter)
void ParseToBoardItemContainer(BOARD_ITEM_CONTAINER *aContainer, BOARD *aParent, std::map< wxString, wxString > paramMap, std::map< wxString, std::unique_ptr< FOOTPRINT > > &aFootprintMap, wxArrayString shapes)
FOOTPRINT * ParseFootprint(const VECTOR2D &aOrigin, const EDA_ANGLE &aOrientation, int aLayer, BOARD *aParent, std::map< wxString, wxString > aParams, std::map< wxString, std::unique_ptr< FOOTPRINT > > &aFootprintMap, wxArrayString aShapes)
double ScaleSize(double aValue) override
void ParseBoard(BOARD *aBoard, const VECTOR2D &aOrigin, std::map< wxString, std::unique_ptr< FOOTPRINT > > &aFootprintMap, wxArrayString aShapes)
PCB_LAYER_ID LayerToKi(const wxString &aLayer)
A progress reporter interface for use in multi-threaded environments.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
VECTOR2< double > VECTOR2D
Definition vector2d.h:682