KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_writer_v10.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <wx/string.h>
23#include <lset.h>
24#include <layer_ids.h>
25
26class BOARD;
27class BOARD_ITEM;
28class FOOTPRINT;
29class OUTPUTFORMATTER;
32class PCB_GROUP;
33class PCB_SHAPE;
34class PCB_TARGET;
35class PCB_POINT;
36class PAD;
37class PCB_BARCODE;
38class PCB_TEXT;
39class PCB_TEXTBOX;
40class PCB_TABLE;
41class PCB_GENERATOR;
42class PCB_TRACK;
43class ZONE;
46class EDA_TEXT;
48
52{
53public:
54 static constexpr int FORMAT_VERSION = 20260206;
55
57 m_board( nullptr ),
58 m_out( nullptr ),
59 m_ctl( 0 )
60 {
61 }
62
63 void SaveBoard( const wxString& aFileName, BOARD* aBoard );
64
65 void SaveFootprintFile( const wxString& aFileName, FOOTPRINT* aFootprint );
66
67private:
68 void FormatBoardToFormatter( OUTPUTFORMATTER* aOut, BOARD* aBoard );
69
70 void Format( const BOARD_ITEM* aItem ) const;
71
72 void formatSetup( const BOARD* aBoard ) const;
73
74 void formatGeneral( const BOARD* aBoard ) const;
75
76 void formatBoardLayers( const BOARD* aBoard ) const;
77
78 void formatProperties( const BOARD* aBoard ) const;
79
80 void formatVariants( const BOARD* aBoard ) const;
81
82 void formatHeader( const BOARD* aBoard ) const;
83
84 void formatTeardropParameters( const TEARDROP_PARAMETERS& tdParams ) const;
85
86 void format( const BOARD* aBoard ) const;
87
88 void format( const PCB_DIMENSION_BASE* aDimension ) const;
89
90 void format( const PCB_REFERENCE_IMAGE* aBitmap ) const;
91
92 void format( const PCB_GROUP* aGroup ) const;
93
94 void format( const PCB_SHAPE* aSegment ) const;
95
96 void format( const PCB_TARGET* aTarget ) const;
97
98 void format( const PCB_POINT* aPoint ) const;
99
100 void format( const FOOTPRINT* aFootprint ) const;
101
102 void format( const PAD* aPad ) const;
103
104 void format( const PCB_BARCODE* aBarcode ) const;
105
106 void format( const PCB_TEXT* aText ) const;
107
108 void format( const PCB_TEXTBOX* aTextBox ) const;
109
110 void format( const PCB_TABLE* aTable ) const;
111
112 void format( const PCB_GENERATOR* aGenerator ) const;
113
114 void format( const PCB_TRACK* aTrack ) const;
115
116 void format( const ZONE* aZone ) const;
117
118 void format( const ZONE_LAYER_PROPERTIES& aZoneLayerProperties, int aNestLevel, PCB_LAYER_ID aLayer ) const;
119
120 void formatPolyPts( const SHAPE_LINE_CHAIN& aOutline, const FOOTPRINT* aParentFP = nullptr ) const;
121
122 void formatRenderCache( const EDA_TEXT* aText ) const;
123
124 void formatLayer( PCB_LAYER_ID aLayer, bool aIsKnockout = false ) const;
125
126 void formatLayers( LSET aLayerMask, bool aEnumerateLayers, bool aIsZone = false ) const;
127
130 int m_ctl;
131};
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:94
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
An interface used to output 8 bit text in a convenient way.
Definition richio.h:294
Definition pad.h:61
Abstract dimension API.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:51
A PCB_POINT is a 0-dimensional point that is used to mark a position on a PCB, or more usually a foot...
Definition pcb_point.h:39
Object to handle a bitmap image that can be inserted in a PCB.
static constexpr int FORMAT_VERSION
void formatGeneral(const BOARD *aBoard) const
void FormatBoardToFormatter(OUTPUTFORMATTER *aOut, BOARD *aBoard)
OUTPUTFORMATTER * m_out
void formatProperties(const BOARD *aBoard) const
void formatLayer(PCB_LAYER_ID aLayer, bool aIsKnockout=false) const
void formatLayers(LSET aLayerMask, bool aEnumerateLayers, bool aIsZone=false) const
void formatPolyPts(const SHAPE_LINE_CHAIN &aOutline, const FOOTPRINT *aParentFP=nullptr) const
void formatHeader(const BOARD *aBoard) const
void formatTeardropParameters(const TEARDROP_PARAMETERS &tdParams) const
void formatVariants(const BOARD *aBoard) const
void formatBoardLayers(const BOARD *aBoard) const
void Format(const BOARD_ITEM *aItem) const
void SaveFootprintFile(const wxString &aFileName, FOOTPRINT *aFootprint)
void format(const BOARD *aBoard) const
void SaveBoard(const wxString &aFileName, BOARD *aBoard)
void formatSetup(const BOARD *aBoard) const
void formatRenderCache(const EDA_TEXT *aText) const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
TEARDROP_PARAMETARS is a helper class to handle parameters needed to build teardrops for a board thes...
Handle a list of polygons defining a copper zone.
Definition zone.h:70
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56