KiCad PCB EDA Suite
SCH_SCREEN Class Reference

#include <sch_screen.h>

Inheritance diagram for SCH_SCREEN:
BASE_SCREEN EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 SCH_SCREEN (EDA_ITEM *aParent=nullptr)
 Constructor. More...
 
 ~SCH_SCREEN ()
 
SCHEMATICSchematic () const
 
EE_RTREEItems ()
 
const EE_RTREEItems () const
 
bool IsEmpty ()
 
bool HasItems (KICAD_T aItemType) const
 
bool HasSheets () const
 
virtual wxString GetClass () const override
 Return the class name. More...
 
const PAGE_INFOGetPageSettings () const
 
void SetPageSettings (const PAGE_INFO &aPageSettings)
 
void SetFileName (const wxString &aFileName)
 
const wxString & GetFileName () const
 
const wxPoint & GetAuxOrigin () const
 
void SetAuxOrigin (const wxPoint &aPosition)
 
const TITLE_BLOCKGetTitleBlock () const
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock)
 
void DecRefCount ()
 
void IncRefCount ()
 
int GetRefCount () const
 
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths ()
 
void Append (SCH_ITEM *aItem)
 
void Append (SCH_SCREEN *aScreen)
 Copy the contents of aScreen into this SCH_SCREEN object. More...
 
void Clear (bool aFree=true)
 Delete all draw items and clears the project settings. More...
 
void FreeDrawList ()
 Free all the items from the schematic associated with the screen. More...
 
SCH_ITEMGetItem (const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T)
 Check aPosition within a distance of aAccuracy for items of type aFilter. More...
 
void Place (SCH_EDIT_FRAME *frame, wxDC *DC)
 
void UpdateSymbolLinks (REPORTER *aReporter=nullptr)
 Initialize the LIB_PART reference for each SCH_COMPONENT found in this schematic from the project SYMBOL_LIB_TABLE. More...
 
void UpdateLocalLibSymbolLinks ()
 Initialize the LIB_PART reference for each SCH_COMPONENT found in this schematic with the local project library symbols. More...
 
void Print (RENDER_SETTINGS *aSettings)
 Print all the items in the screen to aDC. More...
 
void Plot (PLOTTER *aPlotter)
 Plot all the schematic objects to aPlotter. More...
 
bool Remove (SCH_ITEM *aItem)
 Remove aItem from the schematic associated with this screen. More...
 
void Update (SCH_ITEM *aItem)
 Updates aItem's bounding box in the tree. More...
 
void DeleteItem (SCH_ITEM *aItem)
 Removes aItem from the linked list and deletes the object. More...
 
bool CheckIfOnDrawList (SCH_ITEM *st)
 
bool TestDanglingEnds (const SCH_SHEET_PATH *aPath=nullptr)
 Test all of the connectable objects in the schematic for unused connection points. More...
 
std::set< SCH_ITEM * > MarkConnections (SCH_LINE *aSegment)
 Return all wires and junctions connected to aSegment which are not connected any component pin. More...
 
void ClearDrawingState ()
 Clear the state flags of all the items in the screen. More...
 
size_t CountConnectedItems (const wxPoint &aPos, bool aTestJunctions)
 
bool IsJunctionNeeded (const wxPoint &aPosition, bool aNew=false)
 Test if a junction is required for the items at aPosition on the screen. More...
 
bool IsTerminalPoint (const wxPoint &aPosition, int aLayer)
 Test if aPosition is a connection point on aLayer. More...
 
LIB_PINGetPin (const wxPoint &aPosition, SCH_COMPONENT **aSymbol=NULL, bool aEndPointOnly=false)
 Test the screen for a component pin item at aPosition. More...
 
SCH_SHEET_PINGetSheetLabel (const wxPoint &aPosition)
 Test the screen if aPosition is a sheet label object. More...
 
void ClearAnnotation (SCH_SHEET_PATH *aSheetPath)
 Clear the annotation for the components in aSheetPath on the screen. More...
 
