30 #include <unordered_set> 32 #include <wx/arrstr.h> 33 #include <wx/chartype.h> 34 #include <wx/gdicmn.h> 35 #include <wx/string.h> 78 #define NB_MAX_SHEET 500 86 std::vector<std::pair<int, wxString>>
Fields;
126 return wxT(
"SCH_SCREEN" );
201 void Clear(
bool aFree =
true );
297 std::function<
void(
SCH_ITEM* )>* aChangedHandler =
nullptr )
const;
328 bool IsJunction(
const wxPoint& aPosition )
const;
368 bool aEndPointOnly =
false )
const;
408 void GetSheets( std::vector<SCH_ITEM*>* aItems )
const;
468 void AddBusAlias( std::shared_ptr<BUS_ALIAS> aAlias );
501 void Show(
int nestLevel, std::ostream& os )
const override;
511 bool doIsJunction(
const wxPoint& aPosition,
bool aBreakCrossings,
512 bool* aHasExplicitJunctionDot,
bool* aHasBusEntry )
const;
552 std::unordered_set< std::shared_ptr< BUS_ALIAS > >
m_aliases;
638 bool aIncludeExclusions =
true );
698 bool HasSchematic(
const wxString& aSchematicFileName );
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void Plot(PLOTTER *aPlotter) const
Plot all the schematic objects to aPlotter.
const wxString & GetFileName() const
bool IsExplicitJunction(const wxPoint &aPosition) const
Indicates that a junction dot is necessary at the given location.
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
void DeleteMarkers(enum MARKER_BASE::TYPEMARKER aMarkerTyp, int aErrorCode, bool aIncludeExclusions=true)
Delete all markers of a particular type and error code.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
std::vector< SYMBOL_INSTANCE_REFERENCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
Holds all the data relating to one schematic.
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 IsTerminalPoint(const wxPoint &aPosition, int aLayer) const
Test if aPosition is a connection point on aLayer.
const std::vector< SYMBOL_INSTANCE_REFERENCE > & GetSymbolInstances() const
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
int GetFileFormatVersionAtLoad() const
void addScreenToList(SCH_SCREEN *aScreen, SCH_SHEET *aSheet)
int ChangeSymbolLibNickname(const wxString &aFrom, const wxString &aTo)
Change all of the symbol library nicknames.
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 SetConnectivityDirty()
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols() const
const TITLE_BLOCK & GetTitleBlock() const
void SetPageSettings(const PAGE_INFO &aPageSettings)
Schematic editor (Eeschema) main window.
Implements an R-tree for fast spatial and type indexing of schematic items.
void EnsureAlternateReferencesExist()
For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any refere...
void SetFileExists(bool aFileExists)
void SetAuxOrigin(const wxPoint &aPosition)
A pure virtual class used to derive REPORTER objects from.
A logical library item identifier and consists of various portions much like a URI.
Define a library symbol object.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
const PAGE_INFO & GetPageSettings() const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
SCH_SCREENS(SCH_SHEET &aSheet)
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
std::vector< SCH_SHEET_PATH > m_clientSheetPathList
The list of sheet paths sharing this screen.
void SetFileReadOnly(bool aIsReadOnly)
SCH_SCREEN(EDA_ITEM *aParent=nullptr)
bool m_isReadOnly
Read only status of the screen file.
bool HasItems(KICAD_T aItemType) const
void UpdateLocalLibSymbolLinks()
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic with the local projec...
std::vector< SCH_SHEET * > m_sheets
int m_fileFormatVersionAtLoad
SCH_LINE * GetBus(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
void DeleteItem(SCH_ITEM *aItem)
Removes aItem from the linked list and deletes the object.
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
Describe the page size and margins of a paper page on which to eventually print or plot.
Handles how to draw a screen (a board, a schematic ...)
SCH_SHEET_PIN * GetSheetPin(const wxPoint &aPosition) const
Test the screen if aPosition is a sheet label object.
const std::vector< SCH_SHEET_INSTANCE > & GetSheetInstances() const
void DeleteAllMarkers(enum MARKER_BASE::TYPEMARKER aMarkerType, bool aIncludeExclusions)
Delete all electronic rules check markers of aMarkerType from all the screens in the list.
bool IsJunction(const wxPoint &aPosition) const
Test if a junction is required for the items at aPosition on the screen.
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
void BuildClientSheetPathList()
built the list of sheet paths sharing a screen for each screen in use
bool doIsJunction(const wxPoint &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
bool HasSchematic(const wxString &aSchematicFileName)
Check if one of the schematics in the list of screens is aSchematicFileName.
std::map< wxString, LIB_SYMBOL * > & GetLibSymbols()
Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
bool HasNoFullyDefinedLibIds()
Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.
Object to parser s-expression symbol library and schematic file formats.
const EE_RTREE & Items() const
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void SetFileFormatVersionAtLoad(int aVersion)
void DeleteMarker(SCH_MARKER *aMarker)
Delete a specific marker.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
void ClearBusAliases()
Remove all bus alias definitions.
static bool ClassOf(const EDA_ITEM *aItem)
void FreeDrawList()
Free all the items from the schematic associated with the screen.
A SCH_PLUGIN derivation for loading schematic files using the new s-expression file format.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
bool IsExplicitJunctionNeeded(const wxPoint &aPosition) const
Indicates that a junction dot is necessary at the given location, and does not yet exist.
const KIID & GetUuid() const
void AddLibSymbol(LIB_SYMBOL *aLibSymbol)
Add aLibSymbol to the library symbol map.
size_t CountConnectedItems(const wxPoint &aPos, bool aTestJunctions) const
void buildScreenList(SCH_SHEET *aSheet)
Base plotter engine class.
std::unordered_set< std::shared_ptr< BUS_ALIAS > > GetBusAliases() const
Return a list of bus aliases defined in this screen.
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic from the project SYMB...
bool IsExplicitJunctionAllowed(const wxPoint &aPosition) const
Indicates that a juction dot may be placed at the given location.
void Print(const RENDER_SETTINGS *aSettings)
Print all the items in the screen to aDC.
void AddBusAlias(std::shared_ptr< BUS_ALIAS > aAlias)
Add a bus alias definition (and transfers ownership of the pointer).
Segment description base class to describe items which have 2 end points (track, wire,...
SCH_LINE * GetLine(const wxPoint &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Return a line item located at aPosition.
std::vector< SCH_SCREEN * > m_screens
void Append(SCH_ITEM *aItem)
SCH_LINE * GetWire(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
SCHEMATIC * Schematic() const
KIID m_uuid
A unique identifier for each schematic file.
SCH_SCREENS(SCH_SHEET *aSheet)
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
SCH_SHEET * GetSheet(unsigned int aIndex) const
A base class for most all the KiCad significant classes used in schematics and boards.
SCH_TEXT * GetLabel(const wxPoint &aPosition, int aAccuracy=0) const
Return a label item located at aPosition.
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear the annotation for the symbols in aSheetPath on the screen.
int ReplaceDuplicateTimeStamps()
Test all sheet and symbol objects in the schematic for duplicate time stamps and replaces them as nec...
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
bool CanCauseCaseSensitivityIssue(const wxString &aSchematicFileName) const
Check aSchematicFileName for a potential file name case sensitivity issue.
SCH_SCREEN * GetScreen(unsigned int aIndex) const
void ClearDrawingState()
Clear the state flags of all the items in the screen.
void Update(SCH_ITEM *aItem)
Update aItem's bounding box in the tree.
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
void ClearAnnotationOfNewSheetPaths(SCH_SHEET_LIST &aInitialSheetPathList)
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and n...
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
BASE_SCREEN class implementation.
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
void UpdateSymbolLinks(REPORTER *aReporter=nullptr)
Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in the full schematic.
LIB_PIN * GetPin(const wxPoint &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
Test the screen for a symbol pin item at aPosition.
const wxPoint & GetAuxOrigin() const
size_t GetLibNicknames(wxArrayString &aLibNicknames)
Fetch all of the symbol library nicknames into aLibNicknames.
std::vector< std::pair< int, wxString > > Fields
Base class for any item which can be embedded within the SCHEMATIC container class,...
void GetHierarchicalItems(std::vector< SCH_ITEM * > *aItems) const
Add all schematic sheet and symbol objects in the screen to aItems.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
bool CheckIfOnDrawList(const SCH_ITEM *aItem) const
virtual wxString GetClass() const override
Return the class name.
std::set< SCH_ITEM * > MarkConnections(SCH_LINE *aSegment)
Return all wires and junctions connected to aSegment which are not connected any symbol pin.