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 ()
 
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)
 
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 Place (SCH_EDIT_FRAME *frame, wxDC *DC)
 
void UpdateSymbolLinks (REPORTER *aReporter=nullptr)
 Initialize the LIB_PART reference for each SCH_COMPONENT found in this schematic from the project SYMBOL_LIB_TABLE. More...
 
void UpdateLocalLibSymbolLinks ()
 Initialize the LIB_PART reference for each SCH_COMPONENT found in this schematic with the local project library symbols. More...
 
void SwapSymbolLinks (const SCH_COMPONENT *aOriginalSymbol, const SCH_COMPONENT *aNewSymbol)
 
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 component pin. More...
 
void ClearDrawingState ()
 Clear the state flags of all the items in the screen. More...
 
size_t CountConnectedItems (const wxPoint &aPos, bool aTestJunctions) 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_COMPONENT **aSymbol=NULL, bool aEndPointOnly=false) const
 Test the screen for a component 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 components in aSheetPath on the screen. More...
 
void EnsureAlternateReferencesExist ()
 For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any reference related sharing this screen (i.e. More...
 
void GetHierarchicalItems (std::vector< SCH_ITEM * > *aItems) const
 Add all schematic sheet and component 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_PART * > & GetLibSymbols ()
 Fetch a list of unique LIB_PART object pointers required to properly render each SCH_COMPONENT in this schematic. More...
 
const std::map< wxString, LIB_PART * > & GetLibSymbols () const
 
void AddLibSymbol (LIB_PART *aLibSymbol)
 Add aLibSymbol to the 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 SetModify ()
 
void ClrModify ()
 
void SetSave ()
 
void ClrSave ()
 
bool IsModify () const
 
bool IsSave () const
 
int GetPageCount () const
 
void SetPageCount (int aPageCount)
 
int GetVirtualPageNumber () const
 
void SetVirtualPageNumber (int aPageNumber)
 
const wxString & GetPageNumber () const
 
void SetPageNumber (const wxString &aPageNumber)
 
KICAD_T Type () const
 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 (int type) const
 
void SetState (int type, bool state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag) const
 
STATUS_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_PageLayoutDescrFileName
 the name of the page layout descr file, or emty to used the default pagelayout More...
 

Protected Member Functions

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

Private Member Functions

void clearLibSymbols ()
 

Private Attributes

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_PART * > m_libSymbols
 Library symbols required for this schematic. More...
 
std::vector< SYMBOL_INSTANCE_REFERENCEm_symbolInstances
 The list of symbol instances loaded from the schematic file. More...
 
std::vector< SCH_SHEET_INSTANCEm_sheetInstances
 
KIID m_uuid
 A unique identifier for each schematic file. More...
 

Detailed Description

Definition at line 94 of file sch_screen.h.

Constructor & Destructor Documentation

◆ SCH_SCREEN()

SCH_SCREEN::SCH_SCREEN ( EDA_ITEM aParent = nullptr)

Definition at line 64 of file sch_screen.cpp.

64  :
65  BASE_SCREEN( aParent, SCH_SCREEN_T ),
67  m_paper( wxT( "A4" ) )
68 {
70  m_refCount = 0;
71  m_zoomInitialized = false;
72  m_LastZoomLevel = 1.0;
73 
74  // Suitable for schematic only. For symbol_editor and viewlib, must be set to true
75  m_Center = false;
76 
77  InitDataPoints( m_paper.GetSizeIU() );
78 }
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
Definition: sch_screen.h:473
int m_refCount
Definition: sch_screen.h:484
int m_modification_sync
Definition: sch_screen.h:501
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:47
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:483
PAGE_INFO m_paper
Definition: sch_screen.h:496
bool m_Center
Center on screen.
Definition: base_screen.h:100
BASE_SCREEN(EDA_ITEM *aParent, KICAD_T aType=SCREEN_T)
Definition: base_screen.cpp:35
bool m_zoomInitialized
Definition: sch_screen.h:504

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

82 {
84  FreeDrawList();
85 }
void clearLibSymbols()
Definition: sch_screen.cpp:97
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:218

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

1055 {
1056  m_aliases.insert( aAlias );
1057 }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:508

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_PART aLibSymbol)

Add aLibSymbol to the the library symbol map.

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

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

Definition at line 1036 of file sch_screen.cpp.

1037 {
1038  wxCHECK( aLibSymbol, /* void */ );
1039 
1040  wxString libSymbolName = aLibSymbol->GetLibId().Format().wx_str();
1041 
1042  auto it = m_libSymbols.find( libSymbolName );
1043 
1044  if( it != m_libSymbols.end() )
1045  {
1046  delete it->second;
1047  m_libSymbols.erase( it );
1048  }
1049 
1050  m_libSymbols[libSymbolName] = aLibSymbol;
1051 }
LIB_ID GetLibId() const override
Definition: lib_symbol.h:131
UTF8 Format() const
Definition: lib_id.cpp:233
wxString wx_str() const
Definition: utf8.cpp:51
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:511

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

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ Append() [1/2]

void SCH_SCREEN::Append ( SCH_ITEM aItem)

Definition at line 128 of file sch_screen.cpp.

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

References LIB_ID::Format(), LIB_PART::GetDrawItems(), SCH_COMPONENT::GetLibId(), SCH_COMPONENT::GetPartRef(), SCH_COMPONENT::GetSchSymbolLibraryName(), EE_RTREE::insert(), m_libSymbols, m_modification_sync, m_rtree, SCH_COMPONENT_T, SCH_FIELD_T, SCH_SHEET_PIN_T, EDA_ITEM::SetParent(), SCH_COMPONENT::SetSchSymbolLibraryName(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), EDA_ITEM::Type(), and UTF8::wx_str().

Referenced by 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(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), SCH_EAGLE_PLUGIN::loadSegments(), 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::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseWire(), SCH_EDITOR_CONTROL::Paste(), DIALOG_CHANGE_SYMBOLS::processSymbol(), 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 186 of file sch_screen.cpp.

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

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

◆ AssignNewUuid()

void SCH_SCREEN::AssignNewUuid ( )
inline

Definition at line 463 of file sch_screen.h.

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

References m_uuid.

Referenced by SCH_EDIT_FRAME::SaveEEFile().

◆ CheckIfOnDrawList()

bool SCH_SCREEN::CheckIfOnDrawList ( const SCH_ITEM aItem) const

Definition at line 307 of file sch_screen.cpp.

308 {
309  return m_rtree.contains( aItem, true );
310 }
EE_RTREE m_rtree
Definition: sch_screen.h:499
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()

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

Definition at line 115 of file sch_screen.h.

116  {
117  return aItem && SCH_SCREEN_T == aItem->Type();
118  }
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163

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

200 {
201  if( aFree )
202  {
203  FreeDrawList();
204  clearLibSymbols();
205  }
206  else
207  {
208  m_rtree.clear();
209  }
210 
211  // Clear the project settings
213 
214  m_titles.Clear();
215 }
void clearLibSymbols()
Definition: sch_screen.cpp:97
void Clear()
Definition: title_block.h:113
TITLE_BLOCK m_titles
Definition: sch_screen.h:497
int m_pageCount
The number of BASE_SCREEN objects in this design.
Definition: base_screen.h:115
EE_RTREE m_rtree
Definition: sch_screen.h:499
void FreeDrawList()
Free all the items from the schematic associated with the screen.
Definition: sch_screen.cpp:218
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:123

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

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

◆ ClearAnnotation()

void SCH_SCREEN::ClearAnnotation ( SCH_SHEET_PATH aSheetPath)

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

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

Definition at line 901 of file sch_screen.cpp.

902 {
903 
904  for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) )
905  {
906  SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( item );
907 
908  symbol->ClearAnnotation( aSheetPath );
909  }
910 }
EE_RTREE & Items()
Definition: sch_screen.h:103
Schematic symbol object.
Definition: sch_symbol.h:78
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath)
Clear exiting symbol annotation.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

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

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

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearBusAliases()

