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)
 
 ~SCH_SCREEN ()
 
SCHEMATICSchematic () const
 
EE_RTREEItems ()
 Gets the full RTree, usually for iterating. More...
 
const EE_RTREEItems () const
 
bool IsEmpty () const
 
bool HasItems (KICAD_T aItemType) const
 
bool HasSheets () const
 
virtual wxString GetClass () const override
 Return the class name. More...
 
void SetFileFormatVersionAtLoad (int aVersion)
 
int GetFileFormatVersionAtLoad () const
 
const PAGE_INFOGetPageSettings () const
 
void SetPageSettings (const PAGE_INFO &aPageSettings)
 
void SetFileName (const wxString &aFileName)
 Set the file name for this screen to aFileName. More...
 
const wxString & GetFileName () const
 
void SetFileReadOnly (bool aIsReadOnly)
 
bool IsReadOnly () const
 
void SetFileExists (bool aFileExists)
 
bool FileExists () 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
 
void SetConnectivityDirty ()
 
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths ()
 Return the number of times this screen is used. More...
 
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) const
 Check aPosition within a distance of aAccuracy for items of type aFilter. More...
 
void UpdateSymbolLinks (REPORTER *aReporter=nullptr)
 Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic from the project SYMBOL_LIB_TABLE. More...
 
void UpdateLocalLibSymbolLinks ()
 Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic with the local project library symbols. More...
 
void Print (const RENDER_SETTINGS *aSettings)
 Print all the items in the screen to aDC. More...
 
void Plot (PLOTTER *aPlotter) const
 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)
 Update 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 (const SCH_ITEM *aItem) const
 
void TestDanglingEnds (const SCH_SHEET_PATH *aPath=nullptr, std::function< void(SCH_ITEM *)> *aChangedHandler=nullptr) const
 Test all of the connectable objects in the schematic for unused connection points. More...
 
std::set< SCH_ITEM * > MarkConnections (SCH_LINE *aSegment)
 Return all wires and junctions connected to aSegment which are not connected any symbol pin. More...
 
void ClearDrawingState ()
 Clear the state flags of all the items in the screen. More...
 
size_t CountConnectedItems (const wxPoint &aPos, bool aTestJunctions) const
 
bool IsJunction (const wxPoint &aPosition) const
 Test if a junction is required for the items at aPosition on the screen. More...
 
bool IsExplicitJunction (const wxPoint &aPosition) const
 Indicates that a junction dot is necessary at the given location. More...
 
bool IsExplicitJunctionNeeded (const wxPoint &aPosition) const
 Indicates that a junction dot is necessary at the given location, and does not yet exist. More...
 
bool IsExplicitJunctionAllowed (const wxPoint &aPosition) const
 Indicates that a juction dot may be placed at the given location. More...
 
bool IsTerminalPoint (const wxPoint &aPosition, int aLayer) const
 Test if aPosition is a connection point on aLayer. More...
 
LIB_PINGetPin (const wxPoint &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
 Test the screen for a symbol pin item at aPosition. More...
 
SCH_SHEET_PINGetSheetPin (const wxPoint &aPosition) const
 Test the screen if aPosition is a sheet label object. More...
 
void ClearAnnotation (SCH_SHEET_PATH *aSheetPath)
 Clear the annotation for the symbols 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) const
 Add all schematic sheet and symbol objects in the screen to aItems. More...
 
void GetSheets (std::vector< SCH_ITEM * > *aItems) const
 Similar to Items().OfType( SCH_SHEET_T ), but return the sheets in a deterministic order (L-R, 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) const
 Return a line item located at aPosition. More...
 
SCH_LINEGetWire (const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
 
SCH_LINEGetBus (const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
 
SCH_TEXTGetLabel (const wxPoint &aPosition, int aAccuracy=0) const
 Return a label item located at aPosition. More...
 
std::map< wxString, LIB_SYMBOL * > & GetLibSymbols ()
 Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this schematic. More...
 
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols () const
 
void AddLibSymbol (LIB_SYMBOL *aLibSymbol)
 Add aLibSymbol to the library symbol map. More...
 
void AddBusAlias (std::shared_ptr< BUS_ALIAS > aAlias)
 Add a bus alias definition (and transfers ownership of the pointer). More...
 
void ClearBusAliases ()
 Remove all bus alias definitions. More...
 
std::unordered_set< std::shared_ptr< BUS_ALIAS > > GetBusAliases () const
 Return 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
 
const KIIDGetUuid () const
 
void AssignNewUuid ()
 
void InitDataPoints (const wxSize &aPageSizeInternalUnits)
 
void SetContentModified (bool aModified=true)
 
bool IsContentModified () 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
 Returns the type of object. 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 IsEntered () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (EDA_ITEM_FLAGS type) const
 
void SetState (EDA_ITEM_FLAGS type, bool state)
 
EDA_ITEM_FLAGS GetStatus () const
 
void SetStatus (EDA_ITEM_FLAGS aStatus)
 
void SetFlags (EDA_ITEM_FLAGS aMask)
 
void ClearFlags (EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
EDA_ITEM_FLAGS GetFlags () const
 
bool HasFlag (EDA_ITEM_FLAGS aFlag) const
 
EDA_ITEM_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 Check whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Set and clear 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)
 Populate 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
 Test if aPosition is inside or on the boundary of this item. More...
 
virtual bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const
 Test if aRect intersects this item. More...
 
virtual const EDA_RECT GetBoundingBox () const
 Return 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
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual EDA_ITEMClone () const
 Create 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[])
 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
 Return 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 BITMAPS GetMenuImage () const
 Return a pointer to an image to be used in menus. More...
 
virtual bool Matches (const wxFindReplaceData &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
virtual bool Replace (const wxFindReplaceData &aSearchData, void *aAuxData=nullptr)
 Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Override this method in any derived object that supports test find and replace. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the all the layers within the VIEW the object is painted on. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
virtual double ViewGetLOD (int aLayer, VIEW *aView) const
 Return 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[])
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const wxFindReplaceData &aSearchData, wxString &aText)
 Perform 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)
 Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

double m_LastZoomLevel
 last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse the same zoom level when back to the sheet using this screen More...
 
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...
 
const KIID m_Uuid
 

Static Public Attributes

static wxString m_DrawingSheetFileName
 the name of the drawing sheet file, or empty to use the default drawing sheet More...
 

Protected Member Functions

bool Matches (const wxString &aText, const wxFindReplaceData &aSearchData) const
 Compare 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...
 
EDA_ITEM_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
EDA_ITEM_FLAGS m_flags
 

Private Member Functions

