KiCad PCB EDA Suite
Loading...
Searching...
No Matches
export_gencad_writer.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 along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20class BOARD;
21class wxString;
22struct aFile;
23
30{
31public:
33 m_board( aBoard ),
34 m_file( nullptr ),
35 m_flipBottomPads( false ),
36 m_useUniquePins( false ),
37 m_useIndividualShapes( false ),
38 m_storeOriginCoords( false )
39 {
40 }
41
48 bool WriteFile( const wxString& aFullFileName );
49
51 void SetPlotOffet( VECTOR2I aOffset ) { m_gencadOffset = aOffset; }
52
54 void FlipBottomPads( bool aFlip ) { m_flipBottomPads = aFlip; }
55
57 void UsePinNamesUnique( bool aUnique ) { m_useUniquePins = aUnique; }
58
60 void UseIndividualShapes( bool aUnique ) { m_useIndividualShapes = aUnique; }
61
63 void StoreOriginCoordsInFile( bool aStore ) { m_storeOriginCoords = aStore; }
64
65private:
69
80 void createBoardSection();
81
90
98
106 void createRoutesSection();
108
109
116 void createShapesSection();
118
125 void footprintWriteShape( FOOTPRINT* aFootprint, const wxString& aShapeName );
126 const wxString getShapeName( FOOTPRINT* aFootprint );
127
133 double mapXTo( int aX );
134 double mapYTo( int aY );
135
136
137private:
140 FILE* m_file;
141
142 // Export options
147
148 // These are the export origin (the auxiliary axis)
150};
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:317
Export board to GenCAD file format.
void createRoutesSection()
Create the $ROUTES section.
void UseIndividualShapes(bool aUnique)
Make pad shapes unique.
GENCAD_EXPORTER(BOARD *aBoard)
void createTracksInfoData()
Create the "$TRACKS" section.
void createShapesSection()
Create the footprint shape list.
const wxString getShapeName(FOOTPRINT *aFootprint)
void createDevicesSection()
Create the $DEVICES section.
bool createHeaderInfoData()
Creates the header section.
double mapXTo(int aX)
Helper functions to calculate coordinates of footprints in GenCAD values.
void UsePinNamesUnique(bool aUnique)
Make pin names unique.
void StoreOriginCoordsInFile(bool aStore)
Store origin coordinate in GenCAD file.
void FlipBottomPads(bool aFlip)
Flip pad shapes on the bottom side.
void footprintWriteShape(FOOTPRINT *aFootprint, const wxString &aShapeName)
Create the shape of a footprint (SHAPE section)
void SetPlotOffet(VECTOR2I aOffset)
Set the coordinates offset when exporting items.
bool WriteFile(const wxString &aFullFileName)
Export a GenCAD file.
void createComponentsSection()
Create the $COMPONENTS GenCAD section.