void SCH_SCREEN::ClearBusAliases ( )
inline

Remove all bus alias definitions.

Definition at line 438 of file sch_screen.h.

439  {
440  m_aliases.clear();
441  }
std::unordered_set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:508

References m_aliases.

◆ ClearDrawingState()

void SCH_SCREEN::ClearDrawingState ( )

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

Definition at line 810 of file sch_screen.cpp.

811 {
812  for( SCH_ITEM* item : Items() )
813  item->ClearTempFlags();
814 }
EE_RTREE & Items()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

References Items().

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

◆ ClearEditFlags()

◆ ClearFlags()

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

Definition at line 204 of file eda_item.h.

204 { m_flags &= ~aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:531

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

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

References m_libSymbols.

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

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 216 of file eda_item.h.

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

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_COMPONENT, PAD, FOOTPRINT, SCH_HIERLABEL, CENTER_DIMENSION, LEADER, ORTHOGONAL_DIMENSION, VIA, SCH_GLOBALLABEL, SCH_SHEET, SCH_LABEL, ALIGNED_DIMENSION, PCB_SHAPE, ARC, SCH_TEXT, SCH_LINE, LIB_PIN, FP_TEXT, TRACK, SCH_BUS_BUS_ENTRY, SCH_FIELD, LIB_FIELD, SCH_SHEET_PIN, SCH_BUS_WIRE_ENTRY, FP_SHAPE, SCH_BITMAP, PCB_TEXT, PCB_GROUP, LIB_ARC, LIB_TEXT, SCH_NO_CONNECT, SCH_JUNCTION, SCH_MARKER, LIB_POLYLINE, PCB_TARGET, LIB_CIRCLE, LIB_BEZIER, LIB_RECTANGLE, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 81 of file eda_item.cpp.

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

References EDA_ITEM::GetClass(), and NULL.

Referenced by DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), DIMENSION_BASE::GetEffectiveShape(), LIB_PART::LIB_PART(), new_clone(), LIB_PART::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_PART::SetConversion(), LIB_PART::SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), COMMIT::Stage(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClrModify()

◆ ClrSave()

void BASE_SCREEN::ClrSave ( )
inlineinherited

Definition at line 62 of file base_screen.h.

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

References BASE_SCREEN::m_flagSave.

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

◆ CountConnectedItems()

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

Definition at line 887 of file sch_screen.cpp.

888 {
889  size_t count = 0;
890 
891  for( const SCH_ITEM* item : Items() )
892  {
893  if( ( item->Type() != SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
894  count++;
895  }
896 
897  return count;
898 }
EE_RTREE & Items()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

References Items(), and SCH_JUNCTION_T.

◆ DecRefCount()

void SCH_SCREEN::DecRefCount ( )

Definition at line 112 of file sch_screen.cpp.

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

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

283 {
284  wxCHECK_RET( aItem, wxT( "Cannot delete invalid item from screen." ) );
285 
286  // Markers are not saved in the file, no need to flag as modified.
287  // TODO: Maybe we should have a listing somewhere of items that aren't saved?
288  if( aItem->Type() != SCH_MARKER_T )
289  SetModify();
290 
291  Remove( aItem );
292 
293  if( aItem->Type() == SCH_SHEET_PIN_T )
294  {
295  // This structure is attached to a sheet, get the parent sheet object.
296  SCH_SHEET_PIN* sheetPin = (SCH_SHEET_PIN*) aItem;
297  SCH_SHEET* sheet = sheetPin->GetParent();
298  wxCHECK_RET( sheet, wxT( "Sheet pin parent not properly set, bad programmer!" ) );
299  sheet->RemovePin( sheetPin );
300  return;
301  }
302 
303  delete aItem;
304 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:244
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 SetModify()
Definition: base_screen.h:59
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163

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

◆ EnsureAlternateReferencesExist()

void SCH_SCREEN::EnsureAlternateReferencesExist ( )

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

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

Definition at line 913 of file sch_screen.cpp.

914 {
915  if( GetClientSheetPaths().size() <= 1 ) // No need for alternate reference
916  return;
917 
918  for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) )
919  {
920  SCH_COMPONENT* symbol = static_cast<SCH_COMPONENT*>( item );
921 
922  // Add (when not existing) all sheet path entries
923  for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() )
924  symbol->AddSheetPathReferenceEntryIfMissing( sheet.Path() );
925  }
926 }
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
EE_RTREE & Items()
Definition: sch_screen.h:103
Schematic symbol object.
Definition: sch_symbol.h:78
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
Definition: sch_screen.h:159
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197
bool AddSheetPathReferenceEntryIfMissing(const KIID_PATH &aSheetPath)
Add an instance to the alternate references list (m_instanceReferences), if this entry does not alrea...

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

Referenced by SCH_SCREENS::ClearAnnotationOfNewSheetPaths().

◆ FreeDrawList()

void SCH_SCREEN::FreeDrawList ( )

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

This does not delete any sub hierarchies.

Definition at line 218 of file sch_screen.cpp.

219 {
220  // We don't know which order we will encounter dependent items (e.g. pins or fields), so
221  // we store the items to be deleted until we've fully cleared the tree before deleting
222  std::vector<SCH_ITEM*> delete_list;
223 
224  std::copy_if( m_rtree.begin(), m_rtree.end(), std::back_inserter( delete_list ),
225  []( SCH_ITEM* aItem )
226  {
227  return ( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T );
228  } );
229 
230  m_rtree.clear();
231 
232  for( auto item : delete_list )
233  delete item;
234 }
iterator end()
Definition: sch_rtree.h:250
EE_RTREE m_rtree
Definition: sch_screen.h:499
iterator begin()
Definition: sch_rtree.h:245
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197
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 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;
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 135 of file sch_screen.h.

135 { return m_aux_origin; }
wxPoint m_aux_origin
Definition: sch_screen.h:498

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, CENTER_DIMENSION, SCH_HIERLABEL, SCH_GLOBALLABEL, DS_DRAW_ITEM_BITMAP, SCH_LABEL, DS_DRAW_ITEM_TEXT, SCH_COMPONENT, PCB_SHAPE, DS_DRAW_ITEM_PAGE, SCH_SHEET, SCH_TEXT, DIMENSION_BASE, DS_DRAW_ITEM_RECT, LIB_PART, GERBER_DRAW_ITEM, FP_TEXT, LIB_PIN, DS_DRAW_ITEM_POLYPOLYGONS, LIB_ITEM, FOOTPRINT, PCB_GROUP, SCH_LINE, LIB_FIELD, DS_DRAW_ITEM_LINE, ZONE, PCB_TEXT, TRACK, SCH_FIELD, PCB_MARKER, SCH_BITMAP, PCB_TARGET, DS_DRAW_ITEM_BASE, LIB_TEXT, SCH_BUS_ENTRY_BASE, SCH_PIN, GBR_LAYOUT, SCH_NO_CONNECT, LIB_POLYLINE, SCH_MARKER, LIB_BEZIER, SCH_JUNCTION, LIB_RECTANGLE, LIB_ARC, and LIB_CIRCLE.

Definition at line 73 of file eda_item.cpp.

74 {
75  // return a zero-sized box per default. derived classes should override
76  // this
77  return EDA_RECT( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
78 }
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(), SCH_EAGLE_PLUGIN::moveLabels(), DRC_RTREE::QueryColliding(), EE_RTREE::remove(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), GERBVIEW_SELECTION::ViewBBox(), and EDA_ITEM::ViewBBox().

◆ GetBus()

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

Definition at line 394 of file sch_screen.h.

396  {
397  return GetLine( aPosition, aAccuracy, LAYER_BUS, aSearchType );
398  }
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:976

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

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

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

121  {
122  return wxT( "SCH_SCREEN" );
123  }

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

160  {
161  return m_clientSheetPathList;
162  }
std::vector< SCH_SHEET_PATH > m_clientSheetPathList
The list of sheet paths sharing this screen.
Definition: sch_screen.h:493

References m_clientSheetPathList.

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

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 208 of file eda_item.h.

209  {
210  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
212 
213  return m_flags & mask;
214  }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:108
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:116
#define IS_MOVED
Item being moved.
Definition: eda_item.h:106
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:109
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:120
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:111
STATUS_FLAGS m_flags
Definition: eda_item.h:531
#define IS_NEW
New item, just created.
Definition: eda_item.h:107

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, 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_COMPONENT::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_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow().

◆ GetFileFormatVersionAtLoad()

int SCH_SCREEN::GetFileFormatVersionAtLoad ( ) const
inline

Definition at line 126 of file sch_screen.h.

126 { return m_fileFormatVersionAtLoad; }
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:483

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

Definition at line 309 of file eda_item.h.

309 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:302

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 component objects in the screen to aItems.

Parameters
[out]aItemsHierarchical item list to fill.

Definition at line 929 of file sch_screen.cpp.

930 {
931  static KICAD_T hierarchicalTypes[] = { SCH_COMPONENT_T, SCH_SHEET_T, SCH_GLOBAL_LABEL_T, EOT };
932 
933  for( SCH_ITEM* item : Items() )
934  {
935  if( item->IsType( hierarchicalTypes ) )
936  aItems->push_back( item );
937  }
938 }
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()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

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

◆ GetItem()

SCH_ITEM * SCH_SCREEN::GetItem ( const wxPoint &  aPosition,
int  aAccuracy = 0,
KICAD_T  aType = SCH_LOCATE_ANY_T 
) 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 313 of file sch_screen.cpp.

314 {
315  EDA_RECT bbox;
316  bbox.SetOrigin( aPosition );
317  bbox.Inflate( aAccuracy );
318 
319  for( SCH_ITEM* item : Items().Overlapping( aType, bbox ) )
320  {
321  if( item->HitTest( aPosition, aAccuracy ) )
322  return item;
323  }
324 
325  return nullptr;
326 }
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:126
EE_RTREE & Items()
Definition: sch_screen.h:103
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:197
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363

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

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

◆ GetLabel()

SCH_TEXT * SCH_SCREEN::GetLabel ( const wxPoint &  aPosition,
int  aAccuracy = 0 
) 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 1013 of file sch_screen.cpp.

1014 {
1015  for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
1016  {
1017  switch( item->Type() )
1018  {
1019  case SCH_LABEL_T:
1020  case SCH_GLOBAL_LABEL_T:
1021  case SCH_HIER_LABEL_T:
1022  if( item->HitTest( aPosition, aAccuracy ) )
1023  return static_cast<SCH_TEXT*>( item );
1024 
1025  break;
1026 
1027  default:
1028  ;
1029  }
1030  }
1031 
1032  return NULL;
1033 }
#define NULL
EE_RTREE & Items()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

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

Referenced by IsTerminalPoint().

◆ GetLibSymbols() [1/2]

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

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

Returns
The list of unique LIB_PART object pointers.

Definition at line 416 of file sch_screen.h.

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

References m_libSymbols.

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

◆ GetLibSymbols() [2/2]

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

Definition at line 417 of file sch_screen.h.

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

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

978 {
979  // an accuracy of 0 had problems with rounding errors; use at least 1
980  aAccuracy = std::max( aAccuracy, 1 );
981 
982  for( SCH_ITEM* item : Items() )
983  {
984  if( item->Type() != SCH_LINE_T )
985  continue;
986 
987  if( item->GetLayer() != aLayer )
988  continue;
989 
990  if( !item->HitTest( aPosition, aAccuracy ) )
991  continue;
992 
993  switch( aSearchType )
994  {
995  case ENTIRE_LENGTH_T:
996  return (SCH_LINE*) item;
997 
999  if( !( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1000  return (SCH_LINE*) item;
1001  break;
1002 
1003  case END_POINTS_ONLY_T:
1004  if( ( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1005  return (SCH_LINE*) item;
1006  }
1007  }
1008 
1009  return NULL;
1010 }
#define NULL
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

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

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

◆ GetMenuImage()

BITMAPS EDA_ITEM::GetMenuImage ( ) const
virtualinherited

◆ GetMsgPanelInfo()

◆ GetPageCount()

◆ GetPageNumber()

const wxString & BASE_SCREEN::GetPageNumber ( ) const
inherited

Definition at line 78 of file base_screen.cpp.

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

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

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

◆ GetPageSettings()

◆ GetParent()

◆ GetPin()

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

Test the screen for a component pin item at aPosition.

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

Definition at line 817 of file sch_screen.cpp.

819 {
820  SCH_COMPONENT* candidate = NULL;
821  LIB_PIN* pin = NULL;
822 
823  for( SCH_ITEM* item : Items().Overlapping( SCH_COMPONENT_T, aPosition ) )
824  {
825  candidate = static_cast<SCH_COMPONENT*>( item );
826 
827  if( aEndPointOnly )
828  {
829  pin = NULL;
830 
831  if( !candidate->GetPartRef() )
832  continue;
833 
834  for( pin = candidate->GetPartRef()->GetNextPin(); pin;
835  pin = candidate->GetPartRef()->GetNextPin( pin ) )
836  {
837  // Skip items not used for this part.
838  if( candidate->GetUnit() && pin->GetUnit() &&
839  ( pin->GetUnit() != candidate->GetUnit() ) )
840  continue;
841 
842  if( candidate->GetConvert() && pin->GetConvert() &&
843  ( pin->GetConvert() != candidate->GetConvert() ) )
844  continue;
845 
846  if( candidate->GetPinPhysicalPosition( pin ) == aPosition )
847  break;
848  }
849 
850  if( pin )
851  break;
852  }
853  else
854  {
855  pin = (LIB_PIN*) candidate->GetDrawItem( aPosition, LIB_PIN_T );
856 
857  if( pin )
858  break;
859  }
860  }
861 
862  if( pin && aSymbol )
863  *aSymbol = candidate;
864 
865  return pin;
866 }
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 GetUnit() const
Definition: sch_symbol.h:195
#define NULL
std::unique_ptr< LIB_PART > & GetPartRef()
Definition: sch_symbol.h:164
EE_RTREE & Items()
Definition: sch_screen.h:103
Schematic symbol object.
Definition: sch_symbol.h:78
int GetConvert() const
Definition: sch_symbol.h:223
wxPoint GetPinPhysicalPosition(const LIB_PIN *Pin) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

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

Referenced by IsTerminalPoint(), and MarkConnections().

◆ GetPosition()

virtual wxPoint EDA_ITEM::GetPosition ( ) const
inlinevirtualinherited

Reimplemented in SCH_COMPONENT, VIA, DELETED_BOARD_ITEM, SCH_SHEET, DS_DRAW_ITEM_BITMAP, BOARD, DS_DRAW_ITEM_TEXT, ARC, SCH_TEXT, DS_DRAW_ITEM_PAGE, DS_DRAW_ITEM_RECT, SCH_LINE, LIB_PIN, SCH_FIELD, FOOTPRINT, LIB_FIELD, PAD, DS_DRAW_ITEM_POLYPOLYGONS, GERBER_DRAW_ITEM, PCB_SHAPE, DS_DRAW_ITEM_LINE, SCH_BITMAP, DIMENSION_BASE, PCB_GROUP, ZONE, TRACK, SCH_NO_CONNECT, KIGFX::ORIGIN_VIEWITEM, SCH_BUS_ENTRY_BASE, SCH_MARKER, LIB_TEXT, SCH_JUNCTION, FP_TEXT, LIB_POLYLINE, NETINFO_ITEM, SCH_PIN, LIB_BEZIER, PCB_TEXT, LIB_ARC, LIB_RECTANGLE, LIB_CIRCLE, PCB_MARKER, and PCB_TARGET.

Definition at line 302 of file eda_item.h.

302 { 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::findCallback(), GERBVIEW_SELECTION::GetCenter(), EDA_ITEM::GetFocusPosition(), 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_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 144 of file sch_screen.h.

144 { return m_refCount; }
int m_refCount
Definition: sch_screen.h:484

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_COMPONENT, BOARD, PAD, FOOTPRINT, SCH_HIERLABEL, SCH_GLOBALLABEL, VIA, DELETED_BOARD_ITEM, SCH_SHEET, SCH_LABEL, DS_DRAW_ITEM_BITMAP, PCB_SHAPE, DS_DRAW_ITEM_TEXT, SCH_TEXT, DS_DRAW_ITEM_PAGE, GERBER_DRAW_ITEM, DIMENSION_BASE, DS_DRAW_ITEM_RECT, LIB_PIN, FP_TEXT, TRACK, SCH_LINE, SCH_BUS_BUS_ENTRY, LIB_FIELD, SCH_FIELD, PCB_GROUP, DS_DRAW_ITEM_POLYPOLYGONS, SCH_SHEET_PIN, 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_TARGET, PCB_MARKER, LIB_CIRCLE, SCH_JUNCTION, LIB_RECTANGLE, SCH_PIN, and DELETED_SHEET_ITEM.

Definition at line 107 of file eda_item.cpp.

108 {
109  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
110  GetClass() );
111 
112  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
113 }
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(), BOARD_INSPECTION_TOOL::InspectClearance(), RC_ITEM::ShowReport(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetSheetInstances()

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

Definition at line 456 of file sch_screen.h.

457  {
458  return m_sheetInstances;
459  }
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
Definition: sch_screen.h:528

References m_sheetInstances.

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

870 {
871  SCH_SHEET_PIN* sheetPin = nullptr;
872 
873  for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
874  {
875  auto sheet = static_cast<SCH_SHEET*>( item );
876 
877  sheetPin = sheet->GetPin( aPosition );
878 
879  if( sheetPin )
880  break;
881  }
882 
883  return sheetPin;
884 }
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:65
EE_RTREE & Items()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

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

942 {
943  for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
944  aItems->push_back( item );
945 
946  std::sort( aItems->begin(), aItems->end(),
947  []( EDA_ITEM* a, EDA_ITEM* b ) -> bool
948  {
949  if( a->GetPosition().x == b->GetPosition().x )
950  return a->GetPosition().y < b->GetPosition().y;
951  else
952  return a->GetPosition().x < b->GetPosition().x;
953  } );
954 }
virtual wxPoint GetPosition() const
Definition: eda_item.h:302
EE_RTREE & Items()
Definition: sch_screen.h:103
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

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

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

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 187 of file eda_item.h.

188  {
189  return m_status & type;
190  }
STATUS_FLAGS m_status
Definition: eda_item.h:528

References EDA_ITEM::m_status.

Referenced by BOARD_ITEM::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 200 of file eda_item.h.

200 { return m_status; }
STATUS_FLAGS m_status
Definition: eda_item.h:528

References EDA_ITEM::m_status.

◆ GetSymbolInstances()

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

Definition at line 451 of file sch_screen.h.

452  {
453  return m_symbolInstances;
454  }
std::vector< SYMBOL_INSTANCE_REFERENCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
Definition: sch_screen.h:527

References m_symbolInstances.

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

◆ GetTitleBlock()

◆ GetUuid()

const KIID& SCH_SCREEN::GetUuid ( ) const
inline

Definition at line 461 of file sch_screen.h.

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

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

390  {
391  return GetLine( aPosition, aAccuracy, LAYER_WIRE, aSearchType );
392  }
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:976

References GetLine(), and LAYER_WIRE.

Referenced by IsTerminalPoint().

◆ HasFlag()

◆ HasItems()

bool SCH_SCREEN::HasItems ( KICAD_T  aItemType) const

Definition at line 120 of file sch_screen.cpp.

121 {
122  EE_RTREE::EE_TYPE sheets = m_rtree.OfType( aItemType );
123 
124  return sheets.begin() != sheets.end();
125 }
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:216
EE_RTREE m_rtree
Definition: sch_screen.h:499
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 113 of file sch_screen.h.

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

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_COMPONENT, PAD, ZONE, FOOTPRINT, VIA, SCH_SHEET, DS_DRAW_ITEM_BITMAP, DS_DRAW_ITEM_TEXT, ARC, PCB_SHAPE, SCH_TEXT, DIMENSION_BASE, DS_DRAW_ITEM_RECT, SCH_LINE, GERBER_DRAW_ITEM, FP_TEXT, SCH_FIELD, TRACK, DS_DRAW_ITEM_POLYPOLYGONS, LIB_PIN, LIB_ITEM, PCB_GROUP, SCH_BITMAP, SCH_NO_CONNECT, SCH_JUNCTION, SCH_BUS_ENTRY_BASE, PCB_TEXT, DS_DRAW_ITEM_BASE, PCB_TARGET, LIB_POLYLINE, LIB_BEZIER, LIB_TEXT, LIB_ARC, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 288 of file eda_item.h.

289  {
290  return false; // derived classes should override this function
291  }

◆ IncRefCount()

void SCH_SCREEN::IncRefCount ( )

Definition at line 106 of file sch_screen.cpp.

107 {
108  m_refCount++;
109 }
int m_refCount
Definition: sch_screen.h:484

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

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

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

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

◆ IsBrightened()

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 171 of file eda_item.h.

171 { return m_flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:109
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_DRAGGED, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().

◆ IsEmpty()

bool SCH_SCREEN::IsEmpty ( ) const
inline

Definition at line 106 of file sch_screen.h.

107  {
108  return m_rtree.empty();
109  }
bool empty() const
Definition: sch_rtree.h:163
EE_RTREE m_rtree
Definition: sch_screen.h:499

References EE_RTREE::empty(), and m_rtree.

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 174 of file eda_item.h.

174 { return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered
Definition: eda_item.h:138
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References ENTERED, and EDA_ITEM::m_flags.

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

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 256 of file eda_item.h.

256 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:530

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 component pin.
  • Two or more wire endpoints and a component 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 374 of file sch_screen.cpp.

375 {
376  enum layers { WIRES = 0, BUSES };
377 
378  bool breakLines[ 2 ] = { false };
379  std::unordered_set<int> exitAngles[ 2 ];
380  std::vector<const SCH_LINE*> midPointLines[ 2 ];
381 
382  // A pin at 90º still shouldn't match a line at 90º so just give pins unique numbers
383  int uniqueAngle = 10000;
384 
385  for( const SCH_ITEM* item : Items().Overlapping( aPosition ) )
386  {
387  if( item->GetEditFlags() & STRUCT_DELETED )
388  continue;
389 
390  switch( item->Type() )
391  {
392  case SCH_JUNCTION_T:
393  if( aNew && item->HitTest( aPosition, -1 ) )
394  return false;
395 
396  break;
397 
398  case SCH_LINE_T:
399  {
400  const SCH_LINE* line = static_cast<const SCH_LINE*>( item );
401  int layer;
402 
403  if( line->GetStartPoint() == line->GetEndPoint() )
404  break;
405  else if( line->GetLayer() == LAYER_WIRE )
406  layer = WIRES;
407  else if( line->GetLayer() == LAYER_BUS )
408  layer = BUSES;
409  else
410  break;
411 
412  if( line->IsConnected( aPosition ) )
413  {
414  breakLines[ layer ] = true;
415  exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
416  }
417  else if( line->HitTest( aPosition, -1 ) )
418  {
419  // Defer any line midpoints until we know whether or not we're breaking them
420  midPointLines[ layer ].push_back( line );
421  }
422  }
423  break;
424 
426  case SCH_COMPONENT_T:
427  case SCH_SHEET_T:
428  if( item->IsConnected( aPosition ) )
429  {
430  breakLines[ WIRES ] = true;
431  exitAngles[ WIRES ].insert( uniqueAngle++ );
432  }
433 
434  break;
435 
436  default:
437  break;
438  }
439  }
440 
441  for( int layer : { WIRES, BUSES } )
442  {
443  if( breakLines[ layer ] )
444  {
445  for( const SCH_LINE* line : midPointLines[ layer ] )
446  {
447  exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
448  exitAngles[ layer ].insert( line->GetReverseAngleFrom( aPosition ) );
449  }
450  }
451  }
452 
453  return exitAngles[ WIRES ].size() >= 3 || exitAngles[ BUSES ].size() >= 3;
454 }
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
Definition: eda_item.h:116
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
EE_RTREE & Items()
Definition: sch_screen.h:103
boost::ptr_vector< WIRE > WIRES
Definition: specctra.h:2976
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197
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_COMPONENT_T, SCH_JUNCTION_T, SCH_LINE_T, SCH_SHEET_T, and STRUCT_DELETED.

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

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 168 of file eda_item.h.

168 { return m_flags & IS_CHANGED; }
#define IS_CHANGED
Item was edited, and modified.
Definition: eda_item.h:103
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsModify()

bool BASE_SCREEN::IsModify ( ) const
inlineinherited

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

Definition at line 453 of file eda_item.h.

453 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 175 of file eda_item.h.

175 { return m_flags & IS_RESIZED; }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:108
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_RESIZED, and EDA_ITEM::m_flags.

◆ IsSave()

bool BASE_SCREEN::IsSave ( ) const
inlineinherited

Definition at line 64 of file base_screen.h.

64 { return m_flagSave; }
bool m_flagSave
Indicates automatic file save.
Definition: base_screen.h:137

References BASE_SCREEN::m_flagSave.

Referenced by SCH_EDIT_FRAME::doAutoSave().

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 173 of file eda_item.h.

173 { return m_flags & SELECTED; }
#define SELECTED
Definition: eda_item.h:114
STATUS_FLAGS m_flags
Definition: eda_item.h:531

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(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), 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(), and GERBVIEW_SELECTION_TOOL::unselect().

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

458 {
459  wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
460  wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
461 
462  switch( aLayer )
463  {
464  case LAYER_BUS:
465  {
466  if( GetBus( aPosition ) )
467  return true;
468 
469  SCH_SHEET_PIN* sheetPin = GetSheetPin( aPosition );
470 
471  if( sheetPin && sheetPin->IsConnected( aPosition ) )
472  return true;
473 
474  SCH_TEXT* label = GetLabel( aPosition );
475 
476  if( label && label->IsConnected( aPosition ) )
477  return true;
478  }
479  break;
480 
481  case LAYER_NOTES:
482  {
483  if( GetLine( aPosition ) )
484  return true;
485  }
486  break;
487 
488  case LAYER_WIRE:
489  {
490  if( GetItem( aPosition, 1, SCH_BUS_WIRE_ENTRY_T) )
491  return true;
492 
493  if( GetItem( aPosition, 1, SCH_JUNCTION_T ) )
494  return true;
495 
496  if( GetPin( aPosition, NULL, true ) )
497  return true;
498 
499  if( GetWire( aPosition ) )
500  return true;
501 
502  SCH_TEXT* label = GetLabel( aPosition, 1 );
503 
504  if( label && label->IsConnected( aPosition ) )
505  return true;
506 
507  SCH_SHEET_PIN* sheetPin = GetSheetPin( aPosition );
508 
509  if( sheetPin && sheetPin->IsConnected( aPosition ) )
510  return true;
511  }
512  break;
513 
514  default:
515  break;
516  }
517 
518  return false;
519 }
LIB_PIN * GetPin(const wxPoint &aPosition, SCH_COMPONENT **aSymbol=NULL, bool aEndPointOnly=false) const
Test the screen for a component pin item at aPosition.
Definition: sch_screen.cpp:817
#define NULL
SCH_LINE * GetBus(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:394
SCH_SHEET_PIN * GetSheetPin(const wxPoint &aPosition) const
Test the screen if aPosition is a sheet label object.
Definition: sch_screen.cpp:869
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:313
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:976
SCH_LINE * GetWire(const wxPoint &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:388
SCH_TEXT * GetLabel(const wxPoint &aPosition, int aAccuracy=0) const
Return a label item located at aPosition.
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, NULL, 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 VIA, SCH_LABEL, DIMENSION_BASE, PAD, PCB_SHAPE, SCH_FIELD, FP_TEXT, SCH_LINE, FP_SHAPE, and PCB_TEXT.

Definition at line 233 of file eda_item.h.

234  {
235  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
236  return true;
237 
238  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
239  {
240  if( m_structType == *p )
241  return true;
242  }
243 
244  return false;
245  }
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:538

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(), SCH_LINE::IsType(), FP_TEXT::IsType(), SCH_FIELD::IsType(), PCB_SHAPE::IsType(), PAD::IsType(), DIMENSION_BASE::IsType(), SCH_LABEL::IsType(), VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), SCH_BASE_FRAME::UpdateItem(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 172 of file eda_item.h.

172 { return m_flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:111
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ Items() [1/2]

EE_RTREE& SCH_SCREEN::Items ( )
inline

Definition at line 103 of file sch_screen.h.

103 { return m_rtree; }
EE_RTREE m_rtree
Definition: sch_screen.h:499

References m_rtree.

Referenced by 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::FindComponentAndItem(), 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_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), SCH_DRAWING_TOOLS::importHierLabel(), SCH_EDIT_TOOL::Init(), IsJunctionNeeded(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EDIT_FRAME::LoadSheetFromFile(), SCH_SHEET::LocatePathOfScreen(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeSymbols(), MarkConnections(), SCH_EDITOR_CONTROL::nextMatch(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), 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::updatePastedInstances(), UpdateSymbolLinks(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ Items() [2/2]

const EE_RTREE& SCH_SCREEN::Items ( ) const
inline

Definition at line 104 of file sch_screen.h.

104 { return m_rtree; }
EE_RTREE m_rtree
Definition: sch_screen.h:499

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

349  {
350  for( auto it : aList )
351  {
352  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
354  return SEARCH_RESULT::QUIT;
355  }
356 
358  }
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:91

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

366  {
367  for( auto it : aList )
368  {
369  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
371  return SEARCH_RESULT::QUIT;
372  }
373 
375  }
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:91

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

◆ MarkConnections()

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

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

Parameters
aSegmentThe segment to test for connections.

Definition at line 329 of file sch_screen.cpp.

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

Referenced by EE_SELECTION_TOOL::SelectConnection().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( 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_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, ZONE, SCH_PIN, SCH_MARKER, PCB_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 415 of file eda_item.h.

416  {
417  return false;
418  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), 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 116 of file eda_item.cpp.

117 {
118  wxString text = aText;
119  wxString searchText = aSearchData.GetFindString();
120 
121  // Don't match if searching for replaceable item and the item doesn't support text replace.
122  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
123  return false;
124 
125  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
126  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
127 
128  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
129  {
130  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
131  return text.Matches( searchText );
132 
133  return text.MakeUpper().Matches( searchText.MakeUpper() );
134  }
135 
136  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
137  return aText.Find( searchText ) != wxNOT_FOUND;
138 
139  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
140 }
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:453

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

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

◆ Place()

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

Definition at line 201 of file sch_screen.h.

201 { };

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

756 {
757  // Ensure links are up to date, even if a library was reloaded for some reason:
758  std::vector< SCH_ITEM* > junctions;
759  std::vector< SCH_ITEM* > bitmaps;
760  std::vector< SCH_ITEM* > other;
761 
762  for( auto item : Items() )
763  {
764  if( item->IsMoving() || item->IsResized() )
765  continue;
766 
767  if( item->Type() == SCH_JUNCTION_T )
768  junctions.push_back( item );
769  else if( item->Type() == SCH_BITMAP_T )
770  bitmaps.push_back( item );
771  else
772  other.push_back( item );
773  }
774 
776  std::sort( other.begin(), other.end(),
777  []( const SCH_ITEM* a, const SCH_ITEM* b )
778  {
779  if( a->Type() == b->Type() )
780  return a->GetLayer() > b->GetLayer();
781 
782  return a->Type() > b->Type();
783  } );
784 
785  int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth();
786 
787  // Bitmaps are drawn first to ensure they are in the background
788  // This is particularly important for the wxPostscriptDC (used in *nix printers) as
789  // the bitmap PS command clears the screen
790  for( const SCH_ITEM* item : bitmaps )
791  {
792  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
793  item->Plot( aPlotter );
794  }
795 
796  for( const SCH_ITEM* item : other )
797  {
798  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
799  item->Plot( aPlotter );
800  }
801 
802  for( const SCH_ITEM* item : junctions )
803  {
804  aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
805  item->Plot( aPlotter );
806  }
807 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:155
EE_RTREE & Items()
Definition: sch_screen.h:103
int GetDefaultPenWidth() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.

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

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

◆ Print()

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

715 {
716  // Ensure links are up to date, even if a library was reloaded for some reason:
717  std::vector<SCH_ITEM*> junctions;
718  std::vector<SCH_ITEM*> bitmaps;
719  std::vector<SCH_ITEM*> other;
720 
721  for( SCH_ITEM* item : Items() )
722  {
723  if( item->IsMoving() || item->IsResized() )
724  continue;
725 
726  if( item->Type() == SCH_JUNCTION_T )
727  junctions.push_back( item );
728  else if( item->Type() == SCH_BITMAP_T )
729  bitmaps.push_back( item );
730  else
731  other.push_back( item );
732  }
733 
735  std::sort( other.begin(), other.end(),
736  []( const SCH_ITEM* a, const SCH_ITEM* b )
737  {
738  if( a->Type() == b->Type() )
739  return a->GetLayer() > b->GetLayer();
740 
741  return a->Type() > b->Type();
742  } );
743 
744  for( SCH_ITEM* item : bitmaps )
745  item->Print( aSettings, wxPoint( 0, 0 ) );
746 
747  for( SCH_ITEM* item : other )
748  item->Print( aSettings, wxPoint( 0, 0 ) );
749 
750  for( SCH_ITEM* item : junctions )
751  item->Print( aSettings, wxPoint( 0, 0 ) );
752 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
EE_RTREE & Items()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163

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

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

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

Referenced by SCH_SHEET_LIST::BuildSheetList(), DeleteItem(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), DIALOG_CHANGE_SYMBOLS::processSymbol(), 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 143 of file eda_item.cpp.

144 {
145  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
146 
147  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
148  aSearchData.GetFindString() :
149  aSearchData.GetFindString().Upper() );
150 
151  if( result == wxNOT_FOUND )
152  return false;
153 
154  wxString prefix = aText.Left( result );
155  wxString suffix;
156 
157  if( aSearchData.GetFindString().length() + result < aText.length() )
158  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
159 
160  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
161  aText, prefix, aSearchData.GetReplaceString(), suffix );
162 
163  aText = prefix + aSearchData.GetReplaceString() + suffix;
164 
165  return true;
166 }
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 442 of file eda_item.h.

443  {
444  return false;
445  }

◆ Schematic()

SCHEMATIC * SCH_SCREEN::Schematic ( ) const

Definition at line 88 of file sch_screen.cpp.

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

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

Referenced by isCoupledDiffPair().

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

136 { m_aux_origin = aPosition; }
wxPoint m_aux_origin
Definition: sch_screen.h:498

References m_aux_origin.

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

◆ SetFileFormatVersionAtLoad()

void SCH_SCREEN::SetFileFormatVersionAtLoad ( int  aVersion)
inline

Definition at line 125 of file sch_screen.h.

125 { m_fileFormatVersionAtLoad = aVersion; }
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:483

References m_fileFormatVersionAtLoad.

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ SetFileName()

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 203 of file eda_item.h.

203 { m_flags |= aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:531

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(), SCH_EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::EnterGroup(), 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::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_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_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 254 of file eda_item.h.

254 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: eda_item.h:530

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

◆ SetModify()

◆ SetPageCount()

void BASE_SCREEN::SetPageCount ( int  aPageCount)
inherited

Definition at line 70 of file base_screen.cpp.

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

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

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

References BASE_SCREEN::m_pageNumber.

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

◆ SetPageSettings()

void SCH_SCREEN::SetPageSettings ( const PAGE_INFO aPageSettings)
inline

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in DIMENSION_BASE.

Definition at line 166 of file eda_item.h.

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

References EDA_ITEM::m_parent.

Referenced by FOOTPRINT::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewComponent(), 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::CreateNewPart(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SCH_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_PART::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), LIB_PART::LIB_PART(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), FOOTPRINT::operator=(), LIB_PART::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_PART::SetFields(), DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_SHEET::SwapData(), SCH_GLOBALLABEL::SwapData(), SCH_COMPONENT::SwapData(), and SwapItemData().

◆ SetPosition()

◆ SetSave()

void BASE_SCREEN::SetSave ( )
inlineinherited

Definition at line 61 of file base_screen.h.

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

References BASE_SCREEN::m_flagSave.

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

◆ SetSelected()

◆ SetState()

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

Definition at line 192 of file eda_item.h.

193  {
194  if( state )
195  m_status |= type; // state = ON or OFF
196  else
197  m_status &= ~type;
198  }
STATUS_FLAGS m_status
Definition: eda_item.h:528

References EDA_ITEM::m_status.

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

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 201 of file eda_item.h.

201 { m_status = aStatus; }
STATUS_FLAGS m_status
Definition: eda_item.h:528

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

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

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

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

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

471 { return *aLeft < *aRight; }

◆ SwapSymbolLinks()

void SCH_SCREEN::SwapSymbolLinks ( const SCH_COMPONENT aOriginalSymbol,
const SCH_COMPONENT aNewSymbol 
)

Definition at line 703 of file sch_screen.cpp.

705 {
706  wxCHECK( aOriginalSymbol && aNewSymbol /* && m_rtree.contains( aOriginalSymbol, true ) */,
707  /* void */ );
708 
709  if( aOriginalSymbol->GetSchSymbolLibraryName() == aNewSymbol->GetSchSymbolLibraryName() )
710  return;
711 }
wxString GetSchSymbolLibraryName() const
Definition: sch_symbol.cpp:239

References SCH_COMPONENT::GetSchSymbolLibraryName().

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

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

959 {
960  std::vector<DANGLING_END_ITEM> endPoints;
961 
962  for( SCH_ITEM* item : Items() )
963  item->GetEndPoints( endPoints );
964 
965  for( SCH_ITEM* item : Items() )
966  {
967  if( item->UpdateDanglingState( endPoints, aPath ) )
968  {
969  if( aChangedHandler )
970  (*aChangedHandler)( item );
971  }
972  }
973 }
EE_RTREE & Items()
Definition: sch_screen.h:103
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197

References Items().

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

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Returns the type of object.

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

Returns
the type of object.

Definition at line 163 of file eda_item.h.

163 { 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:538

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(), 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_SHEET::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_COMPONENT::CanConnect(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_PIN::ClassOf(), PCB_TEXT::ClassOf(), PCB_MARKER::ClassOf(), SCH_NO_CONNECT::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), FP_SHAPE::ClassOf(), SCH_LINE::ClassOf(), PCB_GROUP::ClassOf(), PCB_TARGET::ClassOf(), SCH_FIELD::ClassOf(), FP_TEXT::ClassOf(), SCH_SHEET::ClassOf(), NETINFO_ITEM::ClassOf(), PCB_SHAPE::ClassOf(), SCH_SHEET_PIN::ClassOf(), ZONE::ClassOf(), SCH_BITMAP::ClassOf(), PAD::ClassOf(), TRACK::ClassOf(), SCH_COMPONENT::ClassOf(), ClassOf(), FOOTPRINT::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_TEXT::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), BOARD::ClassOf(), ARC::ClassOf(), SCH_LABEL::ClassOf(), VIA::ClassOf(), ALIGNED_DIMENSION::ClassOf(), SCH_GLOBALLABEL::ClassOf(), ORTHOGONAL_DIMENSION::ClassOf(), LEADER::ClassOf(), SCH_HIERLABEL::ClassOf(), CENTER_DIMENSION::ClassOf(), TRACKS_CLEANER::cleanup(), LIB_BEZIER::compare(), LIB_RECTANGLE::compare(), LIB_CIRCLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_ITEM::compare(), LIB_PART::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(), EDIT_TOOL::CreateArray(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewText(), ZONE_CREATE_HELPER::createNewZone(), BOARD_ADAPTER::createTrack(), DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), ALIGN_DISTRIBUTE_TOOL::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::FilterCollectorForGroups(), NETLIST_EXPORTER_BASE::findNextSymbol(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), EDIT_TOOL::Flip(), 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(), 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(), DIMENSION_BASE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), PCB_SHAPE::GetParentFootprint(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), KIGFX::SCH_PAINTER::getRenderColor(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), DRC_ENGINE::GetShape(), PCB_TEXT::GetShownText(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), CONVERT_TOOL::getStartEndPoints(), getTopLevelGroup(), GROUP_TOOL::Group(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), EE_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(), insideFootprintCourtyard(), insideFrontCourtyard(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), 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(), TRACK::IsNull(), SCH_LINE::IsParallel(), isPlated(), SCH_FIELD::IsReplaceable(), PNS::ROUTER::isStartingPointRoutable(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), PCB_SELECTION_TOOL::itemPassesFilter(), CONVERT_TOOL::LinesToPoly(), 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(), MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), SCH_FIELD::Matches(), memberOf(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), 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(), TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), SCH_BUS_ENTRY_BASE::operator<(), SCH_JUNCTION::operator<(), SCH_FIELD::operator<(), SCH_LINE::operator<(), SCH_TEXT::operator<(), SCH_SHEET::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::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(), CONVERT_TOOL::PolyToLines(), 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(), SCH_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_PART::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(), 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(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_FIELD::SwapData(), PCB_TEXT::SwapData(), PCB_GROUP::SwapData(), TRACK::SwapData(), SCH_SHEET::SwapData(), ARC::SwapData(), ALIGNED_DIMENSION::SwapData(), ORTHOGONAL_DIMENSION::SwapData(), SCH_COMPONENT::SwapData(), LEADER::SwapData(), VIA::SwapData(), CENTER_DIMENSION::SwapData(), PAD::SwapData(), FOOTPRINT::SwapData(), ZONE::SwapData(), SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), ERC_TESTER::TestMultUnitPinConflicts(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), 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_EDIT_ONE_FIELD::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::updatePastedInstances(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_SHEET::Visit(), SCH_GLOBALLABEL::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 237 of file sch_screen.cpp.

238 {
239  if( Remove( aItem ) )
240  Append( aItem );
241 }
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:244
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:128

References Append(), and Remove().

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::Load().

◆ UpdateLocalLibSymbolLinks()

void SCH_SCREEN::UpdateLocalLibSymbolLinks ( )

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

Definition at line 677 of file sch_screen.cpp.

678 {
679  std::vector<SCH_COMPONENT*> symbols;
680 
681  for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) )
682  symbols.push_back( static_cast<SCH_COMPONENT*>( item ) );
683 
684  for( SCH_COMPONENT* symbol : symbols )
685  {
686  // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
687  m_rtree.remove( symbol );
688 
689  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
690 
691  LIB_PART* libSymbol = nullptr;
692 
693  if( it != m_libSymbols.end() )
694  libSymbol = new LIB_PART( *it->second );
695 
696  symbol->SetLibSymbol( libSymbol );
697 
698  m_rtree.insert( symbol );
699  }
700 }
void insert(SCH_ITEM *aItem)
Insert an item into the tree.
Definition: sch_rtree.h:60
bool remove(SCH_ITEM *aItem)
Remove an item from the tree.
Definition: sch_rtree.h:75
EE_RTREE m_rtree
Definition: sch_screen.h:499
Define a library symbol object.
Definition: lib_symbol.h:93
EE_RTREE & Items()
Definition: sch_screen.h:103
Schematic symbol object.
Definition: sch_symbol.h:78
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:197
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:511

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

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ UpdateSymbolLinks()

void SCH_SCREEN::UpdateSymbolLinks ( REPORTER aReporter = nullptr)

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

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

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

Definition at line 522 of file sch_screen.cpp.

523 {
524  wxCHECK_RET( Schematic(), "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
525 
526  wxString msg;
527  std::unique_ptr< LIB_PART > libSymbol;
528  std::vector<SCH_COMPONENT*> symbols;
529  SYMBOL_LIB_TABLE* libs = Schematic()->Prj().SchSymbolLibTable();
530 
531  // This will be a nullptr if an s-expression schematic is loaded.
532  PART_LIBS* legacyLibs = Schematic()->Prj().SchLibs();
533 
534  for( auto item : Items().OfType( SCH_COMPONENT_T ) )
535  symbols.push_back( static_cast<SCH_COMPONENT*>( item ) );
536 
537  // Remove them from the R tree. There bounding box size may change.
538  for( auto symbol : symbols )
539  Remove( symbol );
540 
541  // Clear all existing symbol links.
542  clearLibSymbols();
543 
544  for( auto symbol : symbols )
545  {
546  LIB_PART* tmp = nullptr;
547  libSymbol.reset();
548 
549  // If the symbol is already in the internal library, map the symbol to it.
550  auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
551 
552  if( ( it != m_libSymbols.end() ) )
553  {
554  if( aReporter )
555  {
556  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier "
557  "to '%s'. " ),
558  symbol->GetField( REFERENCE_FIELD )->GetText(),
559  symbol->GetField( VALUE_FIELD )->GetText(),
560  symbol->GetLibId().Format().wx_str() );
561  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
562  }
563 
564  // Internal library symbols are already flattened so just make a copy.
565  symbol->SetLibSymbol( new LIB_PART( *it->second ) );
566  continue;
567  }
568 
569  if( !symbol->GetLibId().IsValid() )
570  {
571  if( aReporter )
572  {
573  msg.Printf( _( "Schematic symbol reference '%s' library identifier is not "
574  "valid. Unable to link library symbol." ),
575  symbol->GetLibId().Format().wx_str() );
576  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
577  }
578 
579  continue;
580  }
581 
582  // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the the library nickname
583  // is not found in the table so check if the library still exists in the table
584  // before attempting to load the symbol.
585  if( !libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) && !legacyLibs )
586  {
587  if( aReporter )
588  {
589  msg.Printf( _( "Symbol library '%s' not found and no fallback cache "
590  "library available. Unable to link library symbol." ),
591  symbol->GetLibId().GetLibNickname().wx_str() );
592  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
593  }
594 
595  continue;
596  }
597 
598  if( libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) )
599  {
600  try
601  {
602  tmp = libs->LoadSymbol( symbol->GetLibId() );
603  }
604  catch( const IO_ERROR& ioe )
605  {
606  if( aReporter )
607  {
608  msg.Printf( _( "I/O error %s resolving library symbol %s" ), ioe.What(),
609  symbol->GetLibId().Format().wx_str() );
610  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
611  }
612  }
613  }
614 
615  if( !tmp && legacyLibs && legacyLibs->GetLibraryCount() )
616  {
617  PART_LIB& legacyCacheLib = legacyLibs->at( 0 );
618 
619  // It better be the cache library.
620  wxCHECK2( legacyCacheLib.IsCache(), continue );
621 
622  wxString id = symbol->GetLibId().Format();
623 
624  id.Replace( ':', '_' );
625 
626  if( aReporter )
627  {
628  msg.Printf( _( "Falling back to cache to set symbol '%s:%s' link '%s'." ),
629  symbol->GetField( REFERENCE_FIELD )->GetText(),
630  symbol->GetField( VALUE_FIELD )->GetText(),
631  id );
632  aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
633  }
634 
635  tmp = legacyCacheLib.FindPart( id );
636  }
637 
638  if( tmp )
639  {
640  // We want a full symbol not just the top level child symbol.
641  libSymbol = tmp->Flatten();
642  libSymbol->SetParent();
643 
644  m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
645  new LIB_PART( *libSymbol.get() ) } );
646 
647  if( aReporter )
648  {
649  msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
650  symbol->GetField( REFERENCE_FIELD )->GetText(),
651  symbol->GetField( VALUE_FIELD )->GetText(),
652  symbol->GetLibId().Format().wx_str() );
653  aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
654  }
655  }
656  else
657  {
658  if( aReporter )
659  {
660  msg.Printf( _( "No library symbol found for schematic symbol '%s %s'." ),
661  symbol->GetField( REFERENCE_FIELD )->GetText(),
662  symbol->GetField( VALUE_FIELD )->GetText() );
663  aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
664  }
665  }
666 
667  symbol->SetLibSymbol( libSymbol.release() );
668  }
669 
670  // Changing the symbol may adjust the bbox of the symbol. This re-inserts the
671  // item with the new bbox
672  for( auto symbol : symbols )
673  Append( symbol );
674 }
Field Reference of part, i.e. "IC21".
bool Remove(SCH_ITEM *aItem)
Remove aItem from the schematic associated with this screen.
Definition: sch_screen.cpp:244
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
void clearLibSymbols()
Definition: sch_screen.cpp:97
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:93
LIB_PART * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_PART having aName from the library given by aNickname.
int GetLibraryCount()
Field Value of part, i.e. "3.3K".
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
Define a library symbol object.
Definition: lib_symbol.h:93
std::unique_ptr< LIB_PART > Flatten() const
Return a flattened symbol inheritance to the caller.
Definition: lib_symbol.cpp:334
LIB_PART * FindPart(const wxString &aName) const
Find LIB_PART by aName.
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:75
A collection of PART_LIB objects.
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:128
#define _(s)
Definition: 3d_actions.cpp:33
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:88
EE_RTREE & Items()
Definition: sch_screen.h:103
Object used to load, save, search, and otherwise manipulate symbol library files.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
bool IsCache() const
std::map< wxString, LIB_PART * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:511

References _, Append(), clearLibSymbols(), PART_LIB::FindPart(), LIB_PART::Flatten(), PART_LIBS::GetLibraryCount(), LIB_TABLE::HasLibrary(), PART_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_COMPONENT_T, Schematic(), 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, CENTER_DIMENSION, EDIT_POINTS, PCB_SHAPE, DIMENSION_BASE, GERBER_DRAW_ITEM, FP_TEXT, 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 190 of file eda_item.cpp.

191 {
192  // Basic fallback
193  EDA_RECT bbox = GetBoundingBox();
194 
195  return BOX2I( bbox.GetOrigin(), bbox.GetSize() );
196 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
const wxPoint GetOrigin() const
Definition: eda_rect.h:106
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:73
const wxSize GetSize() const
Definition: eda_rect.h:96

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

Referenced by GERBVIEW_FRAME::GetDocumentExtents(), 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, VIA, SCH_SHEET, BOARD_ITEM, SCH_ITEM, GERBER_DRAW_ITEM, FP_TEXT, TRACK, LIB_PART, MY_DRAWING, ZONE, PCB_GROUP, SCH_LINE, LIB_ITEM, LIB_FIELD, SCH_COMPONENT, 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 199 of file eda_item.cpp.

200 {
201  // Basic fallback
202  aCount = 1;
203  aLayers[0] = 0;
204 }

◆ 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, VIA, GERBER_DRAW_ITEM, FP_TEXT, 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_COMPONENT, FOOTPRINT, LIB_PART, SCH_GLOBALLABEL, SCH_SHEET, GERBER_FILE_IMAGE, GERBER_DRAW_ITEM, TRACK, PCB_GROUP, and GBR_LAYOUT.

Definition at line 91 of file eda_item.cpp.

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

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

◆ m_aux_origin

wxPoint SCH_SCREEN::m_aux_origin
private

Definition at line 498 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 100 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 493 of file sch_screen.h.

Referenced by GetClientSheetPaths().

◆ m_DrawOrg

wxPoint BASE_SCREEN::m_DrawOrg
inherited

offsets for drawing the circuit on the screen

Definition at line 92 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 483 of file sch_screen.h.

Referenced by GetFileFormatVersionAtLoad(), and SetFileFormatVersionAtLoad().

◆ m_fileName

wxString SCH_SCREEN::m_fileName
private

Definition at line 482 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 473 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_PART*> SCH_SCREEN::m_libSymbols
private

Library symbols required for this schematic.

Definition at line 511 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 501 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 115 of file base_screen.h.

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

◆ m_PageLayoutDescrFileName

◆ m_pageNumber

wxString BASE_SCREEN::m_pageNumber
protectedinherited

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

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

Definition at line 133 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 496 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 484 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 104 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 97 of file base_screen.h.

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

◆ m_status

STATUS_FLAGS EDA_ITEM::m_status
protectedinherited

◆ m_symbolInstances

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

The list of symbol instances loaded from the schematic file.

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

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

Definition at line 527 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 497 of file sch_screen.h.

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

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 525 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddHierarchicalReference(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateSymbols(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), DRAWING_TOOL::DrawVia(), LIB_PART::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), FOOTPRINT::Duplicate(), FOOTPRINT::DuplicateItem(), PCB_EDIT_FRAME::ExchangeFootprint(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportNetlist(), SCH_SHEET_LIST::FillItemMap(), BOARD::FillItemMap(), PCB_BASE_FRAME::FocusOnItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_IO::format(), FormatProbeItem(), SCH_PIN::GetDefaultNetName(), SCH_SHEET_LIST::GetItem(), BOARD::GetItem(), PAD::GetMsgPanelInfo(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), FP_TEXT::GetParentAsString(), PAD::GetParentAsString(), FP_SHAPE::GetParentAsString(), SCH_REFERENCE::GetPath(), SCH_MARKER::GetUUID(), PCB_MARKER::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), SCH_LEGACY_PLUGIN::loadComponent(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), LEGACY_PLUGIN::loadTrackList(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), TRACK::cmp_tracks::operator()(), BOARD_ITEM::ptr_cmp::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), PAD::PAD(), SCH_SEXPR_PARSER::parseSchSheetInstances(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_COMPONENT::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), SCH_LEGACY_PLUGIN::saveComponent(), 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_SEXPR_PLUGIN::saveText(), SCH_COMPONENT::SCH_COMPONENT(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), RC_ITEM::SetItems(), SwapItemData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), SCH_EDITOR_CONTROL::updatePastedInstances(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ m_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 536 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 123 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 476 of file sch_screen.h.

◆ SCH_SEXPR_PARSER

friend SCH_SCREEN::SCH_SEXPR_PARSER
private

Definition at line 477 of file sch_screen.h.

◆ SCH_SEXPR_PLUGIN

friend SCH_SCREEN::SCH_SEXPR_PLUGIN
private

Definition at line 478 of file sch_screen.h.


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