bool doIsJunction (const wxPoint &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
 
void clearLibSymbols ()
 

Private Attributes

friend SCH_EDIT_FRAME
 
friend SCH_SEXPR_PARSER
 
friend SCH_SEXPR_PLUGIN
 
wxString m_fileName
 
int m_fileFormatVersionAtLoad
 
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
 
bool m_zoomInitialized
 
bool m_isReadOnly
 Read only status of the screen file. More...
 
bool m_fileExists
 
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
 List of bus aliases stored in this screen. More...
 
std::map< wxString, LIB_SYMBOL * > 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
 
KIID m_uuid
 A unique identifier for each schematic file. More...
 

Detailed Description

Definition at line 93 of file sch_screen.h.

Constructor & Destructor Documentation

◆ SCH_SCREEN()

SCH_SCREEN::SCH_SCREEN ( EDA_ITEM aParent = nullptr)

Definition at line 66 of file sch_screen.cpp.

66  :
67  BASE_SCREEN( aParent, SCH_SCREEN_T ),
69  m_paper( wxT( "A4" ) ),
70  m_isReadOnly( false ),
71  m_fileExists( false )
72 {
74  m_refCount = 0;
75  m_zoomInitialized = false;
76  m_LastZoomLevel = 1.0;
77 
78  // Suitable for schematic only. For symbol_editor and viewlib, must be set to true
79  m_Center = false;
80 
81  InitDataPoints( m_paper.GetSizeIU() );
82 }
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
Definition: sch_screen.h:508
int m_refCount
Definition: sch_screen.h:523
int m_modification_sync
Definition: sch_screen.h:540
bool m_fileExists
Definition: sch_screen.h:549
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:46
bool m_isReadOnly
Read only status of the screen file.
Definition: sch_screen.h:546
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:522
PAGE_INFO m_paper
Definition: sch_screen.h:535
bool m_Center
Center on screen.
Definition: base_screen.h:96
BASE_SCREEN(EDA_ITEM *aParent, KICAD_T aType=SCREEN_T)
Definition: base_screen.cpp:35
bool m_zoomInitialized
Definition: sch_screen.h:543

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

◆ ~SCH_SCREEN()

SCH_SCREEN::~SCH_SCREEN ( )

Definition at line 85 of file sch_screen.cpp.

86 {
88  FreeDrawList();
89 }
void clearLibSymbols()
Definition: sch_screen.cpp:101
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:247

References clearLibSymbols(), and FreeDrawList().

Member Function Documentation

◆ AddBusAlias()

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

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

Definition at line 1148 of file sch_screen.cpp.

1149 {
1150  m_aliases.insert( aAlias );
1151 }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:552

References m_aliases.

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

◆ AddLibSymbol()

void SCH_SCREEN::AddLibSymbol ( LIB_SYMBOL aLibSymbol)

Add aLibSymbol to 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_SYMBOL to be added to the symbol map.

Definition at line 1130 of file sch_screen.cpp.

1131 {
1132  wxCHECK( aLibSymbol, /* void */ );
1133 
1134  wxString libSymbolName = aLibSymbol->GetLibId().Format().wx_str();
1135 
1136  auto it = m_libSymbols.find( libSymbolName );
1137 
1138  if( it != m_libSymbols.end() )
1139  {
1140  delete it->second;
1141  m_libSymbols.erase( it );
1142  }
1143 
1144  m_libSymbols[libSymbolName] = aLibSymbol;
1145 }
LIB_ID GetLibId() const override
Definition: lib_symbol.h:135
UTF8 Format() const
Definition: lib_id.cpp:116
wxString wx_str() const
Definition: utf8.cpp:46
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555

References LIB_ID::Format(), LIB_SYMBOL::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 146 of file sch_screen.cpp.

147 {
148  if( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T )
149  {
150  // Ensure the item can reach the SCHEMATIC through this screen
151  aItem->SetParent( this );
152 
153  if( aItem->Type() == SCH_SYMBOL_T )
154  {
155  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( aItem );
156 
157  if( symbol->GetLibSymbolRef() )
158  {
159  symbol->GetLibSymbolRef()->GetDrawItems().sort();
160 
161  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
162 
163  if( it == m_libSymbols.end() || !it->second )
164  {
166  new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
167  }
168  else
169  {
170  // The original library symbol may have changed since the last time
171  // it was added to the schematic. If it has changed, then a new name
172  // must be created for the library symbol list to prevent all of the
173  // other schematic symbols referencing that library symbol from changing.
174  LIB_SYMBOL* foundSymbol = it->second;
175 
176  foundSymbol->GetDrawItems().sort();
177 
178  if( *foundSymbol != *symbol->GetLibSymbolRef() )
179  {
180  int cnt = 1;
181  wxString newName;
182 
183  newName.Printf( wxT( "%s_%d" ), symbol->GetLibId().GetUniStringLibItemName(),
184  cnt );
185 
186  while( m_libSymbols.find( newName ) != m_libSymbols.end() )
187  {
188  cnt += 1;
189  newName.Printf( wxT( "%s_%d" ), symbol->GetLibId().GetUniStringLibItemName(),
190  cnt );
191  }
192 
193  // Update the schematic symbol library link as this symbol only exists
194  // in the schematic.
195  symbol->SetSchSymbolLibraryName( newName );
196 
197  LIB_SYMBOL* newLibSymbol = new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
198  LIB_ID newLibId( wxEmptyString, newName );
199 
200  newLibSymbol->SetLibId( newLibId );
201  newLibSymbol->SetName( newName );
202  symbol->SetLibSymbol( newLibSymbol->Flatten().release() );
203  m_libSymbols[newName] = newLibSymbol;
204  }
205  }
206  }
207  }
208 
209  m_rtree.insert( aItem );
211  }
212 }
void insert(SCH_ITEM *aItem)
Insert an item into the tree.
Definition: sch_rtree.h:60
void sort()
Definition: multivector.h:247
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
int m_modification_sync
Definition: sch_screen.h:540
Define a library symbol object.
Definition: lib_symbol.h:96
void SetLibSymbol(LIB_SYMBOL *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
Definition: sch_symbol.cpp:280
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:380
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:115
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition: sch_symbol.h:165
wxString GetSchSymbolLibraryName() const
Definition: sch_symbol.cpp:271
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:362
EE_RTREE m_rtree
Definition: sch_screen.h:538
void SetSchSymbolLibraryName(const wxString &aName)
The name of the symbol in the schematic library symbol list.
Definition: sch_symbol.h:161
void SetLibId(const LIB_ID &aLibId)
Definition: lib_symbol.h:136
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
Definition: lib_symbol.h:484
Schematic symbol object.
Definition: sch_symbol.h:78
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
Definition: lib_id.h:114
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
const LIB_ID & GetLibId() const
Definition: sch_symbol.h:148

References LIB_SYMBOL::Flatten(), LIB_SYMBOL::GetDrawItems(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetSchSymbolLibraryName(), LIB_ID::GetUniStringLibItemName(), EE_RTREE::insert(), m_libSymbols, m_modification_sync, m_rtree, SCH_FIELD_T, SCH_SHEET_PIN_T, SCH_SYMBOL_T, LIB_SYMBOL::SetLibId(), SCH_SYMBOL::SetLibSymbol(), LIB_SYMBOL::SetName(), EDA_ITEM::SetParent(), SCH_SYMBOL::SetSchSymbolLibraryName(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), and EDA_ITEM::Type().

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_EAGLE_PLUGIN::addImplicitConnections(), Append(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckHierSheets(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), SCH_LEGACY_PLUGIN::LoadContent(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), SCH_EAGLE_PLUGIN::loadInstance(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_EAGLE_PLUGIN::loadSegments(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_ERC::OnRunERCClick(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseComponent(), SCH_ALTIUM_PLUGIN::ParseImage(), SCH_ALTIUM_PLUGIN::ParseJunction(), SCH_ALTIUM_PLUGIN::ParseLabel(), SCH_ALTIUM_PLUGIN::ParseLine(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseNoERC(), SCH_ALTIUM_PLUGIN::ParseNote(), 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::ParseTextFrame(), SCH_ALTIUM_PLUGIN::ParseWire(), SCH_EDITOR_CONTROL::Paste(), DIALOG_CHANGE_SYMBOLS::processSymbol(), SCH_EDIT_FRAME::ResolveERCExclusions(), SCH_EDIT_FRAME::SaveSymbolToSchematic(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestMultiunitFootprints(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestSimilarLabels(), ERC_TESTER::TestTextVars(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), Update(), 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 215 of file sch_screen.cpp.

216 {
217  wxCHECK_RET( aScreen, wxT( "Invalid screen object." ) );
218 
219  // No need to descend the hierarchy. Once the top level screen is copied, all of its
220  // children are copied as well.
221  for( SCH_ITEM* aItem : aScreen->m_rtree )
222  Append( aItem );
223 
224  aScreen->Clear( false );
225 }
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
Definition: sch_screen.cpp:228
EE_RTREE m_rtree
Definition: sch_screen.h:538
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:146
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

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

◆ AssignNewUuid()

void SCH_SCREEN::AssignNewUuid ( )
inline

Definition at line 498 of file sch_screen.h.

498 { m_uuid = KIID(); }
Definition: kiid.h:44
KIID m_uuid
A unique identifier for each schematic file.
Definition: sch_screen.h:580

References m_uuid.

Referenced by SCH_EDIT_FRAME::SaveProject().

◆ CheckIfOnDrawList()

bool SCH_SCREEN::CheckIfOnDrawList ( const SCH_ITEM aItem) const

Definition at line 336 of file sch_screen.cpp.

337 {
338  return m_rtree.contains( aItem, true );
339 }
EE_RTREE m_rtree
Definition: sch_screen.h:538
bool contains(const SCH_ITEM *aItem, bool aRobust=false) const
Determine if a given item exists in the tree.
Definition: sch_rtree.h:126

References EE_RTREE::contains(), and m_rtree.

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList().

◆ ClassOf()

bool SCH_SCREEN::ClassOf ( const EDA_ITEM aItem)
static

Definition at line 140 of file sch_screen.cpp.

141 {
142  return aItem && SCH_SCREEN_T == aItem->Type();
143 }
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

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 228 of file sch_screen.cpp.

229 {
230  if( aFree )
231  {
232  FreeDrawList();
233  clearLibSymbols();
234  }
235  else
236  {
237  m_rtree.clear();
238  }
239 
240  // Clear the project settings
242 
243  m_titles.Clear();
244 }
void clearLibSymbols()
Definition: sch_screen.cpp:101
void Clear()
Definition: title_block.h:113
TITLE_BLOCK m_titles
Definition: sch_screen.h:536
int m_pageCount
The number of BASE_SCREEN objects in this design.
Definition: base_screen.h:111
EE_RTREE m_rtree
Definition: sch_screen.h:538
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:247
void clear()
Remove all items from the RTree.
Definition: sch_rtree.h:112
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:119

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 symbols in aSheetPath on the screen.

Parameters
[in]aSheetPathThe sheet path of the symbol annotation to clear. If NULL then the entire hierarchy is cleared.

Definition at line 984 of file sch_screen.cpp.

985 {
986 
987  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
988  {
989  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
990 
991  symbol->ClearAnnotation( aSheetPath );
992  }
993 }
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath)
Clear exiting symbol annotation.
Schematic symbol object.
Definition: sch_symbol.h:78
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References SCH_SYMBOL::ClearAnnotation(), Items(), and SCH_SYMBOL_T.

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

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearBusAliases()

void SCH_SCREEN::ClearBusAliases ( )
inline

Remove all bus alias definitions.

Definition at line 473 of file sch_screen.h.

474  {
475  m_aliases.clear();
476  }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:552

References m_aliases.

◆ ClearDrawingState()

void SCH_SCREEN::ClearDrawingState ( )

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

Definition at line 893 of file sch_screen.cpp.

894 {
895  for( SCH_ITEM* item : Items() )
896  item->ClearTempFlags();
897 }
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References Items().

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

◆ ClearEditFlags()

◆ ClearFlags()

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

Definition at line 153 of file eda_item.h.

153 { m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480

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(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SYMBOL_EDITOR_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), EE_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::narrowSelection(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::selectMultiple(), 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 101 of file sch_screen.cpp.

102 {
103  for( auto libSymbol : m_libSymbols )
104  delete libSymbol.second;
105 
106  m_libSymbols.clear();
107 }
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555

References m_libSymbols.

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

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 165 of file eda_item.h.

166  {
168  DO_NOT_DRAW );
169  }
#define DO_NOT_DRAW
Used to disable draw function.
#define STARTPOINT
When a line is selected, these flags indicate which.
#define ENDPOINT
ends. (Used to support dragging.)
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
#define CANDIDATE
flag indicating that the structure is connected
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:153
#define SKIP_STRUCT
flag indicating that the structure should be ignored
#define TEMP_SELECTED
flag indicating that the structure has already selected

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 143 of file view_item.h.

144  {
145  m_viewPrivData = nullptr;
146  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:151

References KIGFX::VIEW_ITEM::m_viewPrivData.

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

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Create 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_SYMBOL, PAD, FOOTPRINT, PCB_DIM_CENTER, PCB_DIM_LEADER, SCH_HIERLABEL, PCB_DIM_ORTHOGONAL, PCB_VIA, SCH_SHEET, PCB_DIM_ALIGNED, SCH_GLOBALLABEL, SCH_LABEL, PCB_ARC, SCH_TEXT, SCH_LINE, LIB_PIN, SCH_BUS_BUS_ENTRY, FP_TEXT, SCH_FIELD, PCB_TRACK, SCH_SHEET_PIN, SCH_BUS_WIRE_ENTRY, LIB_FIELD, FP_SHAPE, PCB_TEXT, SCH_BITMAP, PCB_SHAPE, PCB_GROUP, SCH_JUNCTION, SCH_NO_CONNECT, LIB_TEXT, SCH_MARKER, LIB_SHAPE, NETINFO_ITEM, PCB_TARGET, SCH_PIN, PCB_MARKER, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 83 of file eda_item.cpp.

84 {
85  wxCHECK_MSG( false, nullptr, wxT( "Clone not implemented in derived class " ) + GetClass() +
86  wxT( ". Bad programmer!" ) );
87 }
virtual wxString GetClass() const =0
Return the class name.

References EDA_ITEM::GetClass().

Referenced by BOOST_AUTO_TEST_CASE(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), PCB_DIMENSION_BASE::GetEffectiveShape(), LIB_SYMBOL::LIB_SYMBOL(), new_clone(), LIB_SYMBOL::operator=(), SYMBOL_EDITOR_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_SYMBOL::SetConversion(), LIB_SYMBOL::SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), COMMIT::Stage(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ CountConnectedItems()

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

Definition at line 970 of file sch_screen.cpp.

971 {
972  size_t count = 0;
973 
974  for( const SCH_ITEM* item : Items().Overlapping( aPos ) )
975  {
976  if( ( item->Type() != SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
977  count++;
978  }
979 
980  return count;
981 }
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References Items(), and SCH_JUNCTION_T.

◆ DecRefCount()

void SCH_SCREEN::DecRefCount ( )

Definition at line 124 of file sch_screen.cpp.

125 {
126  wxCHECK_RET( m_refCount != 0,
127  wxT( "Screen reference count already zero. Bad programmer!" ) );
128  m_refCount--;
129 }
int m_refCount
Definition: sch_screen.h:523

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
[in]aItemThe schematic object to be deleted from the screen.

Definition at line 311 of file sch_screen.cpp.

312 {
313  wxCHECK_RET( aItem, wxT( "Cannot delete invalid item from screen." ) );
314 
315  // Markers are not saved in the file, no need to flag as modified.
316  // TODO: Maybe we should have a listing somewhere of items that aren't saved?
317  if( aItem->Type() != SCH_MARKER_T )
319 
320  Remove( aItem );
321 
322  if( aItem->Type() == SCH_SHEET_PIN_T )
323  {
324  // This structure is attached to a sheet, get the parent sheet object.
325  SCH_SHEET_PIN* sheetPin = (SCH_SHEET_PIN*) aItem;
326  SCH_SHEET* sheet = sheetPin->GetParent();
327  wxCHECK_RET( sheet, wxT( "Sheet pin parent not properly set, bad programmer!" ) );
328  sheet->RemovePin( sheetPin );
329  return;
330  }
331 
332  delete aItem;
333 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:273
SCH_SHEET * GetParent() const
Get the parent sheet object of this sheet pin.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:353
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

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

◆ doIsJunction()

bool SCH_SCREEN::doIsJunction ( const wxPoint &  aPosition,
bool  aBreakCrossings,
bool *  aHasExplicitJunctionDot,
bool *  aHasBusEntry 
) const
private

Definition at line 444 of file sch_screen.cpp.

446 {
447  enum layers { WIRES = 0, BUSES };
448 
449  *aHasExplicitJunctionDot = false;
450  *aHasBusEntry = false;
451 
452  bool breakLines[ 2 ] = { false };
453  std::unordered_set<int> exitAngles[ 2 ];
454  std::vector<const SCH_LINE*> midPointLines[ 2 ];
455 
456  // A pin at 90º still shouldn't match a line at 90º so just give pins unique numbers
457  int uniqueAngle = 10000;
458 
459  for( const SCH_ITEM* item : Items().Overlapping( aPosition ) )
460  {
461  if( item->GetEditFlags() & STRUCT_DELETED )
462  continue;
463 
464  switch( item->Type() )
465  {
466  case SCH_JUNCTION_T:
467  if( item->HitTest( aPosition, -1 ) )
468  *aHasExplicitJunctionDot = true;
469 
470  break;
471 
472  case SCH_LINE_T:
473  {
474  const SCH_LINE* line = static_cast<const SCH_LINE*>( item );
475  int layer;
476 
477  if( line->GetStartPoint() == line->GetEndPoint() )
478  break;
479  else if( line->GetLayer() == LAYER_WIRE )
480  layer = WIRES;
481  else if( line->GetLayer() == LAYER_BUS )
482  layer = BUSES;
483  else
484  break;
485 
486  if( line->IsConnected( aPosition ) )
487  {
488  breakLines[ layer ] = true;
489  exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
490  }
491  else if( line->HitTest( aPosition, -1 ) )
492  {
493  if( aBreakCrossings )
494  breakLines[ layer ] = true;
495 
496  // Defer any line midpoints until we know whether or not we're breaking them
497  midPointLines[ layer ].push_back( line );
498  }
499  }
500  break;
501 
503  if( item->IsConnected( aPosition ) )
504  {
505  breakLines[ BUSES ] = true;
506  exitAngles[ BUSES ].insert( uniqueAngle++ );
507  breakLines[ WIRES ] = true;
508  exitAngles[ WIRES ].insert( uniqueAngle++ );
509  *aHasBusEntry = true;
510  }
511 
512  break;
513 
514  case SCH_SYMBOL_T:
515  case SCH_SHEET_T:
516  if( item->IsConnected( aPosition ) )
517  {
518  breakLines[ WIRES ] = true;
519  exitAngles[ WIRES ].insert( uniqueAngle++ );
520  }
521 
522  break;
523 
524  default:
525  break;
526  }
527  }
528 
529  for( int layer : { WIRES, BUSES } )
530  {
531  if( breakLines[ layer ] )
532  {
533  for( const SCH_LINE* line : midPointLines[ layer ] )
534  {
535  exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
536  exitAngles[ layer ].insert( line->GetReverseAngleFrom( aPosition ) );
537  }
538  }
539  }
540 
541  return exitAngles[ WIRES ].size() >= 3 || exitAngles[ BUSES ].size() >= 3;
542 }
int GetReverseAngleFrom(const wxPoint &aPoint) const
Definition: sch_line.cpp:485
wxPoint GetStartPoint() const
Definition: sch_line.h:90
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_line.cpp:833
int GetAngleFrom(const wxPoint &aPoint) const
Definition: sch_line.cpp:472
#define STRUCT_DELETED
flag indication structures to be erased
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:259
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
boost::ptr_vector< WIRE > WIRES
Definition: specctra.h:2983
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
bool IsConnected(const wxPoint &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:129
wxPoint GetEndPoint() const
Definition: sch_line.h:93

References SCH_LINE::GetAngleFrom(), SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), SCH_LINE::GetStartPoint(), SCH_LINE::HitTest(), SCH_ITEM::IsConnected(), Items(), LAYER_BUS, LAYER_WIRE, SCH_BUS_WIRE_ENTRY_T, SCH_JUNCTION_T, SCH_LINE_T, SCH_SHEET_T, SCH_SYMBOL_T, and STRUCT_DELETED.

Referenced by IsExplicitJunction(), IsExplicitJunctionAllowed(), IsExplicitJunctionNeeded(), and IsJunction().

◆ 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.

the list of symbols), 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 996 of file sch_screen.cpp.

997 {
998  if( GetClientSheetPaths().size() <= 1 ) // No need for alternate reference
999  return;
1000 
1001  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
1002  {
1003  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
1004 
1005  // Add (when not existing) all sheet path entries
1006  for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() )
1007  symbol->AddSheetPathReferenceEntryIfMissing( sheet.Path() );
1008  }
1009 }
bool AddSheetPathReferenceEntryIfMissing(const KIID_PATH &aSheetPath)
Add an instance to the alternate references list (m_instanceReferences), if this entry does not alrea...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Schematic symbol object.
Definition: sch_symbol.h:78
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
Definition: sch_screen.h:179
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References SCH_SYMBOL::AddSheetPathReferenceEntryIfMissing(), GetClientSheetPaths(), Items(), and SCH_SYMBOL_T.

Referenced by SCH_SCREENS::ClearAnnotationOfNewSheetPaths().

◆ FileExists()

bool SCH_SCREEN::FileExists ( ) const
inline

Definition at line 151 of file sch_screen.h.

151 { return m_fileExists; }
bool m_fileExists
Definition: sch_screen.h:549

References m_fileExists.

Referenced by SCH_EDIT_FRAME::UpdateTitle().

◆ 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 247 of file sch_screen.cpp.

248 {
249  // We don't know which order we will encounter dependent items (e.g. pins or fields), so
250  // we store the items to be deleted until we've fully cleared the tree before deleting
251  std::vector<SCH_ITEM*> delete_list;
252 
253  std::copy_if( m_rtree.begin(), m_rtree.end(), std::back_inserter( delete_list ),
254  []( SCH_ITEM* aItem )
255  {
256  return ( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T );
257  } );
258 
259  m_rtree.clear();
260 
261  for( SCH_ITEM* item : delete_list )
262  delete item;
263 }
iterator end()
Returns a read/write iterator that points to one past the last element in the EE_RTREE.
Definition: sch_rtree.h:277
EE_RTREE m_rtree
Definition: sch_screen.h:538
iterator begin()
Returns a read/write iterator that points to the first element in the EE_RTREE N.B.
Definition: sch_rtree.h:268
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
void clear()
Remove all items from the RTree.
Definition: sch_rtree.h:112

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 86 of file inspectable.h.

87  {
89  TYPE_ID thisType = TYPE_HASH( *this );
90  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
91  return object ? aProperty->getter( object ) : wxAny();
92  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual wxAny getter(void *aObject) const =0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

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

Referenced by BOOST_AUTO_TEST_CASE(), 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 95 of file inspectable.h.

96  {
98  TYPE_ID thisType = TYPE_HASH( *this );
99  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
100  return object ? aProperty->get<T>( object ) : T();
101  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return 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 104 of file inspectable.h.

105  {
107  TYPE_ID thisType = TYPE_HASH( *this );
108  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
109  boost::optional<T> ret = T();
110 
111  if( prop )
112  {
113  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114 
115  if( object )
116  ret = prop->get<T>( object );
117  }
118 
119  return ret;
120  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return 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 153 of file sch_screen.h.

153 { return m_aux_origin; }
wxPoint m_aux_origin
Definition: sch_screen.h:537

References m_aux_origin.

◆ GetBoundingBox()

const EDA_RECT EDA_ITEM::GetBoundingBox ( ) const
virtualinherited

Return 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, PCB_DIM_CENTER, SCH_HIERLABEL, SCH_GLOBALLABEL, DS_DRAW_ITEM_BITMAP, DS_DRAW_ITEM_TEXT, SCH_SYMBOL, SCH_LABEL, DS_DRAW_ITEM_PAGE, SCH_SHEET, PCB_DIMENSION_BASE, DS_DRAW_ITEM_RECT, LIB_SYMBOL, SCH_TEXT, LIB_ITEM, GERBER_DRAW_ITEM, FP_TEXT, LIB_PIN, DS_DRAW_ITEM_POLYPOLYGONS, SCH_LINE, FOOTPRINT, PCB_GROUP, PCB_TEXT, DS_DRAW_ITEM_LINE, ZONE, LIB_FIELD, SCH_FIELD, PCB_TRACK, PCB_MARKER, PCB_SHAPE, SCH_BUS_ENTRY_BASE, SCH_BITMAP, DS_DRAW_ITEM_BASE, PCB_TARGET, SCH_PIN, LIB_TEXT, GBR_LAYOUT, SCH_NO_CONNECT, LIB_SHAPE, SCH_JUNCTION, and SCH_MARKER.

Definition at line 75 of file eda_item.cpp.

76 {
77  // return a zero-sized box per default. derived classes should override
78  // this
79  return EDA_RECT( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
80 }
Handle the component boundary box.
Definition: eda_rect.h:42

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), CN_ITEM::BBox(), TEST_EE_ITEM_FIXTURE::CompareItems(), TEST_BOARD_ITEM_FIXTURE::CompareItems(), EE_RTREE::contains(), KIGFX::PCB_PAINTER::Draw(), LIB_ITEM::GetBoundingBox(), GetBoundingBoxes(), GERBVIEW_SELECTION::GetCenter(), BOARD_ITEM::GetCenter(), SCH_MOVE_TOOL::getConnectedDragItems(), EE_SELECTION_TOOL::GuessSelectionCandidates(), EE_RTREE::insert(), insideArea(), insideBackCourtyard(), insideCourtyard(), insideFrontCourtyard(), SCH_EDIT_TOOL::Mirror(), DRC_RTREE::QueryColliding(), EE_RTREE::remove(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskBridges(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance(), 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 
) const
inline

Definition at line 429 of file sch_screen.h.

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

References GetLine(), and LAYER_BUS.

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

◆ GetBusAliases()

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

Return a list of bus aliases defined in this screen.

Definition at line 481 of file sch_screen.h.

482  {
483  return m_aliases;
484  }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:552

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 124 of file sch_screen.h.

125  {
126  return wxT( "SCH_SCREEN" );
127  }

◆ GetClientSheetPaths()

std::vector<SCH_SHEET_PATH>& SCH_SCREEN::GetClientSheetPaths ( )
inline

Return the number of times this screen is used.

In the legacy file formats: if this screen is used only once (not a complex hierarchy) the reference field can be used to store the symbol reference. If this screen is used more than once (a complex hierarchy), then symbols must have a full alternate reference management via sheet paths.

In the new schematic file format, all instance data is stored in the root sheet even for simple hierarchies.

Returns
the sheet paths sharing this screen.

Definition at line 179 of file sch_screen.h.

180  {
181  return m_clientSheetPathList;
182  }
std::vector< SCH_SHEET_PATH > m_clientSheetPathList
The list of sheet paths sharing this screen.
Definition: sch_screen.h:532

References m_clientSheetPathList.

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

◆ GetEditFlags()

EDA_ITEM_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 157 of file eda_item.h.

158  {
159  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_RESIZING | IS_DRAGGING
161 
162  return m_flags & mask;
163  }
#define IS_NEW
New item, just created.
#define IS_RESIZING
Item being resized.
#define IS_DRAGGING
Item being dragged.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_MOVING
Item being moved.
#define STRUCT_DELETED
flag indication structures to be erased
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.

References IS_DRAGGING, IS_MOVING, IS_NEW, IS_PASTED, IS_RESIZING, IS_WIRE_IMAGE, EDA_ITEM::m_flags, and STRUCT_DELETED.

Referenced by EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_SYMBOL::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_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_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), and DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow().

◆ GetFileFormatVersionAtLoad()

int SCH_SCREEN::GetFileFormatVersionAtLoad ( ) const
inline

Definition at line 130 of file sch_screen.h.

130 { return m_fileFormatVersionAtLoad; }
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:522

References m_fileFormatVersionAtLoad.

Referenced by SCH_EDIT_FRAME::OpenProjectFiles().

◆ GetFileName()

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in BOARD, PCB_TRACK, and PCB_SHAPE.

Definition at line 258 of file eda_item.h.

258 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:251

References EDA_ITEM::GetPosition().

Referenced by SCH_EDIT_FRAME::FocusOnItem().

◆ GetHierarchicalItems()

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

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

Parameters
[out]aItemsHierarchical item list to fill.

Definition at line 1012 of file sch_screen.cpp.

1013 {
1014  static KICAD_T hierarchicalTypes[] = { SCH_SYMBOL_T, SCH_SHEET_T, SCH_GLOBAL_LABEL_T, EOT };
1015 
1016  for( SCH_ITEM* item : Items() )
1017  {
1018  if( item->IsType( hierarchicalTypes ) )
1019  aItems->push_back( item );
1020  }
1021 }
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

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

◆ GetItem()

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

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

Parameters
[in]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 342 of file sch_screen.cpp.

343 {
344  EDA_RECT bbox;
345  bbox.SetOrigin( aPosition );
346  bbox.Inflate( aAccuracy );
347 
348  for( SCH_ITEM* item : Items().Overlapping( aType, bbox ) )
349  {
350  if( item->HitTest( aPosition, aAccuracy ) )
351  return item;
352  }
353 
354  return nullptr;
355 }
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:130
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Handle the component boundary box.
Definition: eda_rect.h:42
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:364

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 
) const

Return a label item located at aPosition.

Parameters
[in]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 1107 of file sch_screen.cpp.

1108 {
1109  for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
1110  {
1111  switch( item->Type() )
1112  {
1113  case SCH_LABEL_T:
1114  case SCH_GLOBAL_LABEL_T:
1115  case SCH_HIER_LABEL_T:
1116  if( item->HitTest( aPosition, aAccuracy ) )
1117  return static_cast<SCH_TEXT*>( item );
1118 
1119  break;
1120 
1121  default:
1122  ;
1123  }
1124  }
1125 
1126  return nullptr;
1127 }
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

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

Referenced by IsTerminalPoint().

◆ GetLibSymbols() [1/2]

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

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

Returns
The list of unique LIB_SYMBOL object pointers.

Definition at line 451 of file sch_screen.h.

451 { return m_libSymbols; }
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555

References m_libSymbols.

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

◆ GetLibSymbols() [2/2]

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

Definition at line 452 of file sch_screen.h.

452 { return m_libSymbols; }
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555

References m_libSymbols.

◆ GetLine()

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

Return a line item located at aPosition.

Parameters
[in]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 1070 of file sch_screen.cpp.

1072 {
1073  // an accuracy of 0 had problems with rounding errors; use at least 1
1074  aAccuracy = std::max( aAccuracy, 1 );
1075 
1076  for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
1077  {
1078  if( item->Type() != SCH_LINE_T )
1079  continue;
1080 
1081  if( item->GetLayer() != aLayer )
1082  continue;
1083 
1084  if( !item->HitTest( aPosition, aAccuracy ) )
1085  continue;
1086 
1087  switch( aSearchType )
1088  {
1089  case ENTIRE_LENGTH_T:
1090  return (SCH_LINE*) item;
1091 
1092  case EXCLUDE_END_POINTS_T:
1093  if( !( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1094  return (SCH_LINE*) item;
1095  break;
1096 
1097  case END_POINTS_ONLY_T:
1098  if( ( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1099  return (SCH_LINE*) item;
1100  }
1101  }
1102 
1103  return nullptr;
1104 }
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

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

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

◆ GetMenuImage()

BITMAPS EDA_ITEM::GetMenuImage ( ) const
virtualinherited

Return 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_SYMBOL, PAD, FOOTPRINT, PCB_DIM_CENTER, PCB_DIM_LEADER, SCH_HIERLABEL, PCB_DIM_ORTHOGONAL, SCH_GLOBALLABEL, PCB_VIA, SCH_SHEET, PCB_DIM_ALIGNED, SCH_LABEL, GERBER_DRAW_ITEM, SCH_TEXT, SCH_BUS_BUS_ENTRY, SCH_LINE, LIB_PIN, FP_TEXT, PCB_TRACK, SCH_FIELD, SCH_SHEET_PIN, PCB_GROUP, SCH_BUS_WIRE_ENTRY, LIB_FIELD, FP_SHAPE, PCB_TEXT, PCB_SHAPE, SCH_BITMAP, LIB_TEXT, LIB_SHAPE, SCH_JUNCTION, SCH_NO_CONNECT, SCH_MARKER, PCB_MARKER, and PCB_TARGET.

Definition at line 274 of file eda_item.cpp.

275 {
276  return BITMAPS::dummy_item;
277 }

References dummy_item.

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

◆ GetMsgPanelInfo()

◆ GetPageCount()

◆ GetPageNumber()

const wxString & BASE_SCREEN::GetPageNumber ( ) const
inherited

Definition at line 71 of file base_screen.cpp.

72 {
73  static wxString pageNumber;
74 
75  if( m_pageNumber.IsEmpty() )
76  pageNumber.Printf( wxT( "%d" ), m_virtualPageNumber );
77  else
78  pageNumber = m_pageNumber;
79 
80  return pageNumber;
81 }
wxString m_pageNumber
A user defined string page number used for printing and plotting.
Definition: base_screen.h:129
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:119

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

Referenced by KIGFX::SCH_VIEW::DisplaySheet(), DIALOG_PLOT_SCHEMATIC::plotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetHpgl(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), EDA_DRAW_FRAME::PrintDrawingSheet(), PCB_EDIT_FRAME::SetPageSettings(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().

◆ GetPageSettings()

◆ GetParent()

◆ GetPin()

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

Test the screen for a symbol pin item at aPosition.

Parameters
[in]aPositionPosition to test.
[out]aSymbolThe symbol 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 900 of file sch_screen.cpp.

902 {
903  SCH_SYMBOL* candidate = nullptr;
904  LIB_PIN* pin = nullptr;
905 
906  for( SCH_ITEM* item : Items().Overlapping( SCH_SYMBOL_T, aPosition ) )
907  {
908  candidate = static_cast<SCH_SYMBOL*>( item );
909 
910  if( aEndPointOnly )
911  {
912  pin = nullptr;
913 
914  if( !candidate->GetLibSymbolRef() )
915  continue;
916 
917  for( pin = candidate->GetLibSymbolRef()->GetNextPin(); pin;
918  pin = candidate->GetLibSymbolRef()->GetNextPin( pin ) )
919  {
920  // Skip items not used for this part.
921  if( candidate->GetUnit() && pin->GetUnit() &&
922  ( pin->GetUnit() != candidate->GetUnit() ) )
923  continue;
924 
925  if( candidate->GetConvert() && pin->GetConvert() &&
926  ( pin->GetConvert() != candidate->GetConvert() ) )
927  continue;
928 
929  if( candidate->GetPinPhysicalPosition( pin ) == aPosition )
930  break;
931  }
932 
933  if( pin )
934  break;
935  }
936  else
937  {
938  pin = (LIB_PIN*) candidate->GetDrawItem( aPosition, LIB_PIN_T );
939 
940  if( pin )
941  break;
942  }
943  }
944 
945  if( pin && aSymbol )
946  *aSymbol = candidate;
947 
948  return pin;
949 }
wxPoint GetPinPhysicalPosition(const LIB_PIN *Pin) const
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition: sch_symbol.h:165
Schematic symbol object.
Definition: sch_symbol.h:78
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
int GetUnit() const
Definition: sch_symbol.h:196
LIB_ITEM * GetDrawItem(const wxPoint &aPosition, KICAD_T aType=TYPE_NOT_INIT)
Return the symbol library item at aPosition that is part of this symbol.
int GetConvert() const
Definition: sch_symbol.h:224
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References SCH_SYMBOL::GetConvert(), SCH_SYMBOL::GetDrawItem(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPinPhysicalPosition(), SCH_SYMBOL::GetUnit(), Items(), LIB_PIN_T, pin, and SCH_SYMBOL_T.

Referenced by IsTerminalPoint(), and MarkConnections().

◆ GetPosition()

virtual wxPoint EDA_ITEM::GetPosition ( ) const
inlinevirtualinherited

Reimplemented in SCH_SYMBOL, PCB_VIA, SCH_SHEET, DS_DRAW_ITEM_BITMAP, DELETED_BOARD_ITEM, DS_DRAW_ITEM_TEXT, PCB_ARC, BOARD, DS_DRAW_ITEM_PAGE, SCH_TEXT, SCH_LINE, DS_DRAW_ITEM_RECT, LIB_PIN, SCH_FIELD, FOOTPRINT, PAD, DS_DRAW_ITEM_POLYPOLYGONS, LIB_FIELD, GERBER_DRAW_ITEM, DS_DRAW_ITEM_LINE, SCH_BITMAP, PCB_DIMENSION_BASE, SCH_BUS_ENTRY_BASE, PCB_GROUP, ZONE, SCH_JUNCTION, SCH_NO_CONNECT, KIGFX::ORIGIN_VIEWITEM, SCH_MARKER, PCB_TRACK, LIB_TEXT, NETINFO_ITEM, FP_TEXT, LIB_SHAPE, SCH_PIN, PCB_SHAPE, PCB_TEXT, PCB_MARKER, and PCB_TARGET.

Definition at line 251 of file eda_item.h.

251 { return wxPoint(); }

Referenced by SCH_MOVE_TOOL::AlignElements(), BOOST_AUTO_TEST_CASE(), TEST_EE_ITEM_FIXTURE::CompareItems(), TEST_BOARD_ITEM_FIXTURE::CompareItems(), EE_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::computeAnchors(), SCH_EDIT_FRAME::DeleteJunction(), KIGFX::PCB_PAINTER::draw(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), PCB_SELECTION_TOOL::FindItem(), GERBVIEW_SELECTION::GetCenter(), EDA_ITEM::GetFocusPosition(), getMinDist(), SCH_FIELD::GetParentPosition(), GetSheets(), PCB_SELECTION::GetTopLeftItem(), EE_SELECTION::GetTopLeftItem(), BOARD_ITEM::GetX(), BOARD_ITEM::GetY(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_EDITOR_CONTROL::nextMatch(), BOARD::cmp_items::operator()(), SCH_ITEM::operator<(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), PCB_CONTROL::placeBoardItems(), POSITION_RELATIVE_TOOL::PositionRelative(), BACK_ANNOTATE::processNetNameChange(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), PCB_SELECTION_TOOL::selectConnectedTracks(), RC_ITEM::ShowReport(), DRC_TEST_PROVIDER_MISC::testTextVars(), TransformItem(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), PL_EDIT_TOOL::updateModificationPoint(), and EE_POINT_EDITOR::updatePoints().

◆ GetRefCount()

int SCH_SCREEN::GetRefCount ( ) const
inline

Definition at line 162 of file sch_screen.h.

162 { return m_refCount; }
int m_refCount
Definition: sch_screen.h:523

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

Return 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_SYMBOL, PAD, FOOTPRINT, BOARD, SCH_HIERLABEL, SCH_GLOBALLABEL, PCB_VIA, SCH_SHEET, DS_DRAW_ITEM_BITMAP, DELETED_BOARD_ITEM, DS_DRAW_ITEM_TEXT, SCH_LABEL, DS_DRAW_ITEM_PAGE, GERBER_DRAW_ITEM, PCB_DIMENSION_BASE, SCH_TEXT, DS_DRAW_ITEM_RECT, LIB_PIN, SCH_BUS_BUS_ENTRY, SCH_LINE, FP_TEXT, PCB_TRACK, SCH_FIELD, SCH_SHEET_PIN, PCB_GROUP, DS_DRAW_ITEM_POLYPOLYGONS, SCH_BUS_WIRE_ENTRY, LIB_FIELD, FP_SHAPE, DS_DRAW_ITEM_LINE, PCB_TEXT, PCB_SHAPE, SCH_BITMAP, LIB_TEXT, LIB_SHAPE, PCB_MARKER, SCH_JUNCTION, SCH_NO_CONNECT, SCH_MARKER, PCB_TARGET, SCH_PIN, and DELETED_SHEET_ITEM.

Definition at line 109 of file eda_item.cpp.

110 {
111  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
112  GetClass() );
113 
114  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
115 }
virtual wxString GetClass() const =0
Return the class name.

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::collectAllDriverValues(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), DIALOG_GROUP_PROPERTIES::DoAddMember(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), DRC_ENGINE::EvalRules(), BOARD_INSPECTION_TOOL::getItemDescription(), PCB_MARKER::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), RC_ITEM::ShowReport(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetSheetInstances()

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

Definition at line 491 of file sch_screen.h.

492  {
493  return m_sheetInstances;
494  }
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
Definition: sch_screen.h:572

References m_sheetInstances.

Referenced by TEST_SCH_SHEET_LIST_FIXTURE::loadSchematic(), and SCH_EDITOR_CONTROL::setClipboardInstances().

◆ GetSheetPin()

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

Test the screen if aPosition is a sheet label object.

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

Definition at line 952 of file sch_screen.cpp.

953 {
954  SCH_SHEET_PIN* sheetPin = nullptr;
955 
956  for( SCH_ITEM* item : Items().Overlapping( SCH_SHEET_T, aPosition ) )
957  {
958  SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
959 
960  sheetPin = sheet->GetPin( aPosition );
961 
962  if( sheetPin )
963  break;
964  }
965 
966  return sheetPin;
967 }
SCH_SHEET_PIN * GetPin(const wxPoint &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:555
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:54
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References SCH_SHEET::GetPin(), Items(), and SCH_SHEET_T.

Referenced by IsTerminalPoint().

◆ GetSheets()

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

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

Definition at line 1024 of file sch_screen.cpp.

1025 {
1026  for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
1027  aItems->push_back( item );
1028 
1029  std::sort( aItems->begin(), aItems->end(),
1030  []( EDA_ITEM* a, EDA_ITEM* b ) -> bool
1031  {
1032  if( a->GetPosition().x == b->GetPosition().x )
1033  {
1034  // Ensure deterministic sort
1035  if( a->GetPosition().y == b->GetPosition().y )
1036  return a->m_Uuid < b->m_Uuid;
1037 
1038  return a->GetPosition().y < b->GetPosition().y;
1039  }
1040  else
1041  return a->GetPosition().x < b->GetPosition().x;
1042  } );
1043 }
virtual wxPoint GetPosition() const
Definition: eda_item.h:251
const KIID m_Uuid
Definition: eda_item.h:474
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

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

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

◆ GetState()

int EDA_ITEM::GetState ( EDA_ITEM_FLAGS  type) const
inlineinherited

Definition at line 136 of file eda_item.h.

137  {
138  return m_status & type;
139  }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:477

References EDA_ITEM::m_status.

Referenced by BOARD_ITEM::IsLocked().

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 149 of file eda_item.h.

149 { return m_status; }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:477

References EDA_ITEM::m_status.

◆ GetSymbolInstances()

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

Definition at line 486 of file sch_screen.h.

487  {
488  return m_symbolInstances;
489  }
std::vector< SYMBOL_INSTANCE_REFERENCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
Definition: sch_screen.h:571

References m_symbolInstances.

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

◆ GetTitleBlock()

◆ GetUuid()

const KIID& SCH_SCREEN::GetUuid ( ) const
inline

Definition at line 496 of file sch_screen.h.

496 { return m_uuid; }
KIID m_uuid
A unique identifier for each schematic file.
Definition: sch_screen.h:580

References m_uuid.

Referenced by SCH_EDIT_FRAME::SaveProject().

◆ GetVirtualPageNumber()

◆ GetWire()

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

Definition at line 423 of file sch_screen.h.

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

References GetLine(), and LAYER_WIRE.

Referenced by IsTerminalPoint().

◆ HasFlag()

◆ HasItems()

bool SCH_SCREEN::HasItems ( KICAD_T  aItemType) const

Definition at line 132 of file sch_screen.cpp.

133 {
134  EE_RTREE::EE_TYPE sheets = m_rtree.OfType( aItemType );
135 
136  return sheets.begin() != sheets.end();
137 }
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:230
EE_RTREE m_rtree
Definition: sch_screen.h:538
iterator end()
Definition: sch_rtree.h:224
iterator begin()
Definition: sch_rtree.h:219
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
Definition: sch_rtree.h:192

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

Referenced by HasSheets().

◆ HasSheets()

bool SCH_SCREEN::HasSheets ( ) const
inline

Definition at line 120 of file sch_screen.h.

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

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

Test if aRect intersects this 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_SYMBOL, PAD, ZONE, FOOTPRINT, PCB_VIA, SCH_GLOBALLABEL, SCH_SHEET, DS_DRAW_ITEM_BITMAP, DS_DRAW_ITEM_TEXT, PCB_ARC, SCH_TEXT, SCH_LINE, PCB_DIMENSION_BASE, DS_DRAW_ITEM_RECT, GERBER_DRAW_ITEM, SCH_FIELD, FP_TEXT, LIB_ITEM, PCB_TRACK, DS_DRAW_ITEM_POLYPOLYGONS, LIB_PIN, PCB_GROUP, SCH_BITMAP, SCH_JUNCTION, SCH_BUS_ENTRY_BASE, PCB_TEXT, PCB_SHAPE, SCH_NO_CONNECT, DS_DRAW_ITEM_BASE, PCB_TARGET, LIB_TEXT, and LIB_SHAPE.

Definition at line 237 of file eda_item.h.

238  {
239  return false; // derived classes should override this function
240  }

◆ IncRefCount()

void SCH_SCREEN::IncRefCount ( )

Definition at line 118 of file sch_screen.cpp.

119 {
120  m_refCount++;
121 }
int m_refCount
Definition: sch_screen.h:523

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 46 of file base_screen.cpp.

47 {
48  if( m_Center )
49  {
50  m_DrawOrg.x = -aPageSizeIU.x / 2;
51  m_DrawOrg.y = -aPageSizeIU.y / 2;
52  }
53  else
54  {
55  m_DrawOrg.x = 0;
56  m_DrawOrg.y = 0;
57  }
58 
59  m_LocalOrigin = { 0, 0 };
60 }
bool m_Center
Center on screen.
Definition: base_screen.h:96
wxPoint m_DrawOrg
offsets for drawing the circuit on the screen
Definition: base_screen.h:88
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:90

References BASE_SCREEN::m_Center, 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(), PL_EDITOR_FRAME::SetPageSettings(), PCB_BASE_FRAME::SetPageSettings(), and GERBVIEW_FRAME::SetPageSettings().

◆ IsBrightened()

◆ IsContentModified()

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 120 of file eda_item.h.

120 { return m_flags & IS_DRAGGING; }
#define IS_DRAGGING
Item being dragged.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480

References IS_DRAGGING, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().

◆ IsEmpty()

bool SCH_SCREEN::IsEmpty ( ) const
inline

Definition at line 113 of file sch_screen.h.

114  {
115  return m_rtree.empty();
116  }
bool empty() const
Definition: sch_rtree.h:177
EE_RTREE m_rtree
Definition: sch_screen.h:538

References EE_RTREE::empty(), and m_rtree.

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 123 of file eda_item.h.

123 { return m_flags & ENTERED; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480
#define ENTERED
indicates a group has been entered

References ENTERED, and EDA_ITEM::m_flags.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ IsExplicitJunction()

bool SCH_SCREEN::IsExplicitJunction ( const wxPoint &  aPosition) const

Indicates that a junction dot is necessary at the given location.

See IsJunctionNeeded for more info.

Definition at line 413 of file sch_screen.cpp.

414 {
415  bool hasExplicitJunction;
416  bool hasBusEntry;
417  bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
418 
419  return isJunction && !hasBusEntry;
420 }
bool doIsJunction(const wxPoint &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
Definition: sch_screen.cpp:444

References doIsJunction().

Referenced by SCH_EDIT_TOOL::DoDelete(), and SCH_EDIT_FRAME::SchematicCleanUp().

◆ IsExplicitJunctionAllowed()

bool SCH_SCREEN::IsExplicitJunctionAllowed ( const wxPoint &  aPosition) const

Indicates that a juction dot may be placed at the given location.

See IsJunctionNeeded for more info.

Definition at line 433 of file sch_screen.cpp.

434 {
435  bool hasExplicitJunction;
436  bool hasBusEntry;
437  bool isJunction = doIsJunction( aPosition, true, &hasExplicitJunction, &hasBusEntry );
438 
439  return isJunction && !hasBusEntry;
440 }
bool doIsJunction(const wxPoint &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
Definition: sch_screen.cpp:444

References doIsJunction().

Referenced by SCH_DRAWING_TOOLS::SingleClickPlace().

◆ IsExplicitJunctionNeeded()

bool SCH_SCREEN::IsExplicitJunctionNeeded ( const wxPoint &  aPosition) const

Indicates that a junction dot is necessary at the given location, and does not yet exist.

See IsJunctionNeeded for more info.

Definition at line 423 of file sch_screen.cpp.

424 {
425  bool hasExplicitJunction;
426  bool hasBusEntry;
427  bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
428 
429  return isJunction && !hasBusEntry && !hasExplicitJunction;
430 }
bool doIsJunction(const wxPoint &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
Definition: sch_screen.cpp:444

References doIsJunction().

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), SCH_EDIT_TOOL::BreakWire(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), and SCH_MOVE_TOOL::Main().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 205 of file eda_item.h.

205 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:479

References EDA_ITEM::m_forceVisible.

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

◆ IsJunction()

bool SCH_SCREEN::IsJunction ( const wxPoint &  aPosition) const

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

Note that this coule be either an implied junction (bus entry) or an explicit junction (dot).

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 symbol pin.
  • Two or more wire endpoints and a symbol pin.
  • One bus midpoint or endpoint and a bus entry.
Parameters
[in]aPositionThe position to test.
Returns
True if a junction is required at aPosition.

Definition at line 403 of file sch_screen.cpp.

404 {
405  bool hasExplicitJunction;
406  bool hasBusEntry;
407  bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
408 
409  return isJunction;
410 }
bool doIsJunction(const wxPoint &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
Definition: sch_screen.cpp:444

References doIsJunction().

Referenced by SCH_LINE::MergeOverlap().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 117 of file eda_item.h.

117 { return m_flags & IS_CHANGED; }
#define IS_CHANGED
Item was edited, and modified.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsReadOnly()

bool SCH_SCREEN::IsReadOnly ( ) const
inline

Definition at line 148 of file sch_screen.h.

148 { return m_isReadOnly; }
bool m_isReadOnly
Read only status of the screen file.
Definition: sch_screen.h:546

References m_isReadOnly.

Referenced by SCH_EDIT_FRAME::UpdateTitle().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

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_SYMBOL, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 402 of file eda_item.h.

402 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 124 of file eda_item.h.

124 { return m_flags & IS_RESIZING; }
#define IS_RESIZING
Item being resized.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480

References IS_RESIZING, and EDA_ITEM::m_flags.

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 122 of file eda_item.h.

122 { return m_flags & SELECTED; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480
#define SELECTED

References EDA_ITEM::m_flags, and SELECTED.

Referenced by ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DS_PROXY_UNDO_ITEM::DS_PROXY_UNDO_ITEM(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_PAINTER::getLineWidth(), KIGFX::SCH_PAINTER::getRenderColor(), KIGFX::SCH_PAINTER::getTextThickness(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), DIALOG_CHANGE_SYMBOLS::isMatch(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), EE_SELECTION_TOOL::RebuildSelection(), RENDER_3D_OPENGL::renderFootprint(), SCH_EDIT_TOOL::Rotate(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::selectionContains(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), KIGFX::SCH_PAINTER::setDeviceColors(), GERBVIEW_SELECTION_TOOL::unselect(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsTerminalPoint()

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

Test if aPosition is a connection point on aLayer.

Parameters
[in]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 545 of file sch_screen.cpp.

546 {
547  wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
548  wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
549 
550  switch( aLayer )
551  {
552  case LAYER_BUS:
553  {
554  if( GetBus( aPosition ) )
555  return true;
556 
557  SCH_SHEET_PIN* sheetPin = GetSheetPin( aPosition );
558 
559  if( sheetPin && sheetPin->IsConnected( aPosition ) )
560  return true;
561 
562  SCH_TEXT* label = GetLabel( aPosition );
563 
564  if( label && label->IsConnected( aPosition ) )
565  return true;
566  }
567  break;
568 
569  case LAYER_NOTES:
570  {
571  if( GetLine( aPosition ) )
572  return true;
573  }
574  break;
575 
576  case LAYER_WIRE:
577  {
578  if( GetItem( aPosition, 1, SCH_BUS_WIRE_ENTRY_T) )
579  return true;
580 
581  if( GetItem( aPosition, 1, SCH_JUNCTION_T ) )
582  return true;
583 
584  if( GetPin( aPosition, nullptr, true ) )
585  return true;
586 
587  if( GetWire( aPosition ) )
588  return true;
589 
590  SCH_TEXT* label = GetLabel( aPosition, 1 );
591 
592  if( label && label->IsConnected( aPosition ) )
593  return true;
594 
595  SCH_SHEET_PIN* sheetPin = GetSheetPin( aPosition );
596 
597  if( sheetPin && sheetPin->IsConnected( aPosition ) )
598  return true;
599  }
600  break;
601 
602  default:
603  break;
604  }
605 
606  return false;
607 }
SCH_LINE * GetBus(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:429
SCH_SHEET_PIN * GetSheetPin(const wxPoint &aPosition) const
Test the screen if aPosition is a sheet label object.
Definition: sch_screen.cpp:952
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
Definition: sch_screen.cpp:342
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
SCH_LINE * GetLine(const wxPoint &aPosition, int aAccuracy=0, int aLayer=LAYER_NOTES, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Return a line item located at aPosition.
SCH_LINE * GetWire(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:423
SCH_TEXT * GetLabel(const wxPoint &aPosition, int aAccuracy=0) const
Return a label item located at aPosition.
LIB_PIN * GetPin(const wxPoint &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
Test the screen for a symbol pin item at aPosition.
Definition: sch_screen.cpp:900
bool IsConnected(const wxPoint &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:129

References GetBus(), GetItem(), GetLabel(), GetLine(), GetPin(), GetSheetPin(), GetWire(), SCH_ITEM::IsConnected(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, SCH_BUS_WIRE_ENTRY_T, and SCH_JUNCTION_T.

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

Check 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 PCB_VIA, SCH_LABEL, PCB_DIMENSION_BASE, PAD, SCH_FIELD, FP_TEXT, SCH_LINE, PCB_SHAPE, FP_SHAPE, and PCB_TEXT.

Definition at line 182 of file eda_item.h.

183  {
184  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
185  return true;
186 
187  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
188  {
189  if( m_structType == *p )
190  return true;
191  }
192 
193  return false;
194  }
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:487

References EOT, EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by SCH_EDIT_TOOL::AutoplaceFields(), ROUTER_TOOL::CanInlineDrag(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), PCB_TEXT::IsType(), FP_SHAPE::IsType(), PCB_SHAPE::IsType(), SCH_LINE::IsType(), FP_TEXT::IsType(), SCH_FIELD::IsType(), PAD::IsType(), PCB_DIMENSION_BASE::IsType(), SCH_LABEL::IsType(), PCB_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 121 of file eda_item.h.

121 { return m_flags & IS_WIRE_IMAGE; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ Items() [1/2]

EE_RTREE& SCH_SCREEN::Items ( )
inline

Gets the full RTree, usually for iterating.

N.B. The iteration order of the RTree is not readily apparent and will change if/when you add or move items and the RTree is re-balanced. Any exposure of the RTree contents to the user MUST be sorted before being presented. See SCH_SEXPR_PLUGIN::Format or SCH_EDITOR_CONTROL::nextMatch for examples.

Returns
Complete RTree of the screen's items

Definition at line 110 of file sch_screen.h.

110 { return m_rtree; }
EE_RTREE m_rtree
Definition: sch_screen.h:538

References m_rtree.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), SCH_MOVE_TOOL::AlignElements(), SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_EDIT_FRAME::BreakSegments(), SCH_EDIT_FRAME::BreakSegmentsOnJunctions(), CONNECTION_GRAPH::buildConnectionGraph(), 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(), doIsJunction(), EnsureAlternateReferencesExist(), CONNECTION_GRAPH::ercCheckHierSheets(), SCH_SHEET_LIST::FillItemMap(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDIT_FRAME::FixupJunctions(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), SCH_MOVE_TOOL::getConnectedDragItems(), GetHierarchicalItems(), GetItem(), SCH_SHEET_LIST::GetItem(), GetLabel(), GetLine(), GetPin(), AUTOPLACER::getPossibleCollisions(), getSheetBbox(), SCH_LINE_WIRE_BUS_TOOL::getSheetPin(), GetSheetPin(), GetSheets(), SCH_SHEET::HasUndefinedPins(), SCH_DRAWING_TOOLS::importHierLabel(), SCH_EDIT_TOOL::Init(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EAGLE_PLUGIN::loadSheet(), SCH_SHEET::LocatePathOfScreen(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeSymbols(), MarkConnections(), SCH_EAGLE_PLUGIN::moveLabels(), SCH_EDITOR_CONTROL::nextMatch(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), DIALOG_ERC::OnERCItemRClick(), SCH_EDITOR_CONTROL::Paste(), Plot(), Print(), DIALOG_CHANGE_SYMBOLS::processMatchingSymbols(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), EE_SELECTION_TOOL::RebuildSelection(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), Remove(), SCH_EDITOR_CONTROL::RepairSchematic(), SCH_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SetConnectivityDirty(), 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_LINE_WIRE_BUS_TOOL::TrimOverLappingWires(), SCH_EDIT_FRAME::TrimWire(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), SCH_EDITOR_CONTROL::UpdateFind(), UpdateLocalLibSymbolLinks(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), SCH_EDITOR_CONTROL::updatePastedSheet(), UpdateSymbolLinks(), SIM_PLOT_FRAME::UpdateTunerValue(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ Items() [2/2]

const EE_RTREE& SCH_SCREEN::Items ( ) const
inline

Definition at line 111 of file sch_screen.h.

111 { return m_rtree; }
EE_RTREE m_rtree
Definition: sch_screen.h:538

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

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

Definition at line 294 of file eda_item.h.

298  {
299  for( auto it : aList )
300  {
301  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
303  return SEARCH_RESULT::QUIT;
304  }
305 
307  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:93

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

Change first parameter to avoid the DList and use std::vector instead.

Definition at line 313 of file eda_item.h.

315  {
316  for( auto it : aList )
317  {
318  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
320  return SEARCH_RESULT::QUIT;
321  }
322 
324  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:93

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 symbol pin.

Parameters
aSegmentThe segment to test for connections.

Definition at line 358 of file sch_screen.cpp.

359 {
360  std::set<SCH_ITEM*> retval;
361  std::stack<SCH_LINE*> to_search;
362 
363  wxCHECK_MSG( aSegment && aSegment->Type() == SCH_LINE_T, retval, wxT( "Invalid pointer." ) );
364 
365  to_search.push( aSegment );
366 
367  while( !to_search.empty() )
368  {
369  SCH_LINE* test_item = to_search.top();
370  to_search.pop();
371 
372  for( SCH_ITEM* item : Items().Overlapping( SCH_JUNCTION_T, test_item->GetBoundingBox() ) )
373  {
374  if( test_item->IsEndPoint( item->GetPosition() ) )
375  retval.insert( item );
376  }
377 
378  for( SCH_ITEM* item : Items().Overlapping( SCH_LINE_T, test_item->GetBoundingBox() ) )
379  {
380  // Skip connecting lines on different layers (e.g. buses)
381  if( test_item->GetLayer() != item->GetLayer() )
382  continue;
383 
384  SCH_LINE* line = static_cast<SCH_LINE*>( item );
385 
386  if( ( test_item->IsEndPoint( line->GetStartPoint() )
387  && !GetPin( line->GetStartPoint(), nullptr, true ) )
388  || ( test_item->IsEndPoint( line->GetEndPoint() )
389  && !GetPin( line->GetEndPoint(), nullptr, true ) ) )
390  {
391  auto result = retval.insert( line );
392 
393  if( result.second )
394  to_search.push( line );
395  }
396  }
397  }
398 
399  return retval;
400 }
wxPoint GetStartPoint() const
Definition: sch_line.h:90
bool IsEndPoint(const wxPoint &aPoint) const
Definition: sch_line.h:80
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:259
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_line.cpp:190
LIB_PIN * GetPin(const wxPoint &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
Test the screen for a symbol pin item at aPosition.
Definition: sch_screen.cpp:900
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
wxPoint GetEndPoint() const
Definition: sch_line.h:93

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

Referenced by EE_SELECTION_TOOL::SelectConnection().

◆ Matches() [1/2]

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

Compare 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_SYMBOL, SCH_SHEET, SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, ZONE, SCH_PIN, PCB_MARKER, SCH_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 364 of file eda_item.h.

365  {
366  return false;
367  }

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

◆ Matches() [2/2]

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

Compare 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 118 of file eda_item.cpp.

119 {
120  wxString text = aText;
121  int flags = aSearchData.GetFlags();
122  wxString searchText = aSearchData.GetFindString();
123 
124  // Don't match if searching for replaceable item and the item doesn't support text replace.
125  if( ( flags & FR_SEARCH_REPLACE ) && !IsReplaceable() )
126  return false;
127 
128  if( !( flags & wxFR_MATCHCASE ) )
129  {
130  text.MakeUpper();
131  searchText.MakeUpper();
132  }
133 
134  if( flags & wxFR_WHOLEWORD )
135  {
136  int ii = 0;
137 
138  while( ii < (int) text.length() )
139  {
140  int next = text.find( searchText, ii );
141 
142  if( next == wxNOT_FOUND )
143  return false;
144 
145  ii = next;
146  next += searchText.length();
147 
148  bool startOK = ( ii == 0 || !wxIsalnum( text.GetChar( ii - 1 ) ) );
149  bool endOK = ( next == (int) text.length() || !wxIsalnum( text.GetChar( next ) ) );
150 
151  if( startOK && endOK )
152  return true;
153  else
154  ii++;
155  }
156 
157  return false;
158  }
159  else if( flags & FR_MATCH_WILDCARD )
160  {
161  return text.Matches( searchText );
162  }
163  else
164  {
165  return text.Find( searchText ) != wxNOT_FOUND;
166  }
167 }
CITER next(CITER it)
Definition: ptree.cpp:126
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:402

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

◆ 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 234 of file eda_item.cpp.

235 {
236  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
237  GetClass() ) );
238 
239  return false;
240 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
virtual wxString GetClass() const =0
Return the class name.

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

◆ Plot()

void SCH_SCREEN::Plot ( PLOTTER aPlotter) const

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
[in]aPlotterThe plotter object to plot to.

Sort to ensure plot-order consistency with screen drawing

Definition at line 838 of file sch_screen.cpp.

839 {
840  // Ensure links are up to date, even if a library was reloaded for some reason:
841  std::vector< SCH_ITEM* > junctions;
842  std::vector< SCH_ITEM* > bitmaps;
843  std::vector< SCH_ITEM* > other;
844 
845  for( SCH_ITEM* item : Items() )
846  {
847  if( item->IsMoving() || item->IsResized() )
848  continue;
849 
850  if( item->Type() == SCH_JUNCTION_T )
851  junctions.push_back( item );
852  else if( item->Type() == SCH_BITMAP_T )
853  bitmaps.push_back( item );
854  else
855  other.push_back( item );
856  }
857 
859  std::sort( other.begin(), other.end(),
860  []( const SCH_ITEM* a, const SCH_ITEM* b )
861  {
862  if( a->Type() == b->Type() )
863  return a->GetLayer() > b->GetLayer();
864 
865  return a->Type() > b->Type();
866  } );
867 
868  int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth();
869 
870  // Bitmaps are drawn first to ensure they are in the background
871  // This is particularly important for the wxPostscriptDC (used in *nix printers) as
872  // the bitmap PS command clears the screen
873  for( const SCH_ITEM* item : bitmaps )
874  {
875  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
876  item->Plot( aPlotter );
877  }
878 
879  for( const SCH_ITEM* item : other )
880  {
881  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
882  item->Plot( aPlotter );
883  }
884 
885  for( const SCH_ITEM* item : junctions )
886  {
887  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
888  item->Plot( aPlotter );
889  }
890 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:259
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:156
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
int GetDefaultPenWidth() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

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::plotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetHpgl(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), and DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG().

◆ Print()

void SCH_SCREEN::Print ( const 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 797 of file sch_screen.cpp.

798 {
799  // Ensure links are up to date, even if a library was reloaded for some reason:
800  std::vector<SCH_ITEM*> junctions;
801  std::vector<SCH_ITEM*> bitmaps;
802  std::vector<SCH_ITEM*> other;
803 
804  for( SCH_ITEM* item : Items() )
805  {
806  if( item->IsMoving() || item->IsResized() )
807  continue;
808 
809  if( item->Type() == SCH_JUNCTION_T )
810  junctions.push_back( item );
811  else if( item->Type() == SCH_BITMAP_T )
812  bitmaps.push_back( item );
813  else
814  other.push_back( item );
815  }
816 
818  std::sort( other.begin(), other.end(),
819  []( const SCH_ITEM* a, const SCH_ITEM* b )
820  {
821  if( a->Type() == b->Type() )
822  return a->GetLayer() > b->GetLayer();
823 
824  return a->Type() > b->Type();
825  } );
826 
827  for( SCH_ITEM* item : bitmaps )
828  item->Print( aSettings, wxPoint( 0, 0 ) );
829 
830  for( SCH_ITEM* item : other )
831  item->Print( aSettings, wxPoint( 0, 0 ) );
832 
833  for( SCH_ITEM* item : junctions )
834  item->Print( aSettings, wxPoint( 0, 0 ) );
835 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:259
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

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
[in]aItemItem to be removed from schematic.
Returns
True if we successfully removed the item

Definition at line 273 of file sch_screen.cpp.

274 {
275  bool retv = m_rtree.remove( aItem );
276 
277  // Check if the library symbol for the removed schematic symbol is still required.
278  if( retv && aItem->Type() == SCH_SYMBOL_T )
279  {
280  SCH_SYMBOL* removedSymbol = static_cast<SCH_SYMBOL*>( aItem );
281 
282  bool removeUnusedLibSymbol = true;
283 
284  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
285  {
286  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
287 
288  if( removedSymbol->GetSchSymbolLibraryName() == symbol->GetSchSymbolLibraryName() )
289  {
290  removeUnusedLibSymbol = false;
291  break;
292  }
293  }
294 
295  if( removeUnusedLibSymbol )
296  {
297  auto it = m_libSymbols.find( removedSymbol->GetSchSymbolLibraryName() );
298 
299  if( it != m_libSymbols.end() )
300  {
301  delete it->second;
302  m_libSymbols.erase( it );
303  }
304  }
305  }
306 
307  return retv;
308 }
bool remove(SCH_ITEM *aItem)
Remove an item from the tree.
Definition: sch_rtree.h:79
wxString GetSchSymbolLibraryName() const
Definition: sch_symbol.cpp:271
EE_RTREE m_rtree
Definition: sch_screen.h:538
Schematic symbol object.
Definition: sch_symbol.h:78
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

References SCH_SYMBOL::GetSchSymbolLibraryName(), Items(), m_libSymbols, m_rtree, EE_RTREE::remove(), SCH_SYMBOL_T, and EDA_ITEM::Type().

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

◆ Replace() [1/2]

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

Perform 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 170 of file eda_item.cpp.

171 {
172  wxString text = aText;
173  int flags = aSearchData.GetFlags();
174  wxString searchText = aSearchData.GetFindString();
175  wxString result;
176  bool replaced = false;
177 
178  if( flags & wxFR_MATCHCASE )
179  {
180  text = text.Upper();
181  searchText = searchText.Upper();
182  }
183 
184  int ii = 0;
185 
186  while( ii < (int) text.length() )
187  {
188  int next = text.find( searchText, ii );
189 
190  if( next == wxNOT_FOUND )
191  {
192  result += aText.Mid( ii, wxString::npos );
193  break;
194  }
195 
196  if( next > ii )
197  result += aText.Mid( ii, next - ii );
198 
199  ii = next;
200  next += searchText.length();
201 
202  bool startOK;
203  bool endOK;
204 
205  if( flags & wxFR_WHOLEWORD )
206  {
207  startOK = ( ii == 0 || !wxIsalnum( text.GetChar( ii - 1 ) ) );
208  endOK = ( next == (int) text.length() || !wxIsalnum( text.GetChar( next ) ) );
209  }
210  else
211  {
212  startOK = true;
213  endOK = true;
214  }
215 
216  if( startOK && endOK )
217  {
218  result += aSearchData.GetReplaceString();
219  replaced = true;
220  ii = next;
221  }
222  else
223  {
224  result += aText.GetChar( ii );
225  ii++;
226  }
227  }
228 
229  aText = result;
230  return replaced;
231 }
CITER next(CITER it)
Definition: ptree.cpp:126

References next(), and text.

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

◆ Replace() [2/2]

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

Perform 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_FIELD, SCH_SHEET_PIN, and SCH_PIN.

Definition at line 391 of file eda_item.h.

392  {
393  return false;
394  }

◆ Schematic()

SCHEMATIC * SCH_SCREEN::Schematic ( ) const

Definition at line 92 of file sch_screen.cpp.

93 {
94  wxCHECK_MSG( GetParent() && GetParent()->Type() == SCHEMATIC_T, nullptr,
95  wxT( "SCH_SCREEN must have a SCHEMATIC parent!" ) );
96 
97  return static_cast<SCHEMATIC*>( GetParent() );
98 }
EDA_ITEM * GetParent() const
Definition: eda_item.h:114
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

References EDA_ITEM::GetParent(), SCHEMATIC_T, and EDA_ITEM::Type().

Referenced by SCH_SCREENS::BuildClientSheetPathList(), SCH_SCREENS::ClearAnnotationOfNewSheetPaths(), KIGFX::SCH_VIEW::DisplaySheet(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), RESCUER::RESCUER(), SCH_SHEET_PATH::TestForRecursion(), UpdateSymbolLinks(), and SCH_SCREENS::UpdateSymbolLinks().

◆ Set() [1/3]

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

Definition at line 42 of file inspectable.h.

43  {
45  TYPE_ID thisType = TYPE_HASH( *this );
46  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
47 
48  if( object )
49  aProperty->setter( object, aValue );
50 
51  return object != nullptr;
52  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return 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 55 of file inspectable.h.

56  {
58  TYPE_ID thisType = TYPE_HASH( *this );
59  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
60 
61  if( object )
62  aProperty->set<T>( object, aValue );
63 
64  return object != nullptr;
65  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return 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 68 of file inspectable.h.

69  {
71  TYPE_ID thisType = TYPE_HASH( *this );
72  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
73  void* object = nullptr;
74 
75  if( prop )
76  {
77  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
78 
79  if( object )
80  prop->set<T>( object, aValue );
81  }
82 
83  return object != nullptr;
84  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return 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 154 of file sch_screen.h.

154 { m_aux_origin = aPosition; }
wxPoint m_aux_origin
Definition: sch_screen.h:537

References m_aux_origin.

◆ SetBrightened()

◆ SetConnectivityDirty()

void SCH_SCREEN::SetConnectivityDirty ( )

Definition at line 790 of file sch_screen.cpp.

791 {
792  for( SCH_ITEM* item : Items() )
793  item->SetConnectivityDirty( true );
794 }
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References Items().

Referenced by SCH_EDIT_FRAME::OnModify().

◆ SetContentModified()

void BASE_SCREEN::SetContentModified ( bool  aModified = true)
inlineinherited

Definition at line 59 of file base_screen.h.

59 { m_flagModified = aModified; }
bool m_flagModified
Indicates current drawing has been modified.
Definition: base_screen.h:132

References BASE_SCREEN::m_flagModified.

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_SHEET_LIST::BuildSheetList(), FOOTPRINT_EDIT_FRAME::Clear_Pcb(), PCB_EDIT_FRAME::Clear_Pcb(), SYMBOL_LIBRARY_MANAGER::ClearLibraryModified(), FOOTPRINT_EDIT_FRAME::ClearModify(), SCH_SHEET_LIST::ClearModifyStatus(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), DeleteItem(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doAutoSave(), PCB_EDIT_FRAME::ExportSpecctraFile(), PL_EDITOR_FRAME::Files_io(), PCB_EDIT_FRAME::Files_io_from_id(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::InitSheet(), PL_EDITOR_FRAME::LoadDrawingSheetFile(), SCH_LEGACY_PLUGIN::loadSymbol(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), SCH_EDIT_FRAME::OnModify(), SYMBOL_EDIT_FRAME::OnModify(), PL_EDITOR_FRAME::OnModify(), PCB_BASE_FRAME::OnModify(), PL_EDITOR_FRAME::OnNewDrawingSheet(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_SEXPR_PARSER::parseSchSheetInstances(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), FOOTPRINT_EDIT_FRAME::RevertFootprint(), SYMBOL_EDIT_FRAME::Save(), SYMBOL_EDIT_FRAME::saveCurrentSymbol(), PL_EDITOR_FRAME::SaveDrawingSheetFile(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::saveSchematicFile(), DIALOG_PAGES_SETTINGS::TransferDataFromWindow(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbol().

◆ SetFileExists()

void SCH_SCREEN::SetFileExists ( bool  aFileExists)
inline

◆ SetFileFormatVersionAtLoad()

void SCH_SCREEN::SetFileFormatVersionAtLoad ( int  aVersion)
inline

Definition at line 129 of file sch_screen.h.

129 { m_fileFormatVersionAtLoad = aVersion; }
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:522

References m_fileFormatVersionAtLoad.

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ SetFileName()

void SCH_SCREEN::SetFileName ( const wxString &  aFileName)

Set the file name for this screen to aFileName.

Note
Screen file names must be absolute or empty. Absolute file names do not have to exist yet in the case of a new schematic file but file names cannot be relative.
Parameters
aFileNameis the absolute file name and path of the screen.

Definition at line 110 of file sch_screen.cpp.

111 {
112  wxASSERT( aFileName.IsEmpty() || wxIsAbsolutePath( aFileName ) );
113 
114  m_fileName = aFileName;
115 }
wxString m_fileName
Definition: sch_screen.h:521

References m_fileName.

Referenced by SCH_EDIT_FRAME::CreateScreens(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::InitSheet(), CADSTAR_SCH_ARCHIVE_PLUGIN::Load(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::SaveProject(), and DIALOG_SHEET_PROPERTIES::TransferDataFromWindow().

◆ SetFileReadOnly()

void SCH_SCREEN::SetFileReadOnly ( bool  aIsReadOnly)
inline

Definition at line 147 of file sch_screen.h.

147 { m_isReadOnly = aIsReadOnly; }
bool m_isReadOnly
Read only status of the screen file.
Definition: sch_screen.h:546

References m_isReadOnly.

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

◆ SetFlags()

void EDA_ITEM::SetFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 152 of file eda_item.h.

152 { m_flags |= aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480

References EDA_ITEM::m_flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddFootprintToBoard(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_MOVE_TOOL::AlignElements(), PCB_CONTROL::AppendBoard(), FOOTPRINT::BuildPolyCourtyards(), SCH_EDIT_TOOL::ChangeTextType(), GRAPHICS_CLEANER::cleanupShapes(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), SCH_DRAWING_TOOLS::createSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), PCB_SELECTION_TOOL::EnterGroup(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), SCH_MOVE_TOOL::getConnectedDragItems(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), EE_SELECTION_TOOL::Main(), TRACKS_CLEANER::mergeCollinearSegments(), SYMBOL_EDITOR_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(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), SCH_SYMBOL::Plot(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_SELECTION_TOOL::RebuildSelection(), FOOTPRINT::Remove(), BOARD::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), 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(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Set and clear 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 203 of file eda_item.h.

203 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: eda_item.h:479

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

◆ SetPageCount()

void BASE_SCREEN::SetPageCount ( int  aPageCount)
inherited

Definition at line 63 of file base_screen.cpp.

64 {
65  wxCHECK( aPageCount > 0, /* void */ );
66 
67  m_pageCount = aPageCount;
68 }
int m_pageCount
The number of BASE_SCREEN objects in this design.
Definition: base_screen.h:111

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 79 of file base_screen.h.

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

References BASE_SCREEN::m_pageNumber.

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

◆ SetPageSettings()

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in PCB_DIMENSION_BASE.

Definition at line 115 of file eda_item.h.

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

References EDA_ITEM::m_parent.

Referenced by FOOTPRINT::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewFootprint(), SCH_SHEET::AddPin(), PAD::AddPrimitive(), PAD::AddPrimitiveArc(), PAD::AddPrimitiveCircle(), PAD::AddPrimitiveCurve(), PAD::AddPrimitivePoly(), PAD::AddPrimitiveRect(), PAD::AddPrimitiveSegment(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), Append(), LIB_FIELD::Copy(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_SYMBOL::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_PLUGIN::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), LIB_SYMBOL::LIB_SYMBOL(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), FOOTPRINT::operator=(), LIB_SYMBOL::operator=(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PCB_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), pasteFootprintItemsToFootprintEditor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), 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_SYMBOL::SetFields(), PCB_DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_SHEET::SwapData(), SCH_GLOBALLABEL::SwapData(), SCH_SYMBOL::SwapData(), and SwapItemData().

◆ SetPosition()

◆ SetSelected()

◆ SetState()

void EDA_ITEM::SetState ( EDA_ITEM_FLAGS  type,
bool  state 
)
inlineinherited

Definition at line 141 of file eda_item.h.

142  {
143  if( state )
144  m_status |= type; // state = ON or OFF
145  else
146  m_status &= ~type;
147  }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:477

References EDA_ITEM::m_status.

Referenced by LEGACY_PLUGIN::loadTrackList(), TRACKS_CLEANER::mergeCollinearSegments(), and BOARD_ITEM::SetLocked().

◆ SetStatus()

void EDA_ITEM::SetStatus ( EDA_ITEM_FLAGS  aStatus)
inlineinherited

Definition at line 150 of file eda_item.h.

150 { m_status = aStatus; }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:477

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 76 of file base_screen.h.

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

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 127 of file eda_item.h.

127 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:152
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ Sort()

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

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 420 of file eda_item.h.

420 { return *aLeft < *aRight; }

◆ TestDanglingEnds()

void SCH_SCREEN::TestDanglingEnds ( const SCH_SHEET_PATH aPath = nullptr,
std::function< void(SCH_ITEM *)> *  aChangedHandler = nullptr 
) const

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

Parameters
aPathis a sheet path to pass to UpdateDanglingState if desired.
aChangedHandleris an optional callback to make on each changed item.

Definition at line 1046 of file sch_screen.cpp.

1048 {
1049  std::vector<DANGLING_END_ITEM> endPoints;
1050 
1051  for( SCH_ITEM* item : Items() )
1052  {
1053  if( item->IsConnectable() )
1054  {
1055  endPoints.clear();
1056 
1057  for( SCH_ITEM* overlapping : Items().Overlapping( item->GetBoundingBox() ) )
1058  overlapping->GetEndPoints( endPoints );
1059 
1060  if( item->UpdateDanglingState( endPoints, aPath ) )
1061  {
1062  if( aChangedHandler )
1063  (*aChangedHandler)( item );
1064  }
1065  }
1066  }
1067 }
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References Items().

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

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Returns the type of object.

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

Returns
the type of object.

Definition at line 112 of file eda_item.h.

112 { 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:487

References EDA_ITEM::m_structType.

Referenced by KIGFX::PCB_VIEW::Add(), FOOTPRINT::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_POINT_EDITOR::addCorner(), CONNECTION_SUBGRAPH::AddItem(), DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees(), 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(), SCH_MOVE_TOOL::AlignElements(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), Append(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PNS::TOPOLOGY::AssembleTuningPath(), CONNECTION_GRAPH::buildConnectionGraph(), DIALOG_NET_INSPECTOR::buildNewItem(), SCH_SCREENS::buildScreenList(), calcIsInsideArea(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PCB_POINT_EDITOR::canAddCorner(), SCH_NO_CONNECT::CanConnect(), SCH_JUNCTION::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_LABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SYMBOL::CanConnect(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), PCB_TEXT::ClassOf(), SCH_NO_CONNECT::ClassOf(), SCH_PIN::ClassOf(), PCB_MARKER::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), FP_SHAPE::ClassOf(), PCB_SHAPE::ClassOf(), PCB_TARGET::ClassOf(), SCH_LINE::ClassOf(), PCB_GROUP::ClassOf(), SCH_FIELD::ClassOf(), FP_TEXT::ClassOf(), SCH_SHEET::ClassOf(), NETINFO_ITEM::ClassOf(), ZONE::ClassOf(), SCH_SHEET_PIN::ClassOf(), SCH_BITMAP::ClassOf(), PCB_TRACK::ClassOf(), PAD::ClassOf(), SCH_SYMBOL::ClassOf(), FOOTPRINT::ClassOf(), ClassOf(), SCH_TEXT::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), BOARD::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), PCB_ARC::ClassOf(), SCH_LABEL::ClassOf(), PCB_VIA::ClassOf(), SCH_GLOBALLABEL::ClassOf(), PCB_DIM_ALIGNED::ClassOf(), PCB_DIM_ORTHOGONAL::ClassOf(), SCH_HIERLABEL::ClassOf(), PCB_DIM_LEADER::ClassOf(), PCB_DIM_CENTER::ClassOf(), TRACKS_CLEANER::cleanup(), CONNECTION_GRAPH::collectAllDriverValues(), LIB_TEXT::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_ITEM::compare(), LIB_SYMBOL::Compare(), EE_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), SCH_LINE::ConnectionPropagatesTo(), EE_RTREE::contains(), BOARD::ConvertKIIDsToCrossReferences(), SCHEMATIC::ConvertKIIDsToRefs(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), FOOTPRINT::CoverageRatio(), BOARD_ADAPTER::createLayers(), CONVERT_TOOL::CreateLines(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewText(), ZONE_CREATE_HELPER::createNewZone(), CONVERT_TOOL::CreatePolys(), BOARD_ADAPTER::createTrack(), DRC_TOOL::CrossProbe(), DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), DIALOG_TEXT_AND_LABEL_PROPERTIES::DIALOG_TEXT_AND_LABEL_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally(), ALIGN_DISTRIBUTE_TOOL::DistributeVertically(), 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(), APPEARANCE_CONTROLS::doesBoardItemNeedRebuild(), EDIT_TOOL::Drag(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawVia(), CONNECTION_SUBGRAPH::driverName(), CN_ITEM::Dump(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), EDA_ITEM_DESC::EDA_ITEM_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_EDIT_TOOL::editTextProperties(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), DRC_ENGINE::EvalRules(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectorForFreePads(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), PCB_SELECTION_TOOL::FilterCollectorForMarkers(), NETLIST_EXPORTER_BASE::findNextSymbol(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), PCB_BASE_FRAME::FocusOnItems(), EDIT_TOOL::FootprintFilter(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), PCB_PLUGIN::Format(), PCB_PLUGIN::format(), FormatProbeItem(), FP_TEXT::FP_TEXT(), PCB_POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), PCB_TRACK::GetBoundingBox(), SCH_FIELD::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetContextualTextVars(), FOOTPRINT::GetCoverageArea(), CONNECTION_GRAPH::getDefaultConnection(), SCH_FIELD::GetDrawRotation(), getDrilledHoleShape(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), getMinDist(), PCB_TRACK::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTIVITY_DATA::GetNetItems(), LIB_SYMBOL::GetNextDrawItem(), PCB_SHAPE::GetParentFootprint(), BOARD_ITEM::GetParentFootprint(), LIB_SYMBOL::GetPin(), SCH_SYMBOL::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), KIGFX::SCH_PAINTER::getRenderColor(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), PCB_TRACK::GetSelectMenuText(), DRC_ENGINE::GetShape(), PCB_TEXT::GetShownText(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), CONVERT_TOOL::getStartEndPoints(), getTopLevelGroup(), PCB_EXPR_TYPE_REF::GetValue(), GROUP_TOOL::Group(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), hash_fp_item(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlightInternal(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::highlightNet(), highlightNet(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_RTREE::insert(), DRC_RTREE::Insert(), insideArea(), insideBackCourtyard(), insideCourtyard(), insideFrontCourtyard(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::InspectDRCError(), ARRAY_CREATOR::Invoke(), CONNECTIVITY_DATA::IsConnectedOnLayer(), isCopper(), CN_ANCHOR::IsDangling(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), PNS_KICAD_IFACE::IsFlashedOnLayer(), CADSTAR_PCB_ARCHIVE_LOADER::isFootprint(), SCH_FIELD::IsHypertext(), isKeepoutZone(), DRC_ENGINE::IsNetTie(), PCB_TRACK::IsNull(), isNullAperture(), SCH_LINE::IsParallel(), isPlated(), SCH_FIELD::IsReplaceable(), PNS::ROUTER::isStartingPointRoutable(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), PCB_SELECTION_TOOL::itemPassesFilter(), CLIPBOARD_IO::Load(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeListOfNets(), PCB_POINT_EDITOR::makePoints(), CONVERT_TOOL::makePolysFromSegs(), 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(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), PCB_POINT_EDITOR::OnSelectionChange(), PCB_SHAPE::cmp_drawings::operator()(), PCB_TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), BOARD::cmp_items::operator()(), BOARD::cmp_drawings::operator()(), SCH_BUS_ENTRY_BASE::operator<(), SCH_JUNCTION::operator<(), SCH_TEXT::operator<(), SCH_FIELD::operator<(), LIB_ITEM::operator<(), SCH_LINE::operator<(), SCH_SHEET::operator<(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_SYMBOL::operator=(), LIB_ITEM::operator==(), PAD::PAD(), EDIT_TOOL::PadFilter(), BOARD_EDITOR_CONTROL::PageSettings(), BOARD_COMMIT::parentObject(), PCB_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), POSITION_RELATIVE_TOOL::PositionRelative(), SCH_FIELD::Print(), Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BACK_ANNOTATE::processNetNameChange(), CONNECTION_GRAPH::processSubGraphs(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), PCB_GRID_HELPER::queryVisible(), BOARD_REANNOTATE_TOOL::ReannotateDuplicates(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshSelection(), KIGFX::PCB_VIEW::Remove(), EE_RTREE::remove(), FOOTPRINT::Remove(), CN_CONNECTIVITY_ALGO::Remove(), Remove(), BOARD::Remove(), PCB_POINT_EDITOR::removeCorner(), PCB_POINT_EDITOR::removeCornerCondition(), LIB_SYMBOL::RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), SCH_EDITOR_CONTROL::ReplaceAll(), PCB_SELECTION_TOOL::RequestSelection(), SCHEMATIC::ResolveCrossReference(), PCB_PARSER::resolveGroups(), DS_PROXY_UNDO_ITEM::Restore(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), 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(), 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(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectConnectedTracks(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_POINT_EDITOR::setAltConstraint(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), DIALOG_TEXT_AND_LABEL_PROPERTIES::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_FIELD::SwapData(), PCB_GROUP::SwapData(), PCB_TEXT::SwapData(), PCB_TRACK::SwapData(), SCH_SHEET::SwapData(), PCB_ARC::SwapData(), PCB_DIM_ALIGNED::SwapData(), PCB_DIM_ORTHOGONAL::SwapData(), SCH_SYMBOL::SwapData(), PCB_VIA::SwapData(), PCB_DIM_LEADER::SwapData(), PCB_DIM_CENTER::SwapData(), PAD::SwapData(), FOOTPRINT::SwapData(), ZONE::SwapData(), SwapItemData(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), ERC_TESTER::TestMultUnitPinConflicts(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_FIELDS_TABLE::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataToWindow(), PCB_TRACK::TransformShapeWithClearanceToPolygon(), SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), SCH_TEXT::UpdateDanglingState(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_SCH_FIELD_PROPERTIES::UpdateField(), PL_POINT_EDITOR::updateItem(), PCB_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::updatePastedSheet(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), PCB_TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_GLOBALLABEL::Visit(), SCH_SHEET::Visit(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and NETLIST_EXPORTER_CADSTAR::writeListOfNets().

◆ Update()

void SCH_SCREEN::Update ( SCH_ITEM aItem)

Update aItem's bounding box in the tree.

Parameters
[in]aItemItem that needs to be updated.

Definition at line 266 of file sch_screen.cpp.

267 {
268  if( Remove( aItem ) )
269  Append( aItem );
270 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:273
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:146

References Append(), and Remove().

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_EAGLE_PLUGIN::loadSheet(), SCH_DRAWING_TOOLS::PlaceSymbol(), SCH_EDIT_FRAME::RecomputeIntersheetRefs(), and SCH_BASE_FRAME::UpdateItem().

◆ UpdateLocalLibSymbolLinks()

void SCH_SCREEN::UpdateLocalLibSymbolLinks ( )

Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic with the local project library symbols.

Definition at line 764 of file sch_screen.cpp.

765 {
766  std::vector<SCH_SYMBOL*> symbols;
767 
768  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
769  symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
770 
771  for( SCH_SYMBOL* symbol : symbols )
772  {
773  // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
774  m_rtree.remove( symbol );
775 
776  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
777 
778  LIB_SYMBOL* libSymbol = nullptr;
779 
780  if( it != m_libSymbols.end() )
781  libSymbol = new LIB_SYMBOL( *it->second );
782 
783  symbol->SetLibSymbol( libSymbol );
784 
785  m_rtree.insert( symbol );
786  }
787 }
void insert(SCH_ITEM *aItem)
Insert an item into the tree.
Definition: sch_rtree.h:60
Define a library symbol object.
Definition: lib_symbol.h:96
bool remove(SCH_ITEM *aItem)
Remove an item from the tree.
Definition: sch_rtree.h:79
EE_RTREE m_rtree
Definition: sch_screen.h:538
Schematic symbol object.
Definition: sch_symbol.h:78
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

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

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ UpdateSymbolLinks()

void SCH_SCREEN::UpdateSymbolLinks ( REPORTER aReporter = nullptr)

Initialize the LIB_SYMBOL reference for each SCH_SYMBOL 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
[in]aReporterOptional REPORTER object to write status and error messages into.

Definition at line 610 of file sch_screen.cpp.

611 {
612  wxCHECK_RET( Schematic(), wxT( "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" ) );
613 
614  wxString msg;
615  std::unique_ptr< LIB_SYMBOL > libSymbol;
616  std::vector<SCH_SYMBOL*> symbols;
617  SYMBOL_LIB_TABLE* libs = Schematic()->Prj().SchSymbolLibTable();
618 
619  // This will be a nullptr if an s-expression schematic is loaded.
620  SYMBOL_LIBS* legacyLibs = Schematic()->Prj().SchLibs();
621 
622  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
623  symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
624 
625  // Remove them from the R tree. There bounding box size may change.
626  for( SCH_SYMBOL* symbol : symbols )
627  Remove( symbol );
628 
629  // Clear all existing symbol links.
630  clearLibSymbols();
631 
632  for( SCH_SYMBOL* symbol : symbols )
633  {
634  LIB_SYMBOL* tmp = nullptr;
635  libSymbol.reset();
636 
637  // If the symbol is already in the internal library, map the symbol to it.
638  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
639 
640  if( ( it != m_libSymbols.end() ) )
641  {
642  if( aReporter )
643  {
644  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
645  symbol->GetField( REFERENCE_FIELD )->GetText(),
646  symbol->GetField( VALUE_FIELD )->GetText(),
647  UnescapeString( symbol->GetLibId().Format() ) );
648  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
649  }
650 
651  // Internal library symbols are already flattened so just make a copy.
652  symbol->SetLibSymbol( new LIB_SYMBOL( *it->second ) );
653  continue;
654  }
655 
656  if( !symbol->GetLibId().IsValid() )
657  {
658  if( aReporter )
659  {
660  msg.Printf( _( "Schematic symbol reference '%s' library identifier is not valid. "
661  "Unable to link library symbol." ),
662  UnescapeString( symbol->GetLibId().Format() ) );
663  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
664  }
665 
666  continue;
667  }
668 
669  // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the library nickname
670  // is not found in the table so check if the library still exists in the table
671  // before attempting to load the symbol.
672  if( !libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) && !legacyLibs )
673  {
674  if( aReporter )
675  {
676  msg.Printf( _( "Symbol library '%s' not found and no fallback cache library "
677  "available. Unable to link library symbol." ),
678  symbol->GetLibId().GetLibNickname().wx_str() );
679  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
680  }
681 
682  continue;
683  }
684 
685  if( libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) )
686  {
687  try
688  {
689  tmp = libs->LoadSymbol( symbol->GetLibId() );
690  }
691  catch( const IO_ERROR& ioe )
692  {
693  if( aReporter )
694  {
695  msg.Printf( _( "I/O error %s resolving library symbol %s" ), ioe.What(),
696  UnescapeString( symbol->GetLibId().Format() ) );
697  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
698  }
699  }
700  }
701 
702  if( !tmp && legacyLibs && legacyLibs->GetLibraryCount() )
703  {
704  SYMBOL_LIB& legacyCacheLib = legacyLibs->at( 0 );
705 
706  // It better be the cache library.
707  wxCHECK2( legacyCacheLib.IsCache(), continue );
708 
709  wxString id = symbol->GetLibId().Format();
710 
711  id.Replace( ':', '_' );
712 
713  if( aReporter )
714  {
715  msg.Printf( _( "Falling back to cache to set symbol '%s:%s' link '%s'." ),
716  symbol->GetField( REFERENCE_FIELD )->GetText(),
717  symbol->GetField( VALUE_FIELD )->GetText(),
718  UnescapeString( id ) );
719  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
720  }
721 
722  tmp = legacyCacheLib.FindSymbol( id );
723  }
724 
725  if( tmp )
726  {
727  // We want a full symbol not just the top level child symbol.
728  libSymbol = tmp->Flatten();
729  libSymbol->SetParent();
730 
731  m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
732  new LIB_SYMBOL( *libSymbol.get() ) } );
733 
734  if( aReporter )
735  {
736  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
737  symbol->GetField( REFERENCE_FIELD )->GetText(),
738  symbol->GetField( VALUE_FIELD )->GetText(),
739  UnescapeString( symbol->GetLibId().Format() ) );
740  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
741  }
742  }
743  else
744  {
745  if( aReporter )
746  {
747  msg.Printf( _( "No library symbol found for schematic symbol '%s %s'." ),
748  symbol->GetField( REFERENCE_FIELD )->GetText(),
749  symbol->GetField( VALUE_FIELD )->GetText() );
750  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
751  }
752  }
753 
754  symbol->SetLibSymbol( libSymbol.release() );
755  }
756 
757  // Changing the symbol may adjust the bbox of the symbol. This re-inserts the
758  // item with the new bbox
759  for( SCH_SYMBOL* symbol : symbols )
760  Append( symbol );
761 }
Field Reference of part, i.e. "IC21".
bool IsCache() const
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:273
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
LIB_SYMBOL * FindSymbol(const wxString &aName) const
Find LIB_SYMBOL by aName.
Object used to load, save, search, and otherwise manipulate symbol library files.
void clearLibSymbols()
Definition: sch_screen.cpp:101
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
int GetLibraryCount()
Define a library symbol object.
Definition: lib_symbol.h:96
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:380
Field Value of part, i.e. "3.3K".
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
#define _(s)
wxString UnescapeString(const wxString &aSource)
A collection of SYMBOL_LIB objects.
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:75
Schematic symbol object.
Definition: sch_symbol.h:78
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:146
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:92
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:555
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:182

References _, Append(), clearLibSymbols(), SYMBOL_LIB::FindSymbol(), LIB_SYMBOL::Flatten(), SYMBOL_LIBS::GetLibraryCount(), LIB_TABLE::HasLibrary(), SYMBOL_LIB::IsCache(), Items(), SYMBOL_LIB_TABLE::LoadSymbol(), m_libSymbols, SCHEMATIC::Prj(), REFERENCE_FIELD, Remove(), REPORTER::ReportTail(), RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, SCH_SYMBOL_T, Schematic(), UnescapeString(), VALUE_FIELD, and IO_ERROR::What().

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

Return the bounding box of the item covering all its layers.

Returns
the current bounding box.

Implements KIGFX::VIEW_ITEM.

Reimplemented in PAD, FOOTPRINT, PCB_DIM_CENTER, EDIT_POINTS, PCB_DIMENSION_BASE, GERBER_DRAW_ITEM, FP_TEXT, PCB_TRACK, PCB_SHAPE, DS_PROXY_VIEW_ITEM, PCB_MARKER, ROUTER_PREVIEW_ITEM, MY_DRAWING, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::RULER_ITEM, RATSNEST_VIEW_ITEM, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 257 of file eda_item.cpp.

258 {
259  // Basic fallback
260  EDA_RECT bbox = GetBoundingBox();
261 
262  return BOX2I( bbox.GetOrigin(), bbox.GetSize() );
263 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:506
const wxPoint GetOrigin() const
Definition: eda_rect.h:110
Handle the component boundary box.
Definition: eda_rect.h:42
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:75
const wxSize GetSize() const
Definition: eda_rect.h:100

References EDA_ITEM::GetBoundingBox(), EDA_RECT::GetOrigin(), and EDA_RECT::GetSize().

Referenced by GERBVIEW_FRAME::GetDocumentExtents(), PCB_SHAPE::ViewBBox(), and PCB_DIMENSION_BASE::ViewBBox().

◆ ViewDraw()

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

Draw the parts of the object belonging to layer aLayer.

An alternative way for drawing objects 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
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.

Reimplemented in EDIT_POINTS, DS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::VIEW_GROUP, MY_DRAWING, KIGFX::VIEW_OVERLAY, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, KIGFX::PREVIEW::RULER_ITEM, and RATSNEST_VIEW_ITEM.

Definition at line 106 of file view_item.h.

107  {}

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

◆ ViewGetLayers()

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

Return 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[]is the output layer index array.
aCountis the number of layer indices in aLayers[].

Implements KIGFX::VIEW_ITEM.

Reimplemented in PAD, FOOTPRINT, EDIT_POINTS, PCB_VIA, SCH_SHEET, BOARD_ITEM, SCH_ITEM, GERBER_DRAW_ITEM, SCH_TEXT, FP_TEXT, PCB_TRACK, LIB_SYMBOL, MY_DRAWING, ZONE, LIB_PIN, LIB_ITEM, PCB_GROUP, SCH_LINE, SCH_SYMBOL, LIB_FIELD, DS_PROXY_VIEW_ITEM, PCB_MARKER, SCH_BITMAP, ROUTER_PREVIEW_ITEM, SCH_BUS_ENTRY_BASE, SCH_JUNCTION, SCH_PIN, SCH_NO_CONNECT, DS_DRAW_ITEM_BASE, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::ORIGIN_VIEWITEM, LIB_TEXT, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, SCH_MARKER, RATSNEST_VIEW_ITEM, KIGFX::PREVIEW::RULER_ITEM, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 266 of file eda_item.cpp.

267 {
268  // Basic fallback
269  aCount = 1;
270  aLayers[0] = 0;
271 }

◆ ViewGetLOD()

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

Return 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
aLayeris the current drawing layer.
aViewis a pointer 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, PCB_VIA, GERBER_DRAW_ITEM, FP_TEXT, PCB_TRACK, ZONE, PCB_GROUP, and FP_SHAPE.

Definition at line 132 of file view_item.h.

133  {
134  // By default always show the item
135  return 0.0;
136  }

Referenced by PNS_KICAD_IFACE::IsItemVisible(), KIGFX::VIEW::DRAW_ITEM_VISITOR::operator()(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), and PCB_SELECTION_TOOL::Selectable().

◆ viewPrivData()

◆ Visit()

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

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_SYMBOL, FOOTPRINT, LIB_SYMBOL, SCH_SHEET, SCH_GLOBALLABEL, GERBER_FILE_IMAGE, GERBER_DRAW_ITEM, PCB_TRACK, PCB_GROUP, and GBR_LAYOUT.

Definition at line 93 of file eda_item.cpp.

94 {
95 #if 0 && defined(DEBUG)
96  std::cout << GetClass().mb_str() << ' ';
97 #endif
98 
99  if( IsType( scanTypes ) )
100  {
101  if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
102  return SEARCH_RESULT::QUIT;
103  }
104 
106 }
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Definition: eda_item.h:182
virtual wxString GetClass() const =0
Return 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 552 of file sch_screen.h.

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

◆ m_aux_origin

wxPoint SCH_SCREEN::m_aux_origin
private

Definition at line 537 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 96 of file base_screen.h.

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

◆ 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 532 of file sch_screen.h.

Referenced by GetClientSheetPaths().

◆ m_DrawingSheetFileName

◆ m_DrawOrg

wxPoint BASE_SCREEN::m_DrawOrg
inherited

offsets for drawing the circuit on the screen

Definition at line 88 of file base_screen.h.

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

◆ m_fileExists

bool SCH_SCREEN::m_fileExists
private

Definition at line 549 of file sch_screen.h.

Referenced by FileExists(), and SetFileExists().

◆ m_fileFormatVersionAtLoad

int SCH_SCREEN::m_fileFormatVersionAtLoad
private

Definition at line 522 of file sch_screen.h.

Referenced by GetFileFormatVersionAtLoad(), and SetFileFormatVersionAtLoad().

◆ m_fileName

wxString SCH_SCREEN::m_fileName
private

Definition at line 521 of file sch_screen.h.

Referenced by GetFileName(), and SetFileName().

◆ m_flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_isReadOnly

bool SCH_SCREEN::m_isReadOnly
private

Read only status of the screen file.

Flag to indicate the file associated with this screen has been created.

Definition at line 546 of file sch_screen.h.

Referenced by IsReadOnly(), and SetFileReadOnly().

◆ m_LastZoomLevel

double SCH_SCREEN::m_LastZoomLevel

last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse the same zoom level when back to the sheet using this screen

Definition at line 508 of file sch_screen.h.

Referenced by SCH_EDITOR_CONTROL::EnterSheet(), SCH_EDITOR_CONTROL::LeaveSheet(), SCH_EDIT_FRAME::OnPageSettingsChange(), HIERARCHY_NAVIG_DLG::onSelectSheetPath(), and SCH_SCREEN().

◆ m_libSymbols

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

Library symbols required for this schematic.

Definition at line 555 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 540 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 111 of file base_screen.h.

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

◆ 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 129 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 535 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 523 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 100 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 93 of file base_screen.h.

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

◆ m_status

◆ 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_SYMBOL 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 571 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 536 of file sch_screen.h.

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

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 474 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_SYMBOL::AddHierarchicalReference(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateSymbols(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), BOOST_FIXTURE_TEST_CASE(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), DRAWING_TOOL::DrawVia(), LIB_SYMBOL::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), FOOTPRINT::Duplicate(), FOOTPRINT::DuplicateItem(), PCB_EDIT_FRAME::ExchangeFootprint(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportNetlist(), BOARD::FillItemMap(), SCH_SHEET_LIST::FillItemMap(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_EDIT_FRAME::FocusOnItem(), SCH_SEXPR_PLUGIN::Format(), PCB_PLUGIN::format(), FormatProbeItem(), SCH_PIN::GetDefaultNetName(), BOARD::GetItem(), SCH_SHEET_LIST::GetItem(), PAD::GetMsgPanelInfo(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), FP_TEXT::GetParentAsString(), PAD::GetParentAsString(), FP_SHAPE::GetParentAsString(), SCH_REFERENCE::GetPath(), GetSheets(), SCH_MARKER::GetUUID(), PCB_MARKER::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), SCH_SHEET_PATH::IsContainedWithin(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), SCH_LEGACY_PLUGIN::loadSymbol(), SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic(), LEGACY_PLUGIN::loadTrackList(), PNS::LOGGER::Log(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), SCH_EDITOR_CONTROL::nextMatch(), PCB_SHAPE::cmp_drawings::operator()(), PCB_TRACK::cmp_tracks::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), BOARD::cmp_items::operator()(), BOARD::cmp_drawings::operator()(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), PAD::PAD(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), BOARD_REANNOTATE_TOOL::ReannotateDuplicates(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SYMBOL::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN::saveJunction(), SCH_SEXPR_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_LEGACY_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), SCH_SYMBOL::SCH_SYMBOL(), RC_ITEM::SetItems(), SwapItemData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), SCH_EDITOR_CONTROL::updatePastedSheet(), SCH_EDITOR_CONTROL::updatePastedSymbol(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ m_uuid

KIID SCH_SCREEN::m_uuid
private

A unique identifier for each schematic file.

As of right now, this only has meaning for the root schematic. In the future, it may be useful to detect unexpected hierarchy changes.

Definition at line 580 of file sch_screen.h.

Referenced by AssignNewUuid(), SCH_SEXPR_PLUGIN::Format(), GetUuid(), and SCH_SEXPR_PARSER::ParseSchematic().

◆ 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 119 of file base_screen.h.

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

◆ m_zoomInitialized

bool SCH_SCREEN::m_zoomInitialized
private

◆ SCH_EDIT_FRAME

friend SCH_SCREEN::SCH_EDIT_FRAME
private

Definition at line 515 of file sch_screen.h.

◆ SCH_SEXPR_PARSER

friend SCH_SCREEN::SCH_SEXPR_PARSER
private

Definition at line 516 of file sch_screen.h.

◆ SCH_SEXPR_PLUGIN

friend SCH_SCREEN::SCH_SEXPR_PLUGIN
private

Definition at line 517 of file sch_screen.h.


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