KiCad PCB EDA Suite
SCH_SCREEN Class Reference

#include <sch_screen.h>

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

Public Member Functions

 SCH_SCREEN (EDA_ITEM *aParent=nullptr)
 
 ~SCH_SCREEN ()
 
SCHEMATICSchematic () const
 
EE_RTREEItems ()
 Gets the full RTree, usually for iterating. More...
 
const EE_RTREEItems () const
 
bool IsEmpty () const
 
bool HasItems (KICAD_T aItemType) const
 
bool HasSheets () const
 
virtual wxString GetClass () const override
 Return the class name. More...
 
void SetFileFormatVersionAtLoad (int aVersion)
 
int GetFileFormatVersionAtLoad () const
 
const PAGE_INFOGetPageSettings () const
 
void SetPageSettings (const PAGE_INFO &aPageSettings)
 
void SetFileName (const wxString &aFileName)
 Set the file name for this screen to aFileName. More...
 
const wxString & GetFileName () const
 
void SetFileReadOnly (bool aIsReadOnly)
 
bool IsReadOnly () const
 
void SetFileExists (bool aFileExists)
 
bool FileExists () const
 
const VECTOR2IGetAuxOrigin () const
 
void SetAuxOrigin (const VECTOR2I &aPosition)
 
const TITLE_BLOCKGetTitleBlock () const
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock)
 
void DecRefCount ()
 
void IncRefCount ()
 
int GetRefCount () const
 
void SetConnectivityDirty ()
 
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths ()
 Return the number of times this screen is used. More...
 
void Append (SCH_ITEM *aItem)
 
void Append (SCH_SCREEN *aScreen)
 Copy the contents of aScreen into this SCH_SCREEN object. More...
 
void Clear (bool aFree=true)
 Delete all draw items and clears the project settings. More...
 
void FreeDrawList ()
 Free all the items from the schematic associated with the screen. More...
 