void EnsureAlternateReferencesExist ()
 For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any reference related sharing this screen (i.e. More...
 
void GetHierarchicalItems (std::vector< SCH_ITEM * > *aItems)
 Add all schematic sheet and component objects in the screen to aItems. More...
 
void GetSheets (std::vector< SCH_ITEM * > *aItems)
 Similar to GetItems().OfType( SCH_SHEET_T ), but return the sheets in a deterministic order (L-R, T-B) for sheet numbering. More...
 
SCH_LINEGetLine (const wxPoint &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
 Return a line item located at aPosition. More...
 
SCH_LINEGetWire (const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
 
SCH_LINEGetBus (const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
 
SCH_TEXTGetLabel (const wxPoint &aPosition, int aAccuracy=0)
 Return a label item located at aPosition. More...
 
std::map< wxString, LIB_PART * > & GetLibSymbols ()
 Fetch a list of unique LIB_PART object pointers required to properly render each SCH_COMPONENT in this schematic. More...
 
void AddLibSymbol (LIB_PART *aLibSymbol)
 Add aLibSymbol to the the library symbol map. More...
 
void AddBusAlias (std::shared_ptr< BUS_ALIAS > aAlias)
 Adds a bus alias definition (and transfers ownership of the pointer) More...
 
void ClearBusAliases ()
 Removes all bus alias definitions. More...
 
std::unordered_set< std::shared_ptr< BUS_ALIAS > > GetBusAliases ()
 Returns a list of bus aliases defined in this screen. More...
 
const std::vector< SYMBOL_INSTANCE_REFERENCE > & GetSymbolInstances () const
 
const std::vector< SCH_SHEET_INSTANCE > & GetSheetInstances () const
 
void InitDataPoints (const wxSize &aPageSizeInternalUnits)
 
void SetModify ()
 
void ClrModify ()
 
void SetSave ()
 
void ClrSave ()
 
bool IsModify () const
 
bool IsSave () const
 
int GetPageCount () const
 
void SetPageCount (int aPageCount)
 
int GetVirtualPageNumber () const
 
void SetVirtualPageNumber (int aPageNumber)
 
const wxString & GetPageNumber () const
 
void SetPageNumber (const wxString &aPageNumber)
 
KICAD_T Type () const
 Function Type() More...
 
EDA_ITEMGetParent () const
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag)
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
virtual bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const
 Function HitTest tests if aPosition is contained within or on the bounding box of an item. More...
 
virtual bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
virtual const EDA_RECT GetBoundingBox () const
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
virtual wxPoint GetPosition () const
 
virtual void SetPosition (const wxPoint &aPos)
 
virtual const wxPoint GetFocusPosition () const
 Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual EDA_ITEMClone () const
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
virtual SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
virtual wxString GetSelectMenuText (EDA_UNITS aUnits) const
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
virtual BITMAP_DEF GetMenuImage () const
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

wxPoint m_DrawOrg
 offsets for drawing the circuit on the screen More...
 
VECTOR2D m_LocalOrigin
 Relative Screen cursor coordinate (on grid) in user units. More...
 
wxPoint m_StartVisu
 Coordinates in drawing units of the current view position (upper left corner of device) More...
 
bool m_Center
 Center on screen. More...
 
VECTOR2D m_ScrollCenter
 Current scroll center point in logical units. More...
 
bool m_Initialized
 
const KIID m_Uuid
 

Static Public Attributes

static wxString m_PageLayoutDescrFileName
 the name of the page layout descr file, or emty to used the default pagelayout More...
 

Protected Member Functions

bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Protected Attributes

int m_pageCount
 The number of BASE_SCREEN objects in this design. More...
 
int m_virtualPageNumber
 An integer based page number used for printing a range of pages. More...
 
wxString m_pageNumber
 A user defined string page number used for printing and plotting. More...
 
STATUS_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_flags
 

Private Member Functions

void clearLibSymbols ()
 

Private Attributes

wxString m_fileName
 
int m_refCount
 
std::vector< SCH_SHEET_PATHm_clientSheetPathList
 The list of sheet paths sharing this screen. More...
 
PAGE_INFO m_paper
 
TITLE_BLOCK m_titles
 
wxPoint m_aux_origin
 
EE_RTREE m_rtree
 
int m_modification_sync
 
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
 List of bus aliases stored in this screen. More...
 
std::map< wxString, LIB_PART * > m_libSymbols
 Library symbols required for this schematic. More...
 
std::vector< SYMBOL_INSTANCE_REFERENCEm_symbolInstances
 The list of symbol instances loaded from the schematic file. More...
 
std::vector< SCH_SHEET_INSTANCEm_sheetInstances
 
friend SCH_EDIT_FRAME
 
friend SCH_SEXPR_PARSER
 
friend SCH_SEXPR_PLUGIN
 

Detailed Description

Definition at line 93 of file sch_screen.h.

Constructor & Destructor Documentation

◆ SCH_SCREEN()

SCH_SCREEN::SCH_SCREEN ( EDA_ITEM aParent = nullptr)

Constructor.

Definition at line 67 of file sch_screen.cpp.

67  :
68  BASE_SCREEN( aParent, SCH_SCREEN_T ),
69  m_paper( wxT( "A4" ) )
70 {
72 
73  m_refCount = 0;
74 
75  // Suitable for schematic only. For symbol_editor and viewlib, must be set to true
76  m_Center = false;
77 
78  InitDataPoints( m_paper.GetSizeIU() );
79 }
int m_refCount
Definition: sch_screen.h:99
int m_modification_sync
Definition: sch_screen.h:116
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:48
PAGE_INFO m_paper
Definition: sch_screen.h:111
bool m_Center
Center on screen.
Definition: base_screen.h:95
BASE_SCREEN(EDA_ITEM *aParent, KICAD_T aType=SCREEN_T)
Definition: base_screen.cpp:35

References BASE_SCREEN::InitDataPoints(), BASE_SCREEN::m_Center, m_modification_sync, m_paper, and m_refCount.

◆ ~SCH_SCREEN()

SCH_SCREEN::~SCH_SCREEN ( )

Definition at line 82 of file sch_screen.cpp.

83 {
85  FreeDrawList();
86 }
void clearLibSymbols()
Definition: sch_screen.cpp:98
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:215

References clearLibSymbols(), and FreeDrawList().

Member Function Documentation

◆ AddBusAlias()

void SCH_SCREEN::AddBusAlias ( std::shared_ptr< BUS_ALIAS aAlias)

Adds a bus alias definition (and transfers ownership of the pointer)

Definition at line 1100 of file sch_screen.cpp.

1101 {
1102  m_aliases.insert( aAlias );
1103 }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:120

References m_aliases.

Referenced by SCH_LEGACY_PLUGIN::LoadContent(), and SCH_SEXPR_PARSER::parseBusAlias().

◆ AddLibSymbol()

void SCH_SCREEN::AddLibSymbol ( LIB_PART aLibSymbol)

Add aLibSymbol to the the library symbol map.

The symbol is mapped to the result of LIB_ID::Format(). If a symbol is already mapped, the existing symbol is replaced with aLibSymbol. The screen object takes ownership of the pointer.

Parameters
aLibSymbolA pointer the LIB_PART to be added to the symbol map.

Definition at line 1082 of file sch_screen.cpp.

1083 {
1084  wxCHECK( aLibSymbol, /* void */ );
1085 
1086  wxString libSymbolName = aLibSymbol->GetLibId().Format().wx_str();
1087 
1088  auto it = m_libSymbols.find( libSymbolName );
1089 
1090  if( it != m_libSymbols.end() )
1091  {
1092  delete it->second;
1093  m_libSymbols.erase( it );
1094  }
1095 
1096  m_libSymbols[libSymbolName] = aLibSymbol;
1097 }
LIB_ID GetLibId() const override
UTF8 Format() const
Definition: lib_id.cpp:237
wxString wx_str() const
Definition: utf8.cpp:51
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:123

References LIB_ID::Format(), LIB_PART::GetLibId(), m_libSymbols, and UTF8::wx_str().

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ Append() [1/2]

void SCH_SCREEN::Append ( SCH_ITEM aItem)

Definition at line 129 of file sch_screen.cpp.

130 {
131  if( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T )
132  {
133  // Ensure the item can reach the SCHEMATIC through this screen
134  aItem->SetParent( this );
135 
136  if( aItem->Type() == SCH_COMPONENT_T )
137  {
138  SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( aItem );
139 
140  if( symbol->GetPartRef() )
141  {
142  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
143 
144  if( it == m_libSymbols.end() )
145  {
147  new LIB_PART( *symbol->GetPartRef() );
148  }
149  else
150  {
151  // The original library symbol may have changed since the last time
152  // it was added to the schematic. If it has changed, then a new name
153  // must be created for the library symbol list to prevent all of the
154  // other schematic symbols referencing that library symbol from changing.
155  LIB_PART* foundSymbol = it->second;
156 
157  if( *foundSymbol != *symbol->GetPartRef() )
158  {
159  int cnt = 1;
160  wxString newName;
161 
162  newName.Printf( "%s_%d", symbol->GetLibId().Format().wx_str(), cnt );
163 
164  while( m_libSymbols.find( newName ) != m_libSymbols.end() )
165  {
166  cnt += 1;
167  newName.Printf( "%s_%d", symbol->GetLibId().Format().wx_str(), cnt );
168  }
169 
170  symbol->SetSchSymbolLibraryName( newName );
171  m_libSymbols[newName] = new LIB_PART( *symbol->GetPartRef() );
172  }
173  }
174  }
175  }
176 
177  m_rtree.insert( aItem );
179  }
180 }
void insert(SCH_ITEM *aItem)
Function Insert() Inserts an item into the tree.
Definition: sch_rtree.h:62
wxString GetSchSymbolLibraryName() const
void SetSchSymbolLibraryName(const wxString &aName)
The name of the symbol in the schematic library symbol list.
int m_modification_sync
Definition: sch_screen.h:116
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:184
EE_RTREE m_rtree
Definition: sch_screen.h:114
Define a library symbol object.
std::unique_ptr< LIB_PART > & GetPartRef()
UTF8 Format() const
Definition: lib_id.cpp:237
wxString wx_str() const
Definition: utf8.cpp:51
Schematic symbol object.
Definition: sch_component.h:79
const LIB_ID & GetLibId() const
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:123

References LIB_ID::Format(), SCH_COMPONENT::GetLibId(), SCH_COMPONENT::GetPartRef(), SCH_COMPONENT::GetSchSymbolLibraryName(), EE_RTREE::insert(), m_libSymbols, m_modification_sync, m_rtree, SCH_COMPONENT_T, SCH_FIELD_T, SCH_SHEET_PIN_T, EDA_ITEM::SetParent(), SCH_COMPONENT::SetSchSymbolLibraryName(), EDA_ITEM::Type(), and UTF8::wx_str().

Referenced by SCH_EAGLE_PLUGIN::addImplicitConnections(), Append(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckNoConnects(), SCH_LEGACY_PLUGIN::LoadContent(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), SCH_EAGLE_PLUGIN::loadInstance(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), SCH_EAGLE_PLUGIN::loadSegments(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseComponent(), SCH_ALTIUM_PLUGIN::ParseJunction(), SCH_ALTIUM_PLUGIN::ParseLabel(), SCH_ALTIUM_PLUGIN::ParseLine(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseNoERC(), SCH_ALTIUM_PLUGIN::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseWire(), SCH_EDITOR_CONTROL::Paste(), DIALOG_CHANGE_SYMBOLS::processSymbol(), CONNECTION_SUBGRAPH::ResolveDrivers(), SCH_EDIT_FRAME::ResolveERCExclusions(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestMultiunitFootprints(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestSimilarLabels(), ERC_TESTER::TestTextVars(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), Update(), SCH_EDIT_FRAME::UpdateSymbolFromEditor(), and UpdateSymbolLinks().

◆ Append() [2/2]

void SCH_SCREEN::Append ( SCH_SCREEN aScreen)

Copy the contents of aScreen into this SCH_SCREEN object.

Warning
The contents of Screen cannot contain any duplicate sheet names or any hierarchy recursion issues or bad things will happen.
Parameters
aScreenis the screen to append to this one.
Returns
false if there are any duplicate sheet names or any hierarchy recursion issues the calling this method or KiCad will crash.

Definition at line 183 of file sch_screen.cpp.

184 {
185  wxCHECK_RET( aScreen, "Invalid screen object." );
186 
187  // No need to descend the hierarchy. Once the top level screen is copied, all of it's
188  // children are copied as well.
189  for( auto aItem : aScreen->m_rtree )
190  Append( aItem );
191 
192  aScreen->Clear( false );
193 }
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
Definition: sch_screen.cpp:196
EE_RTREE m_rtree
Definition: sch_screen.h:114
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:129

References Append(), Clear(), and m_rtree.

◆ CheckIfOnDrawList()

bool SCH_SCREEN::CheckIfOnDrawList ( SCH_ITEM st)

Definition at line 304 of file sch_screen.cpp.

305 {
306  return m_rtree.contains( aItem, true );
307 }
EE_RTREE m_rtree
Definition: sch_screen.h:114
bool contains(const SCH_ITEM *aItem, bool aRobust=false) const
Determine if a given item exists in the tree.
Definition: sch_rtree.h:122

References EE_RTREE::contains(), and m_rtree.

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList().

◆ ClassOf()

static bool SCH_SCREEN::ClassOf ( const EDA_ITEM aItem)
inlinestatic

Definition at line 171 of file sch_screen.h.

172  {
173  return aItem && SCH_SCREEN_T == aItem->Type();
174  }
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References SCH_SCREEN_T, and EDA_ITEM::Type().

◆ Clear()

void SCH_SCREEN::Clear ( bool  aFree = true)

Delete all draw items and clears the project settings.

Definition at line 196 of file sch_screen.cpp.

197 {
198  if( aFree )
199  {
200  FreeDrawList();
201  clearLibSymbols();
202  }
203  else
204  {
205  m_rtree.clear();
206  }
207 
208  // Clear the project settings
210 
211  m_titles.Clear();
212 }
void clearLibSymbols()
Definition: sch_screen.cpp:98
void Clear()
Definition: title_block.h:116
TITLE_BLOCK m_titles
Definition: sch_screen.h:112
int m_pageCount
The number of BASE_SCREEN objects in this design.
Definition: base_screen.h:63
EE_RTREE m_rtree
Definition: sch_screen.h:114
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:215
void clear()
Function RemoveAll() Removes all items from the RTree.
Definition: sch_rtree.h:108
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:71

References EE_RTREE::clear(), TITLE_BLOCK::Clear(), clearLibSymbols(), FreeDrawList(), BASE_SCREEN::m_pageCount, m_rtree, m_titles, and BASE_SCREEN::m_virtualPageNumber.

Referenced by Append(), SCH_EDIT_FRAME::doCloseWindow(), and SCH_EDITOR_CONTROL::Paste().

◆ ClearAnnotation()

void SCH_SCREEN::ClearAnnotation ( SCH_SHEET_PATH aSheetPath)

Clear the annotation for the components in aSheetPath on the screen.

Parameters
aSheetPathThe sheet path of the component annotation to clear. If NULL then the entire hierarchy is cleared.

Definition at line 922 of file sch_screen.cpp.

923 {
924 
925  for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) )
926  {
927  SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( item );
928 
929  symbol->ClearAnnotation( aSheetPath );
930  }
931 }
EE_RTREE & Items()
Definition: sch_screen.h:159
Schematic symbol object.
Definition: sch_component.h:79
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath)
Clear exiting component annotation.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References SCH_COMPONENT::ClearAnnotation(), Items(), and SCH_COMPONENT_T.

Referenced by SCH_SCREENS::ClearAnnotationOfNewSheetPaths(), and SCH_EDIT_TOOL::Properties().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearBusAliases()

void SCH_SCREEN::ClearBusAliases ( )
inline

Removes all bus alias definitions.

Definition at line 483 of file sch_screen.h.

484  {
485  m_aliases.clear();
486  }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:120

References m_aliases.

◆ ClearDrawingState()

void SCH_SCREEN::ClearDrawingState ( )

Clear the state flags of all the items in the screen.

Definition at line 832 of file sch_screen.cpp.

833 {
834  for( auto item : Items() )
835  item->ClearTempFlags();
836 }
EE_RTREE & Items()
Definition: sch_screen.h:159

References Items().

Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), and EE_SELECTION_TOOL::SelectConnection().

◆ ClearEditFlags()

◆ ClearFlags()

void EDA_ITEM::ClearFlags ( STATUS_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 221 of file eda_item.h.

221 { m_flags &= ~aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:164

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), FOOTPRINT::BuildPolyCourtyards(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_TOOLS::CreateFootprint(), LIB_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), EE_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::narrowSelection(), FOOTPRINT_EDITOR_TOOLS::NewFootprint(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), LIB_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), BOARD_COMMIT::Push(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ clearLibSymbols()

void SCH_SCREEN::clearLibSymbols ( )
private

Definition at line 98 of file sch_screen.cpp.

99 {
100  for( auto libSymbol : m_libSymbols )
101  delete libSymbol.second;
102 
103  m_libSymbols.clear();
104 }
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:123

References m_libSymbols.

Referenced by Clear(), UpdateSymbolLinks(), and ~SCH_SCREEN().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 233 of file eda_item.h.

234  {
236  DO_NOT_DRAW );
237  }
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: eda_item.h:114
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: eda_item.h:103
#define CANDIDATE
flag indicating that the structure is connected
Definition: eda_item.h:116
#define DO_NOT_DRAW
Used to disable draw function.
Definition: eda_item.h:118
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: eda_item.h:111
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:221
#define ENDPOINT
ends. (Used to support dragging.)
Definition: eda_item.h:112
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: eda_item.h:117

References CANDIDATE, EDA_ITEM::ClearFlags(), DO_NOT_DRAW, ENDPOINT, IS_LINKED, SKIP_STRUCT, STARTPOINT, and TEMP_SELECTED.

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 154 of file view_item.h.

155  {
157  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:162
#define NULL

References KIGFX::VIEW_ITEM::m_viewPrivData, and NULL.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Function Clone creates a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented in FP_ZONE, ZONE, SCH_COMPONENT, PAD, FOOTPRINT, SCH_SHEET, CENTER_DIMENSION, SCH_HIERLABEL, LEADER, VIA, ORTHOGONAL_DIMENSION, SCH_GLOBALLABEL, SCH_LABEL, ALIGNED_DIMENSION, ARC, PCB_SHAPE, SCH_TEXT, LIB_PIN, SCH_LINE, TRACK, FP_TEXT, SCH_SHEET_PIN, SCH_BUS_BUS_ENTRY, SCH_FIELD, LIB_FIELD, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, FP_SHAPE, LIB_ARC, PCB_TEXT, PCB_GROUP, SCH_JUNCTION, SCH_NO_CONNECT, LIB_POLYLINE, SCH_MARKER, LIB_TEXT, PCB_TARGET, LIB_CIRCLE, LIB_BEZIER, LIB_RECTANGLE, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 97 of file eda_item.cpp.

98 {
99  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
100  wxT( ". Bad programmer!" ) );
101 }
#define NULL
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass(), and NULL.

Referenced by DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), LIB_DRAWING_TOOLS::DrawShape(), LIB_EDIT_TOOL::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), DIMENSION_BASE::GetEffectiveShape(), LIB_PART::LIB_PART(), SYMBOL_EDIT_FRAME::LoadOneSymbol(), new_clone(), LIB_PART::operator=(), LIB_EDIT_TOOL::Paste(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), LIB_PART::SetConversion(), LIB_PART::SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), COMMIT::Stage(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClrModify()

◆ ClrSave()

void BASE_SCREEN::ClrSave ( )
inlineinherited

Definition at line 123 of file base_screen.h.

123 { m_flagSave = false; }
bool m_flagSave
Indicates automatic file save.
Definition: base_screen.h:45

References BASE_SCREEN::m_flagSave.

Referenced by SCH_EDIT_FRAME::SaveEEFile(), and PCB_EDIT_FRAME::SavePcbFile().

◆ CountConnectedItems()

size_t SCH_SCREEN::CountConnectedItems ( const wxPoint &  aPos,
bool  aTestJunctions 
)

Definition at line 908 of file sch_screen.cpp.

909 {
910  size_t count = 0;
911 
912  for( SCH_ITEM* item : Items() )
913  {
914  if( ( item->Type() != SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
915  count++;
916  }
917 
918  return count;
919 }
EE_RTREE & Items()
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References Items(), and SCH_JUNCTION_T.

◆ DecRefCount()

void SCH_SCREEN::DecRefCount ( )

Definition at line 113 of file sch_screen.cpp.

114 {
115  wxCHECK_RET( m_refCount != 0,
116  wxT( "Screen reference count already zero. Bad programmer!" ) );
117  m_refCount--;
118 }
int m_refCount
Definition: sch_screen.h:99

References m_refCount.

Referenced by SCH_SHEET::SetScreen(), and SCH_SHEET::~SCH_SHEET().

◆ DeleteItem()

void SCH_SCREEN::DeleteItem ( SCH_ITEM aItem)

Removes aItem from the linked list and deletes the object.

If aItem is a schematic sheet label, it is removed from the screen associated with the sheet that contains the label to be deleted.

Parameters
aItemThe schematic object to be deleted from the screen.

Definition at line 279 of file sch_screen.cpp.

280 {
281  wxCHECK_RET( aItem, wxT( "Cannot delete invalid item from screen." ) );
282 
283  // Markers are not saved in the file, no need to flag as modified.
284  // TODO: Maybe we should have a listing somewhere of items that aren't saved?
285  if( aItem->Type() != SCH_MARKER_T )
286  SetModify();
287 
288  Remove( aItem );
289 
290  if( aItem->Type() == SCH_SHEET_PIN_T )
291  {
292  // This structure is attached to a sheet, get the parent sheet object.
293  SCH_SHEET_PIN* sheetPin = (SCH_SHEET_PIN*) aItem;
294  SCH_SHEET* sheet = sheetPin->GetParent();
295  wxCHECK_RET( sheet, wxT( "Sheet label parent not properly set, bad programmer!" ) );
296  sheet->RemovePin( sheetPin );
297  return;
298  }
299 
300  delete aItem;
301 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:241
SCH_SHEET * GetParent() const
Get the parent sheet object of this sheet pin.
Definition: sch_sheet.h:169
void RemovePin(SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:291
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:85
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:219
void SetModify()
Definition: base_screen.h:120
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References SCH_SHEET_PIN::GetParent(), Remove(), SCH_SHEET::RemovePin(), SCH_MARKER_T, SCH_SHEET_PIN_T, BASE_SCREEN::SetModify(), and EDA_ITEM::Type().

◆ EnsureAlternateReferencesExist()

void SCH_SCREEN::EnsureAlternateReferencesExist ( )

For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any reference related sharing this screen (i.e.

thie list of components), an entry for each screen path must exist. This function creates missing entries, using as default reference the current reference field and unit number Note: m_clientSheetPathList must be up to date ( built by SCH_SCREENS::BuildClientSheetPathList() )

Definition at line 934 of file sch_screen.cpp.

935 {
936  if( GetClientSheetPaths().size() <= 1 ) // No need for alternate reference
937  return;
938 
939  for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) )
940  {
941  SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( item );
942 
943  // Add (when not existing) all sheet path entries
944  for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() )
945  symbol->AddSheetPathReferenceEntryIfMissing( sheet.Path() );
946  }
947 }
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
EE_RTREE & Items()
Definition: sch_screen.h:159
Schematic symbol object.
Definition: sch_component.h:79
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Definition: sch_screen.h:206
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
bool AddSheetPathReferenceEntryIfMissing(const KIID_PATH &aSheetPath)
Add an instance to the alternate references list (m_instanceReferences), if this entry does not alrea...

References SCH_COMPONENT::AddSheetPathReferenceEntryIfMissing(), GetClientSheetPaths(), Items(), and SCH_COMPONENT_T.

Referenced by SCH_SCREENS::ClearAnnotationOfNewSheetPaths().

◆ FreeDrawList()

void SCH_SCREEN::FreeDrawList ( )

Free all the items from the schematic associated with the screen.

This does not delete any sub hierarchies.

Definition at line 215 of file sch_screen.cpp.

216 {
217  // We don't know which order we will encounter dependent items (e.g. pins or fields), so
218  // we store the items to be deleted until we've fully cleared the tree before deleting
219  std::vector<SCH_ITEM*> delete_list;
220 
221  std::copy_if( m_rtree.begin(), m_rtree.end(), std::back_inserter( delete_list ),
222  []( SCH_ITEM* aItem )
223  {
224  return ( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T );
225  } );
226 
227  m_rtree.clear();
228 
229  for( auto item : delete_list )
230  delete item;
231 }
iterator end()
Definition: sch_rtree.h:253
EE_RTREE m_rtree
Definition: sch_screen.h:114
iterator begin()
Definition: sch_rtree.h:248
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
void clear()
Function RemoveAll() Removes all items from the RTree.
Definition: sch_rtree.h:108

References EE_RTREE::begin(), EE_RTREE::clear(), EE_RTREE::end(), m_rtree, SCH_FIELD_T, and SCH_SHEET_PIN_T.

Referenced by Clear(), and ~SCH_SCREEN().

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 84 of file inspectable.h.

85  {
87  TYPE_ID thisType = TYPE_HASH( *this );
88  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
89  return object ? aProperty->getter( object ) : wxAny();
90  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:64
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:41
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual wxAny getter(void *aObject) const =0
Provides class metadata.
Definition: property_mgr.h:61
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [2/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 93 of file inspectable.h.

94  {
96  TYPE_ID thisType = TYPE_HASH( *this );
97  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
98  return object ? aProperty->get<T>( object ) : T();
99  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:64
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:41
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:61
T get(void *aObject)
Definition: property.h:275
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [3/3]

template<typename T >
boost::optional<T> INSPECTABLE::Get ( const wxString &  aProperty)
inlineinherited

Definition at line 102 of file inspectable.h.

103  {
105  TYPE_ID thisType = TYPE_HASH( *this );
106  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
107  boost::optional<T> ret;
108 
109  if( prop )
110  {
111  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
112 
113  if( object )
114  ret = prop->get<T>( object );
115  }
116 
117  return ret;
118  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:64
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:41
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:61
T get(void *aObject)
Definition: property.h:275
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetAuxOrigin()

const wxPoint& SCH_SCREEN::GetAuxOrigin ( ) const
inline

Definition at line 188 of file sch_screen.h.

188 { return m_aux_origin; }
wxPoint m_aux_origin
Definition: sch_screen.h:113

References m_aux_origin.

◆ GetBoundingBox()

const EDA_RECT EDA_ITEM::GetBoundingBox ( ) const
virtualinherited

Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.

This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.

Reimplemented in BOARD, PAD, CENTER_DIMENSION, SCH_HIERLABEL, SCH_SHEET, SCH_GLOBALLABEL, SCH_COMPONENT, SCH_LABEL, WS_DRAW_ITEM_BITMAP, WS_DRAW_ITEM_TEXT, PCB_SHAPE, WS_DRAW_ITEM_PAGE, SCH_TEXT, DIMENSION_BASE, GERBER_DRAW_ITEM, LIB_PART, WS_DRAW_ITEM_RECT, LIB_PIN, LIB_ITEM, WS_DRAW_ITEM_POLYPOLYGONS, FOOTPRINT, FP_TEXT, SCH_LINE, LIB_FIELD, PCB_GROUP, WS_DRAW_ITEM_LINE, ZONE, PCB_TEXT, TRACK, SCH_FIELD, WS_DRAW_ITEM_BASE, PCB_MARKER, SCH_BITMAP, SCH_PIN, SCH_BUS_ENTRY_BASE, PCB_TARGET, GBR_LAYOUT, LIB_POLYLINE, LIB_ARC, SCH_NO_CONNECT, LIB_TEXT, LIB_BEZIER, SCH_MARKER, LIB_RECTANGLE, SCH_JUNCTION, and LIB_CIRCLE.

Definition at line 89 of file eda_item.cpp.

90 {
91  // return a zero-sized box per default. derived classes should override
92  // this
93  return EDA_RECT( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
94 }
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

Referenced by CN_ITEM::BBox(), EE_RTREE::contains(), FOOTPRINT::CoverageRatio(), LIB_ITEM::GetBoundingBox(), GetBoundingBoxes(), GERBVIEW_SELECTION::GetCenter(), BOARD_ITEM::GetCenter(), SCH_MOVE_TOOL::getConnectedDragItems(), getRect(), EE_SELECTION_TOOL::GuessSelectionCandidates(), EE_RTREE::insert(), insideArea(), SCH_EDIT_TOOL::Mirror(), SCH_EAGLE_PLUGIN::moveLabels(), DRC_RTREE::QueryColliding(), EE_RTREE::remove(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), GERBVIEW_SELECTION::ViewBBox(), and EDA_ITEM::ViewBBox().

◆ GetBus()

SCH_LINE* SCH_SCREEN::GetBus ( const wxPoint &  aPosition,
int  aAccuracy = 0,
SCH_LINE_TEST_T  aSearchType = ENTIRE_LENGTH_T 
)
inline

Definition at line 440 of file sch_screen.h.

442  {
443  return GetLine( aPosition, aAccuracy, LAYER_BUS, aSearchType );
444  }
SCH_LINE * GetLine(const wxPoint &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
Return a line item located at aPosition.

References GetLine(), and LAYER_BUS.

Referenced by IsTerminalPoint(), and CONNECTION_GRAPH::updateItemConnectivity().

◆ GetBusAliases()

std::unordered_set< std::shared_ptr<BUS_ALIAS> > SCH_SCREEN::GetBusAliases ( )
inline

Returns a list of bus aliases defined in this screen.

Definition at line 491 of file sch_screen.h.

492  {
493  return m_aliases;
494  }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:120

References m_aliases.

Referenced by SCH_SEXPR_PLUGIN::Format(), and SCH_LEGACY_PLUGIN::Format().

◆ GetClass()

virtual wxString SCH_SCREEN::GetClass ( ) const
inlineoverridevirtual

Return the class name.

Returns
wxString

Reimplemented from BASE_SCREEN.

Definition at line 176 of file sch_screen.h.

177  {
178  return wxT( "SCH_SCREEN" );
179  }

◆ GetClientSheetPaths()

std::vector<SCH_SHEET_PATH>& SCH_SCREEN::GetClientSheetPaths ( )
inline
Returns
the sheet paths sharing this screen if 1 this screen is not in a complex hierarchy: the reference field can be used to store the component reference if > 1 this screen is in a complex hierarchy, and components must have a full alternate reference management

Definition at line 206 of file sch_screen.h.

207  {
208  return m_clientSheetPathList;
209  }
std::vector< SCH_SHEET_PATH > m_clientSheetPathList
The list of sheet paths sharing this screen.
Definition: sch_screen.h:108

References m_clientSheetPathList.

Referenced by SCH_SCREENS::BuildClientSheetPathList(), EnsureAlternateReferencesExist(), and SCH_EDIT_FRAME::SaveProject().

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 225 of file eda_item.h.

226  {
227  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
229 
230  return m_flags & mask;
231  }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:107
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:115
#define IS_MOVED
Item being moved.
Definition: eda_item.h:105
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:108
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:119
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110
STATUS_FLAGS m_flags
Definition: eda_item.h:164
#define IS_NEW
New item, just created.
Definition: eda_item.h:106

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, IS_WIRE_IMAGE, EDA_ITEM::m_flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), LIB_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_COMPONENT::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), PAD_TOOL::recombinePad(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), and SCH_EDIT_FRAME::TrimWire().

◆ GetFileName()

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in BOARD, PCB_SHAPE, and TRACK.

Definition at line 333 of file eda_item.h.

333 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:325

References EDA_ITEM::GetPosition().

Referenced by PCB_BASE_FRAME::FocusOnItem(), and SCH_EDIT_FRAME::FocusOnItem().

◆ GetHierarchicalItems()

void SCH_SCREEN::GetHierarchicalItems ( std::vector< SCH_ITEM * > *  aItems)

Add all schematic sheet and component objects in the screen to aItems.

Parameters
aItemsHierarchical item list to fill.

Definition at line 950 of file sch_screen.cpp.

951 {
952  static KICAD_T hierarchicalTypes[] = { SCH_COMPONENT_T, SCH_SHEET_T, SCH_GLOBAL_LABEL_T, EOT };
953 
954  for( SCH_ITEM* item : Items() )
955  {
956  if( item->IsType( hierarchicalTypes ) )
957  aItems->push_back( item );
958  }
959 }
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
EE_RTREE & Items()
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References EOT, Items(), SCH_COMPONENT_T, SCH_GLOBAL_LABEL_T, and SCH_SHEET_T.

◆ GetItem()

SCH_ITEM * SCH_SCREEN::GetItem ( const wxPoint &  aPosition,
int  aAccuracy = 0,
KICAD_T  aType = SCH_LOCATE_ANY_T 
)

Check aPosition within a distance of aAccuracy for items of type aFilter.

Parameters
aPositionPosition in drawing units.
aAccuracyThe maximum distance within Position to check for an item.
aTypeThe type of item to find.
Returns
The item found that meets the search criteria or NULL if none found.

Definition at line 310 of file sch_screen.cpp.

311 {
312  EDA_RECT bbox;
313  bbox.SetOrigin( aPosition );
314  bbox.Inflate( aAccuracy );
315 
316  for( auto item : Items().Overlapping( aType, bbox ) )
317  {
318  if( item->HitTest( aPosition, aAccuracy ) )
319  return item;
320  }
321 
322  return nullptr;
323 }
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:131
EE_RTREE & Items()
Definition: sch_screen.h:159
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363

References EDA_RECT::Inflate(), Items(), and EDA_RECT::SetOrigin().

Referenced by SCH_EDIT_TOOL::DoDelete(), IsTerminalPoint(), and SCH_DRAWING_TOOLS::SingleClickPlace().

◆ GetLabel()

SCH_TEXT * SCH_SCREEN::GetLabel ( const wxPoint &  aPosition,
int  aAccuracy = 0 
)

Return a label item located at aPosition.

Parameters
aPositionThe wxPoint to test for label items.
aAccuracyAmount to inflate the item hit test bounding box.
Returns
The SCH_TEXT* of the label item found at aPosition or NULL if item not found.

Definition at line 1059 of file sch_screen.cpp.

1060 {
1061  for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
1062  {
1063  switch( item->Type() )
1064  {
1065  case SCH_LABEL_T:
1066  case SCH_GLOBAL_LABEL_T:
1067  case SCH_HIER_LABEL_T:
1068  if( item->HitTest( aPosition, aAccuracy ) )
1069  return (SCH_TEXT*) item;
1070 
1071  break;
1072 
1073  default:
1074  ;
1075  }
1076  }
1077 
1078  return NULL;
1079 }
#define NULL
EE_RTREE & Items()
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References Items(), NULL, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, and SCH_LABEL_T.

Referenced by IsTerminalPoint().

◆ GetLibSymbols()

std::map<wxString, LIB_PART*>& SCH_SCREEN::GetLibSymbols ( )
inline

Fetch a list of unique LIB_PART object pointers required to properly render each SCH_COMPONENT in this schematic.

Returns
The list of unique LIB_PART object pointers.

Definition at line 462 of file sch_screen.h.

462 { return m_libSymbols; }
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:123

References m_libSymbols.

Referenced by SCH_SEXPR_PLUGIN::Format(), and SCH_EDITOR_CONTROL::Paste().

◆ GetLine()

SCH_LINE * SCH_SCREEN::GetLine ( const wxPoint &  aPosition,
int  aAccuracy = 0,
int  aLayer = LAYER_NOTES,
SCH_LINE_TEST_T  aSearchType = ENTIRE_LENGTH_T 
)

Return a line item located at aPosition.

Parameters
aPositionThe wxPoint to test for a line item.
aAccuracyAmount to inflate the item hit test bounding box.
aLayerThe layer the line is drawn upon.
aSearchTypeAdditional line test criteria.
Returns
The SCH_LINE* of the wire item found at aPosition or NULL if item not found.

Definition at line 1022 of file sch_screen.cpp.

1024 {
1025  // an accuracy of 0 had problems with rounding errors; use at least 1
1026  aAccuracy = std::max( aAccuracy, 1 );
1027 
1028  for( SCH_ITEM* item : Items() )
1029  {
1030  if( item->Type() != SCH_LINE_T )
1031  continue;
1032 
1033  if( item->GetLayer() != aLayer )
1034  continue;
1035 
1036  if( !item->HitTest( aPosition, aAccuracy ) )
1037  continue;
1038 
1039  switch( aSearchType )
1040  {
1041  case ENTIRE_LENGTH_T:
1042  return (SCH_LINE*) item;
1043 
1044  case EXCLUDE_END_POINTS_T:
1045  if( !( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1046  return (SCH_LINE*) item;
1047  break;
1048 
1049  case END_POINTS_ONLY_T:
1050  if( ( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1051  return (SCH_LINE*) item;
1052  }
1053  }
1054 
1055  return NULL;
1056 }
#define NULL
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References END_POINTS_ONLY_T, ENTIRE_LENGTH_T, EXCLUDE_END_POINTS_T, Items(), NULL, and SCH_LINE_T.

Referenced by GetBus(), GetWire(), and IsTerminalPoint().

◆ GetMenuImage()

BITMAP_DEF EDA_ITEM::GetMenuImage ( ) const
virtualinherited

Function GetMenuImage returns a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented in ZONE, SCH_COMPONENT, PAD, FOOTPRINT, SCH_SHEET, CENTER_DIMENSION, SCH_HIERLABEL, LEADER, VIA, ORTHOGONAL_DIMENSION, SCH_GLOBALLABEL, SCH_LABEL, ALIGNED_DIMENSION, PCB_SHAPE, SCH_TEXT, GERBER_DRAW_ITEM, LIB_PIN, SCH_LINE, TRACK, FP_TEXT, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, LIB_FIELD, SCH_FIELD, PCB_GROUP, SCH_BUS_WIRE_ENTRY, FP_SHAPE, SCH_BITMAP, LIB_ARC, PCB_TEXT, LIB_POLYLINE, SCH_NO_CONNECT, SCH_MARKER, LIB_TEXT, PCB_TARGET, SCH_JUNCTION, PCB_MARKER, LIB_CIRCLE, and LIB_RECTANGLE.

Definition at line 221 of file eda_item.cpp.

222 {
223  return dummy_xpm;
224 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: eda_item.cpp:48

References dummy_xpm.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), and SELECTION_TOOL::doSelectionMenu().

◆ GetMsgPanelInfo()

virtual void EDA_ITEM::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
inlinevirtualinherited

◆ GetPageCount()

◆ GetPageNumber()

const wxString & BASE_SCREEN::GetPageNumber ( ) const
inherited

Definition at line 79 of file base_screen.cpp.

80 {
81  static wxString pageNumber;
82 
83  if( m_pageNumber.IsEmpty() )
84  pageNumber.Printf( "%d", m_virtualPageNumber );
85  else
86  pageNumber = m_pageNumber;
87 
88  return pageNumber;
89 }
wxString m_pageNumber
A user defined string page number used for printing and plotting.
Definition: base_screen.h:81
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:71

References BASE_SCREEN::m_pageNumber, and BASE_SCREEN::m_virtualPageNumber.

Referenced by KIGFX::SCH_VIEW::DisplaySheet(), DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), EDA_DRAW_FRAME::PrintWorkSheet(), PCB_EDIT_FRAME::SetPageSettings(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

◆ GetPageSettings()

◆ GetParent()

◆ GetPin()

LIB_PIN * SCH_SCREEN::GetPin ( const wxPoint &  aPosition,
SCH_COMPONENT **  aSymbol = NULL,
bool  aEndPointOnly = false 
)

Test the screen for a component pin item at aPosition.

Parameters
aPositionPosition to test.
aSymbolThe component if a pin was found, otherwise NULL.
aEndPointOnlySet to true to test if aPosition is the connection point of the pin.
Returns
The pin item if found, otherwise NULL.

Definition at line 839 of file sch_screen.cpp.

841 {
842  SCH_COMPONENT* candidate = NULL;
843  LIB_PIN* pin = NULL;
844 
845  for( SCH_ITEM* item : Items().Overlapping( SCH_COMPONENT_T, aPosition ) )
846  {
847  candidate = static_cast<SCH_COMPONENT*>( item );
848 
849  if( aEndPointOnly )
850  {
851  pin = NULL;
852 
853  if( !candidate->GetPartRef() )
854  continue;
855 
856  for( pin = candidate->GetPartRef()->GetNextPin(); pin;
857  pin = candidate->GetPartRef()->GetNextPin( pin ) )
858  {
859  // Skip items not used for this part.
860  if( candidate->GetUnit() && pin->GetUnit() &&
861  ( pin->GetUnit() != candidate->GetUnit() ) )
862  continue;
863 
864  if( candidate->GetConvert() && pin->GetConvert() &&
865  ( pin->GetConvert() != candidate->GetConvert() ) )
866  continue;
867 
868  if( candidate->GetPinPhysicalPosition( pin ) == aPosition )
869  break;
870  }
871  if( pin )
872  break;
873  }
874  else
875  {
876  pin = (LIB_PIN*) candidate->GetDrawItem( aPosition, LIB_PIN_T );
877 
878  if( pin )
879  break;
880  }
881  }
882 
883  if( pin && aSymbol )
884  *aSymbol = candidate;
885 
886  return pin;
887 }
LIB_ITEM * GetDrawItem(const wxPoint &aPosition, KICAD_T aType=TYPE_NOT_INIT)
Return the component library item at aPosition that is part of this component.
int GetUnit() const
Definition: lib_item.h:296
int GetUnit() const
#define NULL
std::unique_ptr< LIB_PART > & GetPartRef()
int GetConvert() const
Definition: lib_item.h:299
EE_RTREE & Items()
Definition: sch_screen.h:159
Schematic symbol object.
Definition: sch_component.h:79
int GetConvert() const
wxPoint GetPinPhysicalPosition(const LIB_PIN *Pin) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References SCH_COMPONENT::GetConvert(), LIB_ITEM::GetConvert(), SCH_COMPONENT::GetDrawItem(), SCH_COMPONENT::GetPartRef(), SCH_COMPONENT::GetPinPhysicalPosition(), SCH_COMPONENT::GetUnit(), LIB_ITEM::GetUnit(), Items(), LIB_PIN_T, NULL, and SCH_COMPONENT_T.

Referenced by IsTerminalPoint(), and MarkConnections().

◆ GetPosition()

virtual wxPoint EDA_ITEM::GetPosition ( ) const
inlinevirtualinherited

Reimplemented in SCH_COMPONENT, SCH_SHEET, VIA, DELETED_BOARD_ITEM, WS_DRAW_ITEM_BITMAP, BOARD, SCH_TEXT, ARC, WS_DRAW_ITEM_TEXT, WS_DRAW_ITEM_PAGE, LIB_PIN, SCH_LINE, WS_DRAW_ITEM_RECT, FOOTPRINT, GERBER_DRAW_ITEM, SCH_FIELD, WS_DRAW_ITEM_POLYPOLYGONS, LIB_FIELD, PAD, SCH_BITMAP, WS_DRAW_ITEM_LINE, PCB_SHAPE, DIMENSION_BASE, ZONE, SCH_BUS_ENTRY_BASE, SCH_NO_CONNECT, PCB_GROUP, NETINFO_ITEM, TRACK, SCH_MARKER, KIGFX::ORIGIN_VIEWITEM, SCH_JUNCTION, LIB_POLYLINE, LIB_ARC, SCH_PIN, FP_TEXT, LIB_TEXT, LIB_BEZIER, LIB_RECTANGLE, LIB_CIRCLE, PCB_TEXT, PCB_MARKER, and PCB_TARGET.

Definition at line 325 of file eda_item.h.

325 { return wxPoint(); }

Referenced by EE_GRID_HELPER::computeAnchors(), GRID_HELPER::computeAnchors(), SCH_EDIT_FRAME::DeleteJunction(), KIGFX::PCB_PAINTER::draw(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckNoConnects(), SELECTION_TOOL::findCallback(), GERBVIEW_SELECTION::GetCenter(), EDA_ITEM::GetFocusPosition(), SCH_FIELD::GetParentPosition(), POSITION_RELATIVE_TOOL::GetSelectionAnchorPosition(), GetSheets(), PCBNEW_SELECTION::GetTopLeftItem(), EE_SELECTION::GetTopLeftItem(), BOARD_ITEM::GetX(), BOARD_ITEM::GetY(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), LIB_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_ITEM::operator<(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PCBNEW_CONTROL::placeBoardItems(), DRAWING_TOOL::PlaceImportedGraphics(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), SELECTION_TOOL::selectConnectedTracks(), RC_ITEM::ShowReport(), TransformItem(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), PL_EDIT_TOOL::updateModificationPoint(), and EE_POINT_EDITOR::updatePoints().

◆ GetRefCount()

int SCH_SCREEN::GetRefCount ( ) const
inline

Definition at line 197 of file sch_screen.h.

197 { return m_refCount; }
int m_refCount
Definition: sch_screen.h:99

References m_refCount.

Referenced by SCH_SHEET::GetScreenCount(), SCH_SHEET::SetScreen(), and SCH_SHEET::~SCH_SHEET().

◆ GetSelectMenuText()

wxString EDA_ITEM::GetSelectMenuText ( EDA_UNITS  aUnits) const
virtualinherited

Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented in ZONE, SCH_COMPONENT, PAD, BOARD, FOOTPRINT, SCH_SHEET, SCH_HIERLABEL, VIA, SCH_GLOBALLABEL, DELETED_BOARD_ITEM, SCH_LABEL, WS_DRAW_ITEM_BITMAP, PCB_SHAPE, WS_DRAW_ITEM_TEXT, SCH_TEXT, GERBER_DRAW_ITEM, LIB_PIN, WS_DRAW_ITEM_PAGE, DIMENSION_BASE, WS_DRAW_ITEM_RECT, SCH_LINE, TRACK, FP_TEXT, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, LIB_FIELD, WS_DRAW_ITEM_POLYPOLYGONS, SCH_FIELD, PCB_GROUP, SCH_BUS_WIRE_ENTRY, WS_DRAW_ITEM_LINE, FP_SHAPE, LIB_ARC, SCH_BITMAP, PCB_TEXT, LIB_POLYLINE, SCH_NO_CONNECT, LIB_TEXT, SCH_MARKER, PCB_TARGET, PCB_MARKER, LIB_CIRCLE, LIB_RECTANGLE, SCH_JUNCTION, SCH_PIN, and DELETED_SHEET_ITEM.

Definition at line 123 of file eda_item.cpp.

124 {
125  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
126  GetClass() );
127 
128  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
129 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), DIALOG_GROUP_PROPERTIES::DoAddMember(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), DRC_ENGINE::EvalRulesForItems(), PCB_MARKER::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), PCB_INSPECTION_TOOL::InspectClearance(), PCB_INSPECTION_TOOL::InspectConstraints(), RC_ITEM::ShowReport(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetSheetInstances()

const std::vector<SCH_SHEET_INSTANCE>& SCH_SCREEN::GetSheetInstances ( ) const
inline

Definition at line 501 of file sch_screen.h.

502  {
503  return m_sheetInstances;
504  }
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
Definition: sch_screen.h:140

References m_sheetInstances.

◆ GetSheetLabel()

SCH_SHEET_PIN * SCH_SCREEN::GetSheetLabel ( const wxPoint &  aPosition)

Test the screen if aPosition is a sheet label object.

Parameters
aPositionThe position to test.
Returns
The sheet label object if found otherwise NULL.

Definition at line 890 of file sch_screen.cpp.

891 {
892  SCH_SHEET_PIN* sheetPin = nullptr;
893 
894  for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
895  {
896  auto sheet = static_cast<SCH_SHEET*>( item );
897 
898  sheetPin = sheet->GetPin( aPosition );
899 
900  if( sheetPin )
901  break;
902  }
903 
904  return sheetPin;
905 }
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:85
EE_RTREE & Items()
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References Items(), and SCH_SHEET_T.

Referenced by IsTerminalPoint().

◆ GetSheets()

void SCH_SCREEN::GetSheets ( std::vector< SCH_ITEM * > *  aItems)

Similar to GetItems().OfType( SCH_SHEET_T ), but return the sheets in a deterministic order (L-R, T-B) for sheet numbering.

Parameters
aItems

Definition at line 962 of file sch_screen.cpp.

963 {
964  for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
965  aItems->push_back( item );
966 
967  std::sort( aItems->begin(), aItems->end(),
968  []( EDA_ITEM* a, EDA_ITEM* b ) -> bool
969  {
970  long a_order = 0;
971  long b_order = 0;
972 
973  for( const SCH_FIELD& field : static_cast<SCH_SHEET*>( a )->GetFields() )
974  {
975  if( field.GetName().CmpNoCase( wxT( "Order" ) ) == 0 )
976  {
977  field.GetText().ToLong( &a_order );
978  break;
979  }
980  }
981 
982  for( const SCH_FIELD& field : static_cast<SCH_SHEET*>( b )->GetFields() )
983  {
984  if( field.GetName().CmpNoCase( wxT( "Order" ) ) == 0 )
985  {
986  field.GetText().ToLong( &b_order );
987  break;
988  }
989  }
990 
991  if( a_order == b_order )
992  {
993  if( a->GetPosition().x == b->GetPosition().x )
994  return a->GetPosition().y < b->GetPosition().y;
995 
996  return a->GetPosition().x < b->GetPosition().x;
997  }
998 
999  return a_order < b_order;
1000  } );
1001 }
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:51
virtual wxPoint GetPosition() const
Definition: eda_item.h:325
EE_RTREE & Items()
Definition: sch_screen.h:159
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References EDA_ITEM::GetPosition(), Items(), and SCH_SHEET_T.

Referenced by HIERARCHY_NAVIG_DLG::buildHierarchyTree(), and SCH_SHEET_LIST::BuildSheetList().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 204 of file eda_item.h.

205  {
206  return m_status & type;
207  }
STATUS_FLAGS m_status
Definition: eda_item.h:161

References EDA_ITEM::m_status.

Referenced by TRACK::GetMsgPanelInfoBase_Common(), and TRACK::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 217 of file eda_item.h.

217 { return m_status; }
STATUS_FLAGS m_status
Definition: eda_item.h:161

References EDA_ITEM::m_status.

◆ GetSymbolInstances()

const std::vector<SYMBOL_INSTANCE_REFERENCE>& SCH_SCREEN::GetSymbolInstances ( ) const
inline

Definition at line 496 of file sch_screen.h.

497  {
498  return m_symbolInstances;
499  }
std::vector< SYMBOL_INSTANCE_REFERENCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
Definition: sch_screen.h:139

References m_symbolInstances.

Referenced by TEST_NETLISTS_FIXTURE::loadSchematic(), and TEST_SCH_SHEET_LIST_FIXTURE::loadSchematic().

◆ GetTitleBlock()

const TITLE_BLOCK& SCH_SCREEN::GetTitleBlock ( ) const
inline

◆ GetVirtualPageNumber()

◆ GetWire()

SCH_LINE* SCH_SCREEN::GetWire ( const wxPoint &  aPosition,
int  aAccuracy = 0,
SCH_LINE_TEST_T  aSearchType = ENTIRE_LENGTH_T 
)
inline

Definition at line 434 of file sch_screen.h.

436  {
437  return GetLine( aPosition, aAccuracy, LAYER_WIRE, aSearchType );
438  }
SCH_LINE * GetLine(const wxPoint &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
Return a line item located at aPosition.

References GetLine(), and LAYER_WIRE.

Referenced by IsTerminalPoint().

◆ HasFlag()

◆ HasItems()

bool SCH_SCREEN::HasItems ( KICAD_T  aItemType) const

Definition at line 121 of file sch_screen.cpp.

122 {
123  EE_RTREE::EE_TYPE sheets = const_cast<EE_RTREE&>( m_rtree ).OfType( aItemType );
124 
125  return sheets.begin() != sheets.end();
126 }
EE_RTREE m_rtree
Definition: sch_screen.h:114
iterator end()
Definition: sch_rtree.h:213
iterator begin()
Definition: sch_rtree.h:208
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
Definition: sch_rtree.h:181

References EE_RTREE::EE_TYPE::begin(), EE_RTREE::EE_TYPE::end(), and m_rtree.

Referenced by HasSheets().

◆ HasSheets()

bool SCH_SCREEN::HasSheets ( ) const
inline

Definition at line 169 of file sch_screen.h.

169 { return HasItems( SCH_SHEET_T ); }
bool HasItems(KICAD_T aItemType) const
Definition: sch_screen.cpp:121

References HasItems(), and SCH_SHEET_T.

◆ HitTest() [1/2]

virtual bool EDA_ITEM::HitTest ( const wxPoint &  aPosition,
int  aAccuracy = 0 
) const
inlinevirtualinherited

◆ HitTest() [2/2]

virtual bool EDA_ITEM::HitTest ( const EDA_RECT aRect,
bool  aContained,
int  aAccuracy = 0 
) const
inlinevirtualinherited

Function HitTest tests if aRect intersects or is contained within the bounding box of an item.

Parameters
aRectA reference to a EDA_RECT object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented in SCH_COMPONENT, SCH_SHEET, PAD, ZONE, VIA, FOOTPRINT, WS_DRAW_ITEM_BITMAP, ARC, SCH_TEXT, WS_DRAW_ITEM_TEXT, PCB_SHAPE, GERBER_DRAW_ITEM, SCH_LINE, DIMENSION_BASE, LIB_PIN, SCH_FIELD, TRACK, LIB_ITEM, FP_TEXT, WS_DRAW_ITEM_POLYPOLYGONS, SCH_BITMAP, PCB_GROUP, SCH_BUS_ENTRY_BASE, SCH_JUNCTION, SCH_NO_CONNECT, WS_DRAW_ITEM_BASE, PCB_TEXT, PCB_TARGET, LIB_POLYLINE, LIB_ARC, LIB_BEZIER, LIB_TEXT, and LIB_CIRCLE.

Definition at line 309 of file eda_item.h.

310  {
311  return false; // derived classes should override this function
312  }

◆ IncRefCount()

void SCH_SCREEN::IncRefCount ( )

Definition at line 107 of file sch_screen.cpp.

108 {
109  m_refCount++;
110 }
int m_refCount
Definition: sch_screen.h:99

References m_refCount.

Referenced by SCH_SHEET::SCH_SHEET(), and SCH_SHEET::SetScreen().

◆ InitDataPoints()

void BASE_SCREEN::InitDataPoints ( const wxSize &  aPageSizeInternalUnits)
inherited

Definition at line 48 of file base_screen.cpp.

49 {
50  if( m_Center )
51  {
52  m_crossHairPosition.x = 0;
53  m_crossHairPosition.y = 0;
54 
55  m_DrawOrg.x = -aPageSizeIU.x / 2;
56  m_DrawOrg.y = -aPageSizeIU.y / 2;
57  }
58  else
59  {
60  m_crossHairPosition.x = aPageSizeIU.x / 2;
61  m_crossHairPosition.y = aPageSizeIU.y / 2;
62 
63  m_DrawOrg.x = 0;
64  m_DrawOrg.y = 0;
65  }
66 
67  m_LocalOrigin = { 0, 0 };
68 }
wxPoint m_crossHairPosition
The cross hair position in logical (drawing) units.
Definition: base_screen.h:52
bool m_Center
Center on screen.
Definition: base_screen.h:95
wxPoint m_DrawOrg
offsets for drawing the circuit on the screen
Definition: base_screen.h:87
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:89

References BASE_SCREEN::m_Center, BASE_SCREEN::m_crossHairPosition, BASE_SCREEN::m_DrawOrg, and BASE_SCREEN::m_LocalOrigin.

Referenced by BASE_SCREEN::BASE_SCREEN(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), SCH_SCREEN(), GERBVIEW_FRAME::SetPageSettings(), PL_EDITOR_FRAME::SetPageSettings(), and PCB_BASE_FRAME::SetPageSettings().

◆ IsBrightened()

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 189 of file eda_item.h.

189 { return m_flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:108
STATUS_FLAGS m_flags
Definition: eda_item.h:164

References IS_DRAGGED, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), and KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsEmpty()

bool SCH_SCREEN::IsEmpty ( )
inline

Definition at line 162 of file sch_screen.h.

163  {
164  return m_rtree.empty();
165  }
bool empty() const
Definition: sch_rtree.h:166
EE_RTREE m_rtree
Definition: sch_screen.h:114

References EE_RTREE::empty(), and m_rtree.

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 274 of file eda_item.h.

274 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:163

References EDA_ITEM::m_forceVisible.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_FIELD::Print().

◆ IsJunctionNeeded()

bool SCH_SCREEN::IsJunctionNeeded ( const wxPoint &  aPosition,
bool  aNew = false 
)

Test if a junction is required for the items at aPosition on the screen.

A junction is required at aPosition if one of the following criteria is satisfied:

  • one wire midpoint and one or more wire endpoints;
  • three or more wire endpoints;
  • one wire midpoint and a component pin;
  • two or more wire endpoints and a component pin.
Parameters
aPositionThe position to test.
aNewChecks if a new junction is needed, i.e. there isn't one already
Returns
True if a junction is required at aPosition.

A line with a midpoint should be counted as two endpoints for this calculation because the junction will split the line into two if there is another item present at the point.

Overlapping lines that point in the same direction should not be counted as extra end_points.

Definition at line 371 of file sch_screen.cpp.

372 {
373  enum { WIRES, BUSES } layers;
374 
375  bool has_nonparallel[ sizeof( layers ) ] = { false };
376  int end_count[ sizeof( layers ) ] = { 0 };
377  int entry_count = 0;
378  int pin_count = 0;
379 
380  std::vector<SCH_LINE*> lines[ sizeof( layers ) ];
381 
382  for( SCH_ITEM* item : Items().Overlapping( aPosition ) )
383  {
384  if( item->GetEditFlags() & STRUCT_DELETED )
385  continue;
386 
387  switch( item->Type() )
388  {
389  case SCH_JUNCTION_T:
390  if( aNew && item->HitTest( aPosition ) )
391  return false;
392 
393  break;
394 
395  case SCH_LINE_T:
396  if( item->HitTest( aPosition, 0 ) )
397  {
398  if( item->GetLayer() == LAYER_WIRE )
399  lines[WIRES].push_back( (SCH_LINE*) item );
400  else if( item->GetLayer() == LAYER_BUS )
401  lines[BUSES].push_back( (SCH_LINE*) item );
402  }
403  break;
404 
406  case SCH_BUS_BUS_ENTRY_T:
407  if( item->IsConnected( aPosition ) )
408  entry_count++;
409 
410  break;
411 
412  case SCH_COMPONENT_T:
413  case SCH_SHEET_T:
414  if( item->IsConnected( aPosition ) )
415  pin_count++;
416 
417  break;
418 
419  default:
420  break;
421  }
422  }
423 
424  for( int i : { WIRES, BUSES } )
425  {
426  bool removed_overlapping = false;
427  bool mid_point = false;
428 
429  for( auto line = lines[i].begin(); line < lines[i].end(); line++ )
430  {
431  if( !(*line)->IsEndPoint( aPosition ) )
432  mid_point = true;
433  else
434  end_count[i]++;
435 
436  for( auto second_line = lines[i].end() - 1; second_line > line; second_line-- )
437  {
438  if( !(*line)->IsParallel( *second_line ) )
439  has_nonparallel[i] = true;
440  else if( !removed_overlapping
441  && (*line)->IsSameQuadrant( *second_line, aPosition ) )
442  {
443  removed_overlapping = true;
444  }
445  }
446  }
447 
451  if( mid_point )
452  end_count[i] += 2;
453 
456  if( removed_overlapping )
457  end_count[i]--;
458  }
459 
460  // If there are three or more endpoints
461  if( pin_count && pin_count + end_count[WIRES] > 2 )
462  return true;
463 
464  // If there is at least one segment that ends on a non-parallel line or
465  // junction of two other lines
466  if( has_nonparallel[WIRES] && end_count[WIRES] > 2 )
467  return true;
468 
469  // Check for bus - bus junction requirements
470  if( has_nonparallel[BUSES] && end_count[BUSES] > 2 )
471  return true;
472 
473  // Check for bus - bus entry requirements
474  if( !aNew && entry_count && end_count[BUSES] )
475  return true;
476 
477  return false;
478 }
EE_TYPE Overlapping(const EDA_RECT &aRect)
Definition: sch_rtree.h:224
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:115
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Definition: sch_screen.h:159
boost::ptr_vector< WIRE > WIRES
Definition: specctra.h:2949
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References Items(), LAYER_BUS, LAYER_WIRE, EE_RTREE::Overlapping(), SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_COMPONENT_T, SCH_JUNCTION_T, SCH_LINE_T, SCH_SHEET_T, and STRUCT_DELETED.

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), SCH_EDIT_TOOL::BreakWire(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDIT_FRAME::FixupJunctions(), SCH_MOVE_TOOL::Main(), SCH_LINE::MergeOverlap(), and SCH_EDIT_FRAME::SchematicCleanUp().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 186 of file eda_item.h.

186 { return m_flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: eda_item.h:102
STATUS_FLAGS m_flags
Definition: eda_item.h:164

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsModify()

◆ IsMoving()

◆ IsNew()

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 490 of file eda_item.h.

490 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 192 of file eda_item.h.

192 { return m_flags & IS_RESIZED; }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:107
STATUS_FLAGS m_flags
Definition: eda_item.h:164

References IS_RESIZED, and EDA_ITEM::m_flags.

Referenced by KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsSave()

bool BASE_SCREEN::IsSave ( ) const
inlineinherited

Definition at line 125 of file base_screen.h.

125 { return m_flagSave; }
bool m_flagSave
Indicates automatic file save.
Definition: base_screen.h:45

References BASE_SCREEN::m_flagSave.

Referenced by SCH_EDIT_FRAME::doAutoSave().

◆ IsSelected()

◆ IsTerminalPoint()

bool SCH_SCREEN::IsTerminalPoint ( const wxPoint &  aPosition,
int  aLayer 
)

Test if aPosition is a connection point on aLayer.

Parameters
aPositionPosition to test.
aLayerThe layer type to test against. Valid layer types are LAYER_NOTES, LAYER_BUS, and LAYER_WIRE.
Returns
True if Position is a connection point on aLayer.

Definition at line 481 of file sch_screen.cpp.

482 {
483  wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
484  wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
485 
486  SCH_SHEET_PIN* label;
487  SCH_TEXT* text;
488  SCH_CONNECTION conn;
489 
490  switch( aLayer )
491  {
492  case LAYER_BUS:
493 
494  if( GetBus( aPosition ) )
495  return true;
496 
497  label = GetSheetLabel( aPosition );
498 
499  if( label && conn.MightBeBusLabel( label->GetText() ) && label->IsConnected( aPosition ) )
500  return true;
501 
502  text = GetLabel( aPosition );
503 
504  if( text && conn.MightBeBusLabel( text->GetText() ) && text->IsConnected( aPosition )
505  && (text->Type() != SCH_LABEL_T) )
506  return true;
507 
508  break;
509 
510  case LAYER_NOTES:
511 
512  if( GetLine( aPosition ) )
513  return true;
514 
515  break;
516 
517  case LAYER_WIRE:
518  if( GetItem( aPosition, Mils2iu( 6 ), SCH_BUS_WIRE_ENTRY_T) )
519  return true;
520 
521  if( GetItem( aPosition, Mils2iu( 6 ), SCH_BUS_BUS_ENTRY_T) )
522  return true;
523 
524  if( GetItem( aPosition, Schematic()->Settings().m_JunctionSize, SCH_JUNCTION_T ) )
525  return true;
526 
527  if( GetPin( aPosition, NULL, true ) )
528  return true;
529 
530  if( GetWire( aPosition ) )
531  return true;
532 
533  text = GetLabel( aPosition );
534 
535  if( text && text->IsConnected( aPosition ) && !conn.MightBeBusLabel( text->GetText() ) )
536  return true;
537 
538  label = GetSheetLabel( aPosition );
539 
540  if( label && label->IsConnected( aPosition ) && !conn.MightBeBusLabel( label->GetText() ) )
541  return true;
542 
543  break;
544 
545  default:
546  break;
547  }
548 
549  return false;
550 }
static bool MightBeBusLabel(const wxString &aLabel)
Test if aLabel looks like a bus notation.
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:125
SCH_LINE * GetLine(const wxPoint &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
Return a line item located at aPosition.
#define NULL
SCH_SHEET_PIN * GetSheetLabel(const wxPoint &aPosition)
Test the screen if aPosition is a sheet label object.
Definition: sch_screen.cpp:890
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:85
SCH_LINE * GetWire(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
Definition: sch_screen.h:434
SCH_TEXT * GetLabel(const wxPoint &aPosition, int aAccuracy=0)
Return a label item located at aPosition.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:89
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T)
Check aPosition within a distance of aAccuracy for items of type aFilter.
Definition: sch_screen.cpp:310
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
bool IsConnected(const wxPoint &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:122
LIB_PIN * GetPin(const wxPoint &aPosition, SCH_COMPONENT **aSymbol=NULL, bool aEndPointOnly=false)
Test the screen for a component pin item at aPosition.
Definition: sch_screen.cpp:839
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
SCH_LINE * GetBus(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T)
Definition: sch_screen.h:440

References GetBus(), GetItem(), GetLabel(), GetLine(), GetPin(), GetSheetLabel(), EDA_TEXT::GetText(), GetWire(), SCH_ITEM::IsConnected(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, SCHEMATIC_SETTINGS::m_JunctionSize, SCH_CONNECTION::MightBeBusLabel(), NULL, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_JUNCTION_T, SCH_LABEL_T, Schematic(), SCHEMATIC::Settings(), and EDA_ITEM::Type().

Referenced by SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), and SCH_ALTIUM_PLUGIN::ParsePort().

◆ IsType()

virtual bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[]) const
inlinevirtualinherited

Function IsType Checks whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Reimplemented in VIA, SCH_LABEL, DIMENSION_BASE, PAD, PCB_SHAPE, SCH_FIELD, SCH_LINE, FP_TEXT, FP_SHAPE, and PCB_TEXT.

Definition at line 250 of file eda_item.h.

251  {
252  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
253  return true;
254 
255  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
256  {
257  if( m_structType == *p )
258  return true;
259  }
260 
261  return false;
262  }
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:158

References EOT, EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), PCB_TEXT::IsType(), FP_SHAPE::IsType(), FP_TEXT::IsType(), SCH_LINE::IsType(), SCH_FIELD::IsType(), PCB_SHAPE::IsType(), PAD::IsType(), DIMENSION_BASE::IsType(), SCH_LABEL::IsType(), VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), SCH_BASE_FRAME::UpdateItem(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 190 of file eda_item.h.

190 { return m_flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110
STATUS_FLAGS m_flags
Definition: eda_item.h:164

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ Items() [1/2]

EE_RTREE& SCH_SCREEN::Items ( )
inline

Definition at line 159 of file sch_screen.h.

159 { return m_rtree; }
EE_RTREE m_rtree
Definition: sch_screen.h:114

References m_rtree.

Referenced by SCH_MOVE_TOOL::AlignElements(), SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_EDIT_FRAME::BreakSegments(), SCH_EDIT_FRAME::BreakSegmentsOnJunctions(), SCH_SCREENS::buildScreenList(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_SHEET::CleanupSheet(), ClearAnnotation(), ClearDrawingState(), EE_COLLECTOR::Collect(), CountConnectedItems(), SCH_SHEET::CountSheets(), SCH_EDIT_FRAME::DeleteAnnotation(), SCH_EDIT_FRAME::DeleteJunction(), KIGFX::SCH_VIEW::DisplaySheet(), EnsureAlternateReferencesExist(), CONNECTION_GRAPH::ercCheckHierSheets(), SCH_SHEET_LIST::FillItemMap(), SCH_EDITOR_CONTROL::FindComponentAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDIT_FRAME::FixupJunctions(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), AUTOPLACER::get_possible_colliders(), SCH_MOVE_TOOL::getConnectedDragItems(), GetHierarchicalItems(), GetItem(), SCH_SHEET_LIST::GetItem(), GetLabel(), GetLine(), GetPin(), getSheetBbox(), GetSheetLabel(), SCH_LINE_WIRE_BUS_TOOL::getSheetPin(), GetSheets(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), SCH_DRAWING_TOOLS::importHierLabel(), SCH_EDIT_TOOL::Init(), IsJunctionNeeded(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EDIT_FRAME::LoadSheetFromFile(), SCH_SHEET::LocatePathOfScreen(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeSymbols(), MarkConnections(), SCH_EDITOR_CONTROL::nextMatch(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), SCH_EDITOR_CONTROL::Paste(), Plot(), Print(), DIALOG_CHANGE_SYMBOLS::processMatchingSymbols(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), EE_SELECTION_TOOL::RebuildSelection(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), Remove(), SCH_SHEET_LIST::ReplaceLegacySheetPaths(), SCH_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SCH_EDIT_FRAME::setupUIConditions(), SCH_SHEET::SymbolCount(), TestDanglingEnds(), ERC_TESTER::TestDuplicateSheetNames(), DIALOG_ERC::testErc(), ERC_TESTER::TestTextVars(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), SCH_EDIT_FRAME::TrimWire(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), SCH_EDITOR_CONTROL::UpdateFind(), UpdateLocalLibSymbolLinks(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), SCH_EDITOR_CONTROL::updatePastedInstances(), UpdateSymbolLinks(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ Items() [2/2]

const EE_RTREE& SCH_SCREEN::Items ( ) const
inline

Definition at line 160 of file sch_screen.h.

160 { return m_rtree; }
EE_RTREE m_rtree
Definition: sch_screen.h:114

References m_rtree.

◆ IterateForward() [1/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use the main queue instead

Definition at line 372 of file eda_item.h.

376  {
377  for( auto it : aList )
378  {
379  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
381  return SEARCH_RESULT::QUIT;
382  }
383 
385  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Definition: eda_item.cpp:107

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use std::vector instead

Definition at line 393 of file eda_item.h.

395  {
396  for( auto it : aList )
397  {
398  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
400  return SEARCH_RESULT::QUIT;
401  }
402 
404  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Definition: eda_item.cpp:107

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ MarkConnections()

std::set< SCH_ITEM * > SCH_SCREEN::MarkConnections ( SCH_LINE aSegment)

Return all wires and junctions connected to aSegment which are not connected any component pin.

Parameters
aSegmentThe segment to test for connections.

Definition at line 326 of file sch_screen.cpp.

327 {
328  std::set<SCH_ITEM*> retval;
329  std::stack<SCH_LINE*> to_search;
330 
331  wxCHECK_MSG( aSegment && aSegment->Type() == SCH_LINE_T, retval, wxT( "Invalid pointer." ) );
332 
333  to_search.push( aSegment );
334 
335  while( !to_search.empty() )
336  {
337  SCH_LINE* test_item = to_search.top();
338  to_search.pop();
339 
340  for( SCH_ITEM* item : Items().Overlapping( SCH_JUNCTION_T, test_item->GetBoundingBox() ) )
341  {
342  if( test_item->IsEndPoint( item->GetPosition() ) )
343  retval.insert( item );
344  }
345 
346  for( SCH_ITEM* item : Items().Overlapping( SCH_LINE_T, test_item->GetBoundingBox() ) )
347  {
348  // Skip connecting lines on different layers (e.g. buses)
349  if( test_item->GetLayer() != item->GetLayer() )
350  continue;
351 
352  SCH_LINE* line = static_cast<SCH_LINE*>( item );
353 
354  if( ( test_item->IsEndPoint( line->GetStartPoint() )
355  && !GetPin( line->GetStartPoint(), NULL, true ) )
356  || ( test_item->IsEndPoint( line->GetEndPoint() )
357  && !GetPin( line->GetEndPoint(), nullptr, true ) ) )
358  {
359  auto result = retval.insert( line );
360 
361  if( result.second )
362  to_search.push( line );
363  }
364  }
365  }
366 
367  return retval;
368 }
wxPoint GetStartPoint() const
Definition: sch_line.h:94
#define NULL
bool IsEndPoint(const wxPoint &aPoint) const
Definition: sch_line.h:87
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:285
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Definition: sch_screen.h:159
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_line.cpp:165
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
LIB_PIN * GetPin(const wxPoint &aPosition, SCH_COMPONENT **aSymbol=NULL, bool aEndPointOnly=false)
Test the screen for a component pin item at aPosition.
Definition: sch_screen.cpp:839
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
wxPoint GetEndPoint() const
Definition: sch_line.h:97

References SCH_LINE::GetBoundingBox(), SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), GetPin(), SCH_LINE::GetStartPoint(), SCH_LINE::IsEndPoint(), Items(), NULL, SCH_JUNCTION_T, SCH_LINE_T, and EDA_ITEM::Type().

Referenced by EE_SELECTION_TOOL::SelectConnection().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData 
)
inlinevirtualinherited

Function Matches compares the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, SCH_PIN, SCH_MARKER, PCB_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 446 of file eda_item.h.

447  {
448  return false;
449  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), PCB_TEXT::Matches(), FP_TEXT::Matches(), PCB_MARKER::Matches(), SCH_MARKER::Matches(), SCH_PIN::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
wxFindReplaceData &  aSearchData 
)
protectedinherited

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 132 of file eda_item.cpp.

133 {
134  wxString text = aText;
135  wxString searchText = aSearchData.GetFindString();
136 
137  // Don't match if searching for replaceable item and the item doesn't support text replace.
138  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
139  return false;
140 
141  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
142  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
143 
144  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
145  {
146  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
147  return text.Matches( searchText );
148 
149  return text.MakeUpper().Matches( searchText.MakeUpper() );
150  }
151 
152  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
153  return aText.Find( searchText ) != wxNOT_FOUND;
154 
155  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
156 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: eda_item.h:490

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, and EDA_ITEM::IsReplaceable().

◆ operator<()

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 185 of file eda_item.cpp.

186 {
187  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
188  GetClass() ) );
189 
190  return false;
191 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References Format(), and EDA_ITEM::GetClass().

◆ Place()

void SCH_SCREEN::Place ( SCH_EDIT_FRAME frame,
wxDC *  DC 
)
inline

Definition at line 248 of file sch_screen.h.

248 { };

◆ Plot()

void SCH_SCREEN::Plot ( PLOTTER aPlotter)

Plot all the schematic objects to aPlotter.

Note
This function is useful only for schematic. The library editor and library viewer do not use a draw list and therefore plots nothing.
Parameters
aPlotterThe plotter object to plot to.

Sort to ensure plot-order consistency with screen drawing

Definition at line 779 of file sch_screen.cpp.

780 {
781  // Ensure links are up to date, even if a library was reloaded for some reason:
782  std::vector< SCH_ITEM* > junctions;
783  std::vector< SCH_ITEM* > bitmaps;
784  std::vector< SCH_ITEM* > other;
785 
786  for( auto item : Items() )
787  {
788  if( item->IsMoving() || item->IsResized() )
789  continue;
790 
791  if( item->Type() == SCH_JUNCTION_T )
792  junctions.push_back( item );
793  else if( item->Type() == SCH_BITMAP_T )
794  bitmaps.push_back( item );
795  else
796  other.push_back( item );
797  }
798 
800  std::sort( other.begin(), other.end(), []( const SCH_ITEM* a, const SCH_ITEM* b ) {
801  if( a->Type() == b->Type() )
802  return a->GetLayer() > b->GetLayer();
803 
804  return a->Type() > b->Type();
805  } );
806 
807  int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth();
808 
809  // Bitmaps are drawn first to ensure they are in the background
810  // This is particularly important for the wxPostscriptDC (used in *nix printers) as
811  // the bitmap PS command clears the screen
812  for( SCH_ITEM* item : bitmaps )
813  {
814  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
815  item->Plot( aPlotter );
816  }
817 
818  for( SCH_ITEM* item : other )
819  {
820  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
821  item->Plot( aPlotter );
822  }
823 
824  for( SCH_ITEM* item : junctions )
825  {
826  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
827  item->Plot( aPlotter );
828  }
829 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:285
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:165
EE_RTREE & Items()
Definition: sch_screen.h:159
int GetDefaultPenWidth() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

References KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), SCH_ITEM::GetLayer(), Items(), PLOTTER::RenderSettings(), SCH_BITMAP_T, SCH_JUNCTION_T, PLOTTER::SetCurrentLineWidth(), and EDA_ITEM::Type().

Referenced by DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), and DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG().

◆ Print()

void SCH_SCREEN::Print ( RENDER_SETTINGS aSettings)

Print all the items in the screen to aDC.

Note
This function is useful only for schematic. The library editor and library viewer do not use a draw list and therefore draws nothing.

Sort to ensure plot-order consistency with screen drawing

Definition at line 738 of file sch_screen.cpp.

739 {
740  // Ensure links are up to date, even if a library was reloaded for some reason:
741  std::vector< SCH_ITEM* > junctions;
742  std::vector<SCH_ITEM*> bitmaps;
743  std::vector<SCH_ITEM*> other;
744 
745  for( auto item : Items() )
746  {
747  if( item->IsMoving() || item->IsResized() )
748  continue;
749 
750  if( item->Type() == SCH_JUNCTION_T )
751  junctions.push_back( item );
752  else if( item->Type() == SCH_BITMAP_T )
753  bitmaps.push_back( item );
754  else
755  other.push_back( item );
756  }
757 
759  std::sort( other.begin(), other.end(),
760  []( const SCH_ITEM* a, const SCH_ITEM* b )
761  {
762  if( a->Type() == b->Type() )
763  return a->GetLayer() > b->GetLayer();
764 
765  return a->Type() > b->Type();
766  } );
767 
768  for( auto item : bitmaps )
769  item->Print( aSettings, wxPoint( 0, 0 ) );
770 
771  for( auto item : other )
772  item->Print( aSettings, wxPoint( 0, 0 ) );
773 
774  for( auto item : junctions )
775  item->Print( aSettings, wxPoint( 0, 0 ) );
776 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:285
EE_RTREE & Items()
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References SCH_ITEM::GetLayer(), Items(), SCH_BITMAP_T, SCH_JUNCTION_T, and EDA_ITEM::Type().

Referenced by SCH_PRINTOUT::PrintPage(), and SCH_EDIT_FRAME::PrintPage().

◆ Remove()

bool SCH_SCREEN::Remove ( SCH_ITEM aItem)

Remove aItem from the schematic associated with this screen.

Note
The removed item is not deleted. It is only unlinked from the item list.
Parameters
aItemItem to be removed from schematic.
Returns
True if we successfully removed the item

Definition at line 241 of file sch_screen.cpp.

242 {
243  bool retv = m_rtree.remove( aItem );
244 
245  // Check if the library symbol for the removed schematic symbol is still required.
246  if( retv && aItem->Type() == SCH_COMPONENT_T )
247  {
248  SCH_COMPONENT* removedSymbol = static_cast<SCH_COMPONENT*>( aItem );
249 
250  bool removeUnusedLibSymbol = true;
251 
252  for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) )
253  {
254  SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( item );
255 
256  if( removedSymbol->GetSchSymbolLibraryName() == symbol->GetSchSymbolLibraryName() )
257  {
258  removeUnusedLibSymbol = false;
259  break;
260  }
261  }
262 
263  if( removeUnusedLibSymbol )
264  {
265  auto it = m_libSymbols.find( removedSymbol->GetSchSymbolLibraryName() );
266 
267  if( it != m_libSymbols.end() )
268  {
269  delete it->second;
270  m_libSymbols.erase( it );
271  }
272  }
273  }
274 
275  return retv;
276 }
wxString GetSchSymbolLibraryName() const
bool remove(SCH_ITEM *aItem)
Function Remove() Removes an item from the tree.
Definition: sch_rtree.h:78
EE_RTREE m_rtree
Definition: sch_screen.h:114
EE_RTREE & Items()
Definition: sch_screen.h:159
Schematic symbol object.
Definition: sch_component.h:79
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:123

References SCH_COMPONENT::GetSchSymbolLibraryName(), Items(), m_libSymbols, m_rtree, EE_RTREE::remove(), SCH_COMPONENT_T, and EDA_ITEM::Type().

Referenced by SCH_SHEET_LIST::BuildSheetList(), DeleteItem(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), DIALOG_CHANGE_SYMBOLS::processSymbol(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), Update(), SCH_EDIT_FRAME::UpdateSymbolFromEditor(), and UpdateSymbolLinks().

◆ Replace() [1/2]

bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
wxString &  aText 
)
staticinherited

Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 159 of file eda_item.cpp.

160 {
161  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
162 
163  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
164  aSearchData.GetFindString() :
165  aSearchData.GetFindString().Upper() );
166 
167  if( result == wxNOT_FOUND )
168  return false;
169 
170  wxString prefix = aText.Left( result );
171  wxString suffix;
172 
173  if( aSearchData.GetFindString().length() + result < aText.length() )
174  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
175 
176  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
177  aText, prefix, aSearchData.GetReplaceString(), suffix );
178 
179  aText = prefix + aSearchData.GetReplaceString() + suffix;
180 
181  return true;
182 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.

References traceFindReplace.

Referenced by SCH_FIELD::Replace(), EDA_TEXT::Replace(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
inlinevirtualinherited

Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented in SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, and SCH_PIN.

Definition at line 478 of file eda_item.h.

478 { return false; }

◆ Schematic()

SCHEMATIC * SCH_SCREEN::Schematic ( ) const

◆ Set() [1/3]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 40 of file inspectable.h.

41  {
43  TYPE_ID thisType = TYPE_HASH( *this );
44  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
45 
46  if( object )
47  aProperty->setter( object, aValue );
48 
49  return object != nullptr;
50  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:64
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:41
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provides class metadata.
Definition: property_mgr.h:61
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [2/3]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 53 of file inspectable.h.

54  {
56  TYPE_ID thisType = TYPE_HASH( *this );
57  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
58 
59  if( object )
60  aProperty->set<T>( object, aValue );
61 
62  return object != nullptr;
63  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:64
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:41
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:61
void set(void *aObject, T aValue)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/3]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 66 of file inspectable.h.

67  {
69  TYPE_ID thisType = TYPE_HASH( *this );
70  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71  void* object = nullptr;
72 
73  if( prop )
74  {
75  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76 
77  if( object )
78  prop->set<T>( object, aValue );
79  }
80 
81  return object != nullptr;
82  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:64
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:41
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:61
void set(void *aObject, T aValue)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ SetAuxOrigin()

void SCH_SCREEN::SetAuxOrigin ( const wxPoint &  aPosition)
inline

Definition at line 189 of file sch_screen.h.

189 { m_aux_origin = aPosition; }
wxPoint m_aux_origin
Definition: sch_screen.h:113

References m_aux_origin.

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

◆ SetFileName()

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 220 of file eda_item.h.

220 { m_flags |= aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:164

References EDA_ITEM::m_flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddFootprintToBoard(), SCH_MOVE_TOOL::AlignElements(), PCBNEW_CONTROL::AppendBoard(), FOOTPRINT::BuildPolyCourtyards(), SCH_EDIT_TOOL::ChangeTextType(), TRACKS_CLEANER::cleanup(), GRAPHICS_CLEANER::cleanupSegments(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), LIB_PIN_TOOL::CreatePin(), SCH_DRAWING_TOOLS::createSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), KIGFX::SCH_PAINTER::draw(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), SCH_MOVE_TOOL::getConnectedDragItems(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), TRACKS_CLEANER::mergeCollinearSegments(), LIB_MOVE_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), EE_SELECTION_TOOL::narrowSelection(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseJunction(), SCH_ALTIUM_PLUGIN::ParseLabel(), SCH_ALTIUM_PLUGIN::ParseLine(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseNoERC(), SCH_ALTIUM_PLUGIN::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseWire(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), WS_DATA_ITEM::SyncDrawItems(), WS_DATA_ITEM_TEXT::SyncDrawItems(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 272 of file eda_item.h.

272 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: eda_item.h:163

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

Definition at line 79 of file eda_item.cpp.

80 {
82 
83  // If this a child object, then the parent modification state also needs to be set.
84  if( m_parent )
86 }
void SetModified()
Definition: eda_item.cpp:79
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:162
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: eda_item.h:102
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:220

References IS_CHANGED, EDA_ITEM::m_parent, EDA_ITEM::SetFlags(), and EDA_ITEM::SetModified().

Referenced by LIB_PIN_TOOL::EditPinProperties(), LEGACY_PLUGIN::loadZONE_CONTAINER(), SCH_LINE::Move(), SCH_COMPONENT::Move(), SCH_LINE::MoveEnd(), SCH_LINE::MoveStart(), LIB_PIN::MoveTo(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_ALTIUM_PLUGIN::Parse(), ALTIUM_PCB::Parse(), LIB_PART::RemoveDrawItem(), SCH_COMPONENT::SetConvert(), SCH_COMPONENT::SetLibId(), EDA_ITEM::SetModified(), LIB_FIELD::SetName(), SCH_COMPONENT::SetTransform(), and SCH_COMPONENT::SetUnit().

◆ SetModify()

◆ SetPageCount()

void BASE_SCREEN::SetPageCount ( int  aPageCount)
inherited

Definition at line 71 of file base_screen.cpp.

72 {
73  wxCHECK( aPageCount > 0, /* void */ );
74 
75  m_pageCount = aPageCount;
76 }
int m_pageCount
The number of BASE_SCREEN objects in this design.
Definition: base_screen.h:63

References BASE_SCREEN::m_pageCount.

Referenced by SCH_LEGACY_PLUGIN::loadPageSettings(), and SCH_EDIT_FRAME::SetSheetNumberAndCount().

◆ SetPageNumber()

void BASE_SCREEN::SetPageNumber ( const wxString &  aPageNumber)
inlineinherited

Definition at line 144 of file base_screen.h.

144 { m_pageNumber = aPageNumber; }
wxString m_pageNumber
A user defined string page number used for printing and plotting.
Definition: base_screen.h:81

References BASE_SCREEN::m_pageNumber.

Referenced by SCH_EDIT_TOOL::EditPageNumber(), and SCH_EDIT_FRAME::SetSheetNumberAndCount().

◆ SetPageSettings()

void SCH_SCREEN::SetPageSettings ( const PAGE_INFO aPageSettings)
inline

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in DIMENSION_BASE.

Definition at line 184 of file eda_item.h.

184 { m_parent = aParent; }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:162

References EDA_ITEM::m_parent.

Referenced by FOOTPRINT::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewComponent(), SCH_SHEET::AddPin(), LIB_CONTROL::AddSymbolToSchematic(), Append(), LIB_FIELD::Copy(), SYMBOL_EDIT_FRAME::CreateNewPart(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SCH_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_PART::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), LIB_PART::LIB_PART(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SYMBOL_EDIT_FRAME::LoadOneSymbol(), FOOTPRINT::operator=(), LIB_PART::operator=(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), LIB_EDIT_TOOL::Paste(), PCBNEW_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), pasteFootprintItemsToFootprintEditor(), SCH_DRAWING_TOOLS::PlaceComponent(), PCB_EDITOR_CONTROL::PlaceModule(), BACK_ANNOTATE::processNetNameChange(), BOARD_COMMIT::Push(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET_PIN::SCH_SHEET_PIN(), LIB_PART::SetFields(), DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_GLOBALLABEL::SwapData(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), and SwapItemData().

◆ SetPosition()

◆ SetSave()

void BASE_SCREEN::SetSave ( )
inlineinherited

Definition at line 122 of file base_screen.h.

122 { m_flagSave = true; }
bool m_flagSave
Indicates automatic file save.
Definition: base_screen.h:45

References BASE_SCREEN::m_flagSave.

Referenced by SCH_EDIT_FRAME::OnModify(), and PCB_BASE_FRAME::OnModify().

◆ SetSelected()

◆ SetState()

void EDA_ITEM::SetState ( int  type,
int  state 
)
inlineinherited

Definition at line 209 of file eda_item.h.

210  {
211  if( state )
212  m_status |= type; // state = ON or OFF
213  else
214  m_status &= ~type;
215  }
STATUS_FLAGS m_status
Definition: eda_item.h:161

References EDA_ITEM::m_status.

Referenced by LEGACY_PLUGIN::loadTrackList(), TRACKS_CLEANER::mergeCollinearSegments(), SELECTION_TOOL::selectConnectedTracks(), and TRACK::SetLocked().

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 218 of file eda_item.h.

218 { m_status = aStatus; }
STATUS_FLAGS m_status
Definition: eda_item.h:161

References EDA_ITEM::m_status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetTitleBlock()

void SCH_SCREEN::SetTitleBlock ( const TITLE_BLOCK aTitleBlock)
inline

◆ SetVirtualPageNumber()

void BASE_SCREEN::SetVirtualPageNumber ( int  aPageNumber)
inlineinherited

Definition at line 141 of file base_screen.h.

141 { m_virtualPageNumber = aPageNumber; }
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:71

References BASE_SCREEN::m_virtualPageNumber.

Referenced by SCH_LEGACY_PLUGIN::loadPageSettings(), PLEDITOR_PRINTOUT::PrintPage(), PL_EDITOR_FRAME::PrintPage(), SCH_EDIT_FRAME::SaveProject(), and SCH_EDIT_FRAME::SetSheetNumberAndCount().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 195 of file eda_item.h.

195 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:220
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ Sort()

static bool EDA_ITEM::Sort ( const EDA_ITEM aLeft,
const EDA_ITEM aRight 
)
inlinestaticinherited

Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers.

Parameters
aLeftThe left hand item to compare.
aRightThe right hand item to compare.
Returns
True if aLeft is less than aRight.

Definition at line 509 of file eda_item.h.

509 { return *aLeft < *aRight; }

◆ TestDanglingEnds()

bool SCH_SCREEN::TestDanglingEnds ( const SCH_SHEET_PATH aPath = nullptr)

Test all of the connectable objects in the schematic for unused connection points.

Parameters
aPathis a sheet path to pass to UpdateDanglingState if desired
Returns
True if any connection state changes were made.

Definition at line 1004 of file sch_screen.cpp.

1005 {
1006  std::vector< DANGLING_END_ITEM > endPoints;
1007  bool hasStateChanged = false;
1008 
1009  for( SCH_ITEM* item : Items() )
1010  item->GetEndPoints( endPoints );
1011 
1012  for( SCH_ITEM* item : Items() )
1013  {
1014  if( item->UpdateDanglingState( endPoints, aPath ) )
1015  hasStateChanged = true;
1016  }
1017 
1018  return hasStateChanged;
1019 }
EE_RTREE & Items()
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194

References Items().

Referenced by SCH_EDIT_FRAME::importFile(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

returns the type of object. This attribute should never be changed after a ctor sets it, so there is no public "setter" method.

Returns
KICAD_T - the type of object.

Definition at line 181 of file eda_item.h.

181 { return m_structType; }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:158

References EDA_ITEM::m_structType.

Referenced by FOOTPRINT::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), POINT_EDITOR::addCorner(), CONNECTION_SUBGRAPH::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), Append(), CONNECTION_GRAPH::buildConnectionGraph(), DIALOG_NET_INSPECTOR::buildNewItem(), SCH_SCREENS::buildScreenList(), calcArea(), calcMaxArea(), PCB_INSPECTION_TOOL::calculateSelectionRatsnest(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), PCB_TEXT::ClassOf(), PCB_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), FP_SHAPE::ClassOf(), SCH_NO_CONNECT::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), PCB_GROUP::ClassOf(), PCB_TARGET::ClassOf(), SCH_PIN::ClassOf(), SCH_LINE::ClassOf(), FP_TEXT::ClassOf(), SCH_FIELD::ClassOf(), PCB_SHAPE::ClassOf(), ZONE::ClassOf(), PAD::ClassOf(), SCH_BITMAP::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), SCH_SHEET_PIN::ClassOf(), FOOTPRINT::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_COMPONENT::ClassOf(), ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), SCH_TEXT::ClassOf(), BOARD::ClassOf(), SCH_SHEET::ClassOf(), ARC::ClassOf(), SCH_LABEL::ClassOf(), ALIGNED_DIMENSION::ClassOf(), VIA::ClassOf(), SCH_GLOBALLABEL::ClassOf(), ORTHOGONAL_DIMENSION::ClassOf(), SCH_HIERLABEL::ClassOf(), LEADER::ClassOf(), CENTER_DIMENSION::ClassOf(), TRACKS_CLEANER::cleanup(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_TEXT::compare(), LIB_POLYLINE::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_ITEM::compare(), EE_GRID_HELPER::computeAnchors(), GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), EE_RTREE::contains(), BOARD::ConvertKIIDsToCrossReferences(), SCHEMATIC::ConvertKIIDsToRefs(), PAD_TOOL::copyPadSettings(), FOOTPRINT::CoverageRatio(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewText(), BOARD_ADAPTER::createNewTrack(), ZONE_CREATE_HELPER::createNewZone(), DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDIT_TOOL::DoDelete(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawDimension(), CN_ITEM::Dump(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), EDA_ITEM_DESC::EDA_ITEM_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), LIB_EDIT_TOOL::editTextProperties(), EditToolSelectionFilter(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckNoConnects(), DRC_ENGINE::EvalRulesForItems(), EDIT_TOOL::FilletTracks(), NETLIST_EXPORTER_BASE::findNextSymbol(), PCB_BASE_FRAME::FocusOnItem(), EDIT_TOOL::FootprintFilter(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), FP_TEXT::FP_TEXT(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetContextualTextVars(), CONNECTION_GRAPH::getDefaultConnection(), getDrilledHoleShape(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), DIMENSION_BASE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTION_SUBGRAPH::GetNameForDriver(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), PCB_SHAPE::GetParentFootprint(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), getRect(), KIGFX::SCH_PAINTER::getRenderColor(), getShape(), PCB_TEXT::GetShownText(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), CONVERT_TOOL::getStartEndPoints(), BOARD::GroupLegalOps(), SELECTION_TOOL::GuessSelectionCandidates(), EE_SELECTION_TOOL::GuessSelectionCandidates(), hash_fp_item(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlightInternal(), PCB_INSPECTION_TOOL::HighlightItem(), PCB_INSPECTION_TOOL::highlightNet(), highlightNet(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_RTREE::insert(), DRC_RTREE::Insert(), insideArea(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), PCB_INSPECTION_TOOL::InspectClearance(), PCB_INSPECTION_TOOL::InspectConstraints(), ARRAY_CREATOR::Invoke(), CN_ANCHOR::IsDangling(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), CADSTAR_PCB_ARCHIVE_LOADER::isFootprint(), SCH_FIELD::IsHypertext(), isKeepoutZone(), isNetTie(), TRACK::IsNull(), PNS_KICAD_IFACE::IsOnLayer(), SCH_LINE::IsParallel(), SCH_FIELD::IsReplaceable(), IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), SELECTION_TOOL::itemPassesFilter(), CONVERT_TOOL::LinesToPoly(), CLIPBOARD_IO::Load(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), EE_POINT_EDITOR::Main(), LIB_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeListOfNets(), MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), SCH_FIELD::Matches(), memberOf(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), SCH_EDITOR_CONTROL::nextMatch(), APPEARANCE_CONTROLS::OnBoardItemAdded(), APPEARANCE_CONTROLS::OnBoardItemChanged(), APPEARANCE_CONTROLS::OnBoardItemRemoved(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), PCB_SHAPE::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), SCH_JUNCTION::operator<(), SCH_BUS_ENTRY_BASE::operator<(), SCH_FIELD::operator<(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_TEXT::operator<(), SCH_ITEM::operator<(), SCH_SHEET::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), PAD::PAD(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), CONVERT_TOOL::PolyToLines(), SCH_FIELD::Print(), Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BACK_ANNOTATE::processNetNameChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SELECTION_TOOL::RebuildSelection(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshSelection(), EE_RTREE::remove(), FOOTPRINT::Remove(), CN_CONNECTIVITY_ALGO::Remove(), Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), SCHEMATIC::ResolveCrossReference(), CONNECTION_SUBGRAPH::ResolveDrivers(), PCB_PARSER::resolveGroups(), WS_PROXY_UNDO_ITEM::Restore(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), SCH_SEXPR_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_SEXPR_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_SEXPR_PLUGIN_CACHE::saveCircle(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_SEXPR_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), CLIPBOARD_IO::SaveSelection(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), Schematic(), SCH_ITEM::Schematic(), CONVERT_TOOL::SegmentToArc(), SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), SELECTION_TOOL::selectConnectedTracks(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), PCB_GROUP::SwapData(), SCH_SHEET_PIN::SwapData(), PCB_TEXT::SwapData(), SCH_FIELD::SwapData(), TRACK::SwapData(), ARC::SwapData(), ALIGNED_DIMENSION::SwapData(), ORTHOGONAL_DIMENSION::SwapData(), SCH_SHEET::SwapData(), LEADER::SwapData(), SCH_COMPONENT::SwapData(), VIA::SwapData(), CENTER_DIMENSION::SwapData(), PAD::SwapData(), FOOTPRINT::SwapData(), ZONE::SwapData(), SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), ERC_TESTER::TestMultUnitPinConflicts(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), PCB_GROUP::TopLevelGroup(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), LIB_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), SCH_TEXT::UpdateDanglingState(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), PL_POINT_EDITOR::updateItem(), POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_BASE_FRAME::UpdateItem(), CONNECTION_GRAPH::updateItemConnectivity(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), SCH_EDITOR_CONTROL::updatePastedInstances(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_GLOBALLABEL::Visit(), SCH_SHEET::Visit(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), PCB_GROUP::WithinScope(), and NETLIST_EXPORTER_CADSTAR::writeListOfNets().

◆ Update()

void SCH_SCREEN::Update ( SCH_ITEM aItem)

Updates aItem's bounding box in the tree.

Parameters
aItemItem that needs to be updated.

Definition at line 234 of file sch_screen.cpp.

235 {
236  if( Remove( aItem ) )
237  Append( aItem );
238 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:241
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:129

References Append(), and Remove().

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::Load().

◆ UpdateLocalLibSymbolLinks()

void SCH_SCREEN::UpdateLocalLibSymbolLinks ( )

Initialize the LIB_PART reference for each SCH_COMPONENT found in this schematic with the local project library symbols.

Definition at line 712 of file sch_screen.cpp.

713 {
714  std::vector<SCH_COMPONENT*> symbols;
715 
716  for( auto item : Items().OfType( SCH_COMPONENT_T ) )
717  symbols.push_back( static_cast<SCH_COMPONENT*>( item ) );
718 
719  for( auto symbol : symbols )
720  {
721  // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
722  m_rtree.remove( symbol );
723 
724  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
725 
726  LIB_PART* libSymbol = nullptr;
727 
728  if( it != m_libSymbols.end() )
729  libSymbol = new LIB_PART( *it->second );
730 
731  symbol->SetLibSymbol( libSymbol );
732 
733  m_rtree.insert( symbol );
734  }
735 }
void insert(SCH_ITEM *aItem)
Function Insert() Inserts an item into the tree.
Definition: sch_rtree.h:62
bool remove(SCH_ITEM *aItem)
Function Remove() Removes an item from the tree.
Definition: sch_rtree.h:78
EE_RTREE m_rtree
Definition: sch_screen.h:114
Define a library symbol object.
EE_RTREE & Items()
Definition: sch_screen.h:159
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:123

References EE_RTREE::insert(), Items(), m_libSymbols, m_rtree, EE_RTREE::remove(), and SCH_COMPONENT_T.

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ UpdateSymbolLinks()

void SCH_SCREEN::UpdateSymbolLinks ( REPORTER aReporter = nullptr)

Initialize the LIB_PART reference for each SCH_COMPONENT found in this schematic from the project SYMBOL_LIB_TABLE.

Symbol library links are set using the symbol library table and will fall back to the cache only if the cache is loaded. The cache should only be loaded when opening legacy schematic files.

Note
This should only be called when the user specifically requests all library symbol links to be updated or when the legacy schematic is opened for the last time. All subsequent schematic loads with the new s-expression will contain the library symbols and should call UpdateLocalLibSymbolLinks.
Parameters
aReporterOptional REPORTER object to write status and error messages into.

Definition at line 553 of file sch_screen.cpp.

554 {
555  wxCHECK_RET( Schematic(), "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
556 
557  wxString msg;
558  std::unique_ptr< LIB_PART > libSymbol;
559  std::vector<SCH_COMPONENT*> symbols;
560  SYMBOL_LIB_TABLE* libs = Schematic()->Prj().SchSymbolLibTable();
561 
562  // This will be a nullptr if an s-expression schematic is loaded.
563  PART_LIBS* legacyLibs = Schematic()->Prj().SchLibs();
564 
565  for( auto item : Items().OfType( SCH_COMPONENT_T ) )
566  symbols.push_back( static_cast<SCH_COMPONENT*>( item ) );
567 
568  // Remove them from the R tree. There bounding box size may change.
569  for( auto symbol : symbols )
570  Remove( symbol );
571 
572  // Clear all existing symbol links.
573  clearLibSymbols();
574 
575  for( auto symbol : symbols )
576  {
577  LIB_PART* tmp = nullptr;
578  libSymbol.reset();
579 
580  // If the symbol is already in the internal library, map the symbol to it.
581  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
582 
583  if( ( it != m_libSymbols.end() ) )
584  {
585  if( aReporter )
586  {
587  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier "
588  "to '%s'. " ),
589  symbol->GetField( REFERENCE_FIELD )->GetText(),
590  symbol->GetField( VALUE_FIELD )->GetText(),
591  symbol->GetLibId().Format().wx_str() );
592  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
593  }
594 
595  // Internal library symbols are already flattened so just make a copy.
596  symbol->SetLibSymbol( new LIB_PART( *it->second ) );
597  continue;
598  }
599 
600  if( !symbol->GetLibId().IsValid() )
601  {
602  if( aReporter )
603  {
604  msg.Printf( _( "Schematic symbol reference '%s' library identifier is not "
605  "valid. Unable to link library symbol." ),
606  symbol->GetLibId().Format().wx_str() );
607  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
608  }
609 
610  continue;
611  }
612 
613  // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the the library nickname
614  // is not found in the table so check if the library still exists in the table
615  // before attempting to load the symbol.
616  if( !libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) && !legacyLibs )
617  {
618  if( aReporter )
619  {
620  msg.Printf( _( "Symbol library '%s' not found and no fallback cache "
621  "library available. Unable to link library symbol." ),
622  symbol->GetLibId().GetLibNickname().wx_str() );
623  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
624  }
625 
626  continue;
627  }
628 
629  if( libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) )
630  {
631  try
632  {
633  tmp = libs->LoadSymbol( symbol->GetLibId() );
634  }
635  catch( const IO_ERROR& ioe )
636  {
637  if( aReporter )
638  {
639  msg.Printf( _( "I/O error %s resolving library symbol %s" ), ioe.What(),
640  symbol->GetLibId().Format().wx_str() );
641  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
642  }
643  }
644  }
645 
646  if( !tmp && legacyLibs )
647  {
648  // If here, only the cache library should be loaded if the loaded schematic
649  // is the legacy file format.
650  wxCHECK2( legacyLibs->GetLibraryCount() == 1, continue );
651 
652  PART_LIB& legacyCacheLib = legacyLibs->at( 0 );
653 
654  // ...and it better be the cache library.
655  wxCHECK2( legacyCacheLib.IsCache(), continue );
656 
657  wxString id = symbol->GetLibId().Format();
658 
659  id.Replace( ':', '_' );
660 
661  if( aReporter )
662  {
663  msg.Printf( _( "Falling back to cache to set symbol '%s:%s' link '%s'." ),
664  symbol->GetField( REFERENCE_FIELD )->GetText(),
665  symbol->GetField( VALUE_FIELD )->GetText(),
666  id );
667  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
668  }
669 
670  tmp = legacyCacheLib.FindPart( id );
671  }
672 
673  if( tmp )
674  {
675  // We want a full symbol not just the top level child symbol.
676  libSymbol = tmp->Flatten();
677  libSymbol->SetParent();
678 
679  m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
680  new LIB_PART( *libSymbol.get() ) } );
681 
682  if( aReporter )
683  {
684  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'. " ),
685  symbol->GetField( REFERENCE_FIELD )->GetText(),
686  symbol->GetField( VALUE_FIELD )->GetText(),
687  symbol->GetLibId().Format().wx_str() );
688  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
689  }
690  }
691  else
692  {
693  if( aReporter )
694  {
695  msg.Printf( _( "No library symbol found for schematic symbol '%s %s'. " ),
696  symbol->GetField( REFERENCE_FIELD )->GetText(),
697  symbol->GetField( VALUE_FIELD )->GetText() );
698  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
699  }
700  }
701 
702  symbol->SetLibSymbol( libSymbol.release() );
703  }
704 
705  // Changing the symbol may adjust the bbox of the symbol. This re-inserts the
706  // item with the new bbox
707  for( auto symbol : symbols )
708  Append( symbol );
709 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:241
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
void clearLibSymbols()
Definition: sch_screen.cpp:98
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Function ReportTail Places the report at the end of the list, for objects that support report orderin...
Definition: reporter.h:94
LIB_PART * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_PART having aName from the library given by aNickname.
int GetLibraryCount()
Field Value of part, i.e. "3.3K".
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
Define a library symbol object.
std::unique_ptr< LIB_PART > Flatten() const
Return a flattened symbol inheritance to the caller.
A collection of PART_LIB objects.
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:129
#define _(s)
Definition: 3d_actions.cpp:33
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:89
EE_RTREE & Items()
Definition: sch_screen.h:159
PROJECT & Prj() const
Return a reference to the project this schematic is part of.
Definition: schematic.h:85
Field Reference of part, i.e. "IC21".
Object used to load, save, search, and otherwise manipulate symbol library files.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:123

References _, Append(), clearLibSymbols(), LIB_PART::Flatten(), PART_LIBS::GetLibraryCount(), LIB_TABLE::HasLibrary(), Items(), SYMBOL_LIB_TABLE::LoadSymbol(), m_libSymbols, SCHEMATIC::Prj(), REFERENCE_FIELD, Remove(), REPORTER::ReportTail(), RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, SCH_COMPONENT_T, Schematic(), VALUE_FIELD, and IO_ERROR::What().

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

Function ViewBBox() returns the bounding box of the item covering all its layers.

Returns
BOX2I - the current bounding box

Implements KIGFX::VIEW_ITEM.

Reimplemented in PAD, FOOTPRINT, EDIT_POINTS, CENTER_DIMENSION, PCB_SHAPE, GERBER_DRAW_ITEM, DIMENSION_BASE, TRACK, FP_TEXT, KIGFX::WS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, PCB_MARKER, MY_DRAWING, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, BRIGHT_BOX, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 206 of file eda_item.cpp.

207 {
208  // Basic fallback
209  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
210  VECTOR2I( GetBoundingBox().GetSize() ) );
211 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: eda_item.cpp:89

References EDA_ITEM::GetBoundingBox().

Referenced by GERBVIEW_FRAME::GetDocumentExtents(), BRIGHT_BOX::ViewBBox(), DIMENSION_BASE::ViewBBox(), PCB_SHAPE::ViewBBox(), and BRIGHT_BOX::ViewDraw().

◆ ViewDraw()

virtual void KIGFX::VIEW_ITEM::ViewDraw ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Function ViewDraw() Draws the parts of the object belonging to layer aLayer.

viewDraw() is an alternative way for drawing objects if if there is no PAINTER assigned for the view or if the PAINTER doesn't know how to paint this particular implementation of VIEW_ITEM. The preferred way of drawing is to design an appropriate PAINTER object, the method below is intended only for quick hacks and debugging purposes.

Parameters
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on

Reimplemented in EDIT_POINTS, KIGFX::WS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, KIGFX::VIEW_GROUP, KIGFX::PREVIEW::SELECTION_AREA, MY_DRAWING, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::VIEW_OVERLAY, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::ORIGIN_VIEWITEM, BRIGHT_BOX, KIGFX::PREVIEW::ARC_ASSISTANT, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, and PCB_BRIGHT_BOX.

Definition at line 117 of file view_item.h.

118  {}

Referenced by KIGFX::VIEW::draw(), and KIGFX::VIEW::updateItemGeometry().

◆ ViewGetLayers()

void EDA_ITEM::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtualinherited

Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.

For instance, a PAD spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw() is repeatedly called for each of the layers returned by ViewGetLayers(), depending on the rendering order.

Parameters
aLayers[]output layer index array
aCountnumber of layer indices in aLayers[]

Implements KIGFX::VIEW_ITEM.

Reimplemented in PAD, FOOTPRINT, SCH_SHEET, EDIT_POINTS, VIA, BOARD_ITEM, SCH_ITEM, GERBER_DRAW_ITEM, TRACK, FP_TEXT, LIB_PART, LIB_ITEM, MY_DRAWING, ZONE, SCH_COMPONENT, SCH_LINE, PCB_GROUP, LIB_FIELD, KIGFX::WS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, SCH_BITMAP, PCB_MARKER, SCH_BUS_ENTRY_BASE, WS_DRAW_ITEM_BASE, SCH_NO_CONNECT, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, LIB_TEXT, SCH_JUNCTION, BRIGHT_BOX, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, SCH_MARKER, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::RULER_ITEM, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 214 of file eda_item.cpp.

215 {
216  // Basic fallback
217  aCount = 1;
218  aLayers[0] = 0;
219 }

◆ ViewGetLOD()

virtual double KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Function ViewGetLOD() Returns the level of detail (LOD) of the item.

A level of detail is the minimal VIEW scale that is sufficient for an item to be shown on a given layer.

Parameters
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on
Returns
the level of detail. 0 always show the item, because the actual zoom level (or VIEW scale) is always > 0

Reimplemented in FP_ZONE, PAD, FOOTPRINT, VIA, GERBER_DRAW_ITEM, TRACK, FP_TEXT, ZONE, PCB_GROUP, and FP_SHAPE.

Definition at line 141 of file view_item.h.

142  {
143  // By default always show the item
144  return 0.0;
145  }

Referenced by PNS_KICAD_IFACE::IsItemVisible(), KIGFX::VIEW::drawItem::operator()(), EE_GRID_HELPER::queryVisible(), GRID_HELPER::queryVisible(), and SELECTION_TOOL::Selectable().

◆ viewPrivData()

◆ Visit()

SEARCH_RESULT EDA_ITEM::Visit ( INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
virtualinherited

Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data.

Implementations should call inspector->Inspect() on types in scanTypes[], and may use IterateForward() to do so on lists of such data.

Parameters
inspectorAn INSPECTOR instance to use in the inspection.
testDataArbitrary data used by the inspector.
scanTypesWhich KICAD_T types are of interest and the order is significant too, terminated by EOT.
Returns
SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE, and determined by the inspector.

Reimplemented in BOARD, SCH_COMPONENT, FOOTPRINT, SCH_SHEET, LIB_PART, GERBER_FILE_IMAGE, SCH_GLOBALLABEL, GERBER_DRAW_ITEM, TRACK, PCB_GROUP, and GBR_LAYOUT.

Definition at line 107 of file eda_item.cpp.

108 {
109 #if 0 && defined(DEBUG)
110  std::cout << GetClass().mb_str() << ' ';
111 #endif
112 
113  if( IsType( scanTypes ) )
114  {
115  if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
116  return SEARCH_RESULT::QUIT;
117  }
118 
120 }
virtual bool IsType(const KICAD_T aScanTypes[]) const
Function IsType Checks whether the item is one of the listed types.
Definition: eda_item.h:250
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References CONTINUE, EDA_ITEM::GetClass(), EDA_ITEM::IsType(), and QUIT.

Referenced by GERBER_COLLECTOR::Collect(), GENERAL_COLLECTOR::Collect(), PCB_TYPE_COLLECTOR::Collect(), PCB_LAYER_COLLECTOR::Collect(), and EDA_ITEM::IterateForward().

Member Data Documentation

◆ m_aliases

std::unordered_set< std::shared_ptr< BUS_ALIAS > > SCH_SCREEN::m_aliases
private

List of bus aliases stored in this screen.

Definition at line 120 of file sch_screen.h.

Referenced by AddBusAlias(), ClearBusAliases(), and GetBusAliases().

◆ m_aux_origin

wxPoint SCH_SCREEN::m_aux_origin
private

Definition at line 113 of file sch_screen.h.

Referenced by GetAuxOrigin(), and SetAuxOrigin().

◆ m_Center

bool BASE_SCREEN::m_Center
inherited

Center on screen.

If true (0.0) is centered on screen coordinates can be < 0 and > 0 except for schematics. false: when coordinates can only be >= 0 (schematics).

Definition at line 95 of file base_screen.h.

Referenced by BASE_SCREEN::BASE_SCREEN(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), BASE_SCREEN::InitDataPoints(), LIB_VIEW_FRAME::LIB_VIEW_FRAME(), and SCH_SCREEN().

◆ m_clientSheetPathList

std::vector<SCH_SHEET_PATH> SCH_SCREEN::m_clientSheetPathList
private

The list of sheet paths sharing this screen.

Used in some annotation calculations to update alternate references.

Note: a screen having a m_refCount = 1 (only one sheet path using it) can have many sheet paths sharing this screen if it is inside another sheet having many instances.

Definition at line 108 of file sch_screen.h.

Referenced by GetClientSheetPaths().

◆ m_DrawOrg

wxPoint BASE_SCREEN::m_DrawOrg
inherited

offsets for drawing the circuit on the screen

Definition at line 87 of file base_screen.h.

Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), BASE_SCREEN::InitDataPoints(), PLEDITOR_PRINTOUT::PrintPage(), and SCH_PRINTOUT::PrintPage().

◆ m_fileName

wxString SCH_SCREEN::m_fileName
private

Definition at line 97 of file sch_screen.h.

Referenced by GetFileName(), and SetFileName().

◆ m_flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_Initialized

bool BASE_SCREEN::m_Initialized
inherited

◆ m_libSymbols

std::map<wxString, LIB_PART*> SCH_SCREEN::m_libSymbols
private

Library symbols required for this schematic.

Definition at line 123 of file sch_screen.h.

Referenced by AddLibSymbol(), Append(), clearLibSymbols(), GetLibSymbols(), Remove(), UpdateLocalLibSymbolLinks(), and UpdateSymbolLinks().

◆ m_LocalOrigin

VECTOR2D BASE_SCREEN::m_LocalOrigin
inherited

◆ m_modification_sync

int SCH_SCREEN::m_modification_sync
private

Definition at line 116 of file sch_screen.h.

Referenced by Append(), and SCH_SCREEN().

◆ m_pageCount

int BASE_SCREEN::m_pageCount
protectedinherited

The number of BASE_SCREEN objects in this design.

This currently only has meaning for SCH_SCREEN objects because PCB_SCREEN object are limited to a single file. The count is virtual because SCH_SCREEN objects can be used more than once so the screen (page) count can be more than the number of screen objects.

Definition at line 63 of file base_screen.h.

Referenced by BASE_SCREEN::BASE_SCREEN(), Clear(), BASE_SCREEN::GetPageCount(), and BASE_SCREEN::SetPageCount().

◆ m_PageLayoutDescrFileName

◆ m_pageNumber

wxString BASE_SCREEN::m_pageNumber
protectedinherited

A user defined string page number used for printing and plotting.

This currently only has meaning for SCH_SCREEN objects because PCB_SCREEN object are limited to a single file. This must be set before displaying, printing, or plotting the current sheet. If empty, the m_virtualPageNumber value is converted to a string.

Definition at line 81 of file base_screen.h.

Referenced by BASE_SCREEN::GetPageNumber(), and BASE_SCREEN::SetPageNumber().

◆ m_paper

PAGE_INFO SCH_SCREEN::m_paper
private

Definition at line 111 of file sch_screen.h.

Referenced by GetPageSettings(), SCH_SCREEN(), and SetPageSettings().

◆ m_parent

◆ m_refCount

int SCH_SCREEN::m_refCount
private

Definition at line 99 of file sch_screen.h.

Referenced by DecRefCount(), GetRefCount(), IncRefCount(), and SCH_SCREEN().

◆ m_rtree

EE_RTREE SCH_SCREEN::m_rtree
private

◆ m_ScrollCenter

VECTOR2D BASE_SCREEN::m_ScrollCenter
inherited

Current scroll center point in logical units.

Definition at line 99 of file base_screen.h.

Referenced by EDA_DRAW_PANEL_GAL::DoRePaint(), and DIALOG_ERC::OnERCItemSelected().

◆ m_sheetInstances

std::vector<SCH_SHEET_INSTANCE> SCH_SCREEN::m_sheetInstances
private

◆ m_StartVisu

wxPoint BASE_SCREEN::m_StartVisu
inherited

Coordinates in drawing units of the current view position (upper left corner of device)

Definition at line 92 of file base_screen.h.

Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), PLEDITOR_PRINTOUT::PrintPage(), SCH_PRINTOUT::PrintPage(), and DIALOG_FIND::search().

◆ m_status

STATUS_FLAGS EDA_ITEM::m_status
protectedinherited

◆ m_symbolInstances

std::vector<SYMBOL_INSTANCE_REFERENCE> SCH_SCREEN::m_symbolInstances
private

The list of symbol instances loaded from the schematic file.

This list is only used to as temporary storage when the schematic file is loaded. If the screen is the root sheet, then this information is used to update the SCH_COMPONENT instance reference and unit information after the entire schematic is loaded and is never used again. If this screen is not the root sheet, then the schematic file is the root sheet of another project and this information is saved unchanged back to the schematic file.

Warning
Under no circumstances is this information to be modified or used after the schematic file is loaded. It is read only and it is only written to non-root schematic files.

Definition at line 139 of file sch_screen.h.

Referenced by SCH_SEXPR_PLUGIN::Format(), GetSymbolInstances(), and SCH_SEXPR_PARSER::parseSchSymbolInstances().

◆ m_titles

TITLE_BLOCK SCH_SCREEN::m_titles
private

Definition at line 112 of file sch_screen.h.

Referenced by Clear(), GetTitleBlock(), and SetTitleBlock().

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 151 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddHierarchicalReference(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateComponents(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), DRAWING_TOOL::DrawVia(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), FOOTPRINT::Duplicate(), FOOTPRINT::DuplicateItem(), PAD_TOOL::EditPad(), PCB_EDIT_FRAME::ExchangeFootprint(), PAD_TOOL::explodePad(), BOARD::FillItemMap(), SCH_SHEET_LIST::FillItemMap(), PCB_BASE_FRAME::FocusOnItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_IO::format(), FormatProbeItem(), SCH_PIN::GetDefaultNetName(), BOARD::GetItem(), SCH_SHEET_LIST::GetItem(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), SCH_REFERENCE::GetPath(), SCH_MARKER::GetUUID(), PCB_MARKER::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), SCH_LEGACY_PLUGIN::loadComponent(), CADSTAR_PCB_ARCHIVE_LOADER::loadComponents(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), LEGACY_PLUGIN::loadTrackList(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), TRACK::cmp_tracks::operator()(), PCB_SHAPE::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), PAD::PAD(), PCB_PARSER::parseDIMENSION(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_COMPONENT::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_COMPONENT::SCH_COMPONENT(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), RC_ITEM::SetItems(), SwapItemData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), SCH_EDITOR_CONTROL::updatePastedInstances(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ m_virtualPageNumber

int BASE_SCREEN::m_virtualPageNumber
protectedinherited

An integer based page number used for printing a range of pages.

This page number is set before printing and plotting because page numbering does not reflect the actual page number in complex hiearachies in SCH_SCREEN objects.

Definition at line 71 of file base_screen.h.

Referenced by BASE_SCREEN::BASE_SCREEN(), Clear(), BASE_SCREEN::GetPageNumber(), BASE_SCREEN::GetVirtualPageNumber(), and BASE_SCREEN::SetVirtualPageNumber().

◆ SCH_EDIT_FRAME

friend SCH_SCREEN::SCH_EDIT_FRAME
private

Definition at line 142 of file sch_screen.h.

◆ SCH_SEXPR_PARSER

friend SCH_SCREEN::SCH_SEXPR_PARSER
private

Definition at line 143 of file sch_screen.h.

◆ SCH_SEXPR_PLUGIN

friend SCH_SCREEN::SCH_SEXPR_PLUGIN
private

Definition at line 144 of file sch_screen.h.


The documentation for this class was generated from the following files: