KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_screen.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 (C) 2009 Jean-Pierre Charras, [email protected]
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef SCREEN_H
26#define SCREEN_H
27
28#include <memory>
29#include <stddef.h>
30#include <unordered_set>
31#include <vector>
32#include <wx/arrstr.h>
33#include <wx/chartype.h>
34#include <wx/gdicmn.h>
35#include <wx/string.h>
36
37#include <base_screen.h>
38#include <core/typeinfo.h>
39#include <kiid.h>
40#include <kiway_holder.h>
41#include <layer_ids.h>
42#include <marker_base.h>
43#include <page_info.h>
44#include <template_fieldnames.h>
45#include <title_block.h>
46
47#include <lib_id.h>
48#include <sch_reference_list.h>
49#include <sch_rtree.h>
50#include <sch_sheet.h>
51#include <sch_label.h>
52#include <sch_sheet_path.h> // SCH_SYMBOL_INSTANCE
53
54class BUS_ALIAS;
55class EDA_ITEM;
56class LIB_SYMBOL;
57class SCH_COMMIT;
58class SCH_PIN;
59class SCH_SYMBOL;
60class SCH_LINE;
61class SCH_LABEL_BASE;
62class PLOTTER;
63class REPORTER;
64class SCH_IO_ALTIUM;
65class SCH_IO_PADS;
66class SCH_EDIT_FRAME;
67class SCH_SHEET_LIST;
71
78
79
81{
83 int Unit;
85
88
89 std::vector<std::pair<FIELD_T, wxString>> Fields;
90
92 Unit( 1 ),
93 Convert( 1 ),
94 KeepSymbol( false ),
95 PlaceAllUnits( false )
96 {
97 }
98};
99
101{
102public:
103 SCH_SCREEN( EDA_ITEM* aParent = nullptr );
104
105 ~SCH_SCREEN();
106
107 SCHEMATIC* Schematic() const;
108
119 EE_RTREE& Items() { return m_rtree; }
120 const EE_RTREE& Items() const { return m_rtree; }
121
122 bool IsEmpty() const
123 {
124 return m_rtree.empty();
125 }
126
127 bool HasItems( KICAD_T aItemType ) const;
128
129 bool HasSheets() const { return HasItems( SCH_SHEET_T ); }
130
131 static bool ClassOf( const EDA_ITEM* aItem );
132
133 virtual wxString GetClass() const override
134 {
135 return wxT( "SCH_SCREEN" );
136 }
137
138 void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; }
140
141 const PAGE_INFO& GetPageSettings() const { return m_paper; }
142 void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }
143
152 void SetFileName( const wxString& aFileName );
153
154 const wxString& GetFileName() const { return m_fileName; }
155
156 void SetFileReadOnly( bool aIsReadOnly ) { m_isReadOnly = aIsReadOnly; }
157 bool IsReadOnly() const { return m_isReadOnly; }
158
159 void SetFileExists( bool aFileExists ) { m_fileExists = aFileExists; }
160 bool FileExists() const { return m_fileExists; }
161
162 const VECTOR2I& GetAuxOrigin() const { return m_aux_origin; }
163 void SetAuxOrigin( const VECTOR2I& aPosition ) { m_aux_origin = aPosition; }
164
165 const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
166
167 void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
168
169 void DecRefCount();
170 void IncRefCount();
171 int GetRefCount() const { return m_refCount; }
172
174
188 std::vector<SCH_SHEET_PATH>& GetClientSheetPaths()
189 {
191 }
192
193 void Append( SCH_ITEM* aItem, bool aUpdateLibSymbol = true );
194
205 void Append( SCH_SCREEN* aScreen );
206
210 void Clear( bool aFree = true );
211
217 void FreeDrawList();
218
227 SCH_ITEM* GetItem( const VECTOR2I& aPosition, int aAccuracy = 0,
228 KICAD_T aType = SCH_LOCATE_ANY_T ) const;
229
245 void UpdateSymbolLinks( REPORTER* aReporter = nullptr );
246
252
261 void Plot( PLOTTER* aPlotter, const SCH_PLOT_OPTS& aPlotOpts ) const;
262
270 void Plot( PLOTTER* aPlotter, const SCH_PLOT_OPTS& aPlotOpts,
271 const std::vector<SCH_ITEM*>& aItems ) const;
272
281 bool Remove( SCH_ITEM* aItem, bool aUpdateLibSymbol = true );
282
289 void Update( SCH_ITEM* aItem, bool aUpdateLibSymbol = true );
290
299 void DeleteItem( SCH_ITEM* aItem );
300
301 bool CheckIfOnDrawList( const SCH_ITEM* aItem ) const;
302
309 void TestDanglingEnds( const SCH_SHEET_PATH* aPath = nullptr,
310 std::function<void( SCH_ITEM* )>* aChangedHandler = nullptr ) const;
311
319 std::set<SCH_ITEM*> MarkConnections( SCH_ITEM* aItem, bool aSecondPass );
320
324 void ClearDrawingState();
325
326 size_t CountConnectedItems( const VECTOR2I& aPos, bool aTestJunctions ) const;
327
342 bool IsJunction( const VECTOR2I& aPosition ) const;
343
349 bool IsExplicitJunction( const VECTOR2I& aPosition ) const;
350
356 bool IsExplicitJunctionNeeded( const VECTOR2I& aPosition ) const;
357
359 SPIN_STYLE aDefaultOrientation,
360 const SCH_SHEET_PATH* aSheet ) const;
366 bool IsExplicitJunctionAllowed( const VECTOR2I& aPosition ) const;
367
376 bool IsTerminalPoint( const VECTOR2I& aPosition, int aLayer ) const;
377
387 SCH_PIN* GetPin( const VECTOR2I& aPosition, SCH_SYMBOL** aSymbol = nullptr,
388 bool aEndPointOnly = false ) const;
389
396 SCH_SHEET_PIN* GetSheetPin( const VECTOR2I& aPosition ) const;
397
406 void ClearAnnotation( SCH_SHEET_PATH* aSheetPath, bool aResetPrefix );
407
418
424 void GetHierarchicalItems( std::vector<SCH_ITEM*>* aItems ) const;
425
430 void GetSheets( std::vector<SCH_ITEM*>* aItems ) const;
431
442 SCH_LINE* GetLine( const VECTOR2I& aPosition, int aAccuracy = 0, int aLayer = LAYER_NOTES,
443 SCH_LINE_TEST_T aSearchType = ENTIRE_LENGTH_T ) const;
444
445 SCH_LINE* GetWire( const VECTOR2I& aPosition, int aAccuracy = 0,
446 SCH_LINE_TEST_T aSearchType = ENTIRE_LENGTH_T ) const
447 {
448 return GetLine( aPosition, aAccuracy, LAYER_WIRE, aSearchType );
449 }
450
451 SCH_LINE* GetBus( const VECTOR2I& aPosition, int aAccuracy = 0,
452 SCH_LINE_TEST_T aSearchType = ENTIRE_LENGTH_T ) const
453 {
454 return GetLine( aPosition, aAccuracy, LAYER_BUS, aSearchType );
455 }
456
464 std::vector<SCH_LINE*> GetBusesAndWires( const VECTOR2I& aPosition,
465 bool aIgnoreEndpoints = false ) const;
466
472 std::vector<VECTOR2I> GetConnections() const;
473
480 std::vector<VECTOR2I> GetNeededJunctions( const std::deque<EDA_ITEM*>& aItems ) const;
481
489 SCH_LABEL_BASE* GetLabel( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
490
497 const std::map<wxString, LIB_SYMBOL*>& GetLibSymbols() const { return m_libSymbols; }
498
508 void AddLibSymbol( LIB_SYMBOL* aLibSymbol );
509
515 void FixupEmbeddedData();
516
520 void AddBusAlias( std::shared_ptr<BUS_ALIAS> aAlias );
521
522 const std::vector<SCH_SYMBOL_INSTANCE>& GetSymbolInstances() const
523 {
524 return m_symbolInstances;
525 }
526
527 const std::vector<SCH_SHEET_INSTANCE>& GetSheetInstances() const
528 {
529 return m_sheetInstances;
530 }
531
532 const KIID& GetUuid() const { return m_uuid; }
533
534 void AssignNewUuid() { m_uuid = KIID(); }
535
540
546
551
553
560 bool InProjectPath() const;
561
562#if defined(DEBUG)
563 void Show( int nestLevel, std::ostream& os ) const override;
564#endif
565
569 void MigrateSimModels();
570
583 void PruneOrphanedSymbolInstances( const wxString& aProjectName,
584 const SCH_SHEET_LIST& aValidSheetPaths );
585
598 void PruneOrphanedSheetInstances( const wxString& aProjectName,
599 const SCH_SHEET_LIST& aValidSheetPaths );
600
604 std::set<wxString> GetSheetNames() const;
605
615
622 wxString GroupsSanityCheck( bool repair = false );
623
629 wxString GroupsSanityCheckInternal( bool repair );
630
631 std::set<wxString> GetVariantNames() const;
632
633 void DeleteVariant( const wxString& aVariantName, SCH_COMMIT* aCommit = nullptr );
634
635 void RenameVariant( const wxString& aOldName, const wxString& aNewName,
636 SCH_COMMIT* aCommit = nullptr );
637
638 void CopyVariant( const wxString& aSourceVariant, const wxString& aNewVariant,
639 SCH_COMMIT* aCommit = nullptr );
640
641private:
642 friend SCH_EDIT_FRAME; // Only to populate m_symbolInstances.
643 friend SCH_IO_KICAD_SEXPR_PARSER; // Only to load instance information from schematic file.
644 friend SCH_IO_KICAD_SEXPR; // Only to save the loaded instance information to schematic file.
648
649 bool doIsJunction( const VECTOR2I& aPosition, bool aBreakCrossings,
650 bool* aHasExplicitJunctionDot, bool* aHasBusEntry ) const;
651
652 void clearLibSymbols();
653
667 size_t getLibSymbolNameMatches( const SCH_SYMBOL& aSymbol, std::vector<wxString>& aMatches );
668
669public:
670 bool IsZoomInitialized() const { return m_zoomInitialized; }
671
677
678private:
679 wxString m_fileName; // File used to load the screen.
681 int m_refCount; // Number of sheets referencing this screen.
682 // Delete when it goes to zero.
690 std::vector<SCH_SHEET_PATH> m_clientSheetPathList;
691
692
693 PAGE_INFO m_paper; // The size of the paper to print or plot on.
695 VECTOR2I m_aux_origin; // Origin used for drill & place files by Pcbnew.
697
698 int m_modification_sync; // Inequality with SYMBOL_LIBS::GetModificationHash()
699 // will trigger ResolveAll().
700
701 bool m_zoomInitialized; // Set to true once the zoom value is initialized with
702 // `InitZoom()`.
703
705
708
710 std::map<wxString, LIB_SYMBOL*> m_libSymbols;
711
726 std::vector<SCH_SYMBOL_INSTANCE> m_symbolInstances;
727 std::vector<SCH_SHEET_INSTANCE> m_sheetInstances;
728
736};
737
738
749{
750public:
751 SCH_SCREENS( SCH_SHEET* aSheet );
752 SCH_SCREENS( SCH_SHEET& aSheet ) : SCH_SCREENS( &aSheet ) {}
753 ~SCH_SCREENS();
754 size_t GetCount() const { return m_screens.size(); }
757 SCH_SCREEN* GetScreen( unsigned int aIndex ) const;
758 SCH_SHEET* GetSheet( unsigned int aIndex ) const;
759
768 void ClearAnnotationOfNewSheetPaths( SCH_SHEET_LIST& aInitialSheetPathList );
769
780
787 void DeleteAllMarkers( enum MARKER_BASE::MARKER_T aMarkerType, bool aIncludeExclusions );
788
792 void DeleteMarkers( enum MARKER_BASE::MARKER_T aMarkerTyp, int aErrorCode,
793 bool aIncludeExclusions = true );
794
798 void DeleteMarker( SCH_MARKER* aMarker );
799
811 void UpdateSymbolLinks( REPORTER* aReporter = nullptr );
812
813 void ClearEditFlags();
814
826
833 size_t GetLibNicknames( wxArrayString& aLibNicknames );
834
842 int ChangeSymbolLibNickname( const wxString& aFrom, const wxString& aTo );
843
853 bool HasSchematic( const wxString& aSchematicFileName );
854
859
864
870
871 void PruneOrphanedSymbolInstances( const wxString& aProjectName,
872 const SCH_SHEET_LIST& aValidSheetPaths );
873
874 void PruneOrphanedSheetInstances( const wxString& aProjectName,
875 const SCH_SHEET_LIST& aValidSheetPaths );
876
878
879 std::set<wxString> GetVariantNames() const;
880
881 void DeleteVariant( const wxString& aVariantName, SCH_COMMIT* aCommit = nullptr );
882
883 void RenameVariant( const wxString& aOldName, const wxString& aNewName,
884 SCH_COMMIT* aCommit = nullptr );
885
886 void CopyVariant( const wxString& aSourceVariant, const wxString& aNewVariant,
887 SCH_COMMIT* aCommit = nullptr );
888
889private:
890 void addScreenToList( SCH_SCREEN* aScreen, SCH_SHEET* aSheet );
891 void buildScreenList( SCH_SHEET* aSheet);
892
893 std::vector< SCH_SCREEN* > m_screens;
894 std::vector< SCH_SHEET* > m_sheets;
895 unsigned int m_index;
896};
897
898#endif /* SCREEN_H */
BASE_SCREEN class implementation.
BASE_SCREEN(EDA_ITEM *aParent, KICAD_T aType=SCREEN_T)
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:99
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:41
Implement an R-tree for fast spatial and type indexing of schematic items.
Definition sch_rtree.h:40
Definition kiid.h:49
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:49
Define a library symbol object.
Definition lib_symbol.h:83
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition page_info.h:79
Base plotter engine class.
Definition plotter.h:136
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
Holds all the data relating to one schematic.
Definition schematic.h:88
Schematic editor (Eeschema) main window.
Object to parser s-expression symbol library and schematic file formats.
A SCH_IO derivation for loading schematic files using the new s-expression file format.
A SCH_IO derivation for loading PADS Logic schematic files.
Definition sch_io_pads.h:40
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:168
Segment description base class to describe items which have 2 end points (track, wire,...
Definition sch_line.h:42
SCH_SCREEN * GetNext()
unsigned int m_index
Definition sch_screen.h:895
std::vector< SCH_SHEET * > m_sheets
Definition sch_screen.h:894
SCH_SCREEN * GetScreen(unsigned int aIndex) const
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in the full schematic.
void DeleteMarker(SCH_MARKER *aMarker)
Delete a specific marker.
void DeleteMarkers(enum MARKER_BASE::MARKER_T aMarkerTyp, int aErrorCode, bool aIncludeExclusions=true)
Delete all markers of a particular type and error code.
void buildScreenList(SCH_SHEET *aSheet)
void FixLegacyPowerSymbolMismatches()
Fix legacy power symbols that have mismatched value text fields and invisible power pin names.
void CopyVariant(const wxString &aSourceVariant, const wxString &aNewVariant, SCH_COMMIT *aCommit=nullptr)
SCH_SCREEN * GetFirst()
void DeleteAllMarkers(enum MARKER_BASE::MARKER_T aMarkerType, bool aIncludeExclusions)
Delete all electronic rules check markers of aMarkerType from all the screens in the list.
void PruneOrphanedSheetInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
int ChangeSymbolLibNickname(const wxString &aFrom, const wxString &aTo)
Change all of the symbol library nicknames.
void RenameVariant(const wxString &aOldName, const wxString &aNewName, SCH_COMMIT *aCommit=nullptr)
SCH_SCREENS(SCH_SHEET *aSheet)
SCH_SCREENS(SCH_SHEET &aSheet)
Definition sch_screen.h:752
void BuildClientSheetPathList()
Build the list of sheet paths sharing a screen for each screen in use.
bool HasSymbolFieldNamesWithWhiteSpace() const
size_t GetCount() const
Definition sch_screen.h:754
void ClearAnnotationOfNewSheetPaths(SCH_SHEET_LIST &aInitialSheetPathList)
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and n...
void PruneOrphanedSymbolInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
bool HasNoFullyDefinedLibIds()
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
void ClearEditFlags()
SCH_SHEET * GetSheet(unsigned int aIndex) const
int ReplaceDuplicateTimeStamps()
Test all sheet and symbol objects in the schematic for duplicate time stamps and replaces them as nec...
std::set< wxString > GetVariantNames() const
std::vector< SCH_SCREEN * > m_screens
Definition sch_screen.h:893
void DeleteVariant(const wxString &aVariantName, SCH_COMMIT *aCommit=nullptr)
bool HasSchematic(const wxString &aSchematicFileName)
Check if one of the schematics in the list of screens is aSchematicFileName.
size_t GetLibNicknames(wxArrayString &aLibNicknames)
Fetch all of the symbol library nicknames into aLibNicknames.
void SetLegacySymbolInstanceData()
Update the symbol value and footprint instance data for legacy designs.
void addScreenToList(SCH_SCREEN *aScreen, SCH_SHEET *aSheet)
void SetFileFormatVersionAtLoad(int aVersion)
Definition sch_screen.h:138
const PAGE_INFO & GetPageSettings() const
Definition sch_screen.h:141
std::set< wxString > GetVariantNames() const
void DeleteVariant(const wxString &aVariantName, SCH_COMMIT *aCommit=nullptr)
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition sch_screen.h:710
SCH_PIN * GetPin(const VECTOR2I &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
Test the screen for a symbol pin item at aPosition.
bool m_fileExists
Flag to indicate the file associated with this screen has been created.
Definition sch_screen.h:707
void ClearDrawingState()
Clear the state flags of all the items in the screen.
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
Definition sch_screen.h:727
SCH_LINE * GetLine(const VECTOR2I &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Return a line item located at aPosition.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition sch_screen.h:167
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
void AddLibSymbol(LIB_SYMBOL *aLibSymbol)
Add aLibSymbol to the library symbol map.
bool HasSymbolFieldNamesWithWhiteSpace() const
void AddBusAlias(std::shared_ptr< BUS_ALIAS > aAlias)
Add a bus alias definition.
void FixLegacyPowerSymbolMismatches()
Fix legacy power symbols that have mismatched value text fields and invisible power pin names.
bool HasItems(KICAD_T aItemType) const
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
bool HasInstanceDataFromOtherProjects() const
Check symbols for instance data from other projects.
void PruneOrphanedSymbolInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
Remove all invalid symbol instance data in this screen object for the project defined by aProjectName...
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
Definition sch_screen.h:188
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic from the project #SYM...
SCH_LINE * GetWire(const VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition sch_screen.h:445
std::set< SCH_ITEM * > MarkConnections(SCH_ITEM *aItem, bool aSecondPass)
Return all wires and junctions connected to aItem which are not connected any symbol pin or all graph...
std::set< wxString > GetSheetNames() const
const EE_RTREE & Items() const
Definition sch_screen.h:120
TITLE_BLOCK m_titles
Definition sch_screen.h:694
void TestDanglingEnds(const SCH_SHEET_PATH *aPath=nullptr, std::function< void(SCH_ITEM *)> *aChangedHandler=nullptr) const
Test all of the connectable objects in the schematic for unused connection points.
void EnsureAlternateReferencesExist()
For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any refere...
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition sch_screen.h:142
bool AllSymbolDefaultInstancesNotSet()
Check all symbol default instance to see if they are not set yet.
void PruneOrphanedSheetInstances(const wxString &aProjectName, const SCH_SHEET_LIST &aValidSheetPaths)
Remove all invalid sheet instance data in this screen object for the project defined by aProjectName ...
std::vector< SCH_LINE * > GetBusesAndWires(const VECTOR2I &aPosition, bool aIgnoreEndpoints=false) const
Return buses and wires passing through aPosition.
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols() const
Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this...
Definition sch_screen.h:497
wxString GroupsSanityCheckInternal(bool repair)
int m_modification_sync
Definition sch_screen.h:698
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
Definition sch_screen.h:676
const VECTOR2I & GetAuxOrigin() const
Definition sch_screen.h:162
void SetAuxOrigin(const VECTOR2I &aPosition)
Definition sch_screen.h:163
bool IsExplicitJunction(const VECTOR2I &aPosition) const
Indicate that a junction dot is necessary at the given location.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Definition sch_screen.h:119
int m_fileFormatVersionAtLoad
Definition sch_screen.h:680
const wxString & GetFileName() const
Definition sch_screen.h:154
void DecRefCount()
const KIID & GetUuid() const
Definition sch_screen.h:532
friend SCH_IO_KICAD_SEXPR_PARSER
Definition sch_screen.h:643
SCH_ITEM * GetItem(const VECTOR2I &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
bool IsExplicitJunctionAllowed(const VECTOR2I &aPosition) const
Indicate that a junction dot may be placed at the given location.
bool IsZoomInitialized() const
Definition sch_screen.h:670
void clearLibSymbols()
wxString m_fileName
Definition sch_screen.h:679
bool IsTerminalPoint(const VECTOR2I &aPosition, int aLayer) const
Test if aPosition is a connection point on aLayer.
bool IsReadOnly() const
Definition sch_screen.h:157
void UpdateLocalLibSymbolLinks()
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic with the local projec...
void IncRefCount()
friend SCH_IO_ALTIUM
Definition sch_screen.h:645
friend TEST_SCH_SCREEN_FIXTURE
Definition sch_screen.h:647
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
static bool ClassOf(const EDA_ITEM *aItem)
void SetLegacySymbolInstanceData()
Update the symbol value and footprint instance data for legacy designs.
const std::vector< SCH_SYMBOL_INSTANCE > & GetSymbolInstances() const
Definition sch_screen.h:522
SCH_LINE * GetBus(const VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition sch_screen.h:451
bool Remove(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Remove aItem from the schematic associated with this screen.
std::vector< SCH_SHEET_PATH > m_clientSheetPathList
The list of sheet paths sharing this screen.
Definition sch_screen.h:690
SCH_SCREEN(EDA_ITEM *aParent=nullptr)
friend SCH_IO_KICAD_SEXPR
Definition sch_screen.h:644
SCHEMATIC * Schematic() const
EE_RTREE m_rtree
Definition sch_screen.h:696
void FixupEmbeddedData()
After loading a file from disk, the library symbols do not yet contain the full data for their embedd...
bool HasSheets() const
Definition sch_screen.h:129
int GetFileFormatVersionAtLoad() const
Definition sch_screen.h:139
VECTOR2I m_aux_origin
Definition sch_screen.h:695
void CopyVariant(const wxString &aSourceVariant, const wxString &aNewVariant, SCH_COMMIT *aCommit=nullptr)
void GetHierarchicalItems(std::vector< SCH_ITEM * > *aItems) const
Add all schematic sheet and symbol objects in the screen to aItems.
bool IsExplicitJunctionNeeded(const VECTOR2I &aPosition) const
Indicate that a junction dot is necessary at the given location, and does not yet exist.
SCH_SHEET_PIN * GetSheetPin(const VECTOR2I &aPosition) const
Test the screen if aPosition is a sheet label object.
wxString GroupsSanityCheck(bool repair=false)
Consistency check of internal m_groups structure.
bool InProjectPath() const
Check if the schematic file is in the current project path.
const TITLE_BLOCK & GetTitleBlock() const
Definition sch_screen.h:165
void RenameVariant(const wxString &aOldName, const wxString &aNewName, SCH_COMMIT *aCommit=nullptr)
void FreeDrawList()
Free all the items from the schematic associated with the screen.
friend SCH_IO_PADS
Definition sch_screen.h:646
void Plot(PLOTTER *aPlotter, const SCH_PLOT_OPTS &aPlotOpts) const
Plot all the schematic objects to aPlotter.
virtual wxString GetClass() const override
Return the class name.
Definition sch_screen.h:133
friend SCH_EDIT_FRAME
Definition sch_screen.h:642
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Update aItem's bounding box in the tree.
void SetConnectivityDirty()
bool m_zoomInitialized
Definition sch_screen.h:701
std::vector< VECTOR2I > GetNeededJunctions(const std::deque< EDA_ITEM * > &aItems) const
Return the unique set of points belonging to aItems where a junction is needed.
bool FileExists() const
Definition sch_screen.h:160
int GetRefCount() const
Definition sch_screen.h:171
void AssignNewUuid()
Definition sch_screen.h:534
PAGE_INFO m_paper
Definition sch_screen.h:693
bool IsJunction(const VECTOR2I &aPosition) const
Test if a junction is required for the items at aPosition on the screen.
const std::vector< SCH_SHEET_INSTANCE > & GetSheetInstances() const
Definition sch_screen.h:527
bool m_isReadOnly
Read only status of the screen file.
Definition sch_screen.h:704
void GetSheets(std::vector< SCH_ITEM * > *aItems) const
Similar to Items().OfType( SCH_SHEET_T ), but return the sheets in a deterministic order (L-R,...
bool CheckIfOnDrawList(const SCH_ITEM *aItem) const
std::vector< VECTOR2I > GetConnections() const
Collect a unique list of all possible connection points in the schematic.
SPIN_STYLE GetLabelOrientationForPoint(const VECTOR2I &aPosition, SPIN_STYLE aDefaultOrientation, const SCH_SHEET_PATH *aSheet) const
KIID m_uuid
A unique identifier for each schematic file.
Definition sch_screen.h:735
std::vector< SCH_SYMBOL_INSTANCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
Definition sch_screen.h:726
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
Clear the annotation for the symbols in aSheetPath on the screen.
void SetFileReadOnly(bool aIsReadOnly)
Definition sch_screen.h:156
bool doIsJunction(const VECTOR2I &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
size_t CountConnectedItems(const VECTOR2I &aPos, bool aTestJunctions) const
void MigrateSimModels()
Migrate any symbols having V6 simulation models to their V7 equivalents.
void DeleteItem(SCH_ITEM *aItem)
Remove aItem from the linked list and deletes the object.
size_t getLibSymbolNameMatches(const SCH_SYMBOL &aSymbol, std::vector< wxString > &aMatches)
Return a list of potential library symbol matches for aSymbol.
bool IsEmpty() const
Definition sch_screen.h:122
void SetFileExists(bool aFileExists)
Definition sch_screen.h:159
SCH_LABEL_BASE * GetLabel(const VECTOR2I &aPosition, int aAccuracy=0) const
Return a label item located at aPosition.
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...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
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:76
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition title_block.h:41
@ LAYER_WIRE
Definition layer_ids.h:452
@ LAYER_NOTES
Definition layer_ids.h:467
@ LAYER_BUS
Definition layer_ids.h:453
SCH_LINE_TEST_T
Definition sch_screen.h:73
@ ENTIRE_LENGTH_T
Definition sch_screen.h:74
@ EXCLUDE_END_POINTS_T
Definition sch_screen.h:76
@ END_POINTS_ONLY_T
Definition sch_screen.h:75
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
bool PlaceAllUnits
Definition sch_screen.h:87
std::vector< std::pair< FIELD_T, wxString > > Fields
Definition sch_screen.h:89
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:78
@ SCH_LOCATE_ANY_T
Definition typeinfo.h:203
@ SCH_SHEET_T
Definition typeinfo.h:179
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695