SCH_ITEMGetItem (const VECTOR2I &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
 Check aPosition within a distance of aAccuracy for items of type aFilter. More...
 
void UpdateSymbolLinks (REPORTER *aReporter=nullptr)
 Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic from the project SYMBOL_LIB_TABLE. More...
 
void UpdateLocalLibSymbolLinks ()
 Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic with the local project library symbols. More...
 
void Print (const RENDER_SETTINGS *aSettings)
 Print all the items in the screen to aDC. More...
 
void Plot (PLOTTER *aPlotter) const
 Plot all the schematic objects to aPlotter. More...
 
bool Remove (SCH_ITEM *aItem)
 Remove aItem from the schematic associated with this screen. More...
 
void Update (SCH_ITEM *aItem)
 Update aItem's bounding box in the tree. More...
 
void DeleteItem (SCH_ITEM *aItem)
 Removes aItem from the linked list and deletes the object. More...
 
bool CheckIfOnDrawList (const SCH_ITEM *aItem) const
 
void TestDanglingEnds (const SCH_SHEET_PATH *aPath=nullptr, std::function< void(SCH_ITEM *)> *aChangedHandler=nullptr) const
 Test all of the connectable objects in the schematic for unused connection points. More...
 
std::set< SCH_ITEM * > MarkConnections (SCH_LINE *aSegment, bool aSecondPass)
 Return all wires and junctions connected to aSegment which are not connected any symbol pin. More...
 
void ClearDrawingState ()
 Clear the state flags of all the items in the screen. More...
 
size_t CountConnectedItems (const VECTOR2I &aPos, bool aTestJunctions) const
 
bool IsJunction (const VECTOR2I &aPosition) const
 Test if a junction is required for the items at aPosition on the screen. More...
 
bool IsExplicitJunction (const VECTOR2I &aPosition) const
 Indicates that a junction dot is necessary at the given location. More...
 
bool IsExplicitJunctionNeeded (const VECTOR2I &aPosition) const
 Indicates that a junction dot is necessary at the given location, and does not yet exist. More...
 
TEXT_SPIN_STYLE GetLabelOrientationForPoint (const VECTOR2I &aPosition, TEXT_SPIN_STYLE aDefaultOrientation, const SCH_SHEET_PATH *aSheet) const
 
bool IsExplicitJunctionAllowed (const VECTOR2I &aPosition) const
 Indicates that a juction dot may be placed at the given location. More...
 
bool IsTerminalPoint (const VECTOR2I &aPosition, int aLayer) const
 Test if aPosition is a connection point on aLayer. More...
 
LIB_PINGetPin (const VECTOR2I &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
 Test the screen for a symbol pin item at aPosition. More...
 
SCH_SHEET_PINGetSheetPin (const VECTOR2I &aPosition) const
 Test the screen if aPosition is a sheet label object. More...
 
void ClearAnnotation (SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
 Clear the annotation for the symbols in aSheetPath on the screen. More...
 
void EnsureAlternateReferencesExist ()
 For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any reference related sharing this screen (i.e. More...
 
void GetHierarchicalItems (std::vector< SCH_ITEM * > *aItems) const
 Add all schematic sheet and symbol objects in the screen to aItems. More...
 
void GetSheets (std::vector< SCH_ITEM * > *aItems) const
 Similar to Items().OfType( SCH_SHEET_T ), but return the sheets in a deterministic order (L-R, T-B) for sheet numbering. More...
 
SCH_LINEGetLine (const VECTOR2I &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 VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
 
SCH_LINEGetBus (const VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
 
SCH_LABEL_BASEGetLabel (const VECTOR2I &aPosition, int aAccuracy=0) const
 Return a label item located at aPosition. More...
 
std::map< wxString, LIB_SYMBOL * > & GetLibSymbols ()
 Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this schematic. More...
 
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols () const
 
void AddLibSymbol (LIB_SYMBOL *aLibSymbol)
 Add aLibSymbol to the library symbol map. More...
 
void AddBusAlias (std::shared_ptr< BUS_ALIAS > aAlias)
 Add a bus alias definition (and transfers ownership of the pointer). More...
 
void ClearBusAliases ()
 Remove all bus alias definitions. More...
 
std::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 SetLegacySymbolInstanceData ()
 Update the symbol value and footprint instance data for legacy designs. More...
 
bool AllSymbolDefaultInstancesNotSet ()
 Check all symbol default instance to see if they are not set yet. More...
 
void InitDataPoints (const wxSize &aPageSizeInternalUnits)
 
void SetContentModified (bool aModified=true)
 
bool IsContentModified () const
 
int GetPageCount () const
 
void SetPageCount (int aPageCount)
 
int GetVirtualPageNumber () const
 
void SetVirtualPageNumber (int aPageNumber)
 
const wxString & GetPageNumber () const
 
void SetPageNumber (const wxString &aPageNumber)
 
KICAD_T Type () const
 Returns the type of object. More...
 
EDA_ITEMGetParent () const
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsResized () const
 
bool IsBrightened () const
 
bool IsRollover () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (EDA_ITEM_FLAGS type) const
 
void SetState (EDA_ITEM_FLAGS type, bool state)
 
EDA_ITEM_FLAGS GetStatus () const
 
void SetStatus (EDA_ITEM_FLAGS aStatus)
 
void SetFlags (EDA_ITEM_FLAGS aMask)
 
void ClearFlags (EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
EDA_ITEM_FLAGS GetFlags () const
 
bool HasFlag (EDA_ITEM_FLAGS aFlag) const
 
EDA_ITEM_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool RenderAsBitmap (double aWorldScale) const
 
void SetIsShownAsBitmap (bool aBitmap)
 
bool IsShownAsBitmap () const
 
virtual bool IsType (const std::vector< 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 wxString GetFriendlyName () const
 
virtual bool HitTest (const VECTOR2I &aPosition, int aAccuracy=0) const
 Test if aPosition is inside or on the boundary of this item. More...
 
virtual bool HitTest (const BOX2I &aRect, bool aContained, int aAccuracy=0) const
 Test if aRect intersects this item. More...
 
virtual const BOX2I GetBoundingBox () const
 Return the orthogonal bounding box of this object for display purposes. More...
 
virtual VECTOR2I GetPosition () const
 
virtual void SetPosition (const VECTOR2I &aPos)
 
virtual const VECTOR2I GetFocusPosition () const
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual VECTOR2I GetSortPosition () const
 Return the coordinates that should be used for sorting this element visually compared to other elements. More...
 
virtual EDA_ITEMClone () const
 Create a duplicate of this item with linked list members set to NULL. More...
 
virtual INSPECT_RESULT Visit (INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
 May be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
wxString GetTypeDesc () const
 Return a translated description of the type for this EDA_ITEM for display in user facing messages. More...
 
virtual wxString GetSelectMenuText (UNITS_PROVIDER *aUnitsProvider) 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 EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
virtual bool Replace (const EDA_SEARCH_DATA &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) const
 
template<typename T >
Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
std::optional< T > Get (const wxString &aProperty) const
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
template<class T >
static INSPECT_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const EDA_SEARCH_DATA &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...
 
VECTOR2I m_DrawOrg
 offsets for drawing the circuit on the screen More...
 
VECTOR2D m_LocalOrigin
 Relative Screen cursor coordinate (on grid) in user units. More...
 
VECTOR2I m_StartVisu
 Coordinates in drawing units of the current view position (upper left corner of device) More...
 
bool m_Center
 Center on screen. More...
 
VECTOR2D m_ScrollCenter
 Current scroll center point in logical units. More...
 
const KIID m_Uuid
 

Static Public Attributes

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

Protected Member Functions

bool Matches (const wxString &aText, const EDA_SEARCH_DATA &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 

Protected Attributes

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

Private Member Functions

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

Private Attributes

friend SCH_EDIT_FRAME
 
friend SCH_SEXPR_PARSER
 
friend SCH_SEXPR_PLUGIN
 
friend SCH_ALTIUM_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
 
VECTOR2I m_aux_origin
 
EE_RTREE m_rtree
 
int m_modification_sync
 
bool m_zoomInitialized
 
bool m_isReadOnly
 Read only status of the screen file. More...
 
bool m_fileExists
 
std::set< std::shared_ptr< BUS_ALIAS > > m_aliases
 List of bus aliases stored in this screen. More...
 
std::map< wxString, LIB_SYMBOL * > m_libSymbols
 Library symbols required for this schematic. More...
 
std::vector< SYMBOL_INSTANCE_REFERENCEm_symbolInstances
 The list of symbol instances loaded from the schematic file. More...
 
std::vector< SCH_SHEET_INSTANCEm_sheetInstances
 
KIID m_uuid
 A unique identifier for each schematic file. More...
 
bool m_flagModified
 Indicates current drawing has been modified. More...
 
KICAD_T m_structType
 Run time identification, keep private so it can never be changed after a ctor sets it. More...
 
VIEW_ITEM_DATA * m_viewPrivData
 

Detailed Description

Definition at line 91 of file sch_screen.h.

Constructor & Destructor Documentation

◆ SCH_SCREEN()

SCH_SCREEN::SCH_SCREEN ( EDA_ITEM aParent = nullptr)

Definition at line 62 of file sch_screen.cpp.

62 :
63 BASE_SCREEN( aParent, SCH_SCREEN_T ),
65 m_paper( wxT( "A4" ) ),
66 m_isReadOnly( false ),
67 m_fileExists( false )
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
78}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
bool m_Center
Center on screen.
Definition: base_screen.h:96
BASE_SCREEN(EDA_ITEM *aParent, KICAD_T aType=SCREEN_T)
Definition: base_screen.cpp:35
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:46
const wxSize GetSizeIU(double aIUScale) const
Gets the page size in internal units.
Definition: page_info.h:162
bool m_fileExists
Definition: sch_screen.h:563
int m_refCount
Definition: sch_screen.h:537
int m_modification_sync
Definition: sch_screen.h:554
double m_LastZoomLevel
last value for the zoom level, useful in Eeschema when changing the current displayed sheet to reuse ...
Definition: sch_screen.h:521
int m_fileFormatVersionAtLoad
Definition: sch_screen.h:536
bool m_zoomInitialized
Definition: sch_screen.h:557
PAGE_INFO m_paper
Definition: sch_screen.h:549
bool m_isReadOnly
Read only status of the screen file.
Definition: sch_screen.h:560
const double IU_PER_MILS
Definition: base_units.h:78
@ SCH_SCREEN_T
Definition: typeinfo.h:186

References PAGE_INFO::GetSizeIU(), BASE_SCREEN::InitDataPoints(), EDA_IU_SCALE::IU_PER_MILS, BASE_SCREEN::m_Center, m_LastZoomLevel, m_modification_sync, m_paper, m_refCount, m_zoomInitialized, and schIUScale.

◆ ~SCH_SCREEN()

SCH_SCREEN::~SCH_SCREEN ( )

Definition at line 81 of file sch_screen.cpp.

82{
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:242

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

1421{
1422 m_aliases.insert( aAlias );
1423}
std::set< std::shared_ptr< BUS_ALIAS > > m_aliases
List of bus aliases stored in this screen.
Definition: sch_screen.h:566

References m_aliases.

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

◆ AddLibSymbol()

void SCH_SCREEN::AddLibSymbol ( LIB_SYMBOL aLibSymbol)

Add aLibSymbol to the library symbol map.

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

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

Definition at line 1402 of file sch_screen.cpp.

1403{
1404 wxCHECK( aLibSymbol, /* void */ );
1405
1406 wxString libSymbolName = aLibSymbol->GetLibId().Format().wx_str();
1407
1408 auto it = m_libSymbols.find( libSymbolName );
1409
1410 if( it != m_libSymbols.end() )
1411 {
1412 delete it->second;
1413 m_libSymbols.erase( it );
1414 }
1415
1416 m_libSymbols[libSymbolName] = aLibSymbol;
1417}
UTF8 Format() const
Definition: lib_id.cpp:117
LIB_ID GetLibId() const override
Definition: lib_symbol.h:139
std::map< wxString, LIB_SYMBOL * > m_libSymbols
Library symbols required for this schematic.
Definition: sch_screen.h:569
wxString wx_str() const
Definition: utf8.cpp:46

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

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ AllSymbolDefaultInstancesNotSet()

bool SCH_SCREEN::AllSymbolDefaultInstancesNotSet ( )

Check all symbol default instance to see if they are not set yet.

◆ Append() [1/2]

void SCH_SCREEN::Append ( SCH_ITEM aItem)

Definition at line 141 of file sch_screen.cpp.

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

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

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_EAGLE_PLUGIN::addImplicitConnections(), SCH_ALTIUM_PLUGIN::AddTextBox(), Append(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckHierSheets(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), SCH_LEGACY_PLUGIN::LoadContent(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), SCH_EAGLE_PLUGIN::loadInstance(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_EAGLE_PLUGIN::loadSegments(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_ERC::OnRunERCClick(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), SCH_ALTIUM_PLUGIN::ParseArc(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseComponent(), SCH_ALTIUM_PLUGIN::ParseEllipse(), SCH_ALTIUM_PLUGIN::ParseHarnessConnector(), SCH_ALTIUM_PLUGIN::ParseHarnessPort(), 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::ParseSignalHarness(), 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::TestMissingUnits(), 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 210 of file sch_screen.cpp.

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

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

◆ AssignNewUuid()

void SCH_SCREEN::AssignNewUuid ( )
inline

Definition at line 501 of file sch_screen.h.

501{ m_uuid = KIID(); }
Definition: kiid.h:48
KIID m_uuid
A unique identifier for each schematic file.
Definition: sch_screen.h:594

References m_uuid.

Referenced by SCH_EDIT_FRAME::SaveProject().

◆ CheckIfOnDrawList()

bool SCH_SCREEN::CheckIfOnDrawList ( const SCH_ITEM aItem) const

Definition at line 331 of file sch_screen.cpp.

332{
333 return m_rtree.contains( aItem, true );
334}
bool contains(const SCH_ITEM *aItem, bool aRobust=false) const
Determine if a given item exists in the tree.
Definition: sch_rtree.h:125

References EE_RTREE::contains(), and m_rtree.

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList().

◆ ClassOf()

bool SCH_SCREEN::ClassOf ( const EDA_ITEM aItem)
static

Definition at line 135 of file sch_screen.cpp.

136{
137 return aItem && SCH_SCREEN_T == aItem->Type();
138}

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

224{
225 if( aFree )
226 {
227 FreeDrawList();
229 }
230 else
231 {
232 m_rtree.clear();
233 }
234
235 // Clear the project settings
237
238 m_titles.Clear();
239}
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:119
int m_pageCount
The number of BASE_SCREEN objects in this design.
Definition: base_screen.h:111
void clear()
Remove all items from the RTree.
Definition: sch_rtree.h:111
TITLE_BLOCK m_titles
Definition: sch_screen.h:550
void Clear()
Definition: title_block.h:113

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,
bool  aResetPrefix 
)

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

Parameters
[in]aSheetPathThe sheet path of the symbol annotation to clear. If NULL then the entire hierarchy is cleared.
[in]aResetPrefixThe annotation prefix ('R', 'U', etc.) should be reset to the symbol library prefix.

Definition at line 1255 of file sch_screen.cpp.

1256{
1257
1258 for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
1259 {
1260 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
1261
1262 symbol->ClearAnnotation( aSheetPath, aResetPrefix );
1263 }
1264}
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:109
void ClearAnnotation(const SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
Clear exiting symbol annotation.

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

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

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 122 of file eda_item.h.

void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:143
#define BRIGHTENED
item is drawn with a bright contour

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by SCH_EDIT_FRAME::FocusOnItem(), PCB_BASE_FRAME::FocusOnItems(), EE_SELECTION_TOOL::unhighlight(), PL_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ ClearBusAliases()

void SCH_SCREEN::ClearBusAliases ( )
inline

Remove all bus alias definitions.

Definition at line 476 of file sch_screen.h.

477 {
478 m_aliases.clear();
479 }

References m_aliases.

◆ ClearDrawingState()

void SCH_SCREEN::ClearDrawingState ( )

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

Definition at line 1164 of file sch_screen.cpp.

1165{
1166 for( SCH_ITEM* item : Items() )
1167 item->ClearTempFlags();
1168}

References Items().

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

◆ ClearEditFlags()

◆ ClearFlags()

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

Definition at line 143 of file eda_item.h.

143{ m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:500

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), FOOTPRINT::BuildCourtyardCaches(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), 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(), PCB_TOOL_BASE::doInteractiveItemPlacement(), KIGFX::SCH_PAINTER::draw(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::Init(), EE_COLLECTOR::Inspect(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::RecombinePad(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), DRC_TEST_PROVIDER_DISALLOW::Run(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetIsShownAsBitmap(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and EE_SELECTION_TOOL::unhighlight().

◆ clearLibSymbols()

void SCH_SCREEN::clearLibSymbols ( )
private

Definition at line 97 of file sch_screen.cpp.

98{
99 for( const std::pair<const wxString, LIB_SYMBOL*>& libSymbol : m_libSymbols )
100 delete libSymbol.second;
101
102 m_libSymbols.clear();
103}

References m_libSymbols.

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

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 155 of file eda_item.h.

156 {
158 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
#define SELECTED_BY_DRAG
Item was algorithmically selected as a dragged item.
#define DO_NOT_DRAW
Used to disable draw function.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
#define CANDIDATE
flag indicating that the structure is connected

References CANDIDATE, EDA_ITEM::ClearFlags(), DO_NOT_DRAW, IS_LINKED, SELECTED_BY_DRAG, and SKIP_STRUCT.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles(), and SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 143 of file view_item.h.

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

References KIGFX::VIEW_ITEM::m_viewPrivData.

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

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Create a duplicate of this item with linked list members set to NULL.

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

Returns
A clone of the item.

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_DIRECTIVE_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, KIGFX::ORIGIN_VIEWITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, NETINFO_ITEM, PAD, PCB_BITMAP, PCB_DIM_ALIGNED, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIM_LEADER, PCB_DIM_CENTER, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_ARC, PCB_VIA, ZONE, and FP_ZONE.

Definition at line 82 of file eda_item.cpp.

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

References EDA_ITEM::GetClass().

Referenced by SCH_EDIT_FRAME::AddCopyForRepeatItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_DIMENSION_BASE::GetEffectiveShape(), LIB_SYMBOL::LIB_SYMBOL(), BOARD_COMMIT::makeImage(), new_clone(), LIB_SYMBOL::operator=(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_LIB_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), LIB_SYMBOL::SetConversion(), LIB_SYMBOL::SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ CountConnectedItems()

size_t SCH_SCREEN::CountConnectedItems ( const VECTOR2I aPos,
bool  aTestJunctions 
) const

Definition at line 1241 of file sch_screen.cpp.

1242{
1243 size_t count = 0;
1244
1245 for( const SCH_ITEM* item : Items().Overlapping( aPos ) )
1246 {
1247 if( ( item->Type() != SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
1248 count++;
1249 }
1250
1251 return count;
1252}
@ SCH_JUNCTION_T
Definition: typeinfo.h:142

References Items(), and SCH_JUNCTION_T.

◆ DecRefCount()

void SCH_SCREEN::DecRefCount ( )

Definition at line 120 of file sch_screen.cpp.

121{
122 wxCHECK_RET( m_refCount != 0, wxT( "Screen reference count already zero. Bad programmer!" ) );
123 m_refCount--;
124}

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

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

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

◆ doIsJunction()

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

Definition at line 677 of file sch_screen.cpp.

679{
680 enum layers { WIRES = 0, BUSES };
681
682 *aHasExplicitJunctionDot = false;
683 *aHasBusEntry = false;
684
685 bool breakLines[ 2 ] = { false };
686 std::unordered_set<int> exitAngles[ 2 ];
687 std::vector<const SCH_LINE*> midPointLines[ 2 ];
688
689 // A pin at 90° still shouldn't match a line at 90° so just give pins unique numbers
690 int uniqueAngle = 10000;
691
692 for( const SCH_ITEM* item : Items().Overlapping( aPosition ) )
693 {
694 if( item->GetEditFlags() & STRUCT_DELETED )
695 continue;
696
697 switch( item->Type() )
698 {
699 case SCH_JUNCTION_T:
700 if( item->HitTest( aPosition, -1 ) )
701 *aHasExplicitJunctionDot = true;
702
703 break;
704
705 case SCH_LINE_T:
706 {
707 const SCH_LINE* line = static_cast<const SCH_LINE*>( item );
708 int layer;
709
710 if( line->GetStartPoint() == line->GetEndPoint() )
711 break;
712 else if( line->GetLayer() == LAYER_WIRE )
713 layer = WIRES;
714 else if( line->GetLayer() == LAYER_BUS )
715 layer = BUSES;
716 else
717 break;
718
719 if( line->IsConnected( aPosition ) )
720 {
721 breakLines[ layer ] = true;
722 exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
723 }
724 else if( line->HitTest( aPosition, -1 ) )
725 {
726 if( aBreakCrossings )
727 breakLines[ layer ] = true;
728
729 // Defer any line midpoints until we know whether or not we're breaking them
730 midPointLines[ layer ].push_back( line );
731 }
732 }
733 break;
734
736 if( item->IsConnected( aPosition ) )
737 {
738 breakLines[ BUSES ] = true;
739 exitAngles[ BUSES ].insert( uniqueAngle++ );
740 breakLines[ WIRES ] = true;
741 exitAngles[ WIRES ].insert( uniqueAngle++ );
742 *aHasBusEntry = true;
743 }
744
745 break;
746
747 case SCH_SYMBOL_T:
748 case SCH_SHEET_T:
749 if( item->IsConnected( aPosition ) )
750 {
751 breakLines[ WIRES ] = true;
752 exitAngles[ WIRES ].insert( uniqueAngle++ );
753 }
754
755 break;
756
757 default:
758 break;
759 }
760 }
761
762 for( int layer : { WIRES, BUSES } )
763 {
764 if( breakLines[ layer ] )
765 {
766 for( const SCH_LINE* line : midPointLines[ layer ] )
767 {
768 exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
769 exitAngles[ layer ].insert( line->GetReverseAngleFrom( aPosition ) );
770 }
771 }
772 }
773
774 return exitAngles[ WIRES ].size() >= 3 || exitAngles[ BUSES ].size() >= 3;
775}
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:246
bool IsConnected(const VECTOR2I &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:137
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:40
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_line.cpp:764
int GetReverseAngleFrom(const VECTOR2I &aPoint) const
Definition: sch_line.cpp:414
int GetAngleFrom(const VECTOR2I &aPoint) const
Definition: sch_line.cpp:401
VECTOR2I GetEndPoint() const
Definition: sch_line.h:143
VECTOR2I GetStartPoint() const
Definition: sch_line.h:138
#define STRUCT_DELETED
flag indication structures to be erased
@ LAYER_WIRE
Definition: layer_ids.h:344
@ LAYER_BUS
Definition: layer_ids.h:345
boost::ptr_vector< WIRE > WIRES
Definition: specctra.h:2983
@ SCH_LINE_T
Definition: typeinfo.h:146
@ SCH_SHEET_T
Definition: typeinfo.h:158
@ SCH_BUS_WIRE_ENTRY_T
Definition: typeinfo.h:144

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

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

◆ EnsureAlternateReferencesExist()

void SCH_SCREEN::EnsureAlternateReferencesExist ( )

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

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

Definition at line 1267 of file sch_screen.cpp.

1268{
1269 if( GetClientSheetPaths().size() <= 1 ) // No need for alternate reference
1270 return;
1271
1272 for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
1273 {
1274 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
1275
1276 // Add (when not existing) all sheet path entries
1277 for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() )
1278 symbol->AddSheetPathReferenceEntryIfMissing( sheet.Path() );
1279 }
1280}
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
Definition: sch_screen.h:178
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool AddSheetPathReferenceEntryIfMissing(const KIID_PATH &aSheetPath)
Add an instance to the alternate references list (m_instanceReferences), if this entry does not alrea...

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

Referenced by SCH_SCREENS::ClearAnnotationOfNewSheetPaths().

◆ FileExists()

bool SCH_SCREEN::FileExists ( ) const
inline

Definition at line 150 of file sch_screen.h.

150{ return m_fileExists; }

References m_fileExists.

Referenced by SCH_EDIT_FRAME::UpdateTitle().

◆ FreeDrawList()

void SCH_SCREEN::FreeDrawList ( )

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

This does not delete any sub hierarchies.

Definition at line 242 of file sch_screen.cpp.

243{
244 // We don't know which order we will encounter dependent items (e.g. pins or fields), so
245 // we store the items to be deleted until we've fully cleared the tree before deleting
246 std::vector<SCH_ITEM*> delete_list;
247
248 std::copy_if( m_rtree.begin(), m_rtree.end(), std::back_inserter( delete_list ),
249 []( SCH_ITEM* aItem )
250 {
251 return ( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T );
252 } );
253
254 m_rtree.clear();
255
256 for( SCH_ITEM* item : delete_list )
257 delete item;
258}
iterator end()
Returns a read/write iterator that points to one past the last element in the EE_RTREE.
Definition: sch_rtree.h:285
iterator begin()
Returns a read/write iterator that points to the first element in the EE_RTREE N.B.
Definition: sch_rtree.h:276

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

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

◆ Get() [1/3]

template<typename T >
std::optional< T > INSPECTABLE::Get ( const wxString &  aProperty) const
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 std::optional<T> ret;
110
111 if( prop )
112 {
113 const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114
115 if( object )
116 ret = prop->get<T>( object );
117 }
118
119 return ret;
120 }
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.
T get(const void *aObject) const
Definition: property.h:294
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:67
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:69
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
#define TYPE_HASH(x)
Definition: property.h:61
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:44

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

◆ Get() [2/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 84 of file inspectable.h.

85 {
87 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
88 return object ? aProperty->getter( object ) : wxAny();
89 }
virtual wxAny getter(const void *aObject) const =0

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

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

◆ Get() [3/3]

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

Definition at line 92 of file inspectable.h.

93 {
95 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
96
97 if( !object )
98 throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" );
99
100 return aProperty->get<T>( object );
101 }

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

◆ GetAuxOrigin()

const VECTOR2I & SCH_SCREEN::GetAuxOrigin ( ) const
inline

Definition at line 152 of file sch_screen.h.

152{ return m_aux_origin; }
VECTOR2I m_aux_origin
Definition: sch_screen.h:551

References m_aux_origin.

◆ GetBoundingBox()

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

Definition at line 74 of file eda_item.cpp.

75{
76 // return a zero-sized box per default. derived classes should override
77 // this
78 return BOX2I( VECTOR2I( 0, 0 ), VECTOR2I( 0, 0 ) );
79}
BOX2< VECTOR2I > BOX2I
Definition: box2.h:847
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), CN_ITEM::BBox(), SCH_EDIT_TOOL::ChangeTextType(), TEST_BOARD_ITEM_FIXTURE::CompareItems(), TEST_EE_ITEM_FIXTURE::CompareItems(), EE_RTREE::contains(), BOARD_COMMIT::dirtyIntersectingZones(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), SCH_DRAWING_TOOLS::DrawSheet(), enclosedByAreaFunc(), PCB_SELECTION_TOOL::FindItem(), SCH_EDITOR_CONTROL::FindNext(), LIB_ITEM::GetBoundingBox(), GetBoundingBoxes(), BOARD_ITEM::GetCenter(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_MOVE_TOOL::getConnectedItems(), EE_SELECTION_TOOL::GuessSelectionCandidates(), EE_RTREE::insert(), intersectsAreaFunc(), MarkConnections(), SCH_EDIT_TOOL::Mirror(), DRC_RTREE::QueryColliding(), EE_RTREE::remove(), SCH_EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskBridges(), GERBVIEW_SELECTION::ViewBBox(), and EDA_ITEM::ViewBBox().

◆ GetBus()

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

Definition at line 433 of file sch_screen.h.

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

References GetLine(), and LAYER_BUS.

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

◆ GetBusAliases()

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

Return a list of bus aliases defined in this screen.

Definition at line 484 of file sch_screen.h.

485 {
486 return m_aliases;
487 }

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

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

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

179 {
181 }
std::vector< SCH_SHEET_PATH > m_clientSheetPathList
The list of sheet paths sharing this screen.
Definition: sch_screen.h:546

References m_clientSheetPathList.

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

◆ GetEditFlags()

EDA_ITEM_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 147 of file eda_item.h.

148 {
149 constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_RESIZING | IS_DRAGGING
151
152 return m_flags & mask;
153 }
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_CHANGED
Item was edited, and modified.
#define IS_NEW
New item, just created.
#define IS_DRAGGING
Item being dragged.
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
#define IS_MOVING
Item being moved.
#define IS_RESIZING
Item being resized.

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

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_SYMBOL::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_IMAGE_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow().

◆ GetFileFormatVersionAtLoad()

◆ GetFileName()

◆ GetFlags()

◆ GetFocusPosition()

virtual const VECTOR2I EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

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

Reimplemented in BOARD, PCB_SHAPE, and PCB_TRACK.

Definition at line 258 of file eda_item.h.

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

References EDA_ITEM::GetPosition().

Referenced by SCH_EDIT_FRAME::FocusOnItem().

◆ GetFriendlyName()

wxString EDA_ITEM::GetFriendlyName ( ) const
virtualinherited

Reimplemented in PCB_SHAPE, and ZONE.

Definition at line 310 of file eda_item.cpp.

311{
312 return GetTypeDesc();
313}
wxString GetTypeDesc() const
Return a translated description of the type for this EDA_ITEM for display in user facing messages.
Definition: eda_item.cpp:301

References EDA_ITEM::GetTypeDesc().

Referenced by PROPERTIES_PANEL::update().

◆ GetHierarchicalItems()

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

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

Parameters
[out]aItemsHierarchical item list to fill.

Definition at line 1283 of file sch_screen.cpp.

1284{
1285 for( SCH_ITEM* item : Items() )
1286 {
1287 if( item->IsType( { SCH_SYMBOL_T, SCH_SHEET_T, SCH_LABEL_LOCATE_ANY_T } ) )
1288 aItems->push_back( item );
1289 }
1290}

References Items().

◆ GetItem()

SCH_ITEM * SCH_SCREEN::GetItem ( const VECTOR2I 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 337 of file sch_screen.cpp.

338{
339 BOX2I bbox;
340 bbox.SetOrigin( aPosition );
341 bbox.Inflate( aAccuracy );
342
343 for( SCH_ITEM* item : Items().Overlapping( aType, bbox ) )
344 {
345 if( item->HitTest( aPosition, aAccuracy ) )
346 return item;
347 }
348
349 return nullptr;
350}
void SetOrigin(const Vec &pos)
Definition: box2.h:202
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:506

References BOX2< Vec >::Inflate(), Items(), and BOX2< Vec >::SetOrigin().

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

◆ GetLabel()

SCH_LABEL_BASE * SCH_SCREEN::GetLabel ( const VECTOR2I aPosition,
int  aAccuracy = 0 
) const

Return a label item located at aPosition.

Parameters
[in]aPositionThe VECTOR2I to test for label items.
aAccuracyAmount to inflate the item hit test bounding box.
Returns
The SCH_LABEL_BASE* of the label item found or nullptr.

Definition at line 1378 of file sch_screen.cpp.

1379{
1380 for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
1381 {
1382 switch( item->Type() )
1383 {
1384 case SCH_LABEL_T:
1385 case SCH_GLOBAL_LABEL_T:
1386 case SCH_HIER_LABEL_T:
1388 if( item->HitTest( aPosition, aAccuracy ) )
1389 return static_cast<SCH_LABEL_BASE*>( item );
1390
1391 break;
1392
1393 default:
1394 ;
1395 }
1396 }
1397
1398 return nullptr;
1399}
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:154
@ SCH_LABEL_T
Definition: typeinfo.h:151
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:153
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:152

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

Referenced by IsTerminalPoint().

◆ GetLabelOrientationForPoint()

TEXT_SPIN_STYLE SCH_SCREEN::GetLabelOrientationForPoint ( const VECTOR2I aPosition,
TEXT_SPIN_STYLE  aDefaultOrientation,
const SCH_SHEET_PATH aSheet 
) const

Definition at line 448 of file sch_screen.cpp.

451{
452 auto ret = aDefaultOrientation;
453 for( SCH_ITEM* item : Items().Overlapping( aPosition ) )
454 {
455 if( item->GetEditFlags() & STRUCT_DELETED )
456 continue;
457
458 switch( item->Type() )
459 {
461 {
462 auto busEntry = static_cast<const SCH_BUS_WIRE_ENTRY*>( item );
463 if( busEntry->m_connected_bus_item )
464 {
465 // bus connected, take the bus direction into consideration ony if it is
466 // vertical or horizontal
467 auto bus = static_cast<const SCH_LINE*>( busEntry->m_connected_bus_item );
468 if( bus->Angle().AsDegrees() == 90.0 )
469 {
470 // bus is vertical -> label shall be horizontal and
471 // shall be placed to the side where the bus entry is
472 if( aPosition.x < bus->GetPosition().x )
474 else if( aPosition.x > bus->GetPosition().x )
476 }
477 else if( bus->Angle().AsDegrees() == 0.0 )
478 {
479 // bus is horizontal -> label shall be vertical and
480 // shall be placed to the side where the bus entry is
481 if( aPosition.y < bus->GetPosition().y )
483 else if( aPosition.y > bus->GetPosition().y )
485 }
486 }
487 }
488 break;
489
490 case SCH_LINE_T:
491 {
492 auto line = static_cast<const SCH_LINE*>( item );
493 // line angles goes between -90 and 90 degrees, but normalize
494 auto angle = line->Angle().Normalize90().AsDegrees();
495
496 if( -45 < angle && angle <= 45 )
497 {
498 if( line->GetStartPoint().x <= line->GetEndPoint().x )
499 {
500 ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::RIGHT
502 }
503 else
504 {
505 ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::LEFT
507 }
508 }
509 else
510 {
511 if( line->GetStartPoint().y <= line->GetEndPoint().y )
512 {
513 ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::BOTTOM
515 }
516 else
517 {
518 ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::UP
520 }
521 }
522 }
523 break;
524
525 case SCH_SYMBOL_T:
526 {
527 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
528
529 for( SCH_PIN* pin : symbol->GetPins( aSheet ) )
530 {
531 if( pin->GetPosition() == aPosition )
532 {
533 if( pin->GetOrientation() == PIN_RIGHT )
534 {
536 }
537 else if( pin->GetOrientation() == PIN_LEFT )
538 {
540 }
541 else if( pin->GetOrientation() == PIN_UP )
542 {
544 }
545 else if( pin->GetOrientation() == PIN_DOWN )
546 {
548 }
549
550 switch( static_cast<SYMBOL_ORIENTATION_T>(
551 symbol->GetOrientation() & ( ~( SYM_MIRROR_X | SYM_MIRROR_Y ) ) ) )
552 {
554 case SYM_ORIENT_90:
555 if( ret == TEXT_SPIN_STYLE::UP )
557 else if( ret == TEXT_SPIN_STYLE::BOTTOM )
559 else if( ret == TEXT_SPIN_STYLE::LEFT )
561 else if( ret == TEXT_SPIN_STYLE::RIGHT )
563
564 if( symbol->GetOrientation() & SYM_MIRROR_X )
565 {
566 if( ret == TEXT_SPIN_STYLE::UP )
568 else if( ret == TEXT_SPIN_STYLE::BOTTOM )
570 }
571
572 if( symbol->GetOrientation() & SYM_MIRROR_Y )
573 {
574 if( ret == TEXT_SPIN_STYLE::LEFT )
576 else if( ret == TEXT_SPIN_STYLE::RIGHT )
578 }
579 break;
581 case SYM_ORIENT_270:
582 if( ret == TEXT_SPIN_STYLE::UP )
584 else if( ret == TEXT_SPIN_STYLE::BOTTOM )
586 else if( ret == TEXT_SPIN_STYLE::LEFT )
588 else if( ret == TEXT_SPIN_STYLE::RIGHT )
590
591 if( symbol->GetOrientation() & SYM_MIRROR_X )
592 {
593 if( ret == TEXT_SPIN_STYLE::UP )
595 else if( ret == TEXT_SPIN_STYLE::BOTTOM )
597 }
598
599 if( symbol->GetOrientation() & SYM_MIRROR_Y )
600 {
601 if( ret == TEXT_SPIN_STYLE::LEFT )
603 else if( ret == TEXT_SPIN_STYLE::RIGHT )
605 }
606 break;
607 case SYM_ORIENT_180:
608 if( ret == TEXT_SPIN_STYLE::UP )
610 else if( ret == TEXT_SPIN_STYLE::BOTTOM )
612 else if( ret == TEXT_SPIN_STYLE::LEFT )
614 else if( ret == TEXT_SPIN_STYLE::RIGHT )
616
617 if( symbol->GetOrientation() & SYM_MIRROR_X )
618 {
619 if( ret == TEXT_SPIN_STYLE::UP )
621 else if( ret == TEXT_SPIN_STYLE::BOTTOM )
623 }
624
625 if( symbol->GetOrientation() & SYM_MIRROR_Y )
626 {
627 if( ret == TEXT_SPIN_STYLE::LEFT )
629 else if( ret == TEXT_SPIN_STYLE::RIGHT )
631 }
632 break;
633 case SYM_ORIENT_0:
634 case SYM_NORMAL:
635 default:
636 if( symbol->GetOrientation() & SYM_MIRROR_X )
637 {
638 if( ret == TEXT_SPIN_STYLE::UP )
640 else if( ret == TEXT_SPIN_STYLE::BOTTOM )
642 }
643
644 if( symbol->GetOrientation() & SYM_MIRROR_Y )
645 {
646 if( ret == TEXT_SPIN_STYLE::LEFT )
648 else if( ret == TEXT_SPIN_STYLE::RIGHT )
650 }
651 break;
652 }
653
654 break;
655 }
656 }
657 }
658 break;
659 default: break;
660 }
661 }
662 return ret;
663}
Class for a wire to bus entry.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
Definition: sch_symbol.cpp:989
int GetOrientation() const
Get the display symbol orientation.
@ PIN_LEFT
Definition: lib_pin.h:46
@ PIN_RIGHT
Definition: lib_pin.h:45
@ PIN_UP
Definition: lib_pin.h:47
@ PIN_DOWN
Definition: lib_pin.h:48
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
SYMBOL_ORIENTATION_T
enum used in RotationMiroir()
@ SYM_ORIENT_270
@ SYM_ROTATE_CLOCKWISE
@ SYM_ROTATE_COUNTERCLOCKWISE
@ SYM_MIRROR_Y
@ SYM_ORIENT_180
@ SYM_MIRROR_X
@ SYM_NORMAL
@ SYM_ORIENT_90
@ SYM_ORIENT_0

References PNS::angle(), TEXT_SPIN_STYLE::BOTTOM, SCH_SYMBOL::GetOrientation(), SCH_SYMBOL::GetPins(), Items(), TEXT_SPIN_STYLE::LEFT, pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, TEXT_SPIN_STYLE::RIGHT, SCH_BUS_WIRE_ENTRY_T, SCH_LINE_T, SCH_SYMBOL_T, STRUCT_DELETED, SYM_MIRROR_X, SYM_MIRROR_Y, SYM_NORMAL, SYM_ORIENT_0, SYM_ORIENT_180, SYM_ORIENT_270, SYM_ORIENT_90, SYM_ROTATE_CLOCKWISE, SYM_ROTATE_COUNTERCLOCKWISE, TEXT_SPIN_STYLE::UP, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SCH_EDIT_FRAME::AutoRotateItem().

◆ GetLibSymbols() [1/2]

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

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

Returns
The list of unique LIB_SYMBOL object pointers.

Definition at line 454 of file sch_screen.h.

454{ return m_libSymbols; }

References m_libSymbols.

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

◆ GetLibSymbols() [2/2]

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

Definition at line 455 of file sch_screen.h.

455{ return m_libSymbols; }

References m_libSymbols.

◆ GetLine()

SCH_LINE * SCH_SCREEN::GetLine ( const VECTOR2I 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 VECTOR2I 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 1341 of file sch_screen.cpp.

1343{
1344 // an accuracy of 0 had problems with rounding errors; use at least 1
1345 aAccuracy = std::max( aAccuracy, 1 );
1346
1347 for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
1348 {
1349 if( item->Type() != SCH_LINE_T )
1350 continue;
1351
1352 if( item->GetLayer() != aLayer )
1353 continue;
1354
1355 if( !item->HitTest( aPosition, aAccuracy ) )
1356 continue;
1357
1358 switch( aSearchType )
1359 {
1360 case ENTIRE_LENGTH_T:
1361 return (SCH_LINE*) item;
1362
1364 if( !( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1365 return (SCH_LINE*) item;
1366 break;
1367
1368 case END_POINTS_ONLY_T:
1369 if( ( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
1370 return (SCH_LINE*) item;
1371 }
1372 }
1373
1374 return nullptr;
1375}
@ ENTIRE_LENGTH_T
Definition: sch_screen.h:72
@ EXCLUDE_END_POINTS_T
Definition: sch_screen.h:74
@ END_POINTS_ONLY_T
Definition: sch_screen.h:73

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

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

◆ GetMenuImage()

BITMAPS EDA_ITEM::GetMenuImage ( ) const
virtualinherited

Return a pointer to an image to be used in menus.

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

Returns
The menu image associated with the item.

Reimplemented in LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_SHAPE, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, GERBER_DRAW_ITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIM_ALIGNED, PCB_DIM_ORTHOGONAL, PCB_DIM_RADIAL, PCB_DIM_LEADER, PCB_DIM_CENTER, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, and ZONE.

Definition at line 269 of file eda_item.cpp.

270{
271 return BITMAPS::dummy_item;
272}

References dummy_item.

Referenced by SELECTION_TOOL::doSelectionMenu().

◆ GetMsgPanelInfo()

◆ GetPageCount()

◆ GetPageNumber()

const wxString & BASE_SCREEN::GetPageNumber ( ) const
inherited

Definition at line 71 of file base_screen.cpp.

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

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

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

◆ GetPageSettings()

◆ GetParent()

◆ GetPin()

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

Test the screen for a symbol pin item at aPosition.

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

Definition at line 1171 of file sch_screen.cpp.

1173{
1174 SCH_SYMBOL* candidate = nullptr;
1175 LIB_PIN* pin = nullptr;
1176
1177 for( SCH_ITEM* item : Items().Overlapping( SCH_SYMBOL_T, aPosition ) )
1178 {
1179 candidate = static_cast<SCH_SYMBOL*>( item );
1180
1181 if( aEndPointOnly )
1182 {
1183 pin = nullptr;
1184
1185 if( !candidate->GetLibSymbolRef() )
1186 continue;
1187
1188 for( pin = candidate->GetLibSymbolRef()->GetNextPin(); pin;
1189 pin = candidate->GetLibSymbolRef()->GetNextPin( pin ) )
1190 {
1191 // Skip items not used for this part.
1192 if( candidate->GetUnit() && pin->GetUnit() &&
1193 ( pin->GetUnit() != candidate->GetUnit() ) )
1194 continue;
1195
1196 if( candidate->GetConvert() && pin->GetConvert() &&
1197 ( pin->GetConvert() != candidate->GetConvert() ) )
1198 continue;
1199
1200 if( candidate->GetPinPhysicalPosition( pin ) == aPosition )
1201 break;
1202 }
1203
1204 if( pin )
1205 break;
1206 }
1207 else
1208 {
1209 pin = (LIB_PIN*) candidate->GetDrawItem( aPosition, LIB_PIN_T );
1210
1211 if( pin )
1212 break;
1213 }
1214 }
1215
1216 if( pin && aSymbol )
1217 *aSymbol = candidate;
1218
1219 return pin;
1220}
LIB_ITEM * GetDrawItem(const VECTOR2I &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:227
VECTOR2I GetPinPhysicalPosition(const LIB_PIN *Pin) const
int GetConvert() const
Definition: sch_symbol.h:269
@ LIB_PIN_T
Definition: typeinfo.h:202

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

Referenced by IsTerminalPoint().

◆ GetPosition()

virtual VECTOR2I EDA_ITEM::GetPosition ( ) const
inlinevirtualinherited

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

Definition at line 251 of file eda_item.h.

251{ return VECTOR2I(); }

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

◆ GetRefCount()

int SCH_SCREEN::GetRefCount ( ) const
inline

Definition at line 161 of file sch_screen.h.

161{ return m_refCount; }

References m_refCount.

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

◆ GetSelectMenuText()

wxString EDA_ITEM::GetSelectMenuText ( UNITS_PROVIDER aUnitsProvider) 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 LIB_FIELD, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_JUNCTION, SCH_LABEL, SCH_DIRECTIVE_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_MARKER, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, DELETED_SHEET_ITEM, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, GERBER_DRAW_ITEM, DELETED_BOARD_ITEM, DS_DRAW_ITEM_LINE, DS_DRAW_ITEM_POLYPOLYGONS, DS_DRAW_ITEM_RECT, DS_DRAW_ITEM_PAGE, DS_DRAW_ITEM_TEXT, DS_DRAW_ITEM_BITMAP, PCB_GROUP, BOARD, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIMENSION_BASE, PCB_MARKER, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, and ZONE.

Definition at line 108 of file eda_item.cpp.

109{
110 wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
111 GetClass() );
112
113 return wxString( wxT( "Undefined menu text for " ) + GetClass() );
114}

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::collectAllDriverValues(), DIALOG_GROUP_PROPERTIES::DoAddMember(), SELECTION_TOOL::doSelectionMenu(), DRC_ENGINE::EvalRules(), BOARD_INSPECTION_TOOL::getItemDescription(), PCB_MARKER::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), RC_ITEM::ShowReport(), DIALOG_POSITION_RELATIVE::updateAnchorInfo(), and PCB_CONTROL::UpdateMessagePanel().

◆ GetSheetInstances()

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

Definition at line 494 of file sch_screen.h.

495 {
496 return m_sheetInstances;
497 }
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
Definition: sch_screen.h:586

References m_sheetInstances.

Referenced by EESCHEMA_HELPERS::LoadSchematic(), and SCH_EDITOR_CONTROL::setClipboardInstances().

◆ GetSheetPin()

SCH_SHEET_PIN * SCH_SCREEN::GetSheetPin ( const VECTOR2I 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 1223 of file sch_screen.cpp.

1224{
1225 SCH_SHEET_PIN* sheetPin = nullptr;
1226
1227 for( SCH_ITEM* item : Items().Overlapping( SCH_SHEET_T, aPosition ) )
1228 {
1229 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
1230
1231 sheetPin = sheet->GetPin( aPosition );
1232
1233 if( sheetPin )
1234 break;
1235 }
1236
1237 return sheetPin;
1238}
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:566

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

Referenced by IsTerminalPoint().

◆ GetSheets()

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

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

Definition at line 1293 of file sch_screen.cpp.

1294{
1295 for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
1296 aItems->push_back( item );
1297
1298 std::sort( aItems->begin(), aItems->end(),
1299 []( EDA_ITEM* a, EDA_ITEM* b ) -> bool
1300 {
1301 if( a->GetPosition().x == b->GetPosition().x )
1302 {
1303 // Ensure deterministic sort
1304 if( a->GetPosition().y == b->GetPosition().y )
1305 return a->m_Uuid < b->m_Uuid;
1306
1307 return a->GetPosition().y < b->GetPosition().y;
1308 }
1309 else
1310 {
1311 return a->GetPosition().x < b->GetPosition().x;
1312 }
1313 } );
1314}
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85

References Items(), and SCH_SHEET_T.

Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), HIERARCHY_NAVIG_PANEL::buildHierarchyTree(), SCH_SHEET_LIST::BuildSheetList(), SCH_EDIT_FRAME::CheckAnnotate(), and SCH_EDIT_FRAME::DeleteAnnotation().

◆ GetSortPosition()

virtual VECTOR2I EDA_ITEM::GetSortPosition ( ) const
inlinevirtualinherited

Return the coordinates that should be used for sorting this element visually compared to other elements.

For instance, for lines the midpoint might be a better sorting point than either end.

Returns
X,Y coordinate of the sort point

Reimplemented in SCH_LINE.

Definition at line 267 of file eda_item.h.

267{ return GetPosition(); }

References EDA_ITEM::GetPosition().

◆ GetState()

int EDA_ITEM::GetState ( EDA_ITEM_FLAGS  type) const
inlineinherited

Definition at line 126 of file eda_item.h.

127 {
128 return m_status & type;
129 }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:497

References EDA_ITEM::m_status.

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 139 of file eda_item.h.

139{ return m_status; }

References EDA_ITEM::m_status.

◆ GetSymbolInstances()

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

Definition at line 489 of file sch_screen.h.

490 {
491 return m_symbolInstances;
492 }
std::vector< SYMBOL_INSTANCE_REFERENCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
Definition: sch_screen.h:585

References m_symbolInstances.

Referenced by EESCHEMA_HELPERS::LoadSchematic(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), and SCH_EDITOR_CONTROL::setClipboardInstances().

◆ GetTitleBlock()

◆ GetTypeDesc()

wxString EDA_ITEM::GetTypeDesc ( ) const
inherited

Return a translated description of the type for this EDA_ITEM for display in user facing messages.

Definition at line 301 of file eda_item.cpp.

302{
303 //@see EDA_ITEM_DESC for definition of ENUM_MAP<KICAD_T>
304 wxString typeDescr = ENUM_MAP<KICAD_T>::Instance().ToString( Type() );
305
306 return wxGetTranslation( typeDescr );
307}
static ENUM_MAP< T > & Instance()
Definition: property.h:546

References ENUM_MAP< T >::Instance(), and EDA_ITEM::Type().

Referenced by PCB_GROUP::AddItem(), EDIT_TOOL::doMoveSelection(), and EDA_ITEM::GetFriendlyName().

◆ GetUuid()

◆ GetVirtualPageNumber()

◆ GetWire()

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

Definition at line 427 of file sch_screen.h.

429 {
430 return GetLine( aPosition, aAccuracy, LAYER_WIRE, aSearchType );
431 }

References GetLine(), and LAYER_WIRE.

Referenced by IsTerminalPoint().

◆ HasFlag()

◆ HasItems()

bool SCH_SCREEN::HasItems ( KICAD_T  aItemType) const

Definition at line 127 of file sch_screen.cpp.

128{
129 EE_RTREE::EE_TYPE sheets = m_rtree.OfType( aItemType );
130
131 return sheets.begin() != sheets.end();
132}
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:238
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
Definition: sch_rtree.h:192
iterator begin()
Definition: sch_rtree.h:222
iterator end()
Definition: sch_rtree.h:227

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

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

References HasItems(), and SCH_SHEET_T.

◆ HitTest() [1/2]

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

Test if aRect intersects this item.

Parameters
aRectA reference to a BOX2I 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 LIB_ITEM, LIB_PIN, LIB_SHAPE, LIB_TEXT, LIB_TEXTBOX, SCH_BITMAP, SCH_BUS_ENTRY_BASE, SCH_FIELD, SCH_JUNCTION, SCH_LABEL_BASE, SCH_LINE, SCH_NO_CONNECT, SCH_PIN, SCH_SHAPE, SCH_SHEET, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, DS_DRAW_ITEM_BASE, DS_DRAW_ITEM_POLYPOLYGONS, DS_DRAW_ITEM_RECT, DS_DRAW_ITEM_TEXT, DS_DRAW_ITEM_BITMAP, PCB_GROUP, FOOTPRINT, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_TARGET, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, PCB_ARC, ZONE, and GERBER_DRAW_ITEM.

Definition at line 237 of file eda_item.h.

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

◆ HitTest() [2/2]

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

◆ IncRefCount()

void SCH_SCREEN::IncRefCount ( )

Definition at line 114 of file sch_screen.cpp.

115{
116 m_refCount++;
117}

References m_refCount.

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

◆ InitDataPoints()

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

Definition at line 46 of file base_screen.cpp.

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

References BASE_SCREEN::m_Center, BASE_SCREEN::m_DrawOrg, BASE_SCREEN::m_LocalOrigin, VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ IsBrightened()

◆ IsContentModified()

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 105 of file eda_item.h.

105{ return m_flags & IS_DRAGGING; }

References IS_DRAGGING, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().

◆ IsEmpty()

bool SCH_SCREEN::IsEmpty ( ) const
inline

Definition at line 112 of file sch_screen.h.

113 {
114 return m_rtree.empty();
115 }
bool empty() const
Definition: sch_rtree.h:176

References EE_RTREE::empty(), and m_rtree.

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 108 of file eda_item.h.

108{ return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered

References ENTERED, and EDA_ITEM::m_flags.

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

◆ IsExplicitJunction()

bool SCH_SCREEN::IsExplicitJunction ( const VECTOR2I aPosition) const

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

See IsJunctionNeeded for more info.

Definition at line 429 of file sch_screen.cpp.

430{
431 bool hasExplicitJunction;
432 bool hasBusEntry;
433 bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
434
435 return isJunction && !hasBusEntry;
436}
bool doIsJunction(const VECTOR2I &aPosition, bool aBreakCrossings, bool *aHasExplicitJunctionDot, bool *aHasBusEntry) const
Definition: sch_screen.cpp:677

References doIsJunction().

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

◆ IsExplicitJunctionAllowed()

bool SCH_SCREEN::IsExplicitJunctionAllowed ( const VECTOR2I aPosition) const

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

See IsJunctionNeeded for more info.

Definition at line 666 of file sch_screen.cpp.

667{
668 bool hasExplicitJunction;
669 bool hasBusEntry;
670 bool isJunction = doIsJunction( aPosition, true, &hasExplicitJunction, &hasBusEntry );
671
672 return isJunction && !hasBusEntry;
673}

References doIsJunction().

Referenced by SCH_DRAWING_TOOLS::SingleClickPlace().

◆ IsExplicitJunctionNeeded()

bool SCH_SCREEN::IsExplicitJunctionNeeded ( const VECTOR2I aPosition) const

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

See IsJunctionNeeded for more info.

Definition at line 439 of file sch_screen.cpp.

440{
441 bool hasExplicitJunction;
442 bool hasBusEntry;
443 bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
444
445 return isJunction && !hasBusEntry && !hasExplicitJunction;
446}

References doIsJunction().

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

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 203 of file eda_item.h.

203{ return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:499

References EDA_ITEM::m_forceVisible.

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

◆ IsJunction()

bool SCH_SCREEN::IsJunction ( const VECTOR2I aPosition) const

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

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

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

  • One wire midpoint and one or more wire endpoints.
  • Three or more wire endpoints.
  • One wire midpoint and a symbol pin.
  • Two or more wire endpoints and a symbol pin.
  • One bus midpoint or endpoint and a bus entry.
Parameters
[in]aPositionThe position to test.
Returns
True if a junction is required at aPosition.

Definition at line 419 of file sch_screen.cpp.

420{
421 bool hasExplicitJunction;
422 bool hasBusEntry;
423 bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
424
425 return isJunction;
426}

References doIsJunction().

Referenced by SCH_LINE::MergeOverlap().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 102 of file eda_item.h.

102{ return m_flags & IS_CHANGED; }

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsReadOnly()

bool SCH_SCREEN::IsReadOnly ( ) const
inline

Definition at line 147 of file sch_screen.h.

147{ return m_isReadOnly; }

References m_isReadOnly.

Referenced by SCH_EDIT_FRAME::UpdateTitle().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

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

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

Reimplemented in LIB_TEXTBOX, SCH_FIELD, SCH_LABEL, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 422 of file eda_item.h.

422{ return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 109 of file eda_item.h.

109{ return m_flags & IS_RESIZING; }

References IS_RESIZING, and EDA_ITEM::m_flags.

◆ IsRollover()

bool EDA_ITEM::IsRollover ( ) const
inlineinherited

Definition at line 112 of file eda_item.h.

113 {
114 return ( m_flags & ( IS_ROLLOVER | IS_MOVING ) ) == IS_ROLLOVER;
115 }
#define IS_ROLLOVER
Rollover active. Used for hyperlink highlighting.

References IS_MOVING, IS_ROLLOVER, and EDA_ITEM::m_flags.

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

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 107 of file eda_item.h.

107{ return m_flags & SELECTED; }

References EDA_ITEM::m_flags, and SELECTED.

Referenced by ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), SCH_EDIT_TOOL::ChangeTextType(), 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(), EDIT_TOOL::doMoveSelection(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DS_PROXY_UNDO_ITEM::DS_PROXY_UNDO_ITEM(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_PAINTER::getLineWidth(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), DIALOG_CHANGE_SYMBOLS::isMatch(), MarkConnections(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), KIGFX::SCH_PAINTER::nonCached(), SCH_MOVE_TOOL::orthoLineDrag(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), BOARD_COMMIT::Push(), EE_SELECTION_TOOL::RebuildSelection(), PCB_SELECTION_TOOL::RebuildSelection(), RENDER_3D_OPENGL::renderFootprint(), SCH_EDIT_TOOL::Rotate(), EE_TOOL_BASE< T >::saveCopyInUndoList(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), KIGFX::SCH_PAINTER::setDeviceColors(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), GERBVIEW_SELECTION_TOOL::unselect(), HIERARCHY_NAVIG_PANEL::UpdateHierarchySelection(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ IsShownAsBitmap()

bool EDA_ITEM::IsShownAsBitmap ( ) const
inlineinherited

Definition at line 175 of file eda_item.h.

175{ return m_flags & IS_SHOWN_AS_BITMAP; }
#define IS_SHOWN_AS_BITMAP

References IS_SHOWN_AS_BITMAP, and EDA_ITEM::m_flags.

◆ IsTerminalPoint()

bool SCH_SCREEN::IsTerminalPoint ( const VECTOR2I 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 778 of file sch_screen.cpp.

779{
780 wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
781 wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
782
783 SCH_SHEET_PIN* sheetPin;
784 SCH_LABEL_BASE* label;
785
786 switch( aLayer )
787 {
788 case LAYER_BUS:
789 if( GetBus( aPosition ) )
790 return true;
791
792 sheetPin = GetSheetPin( aPosition );
793
794 if( sheetPin && sheetPin->IsConnected( aPosition ) )
795 return true;
796
797 label = GetLabel( aPosition );
798
799 if( label && label->IsConnected( aPosition ) )
800 return true;
801
802 break;
803
804 case LAYER_NOTES:
805 if( GetLine( aPosition ) )
806 return true;
807
808 break;
809
810 case LAYER_WIRE:
811 if( GetItem( aPosition, 1, SCH_BUS_WIRE_ENTRY_T) )
812 return true;
813
814 if( GetItem( aPosition, 1, SCH_JUNCTION_T ) )
815 return true;
816
817 if( GetPin( aPosition, nullptr, true ) )
818 return true;
819
820 if( GetWire( aPosition ) )
821 return true;
822
823 label = GetLabel( aPosition, 1 );
824
825 if( label && label->IsConnected( aPosition ) )
826 return true;
827
828 sheetPin = GetSheetPin( aPosition );
829
830 if( sheetPin && sheetPin->IsConnected( aPosition ) )
831 return true;
832
833 break;
834
835 default:
836 break;
837 }
838
839 return false;
840}
LIB_PIN * GetPin(const VECTOR2I &aPosition, SCH_SYMBOL **aSymbol=nullptr, bool aEndPointOnly=false) const
Test the screen for a symbol pin item at aPosition.
SCH_LINE * GetWire(const VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:427
SCH_ITEM * GetItem(const VECTOR2I &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:337
SCH_LINE * GetBus(const VECTOR2I &aPosition, int aAccuracy=0, SCH_LINE_TEST_T aSearchType=ENTIRE_LENGTH_T) const
Definition: sch_screen.h:433
SCH_SHEET_PIN * GetSheetPin(const VECTOR2I &aPosition) const
Test the screen if aPosition is a sheet label object.
SCH_LABEL_BASE * GetLabel(const VECTOR2I &aPosition, int aAccuracy=0) const
Return a label item located at aPosition.
@ LAYER_NOTES
Definition: layer_ids.h:358

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

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

◆ IsType()

virtual bool EDA_ITEM::IsType ( const std::vector< 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 SCH_FIELD, SCH_ITEM, SCH_LABEL_BASE, SCH_LINE, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, and PCB_VIA.

Definition at line 183 of file eda_item.h.

184 {
185 for( KICAD_T scanType : aScanTypes )
186 {
187 if( scanType == SCH_LOCATE_ANY_T || scanType == m_structType )
188 return true;
189 }
190
191 return false;
192 }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:507
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LOCATE_ANY_T
Definition: typeinfo.h:183

References EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by SCH_EDIT_TOOL::AutoplaceFields(), ROUTER_TOOL::CanInlineDrag(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), SCH_FIELD::GetCanonicalName(), KIGFX::SCH_PAINTER::getLineWidth(), SCH_FIELD::GetName(), KIGFX::SCH_PAINTER::getRenderColor(), SCH_FIELD::GetShownText(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), SCH_ITEM::IsType(), FP_TEXT::IsType(), FP_TEXTBOX::IsType(), PAD::IsType(), PCB_DIMENSION_BASE::IsType(), PCB_SHAPE::IsType(), PCB_TEXT::IsType(), PCB_TEXTBOX::IsType(), PCB_VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), CONVERT_TOOL::makePolysFromChainedSegs(), EE_SELECTION_TOOL::RequestSelection(), SCH_FIELD::SetId(), SCH_BASE_FRAME::UpdateItem(), and EDA_ITEM::Visit().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 106 of file eda_item.h.

106{ return m_flags & IS_WIRE_IMAGE; }

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ Items() [1/2]

EE_RTREE & SCH_SCREEN::Items ( )
inline

Gets the full RTree, usually for iterating.

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

Returns
Complete RTree of the screen's items

Definition at line 109 of file sch_screen.h.

109{ return m_rtree; }

References m_rtree.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), SCH_MOVE_TOOL::AlignElements(), SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_EDIT_FRAME::AutoRotateItem(), 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(), SCH_EDIT_FRAME::CommonSettingsChanged(), CountConnectedItems(), SCH_SHEET::CountSheets(), SCH_EDIT_FRAME::DeleteJunction(), KIGFX::SCH_VIEW::DisplaySheet(), doIsJunction(), EnsureAlternateReferencesExist(), CONNECTION_GRAPH::ercCheckHierSheets(), SCH_SHEET_LIST::FillItemMap(), findItemsFromSyncSelection(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDIT_FRAME::FixupJunctions(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_MOVE_TOOL::getConnectedItems(), SCH_EDIT_FRAME::GetDocumentExtents(), GetHierarchicalItems(), SCH_SHEET_LIST::GetItem(), GetItem(), GetLabel(), GetLabelOrientationForPoint(), GetLine(), GetPin(), AUTOPLACER::getPossibleCollisions(), getSheetBbox(), SCH_LINE_WIRE_BUS_TOOL::getSheetPin(), GetSheetPin(), GetSheets(), SCH_EDIT_FRAME::HardRedraw(), SCH_SHEET::HasUndefinedPins(), SCH_DRAWING_TOOLS::importHierLabel(), SCH_EDIT_TOOL::Init(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EAGLE_PLUGIN::loadSheet(), SCH_SHEET::LocatePathOfScreen(), SCH_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeSymbols(), MarkConnections(), SCH_SHEET_LIST::MigrateSimModelNameFields(), SCH_EAGLE_PLUGIN::moveLabels(), SCH_EDITOR_CONTROL::nextMatch(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), DIALOG_ERC::OnERCItemRClick(), SCH_ALTIUM_PLUGIN::ParseAltiumSch(), SCH_EDITOR_CONTROL::Paste(), Plot(), Print(), DIALOG_CHANGE_SYMBOLS::processMatchingSymbols(), EE_SELECTION_TOOL::RebuildSelection(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), Remove(), SCH_EDITOR_CONTROL::RepairSchematic(), SCH_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SetConnectivityDirty(), SetLegacySymbolInstanceData(), SCH_EDIT_FRAME::setupUIConditions(), SCH_SHEET::SymbolCount(), TestDanglingEnds(), ERC_TESTER::TestDuplicateSheetNames(), DIALOG_ERC::testErc(), ERC_TESTER::TestTextVars(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires(), SCH_EDIT_FRAME::TrimWire(), SCH_DRAWING_TOOLS::TwoClickPlace(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), SCH_EDITOR_CONTROL::UpdateFind(), UpdateLocalLibSymbolLinks(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), SCH_EDITOR_CONTROL::updatePastedSheet(), SCH_SHEET_LIST::UpdateSymbolInstances(), UpdateSymbolLinks(), SIM_PLOT_FRAME::UpdateTunerValue(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ Items() [2/2]

const EE_RTREE & SCH_SCREEN::Items ( ) const
inline

Definition at line 110 of file sch_screen.h.

110{ return m_rtree; }

References m_rtree.

◆ IterateForward() [1/2]

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

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

Definition at line 304 of file eda_item.h.

306 {
307 for( const auto& it : aList )
308 {
309 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
310 testData,
311 scanTypes ) == INSPECT_RESULT::QUIT )
312 {
314 }
315 }
316
318 }
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
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 INSPECT_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  scanTypes 
)
inlinestaticinherited

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

Definition at line 324 of file eda_item.h.

326 {
327 for( const auto& it : aList )
328 {
329 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
330 testData,
331 scanTypes ) == INSPECT_RESULT::QUIT )
332 {
334 }
335 }
336
338 }

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

◆ MarkConnections()

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

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

Parameters
aSegmentThe segment to test for connections.

Definition at line 353 of file sch_screen.cpp.

354{
355#define PROCESSED CANDIDATE // Don't use SKIP_STRUCT; IsConnected() returns false if it's set.
356
357 std::set<SCH_ITEM*> retval;
358 std::stack<SCH_LINE*> to_search;
359
360 wxCHECK_MSG( aSegment && aSegment->Type() == SCH_LINE_T, retval, wxT( "Invalid pointer." ) );
361
362 to_search.push( aSegment );
363
364 while( !to_search.empty() )
365 {
366 SCH_ITEM* item = to_search.top();
367 to_search.pop();
368
369 if( item->HasFlag( PROCESSED ) )
370 continue;
371
372 item->SetFlags( PROCESSED );
373
374 for( SCH_ITEM* candidate : Items().Overlapping( SCH_LINE_T, item->GetBoundingBox() ) )
375 {
376 SCH_LINE* line = static_cast<SCH_LINE*>( candidate );
377
378 if( line->HasFlag( PROCESSED ) )
379 continue;
380
381 // Skip connecting lines on different layers (e.g. buses)
382 if( item->GetLayer() != line->GetLayer() )
383 continue;
384
385 for( VECTOR2I pt : { line->GetStartPoint(), line->GetEndPoint() } )
386 {
387 if( item->IsConnected( pt ) )
388 {
389 SCH_ITEM* junction = GetItem( pt, 0, SCH_JUNCTION_T );
390 SCH_ITEM* pin = GetItem( pt, 0, SCH_PIN_T );
391
392 if( item->IsSelected() && aSecondPass )
393 {
394 if( junction )
395 retval.insert( junction );
396
397 retval.insert( line );
398 to_search.push( line );
399 }
400 else if( !junction && !pin )
401 {
402 retval.insert( line );
403 to_search.push( line );
404 }
405
406 break;
407 }
408 }
409 }
410 }
411
412 for( SCH_ITEM* item : Items() )
413 item->ClearTempFlags();
414
415 return retval;
416}
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:74
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:142
void ClearTempFlags()
Definition: eda_item.h:155
bool IsSelected() const
Definition: eda_item.h:107
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
Definition: eda_item.h:145
#define PROCESSED
@ SCH_PIN_T
Definition: typeinfo.h:159

References EDA_ITEM::GetBoundingBox(), SCH_LINE::GetEndPoint(), GetItem(), SCH_ITEM::GetLayer(), SCH_LINE::GetStartPoint(), EDA_ITEM::HasFlag(), SCH_ITEM::IsConnected(), EDA_ITEM::IsSelected(), Items(), pin, PROCESSED, SCH_JUNCTION_T, SCH_LINE_T, SCH_PIN_T, EDA_ITEM::SetFlags(), and EDA_ITEM::Type().

Referenced by EE_SELECTION_TOOL::SelectConnection().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( const EDA_SEARCH_DATA 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_MARKER, LIB_TEXTBOX, SCH_FIELD, SCH_LABEL_BASE, SCH_PIN, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, FP_TEXT, FP_TEXTBOX, NETINFO_ITEM, PCB_MARKER, PCB_TEXT, PCB_TEXTBOX, and ZONE.

Definition at line 384 of file eda_item.h.

385 {
386 return false;
387 }

Referenced by SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_EDITOR_CONTROL::HasMatch(), SCH_MARKER::Matches(), LIB_TEXTBOX::Matches(), SCH_FIELD::Matches(), SCH_LABEL_BASE::Matches(), SCH_PIN::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_TEXTBOX::Matches(), FP_TEXT::Matches(), FP_TEXTBOX::Matches(), NETINFO_ITEM::Matches(), PCB_MARKER::Matches(), PCB_TEXT::Matches(), PCB_TEXTBOX::Matches(), ZONE::Matches(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
const EDA_SEARCH_DATA 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 117 of file eda_item.cpp.

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

References EDA_SEARCH_DATA::findString, EDA_ITEM::IsReplaceable(), EDA_SEARCH_DATA::matchCase, EDA_SEARCH_DATA::matchMode, next(), EDA_SEARCH_DATA::searchAndReplace, text, WHOLEWORD, and WILDCARD.

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

232{
233 wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
234 GetClass() ) );
235
236 return false;
237}
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

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

◆ Plot()

void SCH_SCREEN::Plot ( PLOTTER aPlotter) const

Plot all the schematic objects to aPlotter.

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

Sort to ensure plot-order consistency with screen drawing

Definition at line 1074 of file sch_screen.cpp.

1075{
1076 // Ensure links are up to date, even if a library was reloaded for some reason:
1077 std::vector<SCH_ITEM*> junctions;
1078 std::vector<SCH_ITEM*> bitmaps;
1079 std::vector<SCH_SYMBOL*> symbols;
1080 std::vector<SCH_ITEM*> other;
1081
1082 for( SCH_ITEM* item : Items() )
1083 {
1084 if( item->IsMoving() || item->IsResized() )
1085 continue;
1086
1087 if( item->Type() == SCH_JUNCTION_T )
1088 junctions.push_back( item );
1089 else if( item->Type() == SCH_BITMAP_T )
1090 bitmaps.push_back( item );
1091 else
1092 other.push_back( item );
1093
1094 // Where the symbols overlap each other, we need to plot the text items a second
1095 // time to get them on top of the overlapping element. This collection is in addition
1096 // to the symbols already collected in `other`
1097 if( item->Type() == SCH_SYMBOL_T )
1098 {
1099 for( SCH_ITEM* sym : m_rtree.Overlapping( SCH_SYMBOL_T, item->GetBoundingBox() ) )
1100 {
1101 if( sym != item )
1102 {
1103 symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
1104 break;
1105 }
1106 }
1107 }
1108 }
1109
1111 std::sort( other.begin(), other.end(),
1112 []( const SCH_ITEM* a, const SCH_ITEM* b )
1113 {
1114 if( a->Type() == b->Type() )
1115 return a->GetLayer() > b->GetLayer();
1116
1117 return a->Type() > b->Type();
1118 } );
1119
1120 int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth();
1121 constexpr bool background = true;
1122
1123 // Bitmaps are drawn first to ensure they are in the background
1124 // This is particularly important for the wxPostscriptDC (used in *nix printers) as
1125 // the bitmap PS command clears the screen
1126 for( const SCH_ITEM* item : bitmaps )
1127 {
1128 aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
1129 item->Plot( aPlotter, background );
1130 }
1131
1132 for( const SCH_ITEM* item : other )
1133 {
1134 aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
1135 item->Plot( aPlotter, background );
1136 }
1137
1138 for( const SCH_ITEM* item : other )
1139 {
1140 aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
1141 item->Plot( aPlotter, !background );
1142 }
1143
1144 // After plotting the symbols as a group above (in `other`), we need to overplot the pins
1145 // and symbols to ensure that they are always visible
1146 for( const SCH_SYMBOL* sym :symbols )
1147 {
1148 aPlotter->SetCurrentLineWidth( std::max( sym->GetPenWidth(), defaultPenWidth ) );
1149
1150 for( SCH_FIELD field : sym->GetFields() )
1151 field.Plot( aPlotter, false );
1152
1153 sym->PlotPins( aPlotter );
1154 }
1155
1156 for( const SCH_ITEM* item : junctions )
1157 {
1158 aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
1159 item->Plot( aPlotter, !background );
1160 }
1161}
EE_TYPE Overlapping(const BOX2I &aRect) const
Definition: sch_rtree.h:243
int GetDefaultPenWidth() const
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:141
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:50
@ SCH_BITMAP_T
Definition: typeinfo.h:148

References KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), Items(), m_rtree, EE_RTREE::Overlapping(), PLOTTER::RenderSettings(), SCH_BITMAP_T, SCH_JUNCTION_T, SCH_SYMBOL_T, and PLOTTER::SetCurrentLineWidth().

Referenced by SCH_PLOTTER::plotOneSheetDXF(), SCH_PLOTTER::plotOneSheetHpgl(), SCH_PLOTTER::plotOneSheetPDF(), SCH_PLOTTER::plotOneSheetPS(), and SCH_PLOTTER::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 1030 of file sch_screen.cpp.

1031{
1032 // Ensure links are up to date, even if a library was reloaded for some reason:
1033 std::vector<SCH_ITEM*> junctions;
1034 std::vector<SCH_ITEM*> bitmaps;
1035 std::vector<SCH_ITEM*> other;
1036
1037 for( SCH_ITEM* item : Items() )
1038 {
1039 if( item->IsMoving() || item->IsResized() )
1040 continue;
1041
1042 if( item->Type() == SCH_JUNCTION_T )
1043 junctions.push_back( item );
1044 else if( item->Type() == SCH_BITMAP_T )
1045 bitmaps.push_back( item );
1046 else
1047 other.push_back( item );
1048 }
1049
1051 std::stable_sort( other.begin(), other.end(),
1052 []( const SCH_ITEM* a, const SCH_ITEM* b )
1053 {
1054 if( a->Type() == b->Type() )
1055 return a->GetLayer() > b->GetLayer();
1056
1057 return a->Type() < b->Type();
1058 } );
1059
1060 for( SCH_ITEM* item : bitmaps )
1061 item->Print( aSettings, VECTOR2I( 0, 0 ) );
1062
1063 for( SCH_ITEM* item : other )
1064 item->PrintBackground( aSettings, VECTOR2I( 0, 0 ) );
1065
1066 for( SCH_ITEM* item : other )
1067 item->Print( aSettings, VECTOR2I( 0, 0 ) );
1068
1069 for( SCH_ITEM* item : junctions )
1070 item->Print( aSettings, VECTOR2I( 0, 0 ) );
1071}

References Items(), SCH_BITMAP_T, and SCH_JUNCTION_T.

Referenced by SCH_EDIT_FRAME::PrintPage(), and SCH_PRINTOUT::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 268 of file sch_screen.cpp.

269{
270 bool retv = m_rtree.remove( aItem );
271
272 // Check if the library symbol for the removed schematic symbol is still required.
273 if( retv && aItem->Type() == SCH_SYMBOL_T )
274 {
275 SCH_SYMBOL* removedSymbol = static_cast<SCH_SYMBOL*>( aItem );
276
277 bool removeUnusedLibSymbol = true;
278
279 for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
280 {
281 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
282
283 if( removedSymbol->GetSchSymbolLibraryName() == symbol->GetSchSymbolLibraryName() )
284 {
285 removeUnusedLibSymbol = false;
286 break;
287 }
288 }
289
290 if( removeUnusedLibSymbol )
291 {
292 auto it = m_libSymbols.find( removedSymbol->GetSchSymbolLibraryName() );
293
294 if( it != m_libSymbols.end() )
295 {
296 delete it->second;
297 m_libSymbols.erase( it );
298 }
299 }
300 }
301
302 return retv;
303}
bool remove(SCH_ITEM *aItem)
Remove an item from the tree.
Definition: sch_rtree.h:78

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

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

◆ RenderAsBitmap()

virtual bool EDA_ITEM::RenderAsBitmap ( double  aWorldScale) const
inlinevirtualinherited

Reimplemented in SCH_ITEM.

Definition at line 165 of file eda_item.h.

165{ return false; }

◆ Replace() [1/2]

virtual bool EDA_ITEM::Replace ( const EDA_SEARCH_DATA 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 LIB_TEXTBOX, SCH_LABEL_BASE, SCH_PIN, SCH_TEXT, SCH_TEXTBOX, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 411 of file eda_item.h.

412 {
413 return false;
414 }

◆ Replace() [2/2]

bool EDA_ITEM::Replace ( const EDA_SEARCH_DATA 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 168 of file eda_item.cpp.

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

References EDA_SEARCH_DATA::findString, EDA_SEARCH_DATA::matchCase, EDA_SEARCH_DATA::matchMode, next(), EDA_SEARCH_DATA::replaceString, text, and WHOLEWORD.

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

◆ Schematic()

SCHEMATIC * SCH_SCREEN::Schematic ( ) const

◆ Set() [1/3]

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

Definition at line 66 of file inspectable.h.

67 {
69 TYPE_ID thisType = TYPE_HASH( *this );
70 PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71 void* object = nullptr;
72
73 if( prop )
74 {
75 object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76
77 if( object )
78 prop->set<T>( object, aValue );
79 }
80
81 return object != nullptr;
82 }
void set(void *aObject, T aValue)
Definition: property.h:275

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

◆ Set() [2/3]

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

Definition at line 54 of file inspectable.h.

55 {
57 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
58
59 if( object )
60 aProperty->set<T>( object, aValue );
61
62 return object != nullptr;
63 }

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

◆ Set() [3/3]

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

Definition at line 42 of file inspectable.h.

43 {
45 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
46
47 if( object )
48 aProperty->setter( object, aValue );
49
50 return object != nullptr;
51 }
virtual void setter(void *aObject, wxAny &aValue)=0

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

Referenced by PCB_PROPERTIES_PANEL::valueChanged().

◆ SetAuxOrigin()

void SCH_SCREEN::SetAuxOrigin ( const VECTOR2I aPosition)
inline

Definition at line 153 of file sch_screen.h.

153{ m_aux_origin = aPosition; }

References m_aux_origin.

◆ SetBrightened()

◆ SetConnectivityDirty()

void SCH_SCREEN::SetConnectivityDirty ( )

Definition at line 1023 of file sch_screen.cpp.

1024{
1025 for( SCH_ITEM* item : Items() )
1026 item->SetConnectivityDirty( true );
1027}

References Items().

Referenced by SCH_EDIT_FRAME::OnModify().

◆ SetContentModified()

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

Definition at line 59 of file base_screen.h.

59{ m_flagModified = aModified; }

References BASE_SCREEN::m_flagModified.

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

◆ SetFileExists()

void SCH_SCREEN::SetFileExists ( bool  aFileExists)
inline

◆ SetFileFormatVersionAtLoad()

void SCH_SCREEN::SetFileFormatVersionAtLoad ( int  aVersion)
inline

Definition at line 128 of file sch_screen.h.

128{ m_fileFormatVersionAtLoad = aVersion; }

References m_fileFormatVersionAtLoad.

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ SetFileName()

void SCH_SCREEN::SetFileName ( const wxString &  aFileName)

Set the file name for this screen to aFileName.

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

Definition at line 106 of file sch_screen.cpp.

107{
108 wxASSERT( aFileName.IsEmpty() || wxIsAbsolutePath( aFileName ) );
109
110 m_fileName = aFileName;
111}

References m_fileName.

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

◆ SetFileReadOnly()

void SCH_SCREEN::SetFileReadOnly ( bool  aIsReadOnly)
inline

Definition at line 146 of file sch_screen.h.

146{ m_isReadOnly = aIsReadOnly; }

References m_isReadOnly.

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

◆ SetFlags()

void EDA_ITEM::SetFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 142 of file eda_item.h.

142{ m_flags |= aMask; }

References EDA_ITEM::m_flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddFootprintToBoard(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_ALTIUM_PLUGIN::AddTextBox(), SCH_MOVE_TOOL::AlignElements(), PCB_CONTROL::AppendBoard(), FOOTPRINT::BuildCourtyardCaches(), SCH_EDIT_TOOL::ChangeTextType(), GRAPHICS_CLEANER::cleanupShapes(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), SCH_DRAWING_TOOLS::createSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::EnterGroup(), PAD_TOOL::explodePad(), SCH_MOVE_TOOL::getConnectedDragItems(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), EE_COLLECTOR::Inspect(), CONVERT_TOOL::makePolysFromChainedSegs(), CONVERT_TOOL::makePolysFromClosedGraphics(), CONVERT_TOOL::makePolysFromOpenGraphics(), MarkConnections(), TRACKS_CLEANER::mergeCollinearSegments(), SCH_MOVE_TOOL::moveItem(), SYMBOL_EDITOR_MOVE_TOOL::moveItem(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_MOVE_TOOL::orthoLineDrag(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseHarnessPort(), SCH_ALTIUM_PLUGIN::ParseJunction(), SCH_ALTIUM_PLUGIN::ParseLabel(), SCH_ALTIUM_PLUGIN::ParseLine(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseNoERC(), SCH_ALTIUM_PLUGIN::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseSignalHarness(), SCH_ALTIUM_PLUGIN::ParseWire(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), SCH_SYMBOL::Plot(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_SELECTION_TOOL::RebuildSelection(), BOARD::Remove(), FOOTPRINT::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::SelectAll(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetIsShownAsBitmap(), 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_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_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 201 of file eda_item.h.

201{ m_forceVisible = aEnable; }

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetIsShownAsBitmap()

void EDA_ITEM::SetIsShownAsBitmap ( bool  aBitmap)
inlineinherited

Definition at line 167 of file eda_item.h.

168 {
169 if( aBitmap )
171 else
173 }

References EDA_ITEM::ClearFlags(), IS_SHOWN_AS_BITMAP, and EDA_ITEM::SetFlags().

◆ SetLegacySymbolInstanceData()

void SCH_SCREEN::SetLegacySymbolInstanceData ( )

Update the symbol value and footprint instance data for legacy designs.

Definition at line 1426 of file sch_screen.cpp.

1427{
1428 for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
1429 {
1430 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
1431
1432 // Add missing value and footprint instance data for legacy schematics.
1433 for( const SYMBOL_INSTANCE_REFERENCE& instance : symbol->GetInstanceReferences() )
1434 {
1435 symbol->AddHierarchicalReference( instance.m_Path, instance.m_Reference,
1436 instance.m_Unit );
1437 }
1438 }
1439}
const std::vector< SYMBOL_INSTANCE_REFERENCE > & GetInstanceReferences()
Definition: sch_symbol.h:139
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit)
Add a full hierarchical reference to this symbol.
Definition: sch_symbol.cpp:522
A simple container for schematic symbol instance information.

References SCH_SYMBOL::AddHierarchicalReference(), SCH_SYMBOL::GetInstanceReferences(), Items(), and SCH_SYMBOL_T.

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ SetModified()

◆ SetPageCount()

void BASE_SCREEN::SetPageCount ( int  aPageCount)
inherited

Definition at line 63 of file base_screen.cpp.

64{
65 wxCHECK( aPageCount > 0, /* void */ );
66
67 m_pageCount = aPageCount;
68}

References BASE_SCREEN::m_pageCount.

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

◆ SetPageNumber()

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

◆ SetPageSettings()

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in LIB_SYMBOL, and PCB_DIMENSION_BASE.

Definition at line 100 of file eda_item.h.

100{ m_parent = aParent; }

References EDA_ITEM::m_parent.

Referenced by BOARD::Add(), FOOTPRINT::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewFootprint(), SCH_SHEET::AddPin(), PAD::AddPrimitive(), PAD::AddPrimitiveAnnotationBox(), PAD::AddPrimitiveArc(), PAD::AddPrimitiveCircle(), PAD::AddPrimitiveCurve(), PAD::AddPrimitivePoly(), PAD::AddPrimitiveRect(), PAD::AddPrimitiveSegment(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), Append(), LIB_FIELD::Copy(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_SYMBOL::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_PLUGIN::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), LIB_SYMBOL::LIB_SYMBOL(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), LIB_SYMBOL::operator=(), FOOTPRINT::operator=(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PCB_CONTROL::Paste(), pasteFootprintItemsToFootprintEditor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BACK_ANNOTATE::processNetNameChange(), BOARD_COMMIT::Push(), SCH_LIB_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), SaveCopyOfZones(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET_PIN::SCH_SHEET_PIN(), LIB_SYMBOL::SetFields(), PCB_DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_LABEL_BASE::SwapData(), SCH_SHEET::SwapData(), SCH_SYMBOL::SwapData(), BOARD_ITEM::SwapItemData(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetPosition()

◆ SetSelected()

◆ SetState()

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

Definition at line 131 of file eda_item.h.

132 {
133 if( state )
134 m_status |= type; // state = ON or OFF
135 else
136 m_status &= ~type;
137 }

References EDA_ITEM::m_status.

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

◆ SetStatus()

void EDA_ITEM::SetStatus ( EDA_ITEM_FLAGS  aStatus)
inlineinherited

Definition at line 140 of file eda_item.h.

140{ m_status = aStatus; }

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

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 117 of file eda_item.h.

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

440{ return *aLeft < *aRight; }

◆ TestDanglingEnds()

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

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

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

Definition at line 1317 of file sch_screen.cpp.

1319{
1320 std::vector<DANGLING_END_ITEM> endPoints;
1321
1322 for( SCH_ITEM* item : Items() )
1323 {
1324 if( item->IsConnectable() )
1325 {
1326 endPoints.clear();
1327
1328 for( SCH_ITEM* overlapping : Items().Overlapping( item->GetBoundingBox() ) )
1329 overlapping->GetEndPoints( endPoints );
1330
1331 if( item->UpdateDanglingState( endPoints, aPath ) )
1332 {
1333 if( aChangedHandler )
1334 (*aChangedHandler)( item );
1335 }
1336 }
1337 }
1338}

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

97{ return m_structType; }

References EDA_ITEM::m_structType.

Referenced by CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), FOOTPRINT::Add(), CN_CLUSTER::Add(), KIGFX::PCB_VIEW::Add(), PCB_POINT_EDITOR::addCorner(), PCB_GROUP::AddItem(), CONNECTION_SUBGRAPH::AddItem(), DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), SCH_MOVE_TOOL::AlignElements(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), Append(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PNS::TOPOLOGY::AssembleTuningPath(), SCH_LABEL_BASE::AutoplaceFields(), EE_SELECTION_TOOL::autostartEvent(), DIALOG_NET_INSPECTOR::buildNewItem(), SCH_SCREENS::buildScreenList(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PCB_POINT_EDITOR::canAddCorner(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_JUNCTION::CanConnect(), SCH_LABEL_BASE::CanConnect(), SCH_LINE::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_SHEET::CanConnect(), SCH_SYMBOL::CanConnect(), SCH_EDIT_TOOL::ChangeTextType(), KI_TEST::CheckFootprint(), KI_TEST::CheckFpPad(), KI_TEST::CheckFpShape(), KI_TEST::CheckFpText(), KI_TEST::CheckFpZone(), CN_VISITOR::checkZoneItemConnection(), LIB_TEXTBOX::ClassOf(), SCH_BITMAP::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), SCH_FIELD::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_LABEL::ClassOf(), SCH_DIRECTIVE_LABEL::ClassOf(), SCH_GLOBALLABEL::ClassOf(), SCH_HIERLABEL::ClassOf(), SCH_LINE::ClassOf(), SCH_MARKER::ClassOf(), SCH_NO_CONNECT::ClassOf(), SCH_PIN::ClassOf(), ClassOf(), SCH_SHEET::ClassOf(), SCH_SHEET_PIN::ClassOf(), SCH_SYMBOL::ClassOf(), SCH_TEXT::ClassOf(), SCH_TEXTBOX::ClassOf(), PCB_GROUP::ClassOf(), BOARD::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), FOOTPRINT::ClassOf(), FP_SHAPE::ClassOf(), FP_TEXT::ClassOf(), FP_TEXTBOX::ClassOf(), NETINFO_ITEM::ClassOf(), PAD::ClassOf(), PCB_BITMAP::ClassOf(), PCB_DIM_ALIGNED::ClassOf(), PCB_DIM_ORTHOGONAL::ClassOf(), PCB_DIM_RADIAL::ClassOf(), PCB_DIM_LEADER::ClassOf(), PCB_DIM_CENTER::ClassOf(), PCB_MARKER::ClassOf(), PCB_SHAPE::ClassOf(), PCB_TARGET::ClassOf(), PCB_TEXT::ClassOf(), PCB_TEXTBOX::ClassOf(), PCB_TRACK::ClassOf(), PCB_ARC::ClassOf(), PCB_VIA::ClassOf(), ZONE::ClassOf(), CONNECTION_GRAPH::collectAllDriverValues(), collidesWithArea(), LIB_ITEM::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_TEXT::compare(), LIB_TEXTBOX::compare(), LIB_SYMBOL::Compare(), PCB_GRID_HELPER::computeAnchors(), EE_GRID_HELPER::computeAnchors(), TEARDROP_MANAGER::ComputePointsOnPadVia(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), SCH_LINE::ConnectionPropagatesTo(), EE_RTREE::contains(), BOARD::ConvertKIIDsToCrossReferences(), SCHEMATIC::ConvertKIIDsToRefs(), PAD_TOOL::copyPadSettings(), FOOTPRINT::CoverageRatio(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewText(), ZONE_CREATE_HELPER::createNewZone(), BOARD_ADAPTER::createTrack(), DRC_TOOL::CrossProbe(), DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES(), BOARD_COMMIT::dirtyIntersectingZones(), 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(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawDimension(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawVia(), CONNECTION_SUBGRAPH::driverName(), CN_ITEM::Dump(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), EDA_ITEM_DESC::EDA_ITEM_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_EDIT_TOOL::editTextBoxProperties(), SYMBOL_EDITOR_EDIT_TOOL::editTextProperties(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), DRC_ENGINE::EvalRules(), DRC_ENGINE::EvalZoneConnection(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectorForFreePads(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), PCB_SELECTION_TOOL::FilterCollectorForMarkers(), PCB_SELECTION_TOOL::FindItem(), NETLIST_EXPORTER_BASE::findNextSymbol(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), PCB_BASE_FRAME::FocusOnItems(), EDIT_TOOL::FootprintFilter(), PCB_PLUGIN::Format(), PCB_PLUGIN::format(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), FormatProbeItem(), FP_TEXT::FP_TEXT(), PCB_POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), SCH_LABEL_BASE::GetBoundingBox(), PCB_TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), getClosestGroup(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_MOVE_TOOL::getConnectedItems(), FOOTPRINT::GetCoverageArea(), CONNECTION_GRAPH::getDefaultConnection(), SCH_FIELD::GetDrawRotation(), getDrilledHoleShape(), CONNECTION_SUBGRAPH::GetDriverPriority(), getFieldFunc(), getInferredSymbols(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), getMinDist(), SCH_LABEL_BASE::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTION_SUBGRAPH::GetNetclassForDriver(), CONNECTIVITY_DATA::GetNetItems(), LIB_SYMBOL::GetNextDrawItem(), BOARD_ITEM::GetParentFootprint(), LIB_SYMBOL::GetPin(), SCH_SYMBOL::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), KIGFX::SCH_PAINTER::getRenderColor(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), PCB_TRACK::GetSelectMenuText(), SCH_FIELD::GetShownText(), PCB_TEXT::GetShownText(), PCB_TEXTBOX::GetShownText(), CONVERT_TOOL::getStartEndPoints(), KIGFX::SCH_PAINTER::getTextThickness(), EDA_ITEM::GetTypeDesc(), PCB_EXPR_TYPE_REF::GetValue(), PCB_SELECTION_TOOL::grabUnconnected(), GROUP_TOOL::Group(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), hasDrilledHole(), hash_fp_item(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlightInternal(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::highlightNet(), highlightNet(), SCH_FIELD::HitTest(), SCH_LABEL_BASE::HitTest(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRC_RTREE::Insert(), EE_RTREE::insert(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::InspectDRCError(), ARRAY_CREATOR::Invoke(), CONNECTIVITY_DATA::IsConnectedOnLayer(), isCopper(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), PNS_KICAD_IFACE_BASE::IsFlashedOnLayer(), CADSTAR_PCB_ARCHIVE_LOADER::isFootprint(), SCH_FIELD::IsHypertext(), isKeepoutZone(), isMaskAperture(), isNPTHPad(), PCB_TRACK::IsNull(), isNullAperture(), SCH_LINE::IsParallel(), isPlatedFunc(), SCH_FIELD::IsReplaceable(), PNS::ROUTER::isStartingPointRoutable(), SCH_ITEM::IsType(), itemIsIncludedByFilter(), PCB_SELECTION_TOOL::itemPassesFilter(), CLIPBOARD_IO::Load(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeListOfNets(), PCB_POINT_EDITOR::makePoints(), CONVERT_TOOL::makePolysFromChainedSegs(), MarkConnections(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), SCH_FIELD::Matches(), memberOfFunc(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), SCH_EDITOR_CONTROL::nextMatch(), DIALOG_DRC::OnDRCItemSelected(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), BOARD::cmp_items::operator()(), BOARD::cmp_drawings::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), KI_TEST::kitest_cmp_drawings::operator()(), PCB_TRACK::cmp_tracks::operator()(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_BUS_ENTRY_BASE::operator<(), SCH_FIELD::operator<(), SCH_JUNCTION::operator<(), SCH_LINE::operator<(), SCH_SHEET::operator<(), SCH_SYMBOL::operator<(), SCH_TEXT::operator<(), SCH_TEXTBOX::operator<(), PCB_BITMAP::operator=(), SCH_BITMAP::operator=(), SCH_SYMBOL::operator=(), SCH_SHEET::operator=(), LIB_ITEM::operator==(), PAD::PAD(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), SCH_SEXPR_PARSER::parseSchField(), SCH_EDITOR_CONTROL::Paste(), PCB_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), SCH_LABEL_BASE::Plot(), BRDITEMS_PLOTTER::PlotPcbGraphicItem(), SCH_FIELD::Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BACK_ANNOTATE::processNetNameChange(), CONNECTION_GRAPH::processSubGraphs(), SCH_EDIT_TOOL::Properties(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), PCB_GRID_HELPER::queryVisible(), BOARD_REANNOTATE_TOOL::ReannotateDuplicates(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshZoomDependentItems(), BOARD::Remove(), CN_CONNECTIVITY_ALGO::Remove(), FOOTPRINT::Remove(), EE_RTREE::remove(), Remove(), KIGFX::PCB_VIEW::Remove(), PCB_POINT_EDITOR::removeCorner(), PCB_POINT_EDITOR::removeCornerCondition(), LIB_SYMBOL::RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), SCH_EDITOR_CONTROL::ReplaceAll(), PCB_SELECTION_TOOL::RequestSelection(), CONNECTION_GRAPH::resolveAllDrivers(), SCHEMATIC::ResolveCrossReference(), PCB_PARSER::resolveGroups(), SCH_LABEL_BASE::ResolveTextVar(), DS_PROXY_UNDO_ITEM::Restore(), BOARD_COMMIT::Revert(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), EE_TOOL_BASE< T >::saveCopyInUndoList(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePin(), CLIPBOARD_IO::SaveSelection(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveTextBox(), SCH_ITEM::Schematic(), Schematic(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_SELECTION_TOOL::selectUnconnected(), PCB_POINT_EDITOR::setAltConstraint(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::ShowFindDialog(), SCH_EDIT_FRAME::ShowFindReplaceDialog(), BOARD_COMMIT::Stage(), PNS::LINE_PLACER::Start(), SCH_EDIT_TOOL::Swap(), PCB_GROUP::swapData(), FOOTPRINT::swapData(), PAD::swapData(), PCB_DIM_ALIGNED::swapData(), PCB_DIM_ORTHOGONAL::swapData(), PCB_DIM_RADIAL::swapData(), PCB_DIM_LEADER::swapData(), PCB_DIM_CENTER::swapData(), PCB_TARGET::swapData(), PCB_TEXT::swapData(), PCB_TEXTBOX::swapData(), PCB_TRACK::swapData(), PCB_ARC::swapData(), PCB_VIA::swapData(), ZONE::swapData(), PCB_BITMAP::swapData(), SCH_BITMAP::SwapData(), SCH_FIELD::SwapData(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_SHEET::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_SYMBOL::SwapData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), ERC_TESTER::TestMultUnitPinConflicts(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_FIELDS_TABLE::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), PCB_TRACK::TransformShapeToPolygon(), SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), SCH_SHEET_PATH::UpdateAllScreenReferences(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_SCH_FIELD_PROPERTIES::UpdateField(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< T >::updateItem(), SCH_BASE_FRAME::UpdateItem(), PCB_CONTROL::UpdateMessagePanel(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), SCH_EDITOR_CONTROL::updatePastedSheet(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), SCH_SHEET::Visit(), GERBER_DRAW_ITEM::Visit(), PCB_TRACK::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 261 of file sch_screen.cpp.

262{
263 if( Remove( aItem ) )
264 Append( aItem );
265}

References Append(), and Remove().

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

◆ UpdateLocalLibSymbolLinks()

void SCH_SCREEN::UpdateLocalLibSymbolLinks ( )

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

Definition at line 997 of file sch_screen.cpp.

998{
999 std::vector<SCH_SYMBOL*> symbols;
1000
1001 for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
1002 symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
1003
1004 for( SCH_SYMBOL* symbol : symbols )
1005 {
1006 // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
1007 m_rtree.remove( symbol );
1008
1009 auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
1010
1011 LIB_SYMBOL* libSymbol = nullptr;
1012
1013 if( it != m_libSymbols.end() )
1014 libSymbol = new LIB_SYMBOL( *it->second );
1015
1016 symbol->SetLibSymbol( libSymbol );
1017
1018 m_rtree.insert( symbol );
1019 }
1020}

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

Referenced by SCH_SEXPR_PARSER::ParseSchematic().

◆ UpdateSymbolLinks()

void SCH_SCREEN::UpdateSymbolLinks ( REPORTER aReporter = nullptr)

Initialize the LIB_SYMBOL reference for each SCH_SYMBOL found in this schematic from the project SYMBOL_LIB_TABLE.

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

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

Definition at line 843 of file sch_screen.cpp.

844{
845 wxCHECK_RET( Schematic(), "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
846
847 wxString msg;
848 std::unique_ptr< LIB_SYMBOL > libSymbol;
849 std::vector<SCH_SYMBOL*> symbols;
850 SYMBOL_LIB_TABLE* libs = Schematic()->Prj().SchSymbolLibTable();
851
852 // This will be a nullptr if an s-expression schematic is loaded.
853 SYMBOL_LIBS* legacyLibs = Schematic()->Prj().SchLibs();
854
855 for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
856 symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
857
858 // Remove them from the R tree. There bounding box size may change.
859 for( SCH_SYMBOL* symbol : symbols )
860 Remove( symbol );
861
862 // Clear all existing symbol links.
864
865 for( SCH_SYMBOL* symbol : symbols )
866 {
867 LIB_SYMBOL* tmp = nullptr;
868 libSymbol.reset();
869
870 // If the symbol is already in the internal library, map the symbol to it.
871 auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
872
873 if( ( it != m_libSymbols.end() ) )
874 {
875 if( aReporter )
876 {
877 msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
878 symbol->GetField( REFERENCE_FIELD )->GetText(),
879 symbol->GetField( VALUE_FIELD )->GetText(),
880 UnescapeString( symbol->GetLibId().Format() ) );
881 aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
882 }
883
884 // Internal library symbols are already flattened so just make a copy.
885 symbol->SetLibSymbol( new LIB_SYMBOL( *it->second ) );
886 continue;
887 }
888
889 if( !symbol->GetLibId().IsValid() )
890 {
891 if( aReporter )
892 {
893 msg.Printf( _( "Schematic symbol reference '%s' library identifier is not valid. "
894 "Unable to link library symbol." ),
895 UnescapeString( symbol->GetLibId().Format() ) );
896 aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
897 }
898
899 continue;
900 }
901
902 // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the library nickname
903 // is not found in the table so check if the library still exists in the table
904 // before attempting to load the symbol.
905 if( !libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) && !legacyLibs )
906 {
907 if( aReporter )
908 {
909 msg.Printf( _( "Symbol library '%s' not found and no fallback cache library "
910 "available. Unable to link library symbol." ),
911 symbol->GetLibId().GetLibNickname().wx_str() );
912 aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
913 }
914
915 continue;
916 }
917
918 if( libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) )
919 {
920 try
921 {
922 tmp = libs->LoadSymbol( symbol->GetLibId() );
923 }
924 catch( const IO_ERROR& ioe )
925 {
926 if( aReporter )
927 {
928 msg.Printf( _( "I/O error %s resolving library symbol %s" ), ioe.What(),
929 UnescapeString( symbol->GetLibId().Format() ) );
930 aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
931 }
932 }
933 }
934
935 if( !tmp && legacyLibs && legacyLibs->GetLibraryCount() )
936 {
937 SYMBOL_LIB& legacyCacheLib = legacyLibs->back();
938
939 // It better be the cache library.
940 wxCHECK2( legacyCacheLib.IsCache(), continue );
941
942 wxString id = symbol->GetLibId().Format();
943
944 id.Replace( ':', '_' );
945
946 if( aReporter )
947 {
948 msg.Printf( _( "Falling back to cache to set symbol '%s:%s' link '%s'." ),
949 symbol->GetField( REFERENCE_FIELD )->GetText(),
950 symbol->GetField( VALUE_FIELD )->GetText(),
951 UnescapeString( id ) );
952 aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
953 }
954
955 tmp = legacyCacheLib.FindSymbol( id );
956 }
957
958 if( tmp )
959 {
960 // We want a full symbol not just the top level child symbol.
961 libSymbol = tmp->Flatten();
962 libSymbol->SetParent();
963
964 m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
965 new LIB_SYMBOL( *libSymbol.get() ) } );
966
967 if( aReporter )
968 {
969 msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
970 symbol->GetField( REFERENCE_FIELD )->GetText(),
971 symbol->GetField( VALUE_FIELD )->GetText(),
972 UnescapeString( symbol->GetLibId().Format() ) );
973 aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
974 }
975 }
976 else
977 {
978 if( aReporter )
979 {
980 msg.Printf( _( "No library symbol found for schematic symbol '%s %s'." ),
981 symbol->GetField( REFERENCE_FIELD )->GetText(),
982 symbol->GetField( VALUE_FIELD )->GetText() );
983 aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
984 }
985 }
986
987 symbol->SetLibSymbol( libSymbol.release() );
988 }
989
990 // Changing the symbol may adjust the bbox of the symbol. This re-inserts the
991 // item with the new bbox
992 for( SCH_SYMBOL* symbol : symbols )
993 Append( symbol );
994}
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:76
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:76
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:88
A collection of SYMBOL_LIB objects.
int GetLibraryCount()
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
Object used to load, save, search, and otherwise manipulate symbol library files.
bool IsCache() const
LIB_SYMBOL * FindSymbol(const wxString &aName) const
Find LIB_SYMBOL by aName.
#define _(s)
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_INFO
wxString UnescapeString(const wxString &aSource)
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".

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

◆ ViewBBox()

◆ 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 DS_PROXY_VIEW_ITEM, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, EDIT_POINTS, RATSNEST_VIEW_ITEM, ROUTER_PREVIEW_ITEM, MY_DRAWING, KIGFX::PREVIEW::ARC_ASSISTANT, KIGFX::PREVIEW::RULER_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::ORIGIN_VIEWITEM, KIGFX::VIEW_GROUP, and KIGFX::VIEW_OVERLAY.

Definition at line 106 of file view_item.h.

107 {}

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

◆ ViewGetLayers()

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

Return the all the layers within the VIEW the object is painted on.

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

Parameters
aLayers[]is the output layer index array.
aCountis the number of layer indices in aLayers[].

Implements KIGFX::VIEW_ITEM.

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

Definition at line 261 of file eda_item.cpp.

262{
263 // Basic fallback
264 aCount = 1;
265 aLayers[0] = 0;
266}

◆ 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 GERBER_DRAW_ITEM, PCB_GROUP, FOOTPRINT, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_BITMAP, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, PCB_TRACK, PCB_VIA, ZONE, and FP_ZONE.

Definition at line 132 of file view_item.h.

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

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

◆ viewPrivData()

◆ Visit()

INSPECT_RESULT EDA_ITEM::Visit ( INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  aScanTypes 
)
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 aScanTypes, 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.
aScanTypesWhich KICAD_T types are of interest and the order in which they should be processed.
Returns
#SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, else #SCAN_CONTINUE, and determined by the inspector.

Reimplemented in PCB_GROUP, LIB_SYMBOL, SCH_SHEET, SCH_SYMBOL, GBR_LAYOUT, GERBER_DRAW_ITEM, GERBER_FILE_IMAGE, FOOTPRINT, PCB_TRACK, SCH_LABEL_BASE, and BOARD.

Definition at line 91 of file eda_item.cpp.

93{
94#if 0 && defined(DEBUG)
95 std::cout << GetClass().mb_str() << ' ';
96#endif
97
98 if( IsType( aScanTypes ) )
99 {
100 if( INSPECT_RESULT::QUIT == inspector( this, testData ) )
102 }
103
105}
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition: eda_item.h:183

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

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

Member Data Documentation

◆ m_aliases

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

List of bus aliases stored in this screen.

Definition at line 566 of file sch_screen.h.

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

◆ m_aux_origin

VECTOR2I SCH_SCREEN::m_aux_origin
private

Definition at line 551 of file sch_screen.h.

Referenced by GetAuxOrigin(), and SetAuxOrigin().

◆ m_Center

bool BASE_SCREEN::m_Center
inherited

Center on screen.

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

Definition at line 96 of file base_screen.h.

Referenced by BASE_SCREEN::BASE_SCREEN(), 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 546 of file sch_screen.h.

Referenced by GetClientSheetPaths().

◆ m_DrawingSheetFileName

◆ m_DrawOrg

VECTOR2I BASE_SCREEN::m_DrawOrg
inherited

offsets for drawing the circuit on the screen

Definition at line 88 of file base_screen.h.

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

◆ m_fileExists

bool SCH_SCREEN::m_fileExists
private

Definition at line 563 of file sch_screen.h.

Referenced by FileExists(), and SetFileExists().

◆ m_fileFormatVersionAtLoad

int SCH_SCREEN::m_fileFormatVersionAtLoad
private

Definition at line 536 of file sch_screen.h.

Referenced by GetFileFormatVersionAtLoad(), and SetFileFormatVersionAtLoad().

◆ m_fileName

wxString SCH_SCREEN::m_fileName
private

Definition at line 535 of file sch_screen.h.

Referenced by GetFileName(), and SetFileName().

◆ m_flagModified

bool BASE_SCREEN::m_flagModified
privateinherited

Indicates current drawing has been modified.

Definition at line 132 of file base_screen.h.

Referenced by BASE_SCREEN::BASE_SCREEN(), BASE_SCREEN::IsContentModified(), and BASE_SCREEN::SetContentModified().

◆ m_flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_isReadOnly

bool SCH_SCREEN::m_isReadOnly
private

Read only status of the screen file.

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

Definition at line 560 of file sch_screen.h.

Referenced by IsReadOnly(), and SetFileReadOnly().

◆ m_LastZoomLevel

double SCH_SCREEN::m_LastZoomLevel

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

Definition at line 521 of file sch_screen.h.

Referenced by SCH_NAVIGATE_TOOL::changeSheet(), SCH_EDIT_FRAME::OnPageSettingsChange(), SCH_EDITOR_CONTROL::Revert(), and SCH_SCREEN().

◆ m_libSymbols

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

Library symbols required for this schematic.

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

Referenced by Append(), and SCH_SCREEN().

◆ m_pageCount

int BASE_SCREEN::m_pageCount
protectedinherited

The number of BASE_SCREEN objects in this design.

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

Definition at line 111 of file base_screen.h.

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

◆ m_pageNumber

wxString BASE_SCREEN::m_pageNumber
protectedinherited

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

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

Definition at line 129 of file base_screen.h.

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

◆ m_paper

PAGE_INFO SCH_SCREEN::m_paper
private

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

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

◆ m_rtree

EE_RTREE SCH_SCREEN::m_rtree
private

◆ m_ScrollCenter

VECTOR2D BASE_SCREEN::m_ScrollCenter
inherited

Current scroll center point in logical units.

Definition at line 100 of file base_screen.h.

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

◆ m_sheetInstances

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

◆ m_StartVisu

VECTOR2I BASE_SCREEN::m_StartVisu
inherited

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

Definition at line 93 of file base_screen.h.

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

◆ m_status

◆ m_structType

KICAD_T EDA_ITEM::m_structType
privateinherited

Run time identification, keep private so it can never be changed after a ctor sets it.

See comment near SetType() regarding virtual functions.

Definition at line 507 of file eda_item.h.

Referenced by EDA_ITEM::IsType(), EDA_ITEM::operator=(), and EDA_ITEM::Type().

◆ m_symbolInstances

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

The list of symbol instances loaded from the schematic file.

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

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

Definition at line 585 of file sch_screen.h.

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

◆ m_titles

TITLE_BLOCK SCH_SCREEN::m_titles
private

Definition at line 550 of file sch_screen.h.

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

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

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

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 494 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_SYMBOL::AddHierarchicalReference(), SCH_SHEET::AddInstance(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateSymbols(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), KI_TEST::CheckFpPad(), KI_TEST::CheckFpShape(), KI_TEST::CheckFpText(), KI_TEST::CheckFpZone(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), SCH_EDIT_FRAME::CreateScreens(), ZONE_FILLER_TOOL::DirtyZone(), DRAWING_TOOL::DrawVia(), LIB_SYMBOL::Duplicate(), BOARD_ITEM::Duplicate(), FOOTPRINT::Duplicate(), SCH_ITEM::Duplicate(), FOOTPRINT::DuplicateItem(), PCB_EDIT_FRAME::ExchangeFootprint(), PAD_TOOL::explodePad(), SCH_SHEET_LIST::FillItemMap(), BOARD::FillItemMap(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_PLUGIN::format(), SCH_SEXPR_PLUGIN::Format(), SCH_PIN::GetDefaultNetName(), BOARD::GetItem(), SCH_SHEET_LIST::GetItem(), PAD::GetMsgPanelInfo(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), SCH_SHEET::getPageNumber(), FP_SHAPE::GetParentAsString(), FP_TEXT::GetParentAsString(), FP_TEXTBOX::GetParentAsString(), PAD::GetParentAsString(), SCH_MARKER::GetUUID(), PCB_MARKER::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), ZONE::HigherPriority(), SCH_SHEET_PATH::IsContainedWithin(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), SCH_LEGACY_PLUGIN::loadHierarchy(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic(), LEGACY_PLUGIN::loadTrackList(), PNS::LOGGER::Log(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), BOARD_ITEM::ptr_cmp::operator()(), BOARD::cmp_items::operator()(), BOARD::cmp_drawings::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_zones::operator()(), FOOTPRINT::cmp_pads::operator()(), PCB_TRACK::cmp_tracks::operator()(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), PAD::PAD(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), FIELDS_EDITOR_GRID_DATA_MODEL::RemoveColumn(), SCH_SYMBOL::RemoveInstance(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SYMBOL::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN::saveJunction(), SCH_SEXPR_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveShape(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN::saveTextBox(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), SCH_SYMBOL::SCH_SYMBOL(), RC_ITEM::SetItems(), SCH_SHEET::setPageNumber(), FIELDS_EDITOR_GRID_DATA_MODEL::SetValue(), SCH_DRAWING_TOOLS::SingleClickPlace(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), SCH_EDITOR_CONTROL::updatePastedSheet(), SCH_EDITOR_CONTROL::updatePastedSymbol(), SCH_SHEET_LIST::UpdateSymbolInstances(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ m_viewPrivData

VIEW_ITEM_DATA* KIGFX::VIEW_ITEM::m_viewPrivData
privateinherited

◆ m_virtualPageNumber

int BASE_SCREEN::m_virtualPageNumber
protectedinherited

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

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

Definition at line 119 of file base_screen.h.

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

◆ m_zoomInitialized

bool SCH_SCREEN::m_zoomInitialized
private

◆ SCH_ALTIUM_PLUGIN

friend SCH_SCREEN::SCH_ALTIUM_PLUGIN
private

Definition at line 531 of file sch_screen.h.

◆ SCH_EDIT_FRAME

friend SCH_SCREEN::SCH_EDIT_FRAME
private

Definition at line 528 of file sch_screen.h.

◆ SCH_SEXPR_PARSER

friend SCH_SCREEN::SCH_SEXPR_PARSER
private

Definition at line 529 of file sch_screen.h.

◆ SCH_SEXPR_PLUGIN

friend SCH_SCREEN::SCH_SEXPR_PLUGIN
private

Definition at line 530 of file sch_screen.h.


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