KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_writer_v9.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 <memory>
23#include <vector>
24#include <wx/string.h>
25
26class BUS_ALIAS;
27class SCHEMATIC;
28class SCH_SHEET;
29class SCH_SHEET_LIST;
30class SCH_SHEET_PATH;
32class SCH_SYMBOL;
33class SCH_FIELD;
34class SCH_BITMAP;
35class SCH_JUNCTION;
36class SCH_NO_CONNECT;
38class SCH_SHAPE;
39class SCH_RULE_AREA;
40class SCH_LINE;
41class SCH_TEXT;
42class SCH_TEXTBOX;
43class SCH_TABLE;
44class LIB_SYMBOL;
45class OUTPUTFORMATTER;
46
50{
51public:
52 static constexpr int FORMAT_VERSION = 20250114;
53 static constexpr int SYMBOL_LIB_VERSION = 20241209;
54
56 m_schematic( nullptr ),
57 m_out( nullptr )
58 {
59 }
60
61 void SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic );
62
63 void SaveSymbolLibrary( const wxString& aFileName, const std::vector<LIB_SYMBOL*>& aSymbols );
64
65private:
66 void Format( SCH_SHEET* aSheet );
67
68 void saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchematic, const SCH_SHEET_LIST& aSheetList,
69 bool aForClipboard, const SCH_SHEET_PATH* aRelativePath = nullptr );
70
71 void saveField( SCH_FIELD* aField );
72
73 void saveBitmap( const SCH_BITMAP& aBitmap );
74
75 void saveSheet( SCH_SHEET* aSheet, const SCH_SHEET_LIST& aSheetList );
76
77 void saveJunction( SCH_JUNCTION* aJunction );
78
79 void saveNoConnect( SCH_NO_CONNECT* aNoConnect );
80
81 void saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry );
82
83 void saveShape( SCH_SHAPE* aShape );
84
85 void saveRuleArea( SCH_RULE_AREA* aRuleArea );
86
87 void saveLine( SCH_LINE* aLine );
88
89 void saveText( SCH_TEXT* aText );
90
91 void saveTextBox( SCH_TEXTBOX* aTextBox );
92
93 void saveTable( SCH_TABLE* aTable );
94
95 void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias );
96
97 void saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances );
98
101};
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.
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 Format(SCH_SHEET *aSheet)
void SaveSymbolLibrary(const wxString &aFileName, const std::vector< LIB_SYMBOL * > &aSymbols)
void saveRuleArea(SCH_RULE_AREA *aRuleArea)
void saveTable(SCH_TABLE *aTable)
void saveInstances(const std::vector< SCH_SHEET_INSTANCE > &aInstances)
void saveJunction(SCH_JUNCTION *aJunction)
void saveLine(SCH_LINE *aLine)
static constexpr int FORMAT_VERSION
void saveSheet(SCH_SHEET *aSheet, const SCH_SHEET_LIST &aSheetList)
void saveBitmap(const SCH_BITMAP &aBitmap)
void saveShape(SCH_SHAPE *aShape)
OUTPUTFORMATTER * m_out
void SaveSchematicFile(const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic)
void saveField(SCH_FIELD *aField)
void saveBusEntry(SCH_BUS_ENTRY_BASE *aBusEntry)
void saveSymbol(SCH_SYMBOL *aSymbol, const SCHEMATIC &aSchematic, const SCH_SHEET_LIST &aSheetList, bool aForClipboard, const SCH_SHEET_PATH *aRelativePath=nullptr)
void saveBusAlias(std::shared_ptr< BUS_ALIAS > aAlias)
void saveTextBox(SCH_TEXTBOX *aTextBox)
static constexpr int SYMBOL_LIB_VERSION
SCHEMATIC * m_schematic
void saveText(SCH_TEXT *aText)
void saveNoConnect(SCH_NO_CONNECT *aNoConnect)
A simple container for sheet instance information.