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
 
const wxPoint & GetAuxOrigin () const
 
void SetAuxOrigin (const wxPoint &aPosition)
 
const TITLE_BLOCKGetTitleBlock () const
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock)
 
void DecRefCount ()
 
void IncRefCount ()
 
int GetRefCount () const
 
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths ()
 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 IsJunctionNeeded (const wxPoint &aPosition, bool aNew=false) const
 Test if a junction is required for the items at aPosition on the screen. 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 contained within or on the bounding box of an item. More...
 
virtual bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const
 Test if aRect intersects or is contained within the bounding box of an 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

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
 
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 {
72  m_refCount = 0;
73  m_zoomInitialized = false;
74  m_LastZoomLevel = 1.0;
75 
76  // Suitable for schematic only. For symbol_editor and viewlib, must be set to true
77  m_Center = false;
78 
79  InitDataPoints( m_paper.GetSizeIU() );
80 }
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
Definition: sch_screen.h:481
int m_refCount
Definition: sch_screen.h:492
int m_modification_sync
Definition: sch_screen.h:509
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:46
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:491
PAGE_INFO m_paper
Definition: sch_screen.h:504
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:512

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

84 {
86  FreeDrawList();
87 }
void clearLibSymbols()
Definition: sch_screen.cpp:99
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:245

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

1076 {
1077  m_aliases.insert( aAlias );
1078 }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:516

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

1058 {
1059  wxCHECK( aLibSymbol, /* void */ );
1060 
1061  wxString libSymbolName = aLibSymbol->GetLibId().Format().wx_str();
1062 
1063  auto it = m_libSymbols.find( libSymbolName );
1064 
1065  if( it != m_libSymbols.end() )
1066  {
1067  delete it->second;
1068  m_libSymbols.erase( it );
1069  }
1070 
1071  m_libSymbols[libSymbolName] = aLibSymbol;
1072 }
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:519

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

145 {
146  if( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T )
147  {
148  // Ensure the item can reach the SCHEMATIC through this screen
149  aItem->SetParent( this );
150 
151  if( aItem->Type() == SCH_SYMBOL_T )
152  {
153  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( aItem );
154 
155  if( symbol->GetLibSymbolRef() )
156  {
157  symbol->GetLibSymbolRef()->GetDrawItems().sort();
158 
159  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
160 
161  if( it == m_libSymbols.end() || !it->second )
162  {
164  new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
165  }
166  else
167  {
168  // The original library symbol may have changed since the last time
169  // it was added to the schematic. If it has changed, then a new name
170  // must be created for the library symbol list to prevent all of the
171  // other schematic symbols referencing that library symbol from changing.
172  LIB_SYMBOL* foundSymbol = it->second;
173 
174  foundSymbol->GetDrawItems().sort();
175 
176  if( *foundSymbol != *symbol->GetLibSymbolRef() )
177  {
178  int cnt = 1;
179  wxString newName;
180 
181  newName.Printf( "%s_%d", symbol->GetLibId().GetUniStringLibItemName(),
182  cnt );
183 
184  while( m_libSymbols.find( newName ) != m_libSymbols.end() )
185  {
186  cnt += 1;
187  newName.Printf( "%s_%d", symbol->GetLibId().GetUniStringLibItemName(),
188  cnt );
189  }
190 
191  // Update the schematic symbol library link as this symbol only exists
192  // in the schematic.
193  symbol->SetSchSymbolLibraryName( newName );
194 
195  LIB_SYMBOL* newLibSymbol = new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
196  LIB_ID newLibId( wxEmptyString, newName );
197 
198  newLibSymbol->SetLibId( newLibId );
199  newLibSymbol->SetName( newName );
200  symbol->SetLibSymbol( newLibSymbol->Flatten().release() );
201  m_libSymbols[newName] = newLibSymbol;
202  }
203  }
204  }
205  }
206 
207  m_rtree.insert( aItem );
209  }
210 }
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:509
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:257
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:332
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:116
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition: sch_symbol.h:164
wxString GetSchSymbolLibraryName() const
Definition: sch_symbol.cpp:248
virtual void SetName(const wxString &aName)
Definition: lib_symbol.cpp:314
EE_RTREE m_rtree
Definition: sch_screen.h:507
void SetSchSymbolLibraryName(const wxString &aName)
The name of the symbol in the schematic library symbol list.
Definition: sch_symbol.h:160
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:473
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:519
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:113
const LIB_ID & GetLibId() const
Definition: sch_symbol.h:147

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::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(), 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 213 of file sch_screen.cpp.

214 {
215  wxCHECK_RET( aScreen, "Invalid screen object." );
216 
217  // No need to descend the hierarchy. Once the top level screen is copied, all of its
218  // children are copied as well.
219  for( auto aItem : aScreen->m_rtree )
220  Append( aItem );
221 
222  aScreen->Clear( false );
223 }
void Clear(bool aFree=true)
Delete all draw items and clears the project settings.
Definition: sch_screen.cpp:226
EE_RTREE m_rtree
Definition: sch_screen.h:507
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:144

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

◆ AssignNewUuid()

void SCH_SCREEN::AssignNewUuid ( )
inline

Definition at line 471 of file sch_screen.h.

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

References m_uuid.

Referenced by SCH_EDIT_FRAME::SaveProject().

◆ CheckIfOnDrawList()

bool SCH_SCREEN::CheckIfOnDrawList ( const SCH_ITEM aItem) const

Definition at line 334 of file sch_screen.cpp.

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

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

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

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

227 {
228  if( aFree )
229  {
230  FreeDrawList();
231  clearLibSymbols();
232  }
233  else
234  {
235  m_rtree.clear();
236  }
237 
238  // Clear the project settings
240 
241  m_titles.Clear();
242 }
void clearLibSymbols()
Definition: sch_screen.cpp:99
void Clear()
Definition: title_block.h:113
TITLE_BLOCK m_titles
Definition: sch_screen.h:505
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:507
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:245
void clear()
Remove all items from the RTree.
Definition: sch_rtree.h:104
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 916 of file sch_screen.cpp.

917 {
918 
919  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
920  {
921  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
922 
923  symbol->ClearAnnotation( aSheetPath );
924  }
925 }
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:193

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

447  {
448  m_aliases.clear();
449  }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:516

References m_aliases.

◆ ClearDrawingState()

