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
20#include <stdio.h> // for FILE
21
22#include <wx/string.h>
23
24#include <math/vector2d.h>
25
26class BOARD;
27class FOOTPRINT;
28
35{
36public:
38 m_board( aBoard ),
39 m_file( nullptr ),
40 m_flipBottomPads( false ),
41 m_useUniquePins( false ),
42 m_useIndividualShapes( false ),
43 m_storeOriginCoords( false )
44 {
45 }
46
53 bool WriteFile( const wxString& aFullFileName );
54
56 void SetPlotOffet( VECTOR2I aOffset ) { m_gencadOffset = aOffset; }
57
59 void FlipBottomPads( bool aFlip ) { m_flipBottomPads = aFlip; }
60
62 void UsePinNamesUnique( bool aUnique ) { m_useUniquePins = aUnique; }
63
65 void UseIndividualShapes( bool aUnique ) { m_useIndividualShapes = aUnique; }
66
68 void StoreOriginCoordsInFile( bool aStore ) { m_storeOriginCoords = aStore; }
69
70private:
74
83
85 void createBoardSection();
86
95
101
103
111 void createRoutesSection();
113
114
121 void createShapesSection();
123
130 void footprintWriteShape( FOOTPRINT* aFootprint, const wxString& aShapeName );
131 const wxString getShapeName( FOOTPRINT* aFootprint );
132
138 double mapXTo( int aX );
139 double mapYTo( int aY );
140
141
142private:
145 FILE* m_file;
146
147 // Export options
152
153 // These are the export origin (the auxiliary axis)
155};
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:317
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.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695