KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_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 <vector>
23#include <wx/string.h>
24
25class SCHEMATIC;
26class SCH_SHEET;
27class SCH_SHEET_LIST;
28class SCH_SHEET_PATH;
30class SCH_SYMBOL;
31class SCH_FIELD;
32class SCH_BITMAP;
33class SCH_JUNCTION;
34class SCH_NO_CONNECT;
36class SCH_SHAPE;
37class SCH_RULE_AREA;
38class SCH_LINE;
39class SCH_TEXT;
40class SCH_TEXTBOX;
41class SCH_TABLE;
42class SCH_GROUP;
43class LIB_SYMBOL;
44class OUTPUTFORMATTER;
45
49{
50public:
51 static constexpr int FORMAT_VERSION = 20260306;
52 static constexpr int SYMBOL_LIB_VERSION = 20251024;
53
55 m_schematic( nullptr ),
56 m_out( nullptr )
57 {
58 }
59
60 void SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic );
61
62 void SaveSymbolLibrary( const wxString& aFileName, const std::vector<LIB_SYMBOL*>& aSymbols );
63
64private:
65 void Format( SCH_SHEET* aSheet );
66
67 void saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchematic, const SCH_SHEET_LIST& aSheetList,
68 bool aForClipboard, const SCH_SHEET_PATH* aRelativePath = nullptr );
69
70 void saveField( SCH_FIELD* aField );
71
72 void saveBitmap( const SCH_BITMAP& aBitmap );
73
74 void saveSheet( SCH_SHEET* aSheet, const SCH_SHEET_LIST& aSheetList );
75
76 void saveJunction( SCH_JUNCTION* aJunction );
77
78 void saveNoConnect( SCH_NO_CONNECT* aNoConnect );
79
80 void saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry );
81
82 void saveShape( SCH_SHAPE* aShape );
83
84 void saveRuleArea( SCH_RULE_AREA* aRuleArea );
85
86 void saveLine( SCH_LINE* aLine );
87
88 void saveText( SCH_TEXT* aText );
89
90 void saveTextBox( SCH_TEXTBOX* aTextBox );
91
92 void saveTable( SCH_TABLE* aTable );
93
94 void saveGroup( SCH_GROUP* aGroup );
95
96 void saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances );
97
100};
Define a library symbol object.
Definition lib_symbol.h:114
An interface used to output 8 bit text in a convenient way.
Definition richio.h:294
Holds all the data relating to one schematic.
Definition schematic.h:149
Object to handle a bitmap image that can be inserted in a schematic.
Definition sch_bitmap.h:36
Base class for a bus or wire entry.
A set of SCH_ITEMs (i.e., without duplicates).
Definition sch_group.h:48
Segment description base class to describe items which have 2 end points (track, wire,...
Definition sch_line.h:39
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48
Schematic symbol object.
Definition sch_symbol.h:73
void saveTextBox(SCH_TEXTBOX *aTextBox)
void saveBitmap(const SCH_BITMAP &aBitmap)
void SaveSchematicFile(const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic)
void saveText(SCH_TEXT *aText)
static constexpr int FORMAT_VERSION
void saveTable(SCH_TABLE *aTable)
void Format(SCH_SHEET *aSheet)
void SaveSymbolLibrary(const wxString &aFileName, const std::vector< LIB_SYMBOL * > &aSymbols)
OUTPUTFORMATTER * m_out
void saveSymbol(SCH_SYMBOL *aSymbol, const SCHEMATIC &aSchematic, const SCH_SHEET_LIST &aSheetList, bool aForClipboard, const SCH_SHEET_PATH *aRelativePath=nullptr)
void saveGroup(SCH_GROUP *aGroup)
void saveLine(SCH_LINE *aLine)
SCHEMATIC * m_schematic
void saveRuleArea(SCH_RULE_AREA *aRuleArea)
static constexpr int SYMBOL_LIB_VERSION
void saveInstances(const std::vector< SCH_SHEET_INSTANCE > &aInstances)
void saveSheet(SCH_SHEET *aSheet, const SCH_SHEET_LIST &aSheetList)
void saveJunction(SCH_JUNCTION *aJunction)
void saveBusEntry(SCH_BUS_ENTRY_BASE *aBusEntry)
void saveNoConnect(SCH_NO_CONNECT *aNoConnect)
void saveField(SCH_FIELD *aField)
void saveShape(SCH_SHAPE *aShape)
A simple container for sheet instance information.