void SCH_SCREEN::ClearDrawingState ( )

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

Definition at line 825 of file sch_screen.cpp.

826 {
827  for( SCH_ITEM* item : Items() )
828  item->ClearTempFlags();
829 }
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:193

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

154 { m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481

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(), 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 99 of file sch_screen.cpp.

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

References m_libSymbols.

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

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 166 of file eda_item.h.

167  {
169  DO_NOT_DRAW );
170  }
#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:154
#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 148 of file view_item.h.

149  {
150  m_viewPrivData = nullptr;
151  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:156

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, PCB_SHAPE, SCH_LABEL, PCB_ARC, SCH_TEXT, SCH_LINE, LIB_PIN, FP_TEXT, SCH_BUS_BUS_ENTRY, PCB_TRACK, SCH_FIELD, SCH_SHEET_PIN, LIB_FIELD, SCH_BUS_WIRE_ENTRY, FP_SHAPE, PCB_TEXT, SCH_BITMAP, PCB_GROUP, LIB_ARC, SCH_JUNCTION, LIB_TEXT, SCH_NO_CONNECT, SCH_MARKER, LIB_POLYLINE, PCB_TARGET, LIB_BEZIER, LIB_CIRCLE, LIB_RECTANGLE, 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 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 902 of file sch_screen.cpp.

903 {
904  size_t count = 0;
905 
906  for( const SCH_ITEM* item : Items() )
907  {
908  if( ( item->Type() != SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
909  count++;
910  }
911 
912  return count;
913 }
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:193

References Items(), and SCH_JUNCTION_T.

◆ DecRefCount()

void SCH_SCREEN::DecRefCount ( )

Definition at line 122 of file sch_screen.cpp.

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

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

310 {
311  wxCHECK_RET( aItem, wxT( "Cannot delete invalid item from screen." ) );
312 
313  // Markers are not saved in the file, no need to flag as modified.
314  // TODO: Maybe we should have a listing somewhere of items that aren't saved?
315  if( aItem->Type() != SCH_MARKER_T )
317 
318  Remove( aItem );
319 
320  if( aItem->Type() == SCH_SHEET_PIN_T )
321  {
322  // This structure is attached to a sheet, get the parent sheet object.
323  SCH_SHEET_PIN* sheetPin = (SCH_SHEET_PIN*) aItem;
324  SCH_SHEET* sheet = sheetPin->GetParent();
325  wxCHECK_RET( sheet, wxT( "Sheet pin parent not properly set, bad programmer!" ) );
326  sheet->RemovePin( sheetPin );
327  return;
328  }
329 
330  delete aItem;
331 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:271
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:310
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:113

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

◆ EnsureAlternateReferencesExist()

void SCH_SCREEN::EnsureAlternateReferencesExist ( )

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

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

929 {
930  if( GetClientSheetPaths().size() <= 1 ) // No need for alternate reference
931  return;
932 
933  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
934  {
935  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
936 
937  // Add (when not existing) all sheet path entries
938  for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() )
939  symbol->AddSheetPathReferenceEntryIfMissing( sheet.Path() );
940  }
941 }
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:171
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193

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

Referenced by SCH_SCREENS::ClearAnnotationOfNewSheetPaths().

◆ FreeDrawList()

void SCH_SCREEN::FreeDrawList ( )

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

This does not delete any sub hierarchies.

Definition at line 245 of file sch_screen.cpp.

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

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

147 { return m_aux_origin; }
wxPoint m_aux_origin
Definition: sch_screen.h:506

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, PCB_SHAPE, DS_DRAW_ITEM_PAGE, SCH_SHEET, PCB_DIMENSION_BASE, DS_DRAW_ITEM_RECT, LIB_SYMBOL, SCH_TEXT, GERBER_DRAW_ITEM, LIB_ITEM, FP_TEXT, LIB_PIN, DS_DRAW_ITEM_POLYPOLYGONS, FOOTPRINT, PCB_GROUP, SCH_LINE, PCB_TEXT, DS_DRAW_ITEM_LINE, ZONE, LIB_FIELD, PCB_TRACK, SCH_FIELD, PCB_MARKER, SCH_BITMAP, DS_DRAW_ITEM_BASE, PCB_TARGET, LIB_TEXT, SCH_BUS_ENTRY_BASE, SCH_PIN, GBR_LAYOUT, LIB_POLYLINE, SCH_NO_CONNECT, SCH_MARKER, LIB_BEZIER, SCH_JUNCTION, LIB_RECTANGLE, LIB_ARC, and LIB_CIRCLE.

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(), 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_COPPER_CLEARANCE::testItemAgainstZones(), GERBVIEW_SELECTION::ViewBBox(), and EDA_ITEM::ViewBBox().

◆ GetBus()

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

Definition at line 402 of file sch_screen.h.

404  {
405  return GetLine( aPosition, aAccuracy, LAYER_BUS, aSearchType );
406  }
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.
Definition: sch_screen.cpp:997

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

455  {
456  return m_aliases;
457  }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:516

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

172  {
173  return m_clientSheetPathList;
174  }
std::vector< SCH_SHEET_PATH > m_clientSheetPathList
The list of sheet paths sharing this screen.
Definition: sch_screen.h:501

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

159  {
160  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_RESIZING | IS_DRAGGING
162 
163  return m_flags & mask;
164  }
#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:481
#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:491

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_SHAPE, and PCB_TRACK.

Definition at line 259 of file eda_item.h.

259 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:252

References EDA_ITEM::GetPosition().

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

◆ GetHierarchicalItems()

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

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

Parameters
[out]aItemsHierarchical item list to fill.

Definition at line 944 of file sch_screen.cpp.

945 {
946  static KICAD_T hierarchicalTypes[] = { SCH_SYMBOL_T, SCH_SHEET_T, SCH_GLOBAL_LABEL_T, EOT };
947 
948  for( SCH_ITEM* item : Items() )
949  {
950  if( item->IsType( hierarchicalTypes ) )
951  aItems->push_back( item );
952  }
953 }
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:193

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

341 {
342  EDA_RECT bbox;
343  bbox.SetOrigin( aPosition );
344  bbox.Inflate( aAccuracy );
345 
346  for( SCH_ITEM* item : Items().Overlapping( aType, bbox ) )
347  {
348  if( item->HitTest( aPosition, aAccuracy ) )
349  return item;
350  }
351 
352  return nullptr;
353 }
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:121
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:193
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 1034 of file sch_screen.cpp.

1035 {
1036  for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
1037  {
1038  switch( item->Type() )
1039  {
1040  case SCH_LABEL_T:
1041  case SCH_GLOBAL_LABEL_T:
1042  case SCH_HIER_LABEL_T:
1043  if( item->HitTest( aPosition, aAccuracy ) )
1044  return static_cast<SCH_TEXT*>( item );
1045 
1046  break;
1047 
1048  default:
1049  ;
1050  }
1051  }
1052 
1053  return nullptr;
1054 }
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:193

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

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

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

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

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

999 {
1000  // an accuracy of 0 had problems with rounding errors; use at least 1
1001  aAccuracy = std::max( aAccuracy, 1 );
1002 
1003  for( SCH_ITEM* item : Items() )
1004  {
1005  if( item->Type() != SCH_LINE_T )
1006  continue;
1007 
1008  if( item->GetLayer() != aLayer )
1009  continue;
1010 
1011  if( !item->HitTest( aPosition, aAccuracy ) )
1012  continue;
1013 
1014  switch( aSearchType )
1015  {
1016  case ENTIRE_LENGTH_T:
1017  return (SCH_LINE*) item;
1018 
1019  case EXCLUDE_END_POINTS_T:
1020  if( !( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1021  return (SCH_LINE*) item;
1022  break;
1023 
1024  case END_POINTS_ONLY_T:
1025  if( ( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1026  return (SCH_LINE*) item;
1027  }
1028  }
1029 
1030  return nullptr;
1031 }
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:193

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

◆ 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( "%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 832 of file sch_screen.cpp.

834 {
835  SCH_SYMBOL* candidate = nullptr;
836  LIB_PIN* pin = nullptr;
837 
838  for( SCH_ITEM* item : Items().Overlapping( SCH_SYMBOL_T, aPosition ) )
839  {
840  candidate = static_cast<SCH_SYMBOL*>( item );
841 
842  if( aEndPointOnly )
843  {
844  pin = nullptr;
845 
846  if( !candidate->GetLibSymbolRef() )
847  continue;
848 
849  for( pin = candidate->GetLibSymbolRef()->GetNextPin(); pin;
850  pin = candidate->GetLibSymbolRef()->GetNextPin( pin ) )
851  {
852  // Skip items not used for this part.
853  if( candidate->GetUnit() && pin->GetUnit() &&
854  ( pin->GetUnit() != candidate->GetUnit() ) )
855  continue;
856 
857  if( candidate->GetConvert() && pin->GetConvert() &&
858  ( pin->GetConvert() != candidate->GetConvert() ) )
859  continue;
860 
861  if( candidate->GetPinPhysicalPosition( pin ) == aPosition )
862  break;
863  }
864 
865  if( pin )
866  break;
867  }
868  else
869  {
870  pin = (LIB_PIN*) candidate->GetDrawItem( aPosition, LIB_PIN_T );
871 
872  if( pin )
873  break;
874  }
875  }
876 
877  if( pin && aSymbol )
878  *aSymbol = candidate;
879 
880  return pin;
881 }
wxPoint GetPinPhysicalPosition(const LIB_PIN *Pin) const
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition: sch_symbol.h:164
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:195
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:223
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193

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, DELETED_BOARD_ITEM, SCH_SHEET, DS_DRAW_ITEM_BITMAP, DS_DRAW_ITEM_TEXT, PCB_ARC, BOARD, DS_DRAW_ITEM_PAGE, SCH_TEXT, DS_DRAW_ITEM_RECT, SCH_LINE, LIB_PIN, SCH_FIELD, FOOTPRINT, PAD, DS_DRAW_ITEM_POLYPOLYGONS, LIB_FIELD, GERBER_DRAW_ITEM, DS_DRAW_ITEM_LINE, SCH_BITMAP, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_GROUP, ZONE, SCH_NO_CONNECT, KIGFX::ORIGIN_VIEWITEM, SCH_BUS_ENTRY_BASE, SCH_MARKER, PCB_TRACK, LIB_TEXT, SCH_JUNCTION, FP_TEXT, LIB_POLYLINE, NETINFO_ITEM, SCH_PIN, PCB_TEXT, LIB_BEZIER, LIB_ARC, LIB_RECTANGLE, PCB_MARKER, LIB_CIRCLE, and PCB_TARGET.

Definition at line 252 of file eda_item.h.

252 { return wxPoint(); }

Referenced by 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(), 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(), PCB_SELECTION_TOOL::selectConnectedTracks(), RC_ITEM::ShowReport(), TransformItem(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), PL_EDIT_TOOL::updateModificationPoint(), and EE_POINT_EDITOR::updatePoints().

◆ GetRefCount()

int SCH_SCREEN::GetRefCount ( ) const
inline

Definition at line 156 of file sch_screen.h.

156 { return m_refCount; }
int m_refCount
Definition: sch_screen.h:492

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, DELETED_BOARD_ITEM, SCH_SHEET, DS_DRAW_ITEM_BITMAP, DS_DRAW_ITEM_TEXT, PCB_SHAPE, SCH_LABEL, DS_DRAW_ITEM_PAGE, GERBER_DRAW_ITEM, PCB_DIMENSION_BASE, SCH_TEXT, DS_DRAW_ITEM_RECT, LIB_PIN, FP_TEXT, SCH_LINE, SCH_BUS_BUS_ENTRY, PCB_TRACK, PCB_GROUP, SCH_FIELD, DS_DRAW_ITEM_POLYPOLYGONS, SCH_SHEET_PIN, LIB_FIELD, SCH_BUS_WIRE_ENTRY, FP_SHAPE, DS_DRAW_ITEM_LINE, PCB_TEXT, SCH_BITMAP, LIB_ARC, LIB_TEXT, LIB_POLYLINE, SCH_NO_CONNECT, SCH_MARKER, PCB_MARKER, PCB_TARGET, SCH_JUNCTION, LIB_CIRCLE, LIB_RECTANGLE, 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::buildConnectionGraph(), 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 464 of file sch_screen.h.

465  {
466  return m_sheetInstances;
467  }
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
Definition: sch_screen.h:536

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

885 {
886  SCH_SHEET_PIN* sheetPin = nullptr;
887 
888  for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
889  {
890  auto sheet = static_cast<SCH_SHEET*>( item );
891 
892  sheetPin = sheet->GetPin( aPosition );
893 
894  if( sheetPin )
895  break;
896  }
897 
898  return sheetPin;
899 }
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
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:193

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

957 {
958  for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
959  aItems->push_back( item );
960 
961  std::sort( aItems->begin(), aItems->end(),
962  []( EDA_ITEM* a, EDA_ITEM* b ) -> bool
963  {
964  if( a->GetPosition().x == b->GetPosition().x )
965  {
966  // Ensure deterministic sort
967  if( a->GetPosition().y == b->GetPosition().y )
968  return a->m_Uuid < b->m_Uuid;
969 
970  return a->GetPosition().y < b->GetPosition().y;
971  }
972  else
973  return a->GetPosition().x < b->GetPosition().x;
974  } );
975 }
virtual wxPoint GetPosition() const
Definition: eda_item.h:252
const KIID m_Uuid
Definition: eda_item.h:475
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:100
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193

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

138  {
139  return m_status & type;
140  }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:478

References EDA_ITEM::m_status.

Referenced by BOARD_ITEM::IsLocked().

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 150 of file eda_item.h.

150 { return m_status; }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:478

References EDA_ITEM::m_status.

◆ GetSymbolInstances()

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

Definition at line 459 of file sch_screen.h.

460  {
461  return m_symbolInstances;
462  }
std::vector< SYMBOL_INSTANCE_REFERENCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
Definition: sch_screen.h:535

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

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

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

398  {
399  return GetLine( aPosition, aAccuracy, LAYER_WIRE, aSearchType );
400  }
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.
Definition: sch_screen.cpp:997

References GetLine(), and LAYER_WIRE.

Referenced by IsTerminalPoint().

◆ HasFlag()

◆ HasItems()

bool SCH_SCREEN::HasItems ( KICAD_T  aItemType) const

Definition at line 130 of file sch_screen.cpp.

131 {
132  EE_RTREE::EE_TYPE sheets = m_rtree.OfType( aItemType );
133 
134  return sheets.begin() != sheets.end();
135 }
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:216
EE_RTREE m_rtree
Definition: sch_screen.h:507
iterator end()
Definition: sch_rtree.h:210
iterator begin()
Definition: sch_rtree.h:205
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
Definition: sch_rtree.h:178

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:130

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 or is contained within the bounding box of an item.

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

Reimplemented in SCH_SYMBOL, PAD, ZONE, FOOTPRINT, PCB_VIA, SCH_GLOBALLABEL, SCH_SHEET, DS_DRAW_ITEM_BITMAP, DS_DRAW_ITEM_TEXT, PCB_ARC, PCB_SHAPE, SCH_TEXT, PCB_DIMENSION_BASE, DS_DRAW_ITEM_RECT, SCH_LINE, GERBER_DRAW_ITEM, FP_TEXT, SCH_FIELD, PCB_TRACK, DS_DRAW_ITEM_POLYPOLYGONS, LIB_ITEM, LIB_PIN, PCB_GROUP, SCH_BITMAP, PCB_TEXT, SCH_JUNCTION, SCH_NO_CONNECT, SCH_BUS_ENTRY_BASE, DS_DRAW_ITEM_BASE, PCB_TARGET, LIB_POLYLINE, LIB_BEZIER, LIB_TEXT, LIB_ARC, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 238 of file eda_item.h.

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

◆ IncRefCount()

void SCH_SCREEN::IncRefCount ( )

Definition at line 116 of file sch_screen.cpp.

117 {
118  m_refCount++;
119 }
int m_refCount
Definition: sch_screen.h:492

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

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

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:163
EE_RTREE m_rtree
Definition: sch_screen.h:507

References EE_RTREE::empty(), and m_rtree.

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 124 of file eda_item.h.

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

References ENTERED, and EDA_ITEM::m_flags.

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

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 206 of file eda_item.h.

206 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:480

References EDA_ITEM::m_forceVisible.

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

◆ IsJunctionNeeded()

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

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

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

  • One wire midpoint and one or more wire endpoints.
  • Three or more wire endpoints.
  • One wire midpoint and a symbol pin.
  • Two or more wire endpoints and a symbol pin.
Parameters
[in]aPositionThe position to test.
aNewChecks if a new junction is needed, i.e. there isn't one already
Returns
True if a junction is required at aPosition.

Definition at line 401 of file sch_screen.cpp.

402 {
403  enum layers { WIRES = 0, BUSES };
404 
405  bool breakLines[ 2 ] = { false };
406  std::unordered_set<int> exitAngles[ 2 ];
407  std::vector<const SCH_LINE*> midPointLines[ 2 ];
408 
409  // A pin at 90º still shouldn't match a line at 90º so just give pins unique numbers
410  int uniqueAngle = 10000;
411 
412  for( const SCH_ITEM* item : Items().Overlapping( aPosition ) )
413  {
414  if( item->GetEditFlags() & STRUCT_DELETED )
415  continue;
416 
417  switch( item->Type() )
418  {
419  case SCH_JUNCTION_T:
420  if( aNew && item->HitTest( aPosition, -1 ) )
421  return false;
422 
423  break;
424 
425  case SCH_LINE_T:
426  {
427  const SCH_LINE* line = static_cast<const SCH_LINE*>( item );
428  int layer;
429 
430  if( line->GetStartPoint() == line->GetEndPoint() )
431  break;
432  else if( line->GetLayer() == LAYER_WIRE )
433  layer = WIRES;
434  else if( line->GetLayer() == LAYER_BUS )
435  layer = BUSES;
436  else
437  break;
438 
439  if( line->IsConnected( aPosition ) )
440  {
441  breakLines[ layer ] = true;
442  exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
443  }
444  else if( line->HitTest( aPosition, -1 ) )
445  {
446  // Defer any line midpoints until we know whether or not we're breaking them
447  midPointLines[ layer ].push_back( line );
448  }
449  }
450  break;
451 
453  case SCH_SYMBOL_T:
454  case SCH_SHEET_T:
455  if( item->IsConnected( aPosition ) )
456  {
457  breakLines[ WIRES ] = true;
458  exitAngles[ WIRES ].insert( uniqueAngle++ );
459  }
460 
461  break;
462 
463  default:
464  break;
465  }
466  }
467 
468  for( int layer : { WIRES, BUSES } )
469  {
470  if( breakLines[ layer ] )
471  {
472  for( const SCH_LINE* line : midPointLines[ layer ] )
473  {
474  exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
475  exitAngles[ layer ].insert( line->GetReverseAngleFrom( aPosition ) );
476  }
477  }
478  }
479 
480  return exitAngles[ WIRES ].size() >= 3 || exitAngles[ BUSES ].size() >= 3;
481 }
int GetReverseAngleFrom(const wxPoint &aPoint) const
Definition: sch_line.cpp:427
wxPoint GetStartPoint() const
Definition: sch_line.h:90
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: sch_line.cpp:780
int GetAngleFrom(const wxPoint &aPoint) const
Definition: sch_line.cpp:414
#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:268
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:193
bool IsConnected(const wxPoint &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:122
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 SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), SCH_EDIT_TOOL::BreakWire(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_MOVE_TOOL::Main(), SCH_LINE::MergeOverlap(), SCH_EDIT_FRAME::SchematicCleanUp(), and SCH_DRAWING_TOOLS::SingleClickPlace().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 118 of file eda_item.h.

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

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

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

403 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 125 of file eda_item.h.

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

References IS_RESIZING, and EDA_ITEM::m_flags.

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 123 of file eda_item.h.

123 { return m_flags & SELECTED; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481
#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_LEGACY::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(), EE_SELECTION_TOOL::selectMultiple(), 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 484 of file sch_screen.cpp.

485 {
486  wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
487  wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
488 
489  switch( aLayer )
490  {
491  case LAYER_BUS:
492  {
493  if( GetBus( aPosition ) )
494  return true;
495 
496  SCH_SHEET_PIN* sheetPin = GetSheetPin( aPosition );
497 
498  if( sheetPin && sheetPin->IsConnected( aPosition ) )
499  return true;
500 
501  SCH_TEXT* label = GetLabel( aPosition );
502 
503  if( label && label->IsConnected( aPosition ) )
504  return true;
505  }
506  break;
507 
508  case LAYER_NOTES:
509  {
510  if( GetLine( aPosition ) )
511  return true;
512  }
513  break;
514 
515  case LAYER_WIRE:
516  {
517  if( GetItem( aPosition, 1, SCH_BUS_WIRE_ENTRY_T) )
518  return true;
519 
520  if( GetItem( aPosition, 1, SCH_JUNCTION_T ) )
521  return true;
522 
523  if( GetPin( aPosition, nullptr, true ) )
524  return true;
525 
526  if( GetWire( aPosition ) )
527  return true;
528 
529  SCH_TEXT* label = GetLabel( aPosition, 1 );
530 
531  if( label && label->IsConnected( aPosition ) )
532  return true;
533 
534  SCH_SHEET_PIN* sheetPin = GetSheetPin( aPosition );
535 
536  if( sheetPin && sheetPin->IsConnected( aPosition ) )
537  return true;
538  }
539  break;
540 
541  default:
542  break;
543  }
544 
545  return false;
546 }
SCH_LINE * GetBus(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:402
SCH_SHEET_PIN * GetSheetPin(const wxPoint &aPosition) const
Test the screen if aPosition is a sheet label object.
Definition: sch_screen.cpp:884
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:340
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.
Definition: sch_screen.cpp:997
SCH_LINE * GetWire(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:396
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:832
bool IsConnected(const wxPoint &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:122

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

184  {
185  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
186  return true;
187 
188  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
189  {
190  if( m_structType == *p )
191  return true;
192  }
193 
194  return false;
195  }
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:488

References EOT, EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by 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 122 of file eda_item.h.

122 { return m_flags & IS_WIRE_IMAGE; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481
#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:507

References m_rtree.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), 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(), 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(), IsJunctionNeeded(), 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_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SCH_EDIT_FRAME::setupUIConditions(), SCH_SHEET::SymbolCount(), TestDanglingEnds(), ERC_TESTER::TestDuplicateSheetNames(), DIALOG_ERC::testErc(), ERC_TESTER::TestTextVars(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), SCH_EDIT_FRAME::TrimWire(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), SCH_EDITOR_CONTROL::UpdateFind(), UpdateLocalLibSymbolLinks(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), SCH_EDITOR_CONTROL::updatePastedSheet(), UpdateSymbolLinks(), 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:507

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

299  {
300  for( auto it : aList )
301  {
302  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
304  return SEARCH_RESULT::QUIT;
305  }
306 
308  }
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 314 of file eda_item.h.

316  {
317  for( auto it : aList )
318  {
319  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
321  return SEARCH_RESULT::QUIT;
322  }
323 
325  }
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 356 of file sch_screen.cpp.

357 {
358  std::set<SCH_ITEM*> retval;
359  std::stack<SCH_LINE*> to_search;
360 
361  wxCHECK_MSG( aSegment && aSegment->Type() == SCH_LINE_T, retval, wxT( "Invalid pointer." ) );
362 
363  to_search.push( aSegment );
364 
365  while( !to_search.empty() )
366  {
367  SCH_LINE* test_item = to_search.top();
368  to_search.pop();
369 
370  for( SCH_ITEM* item : Items().Overlapping( SCH_JUNCTION_T, test_item->GetBoundingBox() ) )
371  {
372  if( test_item->IsEndPoint( item->GetPosition() ) )
373  retval.insert( item );
374  }
375 
376  for( SCH_ITEM* item : Items().Overlapping( SCH_LINE_T, test_item->GetBoundingBox() ) )
377  {
378  // Skip connecting lines on different layers (e.g. buses)
379  if( test_item->GetLayer() != item->GetLayer() )
380  continue;
381 
382  SCH_LINE* line = static_cast<SCH_LINE*>( item );
383 
384  if( ( test_item->IsEndPoint( line->GetStartPoint() )
385  && !GetPin( line->GetStartPoint(), nullptr, true ) )
386  || ( test_item->IsEndPoint( line->GetEndPoint() )
387  && !GetPin( line->GetEndPoint(), nullptr, true ) ) )
388  {
389  auto result = retval.insert( line );
390 
391  if( result.second )
392  to_search.push( line );
393  }
394  }
395  }
396 
397  return retval;
398 }
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:268
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:166
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:832
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
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, SCH_MARKER, PCB_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 365 of file eda_item.h.

366  {
367  return false;
368  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), inDiffPair(), PCB_TEXT::Matches(), FP_TEXT::Matches(), PCB_MARKER::Matches(), SCH_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  wxString searchText = aSearchData.GetFindString();
122 
123  // Don't match if searching for replaceable item and the item doesn't support text replace.
124  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
125  return false;
126 
127  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
128  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
129 
130  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
131  {
132  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
133  return text.Matches( searchText );
134 
135  return text.MakeUpper().Matches( searchText.MakeUpper() );
136  }
137 
138  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
139  return aText.Find( searchText ) != wxNOT_FOUND;
140 
141  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
142 }
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:403

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, EDA_ITEM::IsReplaceable(), 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 171 of file eda_item.cpp.

172 {
173  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
174  GetClass() ) );
175 
176  return false;
177 }
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 770 of file sch_screen.cpp.

771 {
772  // Ensure links are up to date, even if a library was reloaded for some reason:
773  std::vector< SCH_ITEM* > junctions;
774  std::vector< SCH_ITEM* > bitmaps;
775  std::vector< SCH_ITEM* > other;
776 
777  for( auto item : Items() )
778  {
779  if( item->IsMoving() || item->IsResized() )
780  continue;
781 
782  if( item->Type() == SCH_JUNCTION_T )
783  junctions.push_back( item );
784  else if( item->Type() == SCH_BITMAP_T )
785  bitmaps.push_back( item );
786  else
787  other.push_back( item );
788  }
789 
791  std::sort( other.begin(), other.end(),
792  []( const SCH_ITEM* a, const SCH_ITEM* b )
793  {
794  if( a->Type() == b->Type() )
795  return a->GetLayer() > b->GetLayer();
796 
797  return a->Type() > b->Type();
798  } );
799 
800  int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth();
801 
802  // Bitmaps are drawn first to ensure they are in the background
803  // This is particularly important for the wxPostscriptDC (used in *nix printers) as
804  // the bitmap PS command clears the screen
805  for( const SCH_ITEM* item : bitmaps )
806  {
807  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
808  item->Plot( aPlotter );
809  }
810 
811  for( const SCH_ITEM* item : other )
812  {
813  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
814  item->Plot( aPlotter );
815  }
816 
817  for( const SCH_ITEM* item : junctions )
818  {
819  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
820  item->Plot( aPlotter );
821  }
822 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:268
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:193
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:113

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

730 {
731  // Ensure links are up to date, even if a library was reloaded for some reason:
732  std::vector<SCH_ITEM*> junctions;
733  std::vector<SCH_ITEM*> bitmaps;
734  std::vector<SCH_ITEM*> other;
735 
736  for( SCH_ITEM* item : Items() )
737  {
738  if( item->IsMoving() || item->IsResized() )
739  continue;
740 
741  if( item->Type() == SCH_JUNCTION_T )
742  junctions.push_back( item );
743  else if( item->Type() == SCH_BITMAP_T )
744  bitmaps.push_back( item );
745  else
746  other.push_back( item );
747  }
748 
750  std::sort( other.begin(), other.end(),
751  []( const SCH_ITEM* a, const SCH_ITEM* b )
752  {
753  if( a->Type() == b->Type() )
754  return a->GetLayer() > b->GetLayer();
755 
756  return a->Type() > b->Type();
757  } );
758 
759  for( SCH_ITEM* item : bitmaps )
760  item->Print( aSettings, wxPoint( 0, 0 ) );
761 
762  for( SCH_ITEM* item : other )
763  item->Print( aSettings, wxPoint( 0, 0 ) );
764 
765  for( SCH_ITEM* item : junctions )
766  item->Print( aSettings, wxPoint( 0, 0 ) );
767 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:268
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:193
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

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

272 {
273  bool retv = m_rtree.remove( aItem );
274 
275  // Check if the library symbol for the removed schematic symbol is still required.
276  if( retv && aItem->Type() == SCH_SYMBOL_T )
277  {
278  SCH_SYMBOL* removedSymbol = static_cast<SCH_SYMBOL*>( aItem );
279 
280  bool removeUnusedLibSymbol = true;
281 
282  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
283  {
284  SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
285 
286  if( removedSymbol->GetSchSymbolLibraryName() == symbol->GetSchSymbolLibraryName() )
287  {
288  removeUnusedLibSymbol = false;
289  break;
290  }
291  }
292 
293  if( removeUnusedLibSymbol )
294  {
295  auto it = m_libSymbols.find( removedSymbol->GetSchSymbolLibraryName() );
296 
297  if( it != m_libSymbols.end() )
298  {
299  delete it->second;
300  m_libSymbols.erase( it );
301  }
302  }
303  }
304 
305  return retv;
306 }
bool remove(SCH_ITEM *aItem)
Remove an item from the tree.
Definition: sch_rtree.h:75
wxString GetSchSymbolLibraryName() const
Definition: sch_symbol.cpp:248
EE_RTREE m_rtree
Definition: sch_screen.h:507
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:519
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

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

146 {
147  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
148 
149  int result = searchString.Find( ( aSearchData.GetFlags() & wxFR_MATCHCASE ) ?
150  aSearchData.GetFindString() :
151  aSearchData.GetFindString().Upper() );
152 
153  if( result == wxNOT_FOUND )
154  return false;
155 
156  wxString prefix = aText.Left( result );
157  wxString suffix;
158 
159  if( aSearchData.GetFindString().length() + result < aText.length() )
160  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
161 
162  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
163  aText, prefix, aSearchData.GetReplaceString(), suffix );
164 
165  aText = prefix + aSearchData.GetReplaceString() + suffix;
166 
167  return true;
168 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.

References traceFindReplace.

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

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( 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 392 of file eda_item.h.

393  {
394  return false;
395  }

◆ Schematic()

SCHEMATIC * SCH_SCREEN::Schematic ( ) const

Definition at line 90 of file sch_screen.cpp.

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

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

148 { m_aux_origin = aPosition; }
wxPoint m_aux_origin
Definition: sch_screen.h:506

References m_aux_origin.

◆ SetBrightened()

◆ 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(), PL_EDITOR_FRAME::SaveDrawingSheetFile(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::saveSchematicFile(), DIALOG_PAGES_SETTINGS::TransferDataFromWindow(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbol().

◆ 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:491

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

109 {
110  wxASSERT( aFileName.IsEmpty() || wxIsAbsolutePath( aFileName ) );
111 
112  m_fileName = aFileName;
113 }
wxString m_fileName
Definition: sch_screen.h:490

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().

◆ SetFlags()

void EDA_ITEM::SetFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 153 of file eda_item.h.

153 { m_flags |= aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481

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::cleanupSegments(), 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(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_SELECTION_TOOL::RebuildSelection(), FOOTPRINT::Remove(), BOARD::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), 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 204 of file eda_item.h.

204 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: eda_item.h:480

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

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

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(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_SYMBOL::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), LIB_SYMBOL::LIB_SYMBOL(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), 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 142 of file eda_item.h.

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

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

151 { m_status = aStatus; }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:478

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

128 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:153
#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 421 of file eda_item.h.

421 { 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 978 of file sch_screen.cpp.

980 {
981  std::vector<DANGLING_END_ITEM> endPoints;
982 
983  for( SCH_ITEM* item : Items() )
984  item->GetEndPoints( endPoints );
985 
986  for( SCH_ITEM* item : Items() )
987  {
988  if( item->UpdateDanglingState( endPoints, aPath ) )
989  {
990  if( aChangedHandler )
991  (*aChangedHandler)( item );
992  }
993  }
994 }
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:193

References Items().

Referenced by SCH_EDITOR_CONTROL::FindNext(), 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 113 of file eda_item.h.

113 { 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:488

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(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), Append(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PNS::TOPOLOGY::AssembleTuningPath(), CONNECTION_GRAPH::buildConnectionGraph(), DIALOG_NET_INSPECTOR::buildNewItem(), SCH_SCREENS::buildScreenList(), calcIsInsideArea(), calcIsInsideCourtyard(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PCB_POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_LABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SYMBOL::CanConnect(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_PIN::ClassOf(), PCB_TEXT::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), SCH_NO_CONNECT::ClassOf(), PCB_MARKER::ClassOf(), FP_SHAPE::ClassOf(), PCB_TARGET::ClassOf(), SCH_LINE::ClassOf(), PCB_SHAPE::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(), SCH_BUS_BUS_ENTRY::ClassOf(), BOARD::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(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::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(), 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(), 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::doMoveSelection(), 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::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), DRC_ENGINE::EvalRules(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), NETLIST_EXPORTER_BASE::findNextSymbol(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), PCB_BASE_FRAME::FocusOnItem(), EDIT_TOOL::FootprintFilter(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), FP_TEXT::FP_TEXT(), PCB_POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), PCB_TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetContextualTextVars(), FOOTPRINT::GetCoverageArea(), CONNECTION_GRAPH::getDefaultConnection(), 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(), 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(), 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(), 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(), EE_POINT_EDITOR::Main(), 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_TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), PCB_SHAPE::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), SCH_BUS_ENTRY_BASE::operator<(), SCH_JUNCTION::operator<(), SCH_TEXT::operator<(), SCH_FIELD::operator<(), SCH_LINE::operator<(), SCH_SHEET::operator<(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_SYMBOL::operator=(), PAD::PAD(), EDIT_TOOL::PadFilter(), 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(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), PCB_GRID_HELPER::queryVisible(), 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(), 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_MATCHED_LENGTH::runInternal(), SCH_SEXPR_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_SEXPR_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_SEXPR_PLUGIN_CACHE::saveCircle(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_SEXPR_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), CLIPBOARD_IO::SaveSelection(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), Schematic(), SCH_ITEM::Schematic(), CONVERT_TOOL::SegmentToArc(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectConnectedTracks(), 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_COPPER_CLEARANCE::testItemAgainstZones(), 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_SYMBOL_FIELDS_TABLE::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataToWindow(), PCB_TRACK::TransformShapeWithClearanceToPolygon(), 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 264 of file sch_screen.cpp.

265 {
266  if( Remove( aItem ) )
267  Append( aItem );
268 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:271
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:144

References Append(), and Remove().

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

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

704 {
705  std::vector<SCH_SYMBOL*> symbols;
706 
707  for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
708  symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
709 
710  for( SCH_SYMBOL* symbol : symbols )
711  {
712  // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
713  m_rtree.remove( symbol );
714 
715  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
716 
717  LIB_SYMBOL* libSymbol = nullptr;
718 
719  if( it != m_libSymbols.end() )
720  libSymbol = new LIB_SYMBOL( *it->second );
721 
722  symbol->SetLibSymbol( libSymbol );
723 
724  m_rtree.insert( symbol );
725  }
726 }
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:75
EE_RTREE m_rtree
Definition: sch_screen.h:507
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:519
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:193

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

550 {
551  wxCHECK_RET( Schematic(), "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
552 
553  wxString msg;
554  std::unique_ptr< LIB_SYMBOL > libSymbol;
555  std::vector<SCH_SYMBOL*> symbols;
556  SYMBOL_LIB_TABLE* libs = Schematic()->Prj().SchSymbolLibTable();
557 
558  // This will be a nullptr if an s-expression schematic is loaded.
559  SYMBOL_LIBS* legacyLibs = Schematic()->Prj().SchLibs();
560 
561  for( auto item : Items().OfType( SCH_SYMBOL_T ) )
562  symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
563 
564  // Remove them from the R tree. There bounding box size may change.
565  for( auto symbol : symbols )
566  Remove( symbol );
567 
568  // Clear all existing symbol links.
569  clearLibSymbols();
570 
571  for( SCH_SYMBOL* symbol : symbols )
572  {
573  LIB_SYMBOL* tmp = nullptr;
574  libSymbol.reset();
575 
576  // If the symbol is already in the internal library, map the symbol to it.
577  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
578 
579  if( ( it != m_libSymbols.end() ) )
580  {
581  if( aReporter )
582  {
583  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
584  symbol->GetField( REFERENCE_FIELD )->GetText(),
585  symbol->GetField( VALUE_FIELD )->GetText(),
586  UnescapeString( symbol->GetLibId().Format() ) );
587  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
588  }
589 
590  // Internal library symbols are already flattened so just make a copy.
591  symbol->SetLibSymbol( new LIB_SYMBOL( *it->second ) );
592  continue;
593  }
594 
595  if( !symbol->GetLibId().IsValid() )
596  {
597  if( aReporter )
598  {
599  msg.Printf( _( "Schematic symbol reference '%s' library identifier is not valid. "
600  "Unable to link library symbol." ),
601  UnescapeString( symbol->GetLibId().Format() ) );
602  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
603  }
604 
605  continue;
606  }
607 
608  // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the library nickname
609  // is not found in the table so check if the library still exists in the table
610  // before attempting to load the symbol.
611  if( !libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) && !legacyLibs )
612  {
613  if( aReporter )
614  {
615  msg.Printf( _( "Symbol library '%s' not found and no fallback cache library "
616  "available. Unable to link library symbol." ),
617  symbol->GetLibId().GetLibNickname().wx_str() );
618  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
619  }
620 
621  continue;
622  }
623 
624  if( libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) )
625  {
626  try
627  {
628  tmp = libs->LoadSymbol( symbol->GetLibId() );
629  }
630  catch( const IO_ERROR& ioe )
631  {
632  if( aReporter )
633  {
634  msg.Printf( _( "I/O error %s resolving library symbol %s" ), ioe.What(),
635  UnescapeString( symbol->GetLibId().Format() ) );
636  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
637  }
638  }
639  }
640 
641  if( !tmp && legacyLibs && legacyLibs->GetLibraryCount() )
642  {
643  SYMBOL_LIB& legacyCacheLib = legacyLibs->at( 0 );
644 
645  // It better be the cache library.
646  wxCHECK2( legacyCacheLib.IsCache(), continue );
647 
648  wxString id = symbol->GetLibId().Format();
649 
650  id.Replace( ':', '_' );
651 
652  if( aReporter )
653  {
654  msg.Printf( _( "Falling back to cache to set symbol '%s:%s' link '%s'." ),
655  symbol->GetField( REFERENCE_FIELD )->GetText(),
656  symbol->GetField( VALUE_FIELD )->GetText(),
657  UnescapeString( id ) );
658  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
659  }
660 
661  tmp = legacyCacheLib.FindSymbol( id );
662  }
663 
664  if( tmp )
665  {
666  // We want a full symbol not just the top level child symbol.
667  libSymbol = tmp->Flatten();
668  libSymbol->SetParent();
669 
670  m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
671  new LIB_SYMBOL( *libSymbol.get() ) } );
672 
673  if( aReporter )
674  {
675  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
676  symbol->GetField( REFERENCE_FIELD )->GetText(),
677  symbol->GetField( VALUE_FIELD )->GetText(),
678  UnescapeString( symbol->GetLibId().Format() ) );
679  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
680  }
681  }
682  else
683  {
684  if( aReporter )
685  {
686  msg.Printf( _( "No library symbol found for schematic symbol '%s %s'." ),
687  symbol->GetField( REFERENCE_FIELD )->GetText(),
688  symbol->GetField( VALUE_FIELD )->GetText() );
689  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
690  }
691  }
692 
693  symbol->SetLibSymbol( libSymbol.release() );
694  }
695 
696  // Changing the symbol may adjust the bbox of the symbol. This re-inserts the
697  // item with the new bbox
698  for( auto symbol : symbols )
699  Append( symbol );
700 }
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:271
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:99
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:332
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:144
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:90
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:519
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75

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_SHAPE, PCB_DIMENSION_BASE, GERBER_DRAW_ITEM, FP_TEXT, PCB_TRACK, DS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, PCB_MARKER, MY_DRAWING, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::POLYGON_ITEM, RATSNEST_VIEW_ITEM, KIGFX::PREVIEW::RULER_ITEM, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 194 of file eda_item.cpp.

195 {
196  // Basic fallback
197  EDA_RECT bbox = GetBoundingBox();
198 
199  return BOX2I( bbox.GetOrigin(), bbox.GetSize() );
200 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:506
const wxPoint GetOrigin() const
Definition: eda_rect.h:101
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:91

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

Referenced by GERBVIEW_FRAME::GetDocumentExtents(), PCB_DIMENSION_BASE::ViewBBox(), and PCB_SHAPE::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::VIEW_GROUP, KIGFX::PREVIEW::SELECTION_AREA, 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 111 of file view_item.h.

112  {}

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, FP_TEXT, PCB_TRACK, LIB_SYMBOL, MY_DRAWING, ZONE, PCB_GROUP, LIB_ITEM, SCH_LINE, SCH_SYMBOL, LIB_FIELD, DS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, PCB_MARKER, SCH_BITMAP, SCH_BUS_ENTRY_BASE, SCH_NO_CONNECT, DS_DRAW_ITEM_BASE, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::ORIGIN_VIEWITEM, LIB_TEXT, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, SCH_JUNCTION, SCH_MARKER, RATSNEST_VIEW_ITEM, KIGFX::PREVIEW::RULER_ITEM, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 203 of file eda_item.cpp.

204 {
205  // Basic fallback
206  aCount = 1;
207  aLayers[0] = 0;
208 }

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

138  {
139  // By default always show the item
140  return 0.0;
141  }

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:183
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 516 of file sch_screen.h.

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

◆ m_aux_origin

wxPoint SCH_SCREEN::m_aux_origin
private

Definition at line 506 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 501 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_fileFormatVersionAtLoad

int SCH_SCREEN::m_fileFormatVersionAtLoad
private

Definition at line 491 of file sch_screen.h.

Referenced by GetFileFormatVersionAtLoad(), and SetFileFormatVersionAtLoad().

◆ m_fileName

wxString SCH_SCREEN::m_fileName
private

Definition at line 490 of file sch_screen.h.

Referenced by GetFileName(), and SetFileName().

◆ m_flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ 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 481 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 519 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 509 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 504 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 492 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 535 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 505 of file sch_screen.h.

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

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 475 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(), PCB_BASE_FRAME::FocusOnItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_IO::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(), LEGACY_PLUGIN::loadTrackList(), PNS::LOGGER::Log(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), SCH_EDITOR_CONTROL::nextMatch(), PCB_TRACK::cmp_tracks::operator()(), PCB_SHAPE::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), PAD::PAD(), SCH_SEXPR_PARSER::parseSchSheetInstances(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SYMBOL::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), 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(), 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 544 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 484 of file sch_screen.h.

◆ SCH_SEXPR_PARSER

friend SCH_SCREEN::SCH_SEXPR_PARSER
private

Definition at line 485 of file sch_screen.h.

◆ SCH_SEXPR_PLUGIN

friend SCH_SCREEN::SCH_SEXPR_PLUGIN
private

Definition at line 486 of file sch_screen.h.


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