KiCad PCB EDA Suite
SCH_SHEET Class Reference

Sheet symbol placed in a schematic, and is the entry point for a sub schematic. More...

#include <sch_sheet.h>

Inheritance diagram for SCH_SHEET:
SCH_ITEM EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 SCH_SHEET (EDA_ITEM *aParent=nullptr, const VECTOR2I &aPos=VECTOR2I(0, 0), wxSize aSize=wxSize(schIUScale.MilsToIU(MIN_SHEET_WIDTH), schIUScale.MilsToIU(MIN_SHEET_HEIGHT)), FIELDS_AUTOPLACED aAutoplaceFields=FIELDS_AUTOPLACED_AUTO)
 
 SCH_SHEET (const SCH_SHEET &aSheet)
 Copy aSheet into a new object. More...
 
 ~SCH_SHEET ()
 
wxString GetClass () const override
 Return the class name. More...
 
bool IsMovableFromAnchorPoint () const override
 Return true for items which are moved with the anchor point at mouse cursor and false for items moved with no reference to anchor. More...
 
std::vector< SCH_FIELD > & GetFields ()
 
const std::vector< SCH_FIELD > & GetFields () const
 
void SetFields (const std::vector< SCH_FIELD > &aFields)
 Set multiple schematic fields. More...
 
wxString GetName () const
 
SCH_SCREENGetScreen () const
 
wxSize GetSize () const
 
void SetSize (const wxSize &aSize)
 
int GetBorderWidth () const
 
void SetBorderWidth (int aWidth)
 
KIGFX::COLOR4D GetBorderColor () const
 
void SetBorderColor (KIGFX::COLOR4D aColor)
 
KIGFX::COLOR4D GetBackgroundColor () const
 
void SetBackgroundColor (KIGFX::COLOR4D aColor)
 
bool IsRootSheet () const
 
void SetScreen (SCH_SCREEN *aScreen)
 Set the SCH_SCREEN associated with this sheet to aScreen. More...
 
int GetScreenCount () const
 Return the number of times the associated screen for the sheet is being used. More...
 
void GetContextualTextVars (wxArrayString *aVars) const
 Return the list of system text vars & fields for this sheet. More...
 
bool ResolveTextVar (wxString *token, int aDepth=0) const
 Resolve any references to system tokens supported by the sheet. More...
 
void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
 Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
bool IsVerticalOrientation () const
 
void AddPin (SCH_SHEET_PIN *aSheetPin)
 Add aSheetPin to the sheet. More...
 
std::vector< SCH_SHEET_PIN * > & GetPins ()
 
const std::vector< SCH_SHEET_PIN * > & GetPins () const
 
void RemovePin (const SCH_SHEET_PIN *aSheetPin)
 Remove aSheetPin from the sheet. More...
 
void CleanupSheet ()
 Delete sheet label which do not have a corresponding hierarchical label. More...
 
SCH_SHEET_PINGetPin (const VECTOR2I &aPosition)
 Return the sheet pin item found at aPosition in the sheet. More...
 
bool HasPin (const wxString &aName) const
 Checks if the sheet already has a sheet pin named aName. More...
 
bool HasPins () const
 
bool HasUndefinedPins () const
 Check all sheet labels against schematic for undefined hierarchical labels. More...
 
int GetMinWidth (bool aFromLeft) const
 Return the minimum width of the sheet based on the widths of the sheet pin text. More...
 
int GetMinHeight (bool aFromTop) const
 Return the minimum height that the sheet can be resized based on the sheet pin positions. More...
 
int GetPenWidth () const override
 
void Print (const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
 Print a schematic item. More...
 
const BOX2I GetBodyBoundingBox () const
 Return a bounding box for the sheet body but not the fields. More...
 
const BOX2I GetBoundingBox () const override
 Return the orthogonal bounding box of this object for display purposes. More...
 
VECTOR2I GetRotationCenter () const
 Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer than the edge it's on. More...
 
void SwapData (SCH_ITEM *aItem) override
 Swap the internal data structures aItem with the schematic item. More...
 
int SymbolCount () const
 Count our own symbols, without the power symbols. More...
 
bool SearchHierarchy (const wxString &aFilename, SCH_SCREEN **aScreen)
 Search the existing hierarchy for an instance of screen loaded from aFileName. More...
 
bool LocatePathOfScreen (SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
 Search the existing hierarchy for an instance of screen loaded from aFileName. More...
 
int CountSheets () const
 Count the number of sheets found in "this" sheet including all of the subsheets. More...
 
wxString GetFileName () const
 Return the filename corresponding to this sheet. More...
 
void SetFileName (const wxString &aFilename)
 
void Move (const VECTOR2I &aMoveVector) override
 Move the item by aMoveVector to a new position. More...
 
void MirrorHorizontally (int aCenter) override
 Mirror item horizontally about aCenter. More...
 
void MirrorVertically (int aCenter) override
 Mirror item vertically about aCenter. More...
 
void Rotate (const VECTOR2I &aCenter) override
 Rotate the item around aCenter 90 degrees in the clockwise direction. More...
 
bool Matches (const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
 Compare the item against the search criteria in aSearchData. More...
 
bool IsReplaceable () const override
 Override this method in any derived object that supports test find and replace. More...
 
void Resize (const wxSize &aSize)
 Resize this sheet to aSize and adjust all of the labels accordingly. More...
 
void AutoplaceFields (SCH_SCREEN *aScreen, bool aManual) override
 
void GetEndPoints (std::vector< DANGLING_END_ITEM > &aItemList) override
 Add the schematic item end points to aItemList if the item has end points. More...
 
bool UpdateDanglingState (std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
 Test the schematic item to aItemList to check if it's dangling state has changed. More...
 
bool IsConnectable () const override
 
bool CanConnect (const SCH_ITEM *aItem) const override
 
std::vector< VECTOR2IGetConnectionPoints () const override
 Add all the connection points for this item to aPoints. More...
 
INSPECT_RESULT Visit (INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
 May be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
void RunOnChildren (const std::function< void(SCH_ITEM *)> &aFunction) override
 
wxString GetSelectMenuText (UNITS_PROVIDER *aUnitsProvider) const override
 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...
 
BITMAPS GetMenuImage () const override
 Return a pointer to an image to be used in menus. More...
 
SCH_SHEEToperator= (const SCH_ITEM &aSheet)
 
bool operator< (const SCH_ITEM &aItem) const override
 
void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the layers the item is drawn on (which may be more than its "home" layer) More...
 
VECTOR2I GetPosition () const override
 
void SetPosition (const VECTOR2I &aPosition) override
 
bool HitTest (const VECTOR2I &aPosition, int aAccuracy) const override
 Test if aPosition is inside or on the boundary of this item. More...
 
bool HitTest (const BOX2I &aRect, bool aContained, int aAccuracy=0) const override
 Test if aRect intersects this item. More...
 
void Plot (PLOTTER *aPlotter, bool aBackground) const override
 Plot the schematic item to aPlotter. More...
 
EDA_ITEMClone () const override
 Create a duplicate of this item with linked list members set to NULL. More...
 
const std::vector< SCH_SHEET_INSTANCE > & GetInstances () const
 
void SetInstances (const std::vector< SCH_SHEET_INSTANCE > &aInstances)
 
bool AddInstance (const SCH_SHEET_PATH &aInstance)
 Add a new instance aSheetPath to the instance list. More...
 
wxString GetPageNumber (const SCH_SHEET_PATH &aInstance) const
 Return the sheet page number for aInstance. More...
 
void SetPageNumber (const SCH_SHEET_PATH &aInstance, const wxString &aPageNumber)
 Set the page number for the sheet instance aInstance. More...
 
bool IsType (const std::vector< KICAD_T > &aScanTypes) const override
 Check whether the item is one of the listed types. More...
 
SCH_ITEMDuplicate (bool doClone=false) const
 Routine to create a new copy of given item. More...
 
VECTOR2IGetStoredPos ()
 
void SetStoredPos (const VECTOR2I &aPos)
 
SCHEMATICSchematic () const
 Searches the item hierarchy to find a SCHEMATIC. More...
 
virtual bool IsLocked () const
 
virtual void SetLocked (bool aLocked)
 Set the 'lock' status to aLocked for of this item. More...
 
virtual bool IsHypertext () const
 Allow items to support hypertext actions when hovered/clicked. More...
 
virtual void DoHypertextAction (EDA_DRAW_FRAME *aFrame) const
 
SCH_LAYER_ID GetLayer () const
 Return the layer this item is on. More...
 
void SetLayer (SCH_LAYER_ID aLayer)
 Set the layer this item is on. More...
 
const wxString & GetDefaultFont () const
 
bool RenderAsBitmap (double aWorldScale) const override
 
virtual void PrintBackground (const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset)
 Print the (optional) backaground elements if they exist. More...
 
virtual bool IsDangling () const
 
virtual bool IsPointClickableAnchor (const VECTOR2I &aPos) const
 
void ClearConnections ()
 Clears all of the connection items from the list. More...
 
bool IsConnected (const VECTOR2I &aPoint) const
 Test the item to see if it is connected to aPoint. More...
 
SCH_CONNECTIONConnection (const SCH_SHEET_PATH *aSheet=nullptr) const
 Retrieve the connection associated with this object in the given sheet. More...
 
SCH_ITEM_SETConnectedItems (const SCH_SHEET_PATH &aPath)
 Retrieve the set of items connected to this item on the given sheet. More...
 
void AddConnectionTo (const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
 Add a connection link between this item and another. More...
 
SCH_CONNECTIONInitializeConnection (const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
 Create a new connection object associated with this object. More...
 
SCH_CONNECTIONGetOrInitConnection (const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
 
virtual bool ConnectionPropagatesTo (const EDA_ITEM *aItem) const
 Return true if this item should propagate connection info to aItem. More...
 
bool IsConnectivityDirty () const
 
void SetConnectivityDirty (bool aDirty=true)
 
virtual void SetLastResolvedState (const SCH_ITEM *aItem)
 
std::shared_ptr< NETCLASSGetEffectiveNetClass (const SCH_SHEET_PATH *aSheet=nullptr) const
 
FIELDS_AUTOPLACED GetFieldsAutoplaced () const
 Return whether the fields have been automatically placed. More...
 
void SetFieldsAutoplaced ()
 
void ClearFieldsAutoplaced ()
 
void AutoAutoplaceFields (SCH_SCREEN *aScreen)
 Autoplace fields only if correct to do so automatically. More...
 
virtual void ClearCaches ()
 
virtual bool HasLineStroke () const
 Check if this schematic item has line stoke properties. More...
 
virtual STROKE_PARAMS GetStroke () const
 
virtual void SetStroke (const STROKE_PARAMS &aStroke)
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
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 ()
 
void SetIsShownAsBitmap (bool aBitmap)
 
bool IsShownAsBitmap () const
 
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 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...
 
wxString GetTypeDesc ()
 Return a translated description of the type for this EDA_ITEM for display in user facing messages. 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 const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. 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)
 
static int ComparePageNum (const wxString &aPageNumberA, const wxString &aPageNumberB)
 Compares page numbers of schematic sheets. More...
 
static const wxString GetDefaultFieldName (int aFieldNdx, bool aTranslated=true)
 
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

const KIID m_Uuid
 

Protected Member Functions

void renumberPins ()
 Renumber the sheet pins in the sheet. More...
 
SCH_SHEET_PATH findSelf () const
 Get the sheetpath of this sheet. More...
 
bool Matches (const wxString &aText, const EDA_SEARCH_DATA &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 

Protected Attributes

SCH_LAYER_ID m_layer
 
EDA_ITEMS m_connections
 
FIELDS_AUTOPLACED m_fieldsAutoplaced
 
VECTOR2I m_storedPos
 
std::map< SCH_SHEET_PATH, SCH_ITEM_SET, SHEET_PATH_CMPm_connected_items
 Store pointers to other items that are connected to this one, per sheet. More...
 
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
 Store connectivity information, per sheet. More...
 
bool m_connectivity_dirty
 
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 doIsConnected (const VECTOR2I &aPosition) const override
 Provide the object specific test to see if it is connected to aPosition. More...
 

Private Attributes

SCH_SCREENm_screen
 
std::vector< SCH_SHEET_PIN * > m_pins
 
std::vector< SCH_FIELDm_fields
 
VECTOR2I m_pos
 
wxSize m_size
 
int m_borderWidth
 
KIGFX::COLOR4D m_borderColor
 
KIGFX::COLOR4D m_backgroundColor
 
std::vector< SCH_SHEET_INSTANCEm_instances
 
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
 

Friends

class SCH_SHEET_PIN
 

Detailed Description

Sheet symbol placed in a schematic, and is the entry point for a sub schematic.

Definition at line 54 of file sch_sheet.h.

Constructor & Destructor Documentation

◆ SCH_SHEET() [1/2]

SCH_SHEET::SCH_SHEET ( EDA_ITEM aParent = nullptr,
const VECTOR2I aPos = VECTOR2I( 0, 0 ),
wxSize  aSize = wxSize( schIUScale.MilsToIU( MIN_SHEET_WIDTH ),                                      schIUScale.MilsToIU( MIN_SHEET_HEIGHT ) ),
FIELDS_AUTOPLACED  aAutoplaceFields = FIELDS_AUTOPLACED_AUTO 
)

Definition at line 77 of file sch_sheet.cpp.

78 :
79 SCH_ITEM( aParent, SCH_SHEET_T )
80{
82 m_pos = aPos;
83 m_size = aSize;
84 m_screen = nullptr;
85
86 for( int i = 0; i < SHEET_MANDATORY_FIELDS; ++i )
87 {
88 m_fields.emplace_back( aPos, i, this, GetDefaultFieldName( i ) );
89 m_fields.back().SetVisible( true );
90
91 if( i == SHEETNAME )
92 m_fields.back().SetLayer( LAYER_SHEETNAME );
93 else if( i == SHEETFILENAME )
94 m_fields.back().SetLayer( LAYER_SHEETFILENAME );
95 else
96 m_fields.back().SetLayer( LAYER_SHEETFIELDS );
97 }
98
99 m_fieldsAutoplaced = aAutoplaceFields;
100 AutoAutoplaceFields( nullptr );
101
102 m_borderWidth = 0;
103 m_borderColor = COLOR4D::UNSPECIFIED;
104 m_backgroundColor = COLOR4D::UNSPECIFIED;
105}
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType)
Definition: sch_item.cpp:52
FIELDS_AUTOPLACED m_fieldsAutoplaced
Definition: sch_item.h:493
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
Definition: sch_item.h:436
SCH_LAYER_ID m_layer
Definition: sch_item.h:491
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated=true)
Definition: sch_sheet.cpp:55
VECTOR2I m_pos
Definition: sch_sheet.h:469
KIGFX::COLOR4D m_borderColor
Definition: sch_sheet.h:472
SCH_SCREEN * m_screen
Definition: sch_sheet.h:462
std::vector< SCH_FIELD > m_fields
Definition: sch_sheet.h:467
KIGFX::COLOR4D m_backgroundColor
Definition: sch_sheet.h:473
wxSize m_size
Definition: sch_sheet.h:470
int m_borderWidth
Definition: sch_sheet.h:471
@ LAYER_SHEETNAME
Definition: layer_ids.h:363
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:365
@ LAYER_SHEET
Definition: layer_ids.h:362
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:364
@ SHEET_MANDATORY_FIELDS
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition: sch_sheet.h:47
@ SHEETNAME
Definition: sch_sheet.h:43
@ SHEETFILENAME
Definition: sch_sheet.h:44
@ SCH_SHEET_T
Definition: typeinfo.h:157

References SCH_ITEM::AutoAutoplaceFields(), GetDefaultFieldName(), LAYER_SHEET, LAYER_SHEETFIELDS, LAYER_SHEETFILENAME, LAYER_SHEETNAME, m_backgroundColor, m_borderColor, m_borderWidth, m_fields, SCH_ITEM::m_fieldsAutoplaced, SCH_ITEM::m_layer, m_pos, m_screen, m_size, SHEET_MANDATORY_FIELDS, SHEETFILENAME, and SHEETNAME.

Referenced by Clone().

◆ SCH_SHEET() [2/2]

SCH_SHEET::SCH_SHEET ( const SCH_SHEET aSheet)

Copy aSheet into a new object.

All sheet pins are copied as is except and the SCH_SHEET_PIN's #m_Parent pointers are set to the new copied parent object.

Definition at line 108 of file sch_sheet.cpp.

108 :
109 SCH_ITEM( aSheet )
110{
111 m_pos = aSheet.m_pos;
112 m_size = aSheet.m_size;
113 m_layer = aSheet.m_layer;
114 const_cast<KIID&>( m_Uuid ) = aSheet.m_Uuid;
115 m_fields = aSheet.m_fields;
117 m_screen = aSheet.m_screen;
118
119 for( SCH_SHEET_PIN* pin : aSheet.m_pins )
120 {
121 m_pins.emplace_back( new SCH_SHEET_PIN( *pin ) );
122 m_pins.back()->SetParent( this );
123 }
124
125 for( SCH_FIELD& field : m_fields )
126 field.SetParent( this );
127
131 m_instances = aSheet.m_instances;
132
133 if( m_screen )
135}
const KIID m_Uuid
Definition: eda_item.h:492
Definition: kiid.h:47
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:50
void IncRefCount()
Definition: sch_screen.cpp:114
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
friend class SCH_SHEET_PIN
Definition: sch_sheet.h:459
std::vector< SCH_SHEET_INSTANCE > m_instances
Definition: sch_sheet.h:475
std::vector< SCH_SHEET_PIN * > m_pins
Definition: sch_sheet.h:466

References SCH_SCREEN::IncRefCount(), m_backgroundColor, m_borderColor, m_borderWidth, m_fields, SCH_ITEM::m_fieldsAutoplaced, m_instances, SCH_ITEM::m_layer, m_pins, m_pos, m_screen, m_size, EDA_ITEM::m_Uuid, pin, and SCH_SHEET_PIN.

◆ ~SCH_SHEET()

SCH_SHEET::~SCH_SHEET ( )

Definition at line 138 of file sch_sheet.cpp.

139{
140 // also, look at the associated sheet & its reference count
141 // perhaps it should be deleted also.
142 if( m_screen )
143 {
145
146 if( m_screen->GetRefCount() == 0 )
147 delete m_screen;
148 }
149
150 // We own our pins; delete them
151 for( SCH_SHEET_PIN* pin : m_pins )
152 delete pin;
153}
void DecRefCount()
Definition: sch_screen.cpp:120
int GetRefCount() const
Definition: sch_screen.h:160

References SCH_SCREEN::DecRefCount(), SCH_SCREEN::GetRefCount(), m_pins, m_screen, and pin.

Member Function Documentation

◆ AddConnectionTo()

void SCH_ITEM::AddConnectionTo ( const SCH_SHEET_PATH aPath,
SCH_ITEM aItem 
)
inherited

Add a connection link between this item and another.

Definition at line 193 of file sch_item.cpp.

194{
195 SCH_ITEM_SET& set = m_connected_items[ aSheet ];
196
197 // The vector elements are small, so reserve 1k at a time to prevent re-allocations
198 if( set.size() == set.capacity() )
199 set.reserve( set.size() + 4096 );
200
201 set.emplace_back( aItem );
202}
std::map< SCH_SHEET_PATH, SCH_ITEM_SET, SHEET_PATH_CMP > m_connected_items
Store pointers to other items that are connected to this one, per sheet.
Definition: sch_item.h:498
std::vector< SCH_ITEM * > SCH_ITEM_SET
Definition: sch_item.h:136

References SCH_ITEM::m_connected_items.

Referenced by SCH_LABEL_BASE::UpdateDanglingState(), and CONNECTION_GRAPH::updateItemConnectivity().

◆ AddInstance()

bool SCH_SHEET::AddInstance ( const SCH_SHEET_PATH aInstance)

Add a new instance aSheetPath to the instance list.

If aSheetPath does not already exist, it is added to the list. If already exists in the list, do nothing. Sheet instances allow for the sharing in complex hierarchies which allows for per instance data such as page number for sheets to stored.

Warning
The SCH_SHEET_PATH object must be a full hierarchical path which means the SCH_SHEET object at index 0 must be the root sheet. A partial sheet path will raise an assertion on debug builds and silently fail and return false on release builds.
Parameters
[in]aInstanceis the SCH_SHEET_PATH of the sheet instance to the instance list.
Returns
false if the instance already exists, true if the instance was added.

Definition at line 1205 of file sch_sheet.cpp.

1206{
1207 wxCHECK( aSheetPath.IsFullPath(), false );
1208
1209 for( const SCH_SHEET_INSTANCE& instance : m_instances )
1210 {
1211 // if aSheetPath is found, nothing to do:
1212 if( instance.m_Path == aSheetPath.Path() )
1213 return false;
1214 }
1215
1216 wxLogTrace( traceSchSheetPaths, wxT( "Adding instance `%s` to sheet `%s`." ),
1217 aSheetPath.Path().AsString(),
1218 ( GetName().IsEmpty() ) ? wxT( "root" ) : GetName() );
1219
1220 SCH_SHEET_INSTANCE instance;
1221
1222 instance.m_Path = aSheetPath.Path();
1223
1224 // This entry does not exist: add it with an empty page number.
1225 m_instances.emplace_back( instance );
1226 return true;
1227}
wxString GetName() const
Definition: sch_sheet.h:101
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
A simple container for sheet instance information.

References KIID_PATH::AsString(), GetName(), SCH_SHEET_PATH::IsFullPath(), m_instances, SCH_SHEET_INSTANCE::m_Path, SCH_SHEET_PATH::Path(), and traceSchSheetPaths.

Referenced by SCH_SHEET_PATH::AddNewSheetInstances(), SCH_EDIT_FRAME::CreateScreens(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), SCH_ALTIUM_PLUGIN::ParseHarnessConnector(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_SHEET_LIST::SetInitialPageNumbers(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), SCH_EDITOR_CONTROL::updatePastedSheet(), and SCH_SHEET_LIST::UpdateSheetInstances().

◆ AddPin()

void SCH_SHEET::AddPin ( SCH_SHEET_PIN aSheetPin)

Add aSheetPin to the sheet.

Note
Once a sheet pin is added to the sheet, it is owned by the sheet. Do not delete the sheet pin object or you will likely get a segfault when the sheet is destroyed.
Parameters
aSheetPinThe sheet pin item to add to the sheet.

Definition at line 353 of file sch_sheet.cpp.

354{
355 wxASSERT( aSheetPin != nullptr );
356 wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
357
358 aSheetPin->SetParent( this );
359 m_pins.push_back( aSheetPin );
360 renumberPins();
361}
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 renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:923
@ SCH_SHEET_PIN_T
Definition: typeinfo.h:156

References m_pins, renumberPins(), SCH_SHEET_PIN_T, EDA_ITEM::SetParent(), and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), and CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins().

◆ AutoAutoplaceFields()

void SCH_ITEM::AutoAutoplaceFields ( SCH_SCREEN aScreen)
inlineinherited

Autoplace fields only if correct to do so automatically.

Fields that have been moved by hand are not automatically placed.

Parameters
aScreenis the SCH_SCREEN associated with the current instance of the symbol.

Definition at line 436 of file sch_item.h.

437 {
438 if( GetFieldsAutoplaced() )
440 }
FIELDS_AUTOPLACED GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
Definition: sch_item.h:424
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Definition: sch_item.h:442
@ FIELDS_AUTOPLACED_MANUAL
Definition: sch_item.h:58

References SCH_ITEM::AutoplaceFields(), FIELDS_AUTOPLACED_MANUAL, and SCH_ITEM::GetFieldsAutoplaced().

Referenced by DIALOG_CHANGE_SYMBOLS::processSymbol(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Rotate(), SCH_SHEET(), SCH_EDIT_FRAME::SelectUnit(), and DIALOG_LABEL_PROPERTIES::TransferDataFromWindow().

◆ AutoplaceFields()

void SCH_SHEET::AutoplaceFields ( SCH_SCREEN aScreen,
bool  aManual 
)
overridevirtual

Reimplemented from SCH_ITEM.

Definition at line 590 of file sch_sheet.cpp.

591{
592 VECTOR2I textSize = m_fields[SHEETNAME].GetTextSize();
593 int borderMargin = KiROUND( GetPenWidth() / 2.0 ) + 4;
594 int margin = borderMargin + KiROUND( std::max( textSize.x, textSize.y ) * 0.5 );
595
597 {
598 m_fields[SHEETNAME].SetTextPos( m_pos + VECTOR2I( -margin, m_size.y ) );
599 m_fields[ SHEETNAME ].SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
600 m_fields[ SHEETNAME ].SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
601 m_fields[ SHEETNAME ].SetTextAngle( ANGLE_VERTICAL );
602 }
603 else
604 {
605 m_fields[SHEETNAME].SetTextPos( m_pos + VECTOR2I( 0, -margin ) );
606 m_fields[ SHEETNAME ].SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
607 m_fields[ SHEETNAME ].SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
608 m_fields[ SHEETNAME ].SetTextAngle( ANGLE_HORIZONTAL );
609 }
610
611 textSize = m_fields[ SHEETFILENAME ].GetTextSize();
612 margin = borderMargin + KiROUND( std::max( textSize.x, textSize.y ) * 0.4 );
613
615 {
616 m_fields[SHEETFILENAME].SetTextPos( m_pos + VECTOR2I( m_size.x + margin, m_size.y ) );
617 m_fields[ SHEETFILENAME ].SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
618 m_fields[ SHEETFILENAME ].SetVertJustify( GR_TEXT_V_ALIGN_TOP );
619 m_fields[ SHEETFILENAME ].SetTextAngle( ANGLE_VERTICAL );
620 }
621 else
622 {
623 m_fields[SHEETFILENAME].SetTextPos( m_pos + VECTOR2I( 0, m_size.y + margin ) );
624 m_fields[ SHEETFILENAME ].SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
625 m_fields[ SHEETFILENAME ].SetVertJustify( GR_TEXT_V_ALIGN_TOP );
626 m_fields[ SHEETFILENAME ].SetTextAngle( ANGLE_HORIZONTAL );
627 }
628
630}
int GetPenWidth() const override
Definition: sch_sheet.cpp:578
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:405
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
Definition: eda_angle.h:408
static constexpr EDA_ANGLE & ANGLE_VERTICAL
Definition: eda_angle.h:409
@ FIELDS_AUTOPLACED_AUTO
Definition: sch_item.h:57
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_TOP
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:80
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

References ANGLE_HORIZONTAL, ANGLE_VERTICAL, FIELDS_AUTOPLACED_AUTO, GetPenWidth(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_TOP, IsVerticalOrientation(), KiROUND(), m_fields, SCH_ITEM::m_fieldsAutoplaced, m_pos, m_size, SHEETFILENAME, SHEETNAME, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PANEL_EESCHEMA_COLOR_SETTINGS::createPreviewItems(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), Resize(), Rotate(), and EE_POINT_EDITOR::updateParentItem().

◆ CanConnect()

bool SCH_SHEET::CanConnect ( const SCH_ITEM aItem) const
inlineoverridevirtual

Reimplemented from SCH_ITEM.

Definition at line 340 of file sch_sheet.h.

341 {
342 return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE )
343 || ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS )
344 || ( aItem->Type() == SCH_NO_CONNECT_T )
345 || ( aItem->Type() == SCH_SYMBOL_T );
346 }
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:246
@ LAYER_WIRE
Definition: layer_ids.h:344
@ LAYER_BUS
Definition: layer_ids.h:345
@ SCH_LINE_T
Definition: typeinfo.h:145
@ SCH_NO_CONNECT_T
Definition: typeinfo.h:142
@ SCH_SYMBOL_T
Definition: typeinfo.h:155

References SCH_ITEM::GetLayer(), LAYER_BUS, LAYER_WIRE, SCH_LINE_T, SCH_NO_CONNECT_T, SCH_SYMBOL_T, and EDA_ITEM::Type().

◆ ClassOf()

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

Definition at line 70 of file sch_sheet.h.

71 {
72 return aItem && SCH_SHEET_T == aItem->Type();
73 }

References SCH_SHEET_T, and EDA_ITEM::Type().

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadNets().

◆ CleanupSheet()

void SCH_SHEET::CleanupSheet ( )

Delete sheet label which do not have a corresponding hierarchical label.

Note
Make sure you save a copy of the sheet in the undo list before calling CleanupSheet() otherwise any unreferenced sheet labels will be lost.

Definition at line 540 of file sch_sheet.cpp.

541{
542 std::vector<SCH_SHEET_PIN*> pins = m_pins;
543
544 m_pins.clear();
545
546 for( SCH_SHEET_PIN* pin : pins )
547 {
548 /* Search the schematic for a hierarchical label corresponding to this sheet label. */
549 const SCH_HIERLABEL* HLabel = nullptr;
550
551 for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_HIER_LABEL_T ) )
552 {
553 if( pin->GetText().CmpNoCase( static_cast<SCH_HIERLABEL*>( aItem )->GetText() ) == 0 )
554 {
555 HLabel = static_cast<SCH_HIERLABEL*>( aItem );
556 break;
557 }
558 }
559
560 if( HLabel )
561 m_pins.push_back( pin );
562 }
563}
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:87
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:238
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:108
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:152

References EDA_TEXT::GetText(), SCH_SCREEN::Items(), m_pins, m_screen, EE_RTREE::OfType(), pin, and SCH_HIER_LABEL_T.

Referenced by SCH_EDIT_TOOL::CleanupSheetPins().

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

◆ ClearCaches()

void SCH_ITEM::ClearCaches ( )
virtualinherited

Reimplemented in SCH_FIELD.

Definition at line 251 of file sch_item.cpp.

252{
253 auto clearTextCaches =
254 []( SCH_ITEM* aItem )
255 {
256 EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
257
258 if( text )
259 {
260 text->ClearBoundingBoxCache();
261 text->ClearRenderCache();
262 }
263 };
264
265 clearTextCaches( this );
266
267 RunOnChildren( clearTextCaches );
268}
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
Definition: sch_item.h:444

References SCH_ITEM::RunOnChildren(), and text.

◆ ClearConnections()

void SCH_ITEM::ClearConnections ( )
inlineinherited

Clears all of the connection items from the list.

The vector release method is used to prevent the item pointers from being deleted. Do not use the vector erase method on the connection list.

Definition at line 372 of file sch_item.h.

372{ m_connections.clear(); }
EDA_ITEMS m_connections
Definition: sch_item.h:492

References SCH_ITEM::m_connections.

◆ ClearEditFlags()

◆ ClearFieldsAutoplaced()

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

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(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SYMBOL_EDITOR_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), 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_TEST_PROVIDER_COURTYARD_CLEARANCE_ON_MOVE::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().

◆ 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 * SCH_SHEET::Clone ( ) const
overridevirtual

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 from EDA_ITEM.

Definition at line 156 of file sch_sheet.cpp.

157{
158 return new SCH_SHEET( *this );
159}
SCH_SHEET(EDA_ITEM *aParent=nullptr, const VECTOR2I &aPos=VECTOR2I(0, 0), wxSize aSize=wxSize(schIUScale.MilsToIU(MIN_SHEET_WIDTH), schIUScale.MilsToIU(MIN_SHEET_HEIGHT)), FIELDS_AUTOPLACED aAutoplaceFields=FIELDS_AUTOPLACED_AUTO)
Definition: sch_sheet.cpp:77

References SCH_SHEET().

Referenced by SCH_DRAWING_TOOLS::DrawSheet().

◆ ComparePageNum()

int SCH_SHEET::ComparePageNum ( const wxString &  aPageNumberA,
const wxString &  aPageNumberB 
)
static

Compares page numbers of schematic sheets.

Returns
0 if the page numbers are equal, -1 if aPageNumberA < aPageNumberB, 1 otherwise

Definition at line 1267 of file sch_sheet.cpp.

1268{
1269 if( aPageNumberA == aPageNumberB )
1270 return 0; // A == B
1271
1272 // First sort numerically if the page numbers are integers
1273 long pageA, pageB;
1274 bool isIntegerPageA = aPageNumberA.ToLong( &pageA );
1275 bool isIntegerPageB = aPageNumberB.ToLong( &pageB );
1276
1277 if( isIntegerPageA && isIntegerPageB )
1278 {
1279 if( pageA < pageB )
1280 return -1; //A < B
1281 else
1282 return 1; // A > B
1283 }
1284
1285 // Numerical page numbers always before strings
1286 if( isIntegerPageA )
1287 return -1; //A < B
1288 else if( isIntegerPageB )
1289 return 1; // A > B
1290
1291 // If not numeric, then sort as strings using natural sort
1292 int result = StrNumCmp( aPageNumberA, aPageNumberB );
1293
1294 // Divide by zero bad.
1295 wxCHECK( result != 0, 0 );
1296
1297 result = result / std::abs( result );
1298
1299 return result;
1300}
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:401
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.

References std::abs(), and StrNumCmp().

Referenced by SCH_SHEET_PATH::ComparePageNum().

◆ ConnectedItems()

SCH_ITEM_SET & SCH_ITEM::ConnectedItems ( const SCH_SHEET_PATH aPath)
inherited

Retrieve the set of items connected to this item on the given sheet.

Definition at line 187 of file sch_item.cpp.

188{
189 return m_connected_items[ aSheet ];
190}

References SCH_ITEM::m_connected_items.

Referenced by addConnections(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE::FindWireSegmentNetNameRecursive(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ Connection()

SCH_CONNECTION * SCH_ITEM::Connection ( const SCH_SHEET_PATH aSheet = nullptr) const
inherited

Retrieve the connection associated with this object in the given sheet.

Note
The returned value can be nullptr.

Definition at line 146 of file sch_item.cpp.

147{
148 if( !IsConnectable() )
149 return nullptr;
150
151 wxCHECK_MSG( !IsConnectivityDirty(), nullptr,
152 wxT( "Shouldn't be asking for connection if connectivity is dirty!" ) );
153
154 if( !aSheet )
155 aSheet = &Schematic()->CurrentSheet();
156
157 auto it = m_connection_map.find( *aSheet );
158
159 if( it == m_connection_map.end() )
160 return nullptr;
161 else
162 return it->second;
163}
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:119
virtual bool IsConnectable() const
Definition: sch_item.h:349
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:112
bool IsConnectivityDirty() const
Definition: sch_item.h:413
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
Store connectivity information, per sheet.
Definition: sch_item.h:501

References SCHEMATIC::CurrentSheet(), SCH_ITEM::IsConnectable(), SCH_ITEM::IsConnectivityDirty(), SCH_ITEM::m_connection_map, and SCH_ITEM::Schematic().

Referenced by CONNECTION_SUBGRAPH::Absorb(), CONNECTION_SUBGRAPH::AddItem(), CONNECTION_GRAPH::buildConnectionGraph(), KIGFX::SCH_PAINTER::draw(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::GetBusesNeedingMigration(), SCH_ITEM::GetEffectiveNetClass(), SCH_BUS_ENTRY_BASE::GetMsgPanelInfo(), SCH_LABEL_BASE::GetMsgPanelInfo(), SCH_LINE::GetMsgPanelInfo(), SCH_PIN::GetMsgPanelInfo(), CONNECTION_SUBGRAPH::GetNetName(), SCH_ITEM::GetOrInitConnection(), highlightNet(), SCH_ITEM::InitializeConnection(), SCH_LABEL_BASE::Plot(), SCH_LINE::Plot(), SCH_TEXT::Plot(), SCH_LABEL_BASE::Print(), SCH_EDIT_FRAME::RecalculateConnections(), CONNECTION_SUBGRAPH::ResolveDrivers(), SCH_LABEL_BASE::ResolveTextVar(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow(), BUS_UNFOLD_MENU::update(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ ConnectionPropagatesTo()

virtual bool SCH_ITEM::ConnectionPropagatesTo ( const EDA_ITEM aItem) const
inlinevirtualinherited

Return true if this item should propagate connection info to aItem.

Reimplemented in SCH_BUS_WIRE_ENTRY, SCH_LINE, and SCH_PIN.

Definition at line 411 of file sch_item.h.

411{ return true; }

◆ CountSheets()

int SCH_SHEET::CountSheets ( ) const

Count the number of sheets found in "this" sheet including all of the subsheets.

Returns
the full count of sheets+subsheets contained by "this"

Definition at line 767 of file sch_sheet.cpp.

768{
769 int count = 1; //1 = this!!
770
771 if( m_screen )
772 {
773 for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_SHEET_T ) )
774 count += static_cast<SCH_SHEET*>( aItem )->CountSheets();
775 }
776
777 return count;
778}
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:55
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
Definition: sch_sheet.cpp:767

References CountSheets(), SCH_SCREEN::Items(), m_screen, EE_RTREE::OfType(), and SCH_SHEET_T.

Referenced by CountSheets(), SCH_PRINTOUT::GetPageInfo(), SCH_PRINTOUT::HasPage(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), and DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow().

◆ DoHypertextAction()

virtual void SCH_ITEM::DoHypertextAction ( EDA_DRAW_FRAME aFrame) const
inlinevirtualinherited

Reimplemented in SCH_FIELD, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 241 of file sch_item.h.

241{ }

◆ doIsConnected()

bool SCH_SHEET::doIsConnected ( const VECTOR2I aPosition) const
overrideprivatevirtual

Provide the object specific test to see if it is connected to aPosition.

Note
Override this function if the derived object can be connect to another object such as a wire, bus, or junction. Do not override this function for objects that cannot have connections. The default will always return false. This functions is call through the public function IsConnected() which performs tests common to all schematic items before calling the item specific connection testing.
Parameters
aPositionis a reference to a VECTOR2I object containing the test position.
Returns
True if connection to aPosition exists.

Reimplemented from SCH_ITEM.

Definition at line 393 of file sch_sheet.cpp.

394{
395 for( SCH_SHEET_PIN* sheetPin : m_pins )
396 {
397 if( sheetPin->GetPosition() == aPosition )
398 return true;
399 }
400
401 return false;
402}

References m_pins.

◆ Duplicate()

SCH_ITEM * SCH_ITEM::Duplicate ( bool  doClone = false) const
inherited

Routine to create a new copy of given item.

The new object is not put in draw list (not linked).

Parameters
doClone(default = false) indicates unique values (such as timestamp and sheet name) should be duplicated. Use only for undo/redo operations.

Definition at line 93 of file sch_item.cpp.

94{
95 SCH_ITEM* newItem = (SCH_ITEM*) Clone();
96
97 if( !doClone )
98 const_cast<KIID&>( newItem->m_Uuid ) = KIID();
99
100 newItem->ClearFlags( SELECTED | BRIGHTENED );
101
102 newItem->RunOnChildren(
103 []( SCH_ITEM* aChild )
104 {
105 aChild->ClearFlags( SELECTED | BRIGHTENED );
106 } );
107
108 return newItem;
109}
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:82

References BRIGHTENED, EDA_ITEM::ClearFlags(), EDA_ITEM::Clone(), EDA_ITEM::m_Uuid, SCH_ITEM::RunOnChildren(), and SELECTED.

Referenced by SCH_EDIT_FRAME::BreakSegment(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), CADSTAR_SCH_ARCHIVE_LOADER::loadItemOntoKiCadSheet(), SCH_EAGLE_PLUGIN::loadSchematic(), SCH_DRAWING_TOOLS::PlaceSymbol(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_FRAME::SaveCopyInUndoList(), and SCH_LINE_WIRE_BUS_TOOL::startSegments().

◆ findSelf()

SCH_SHEET_PATH SCH_SHEET::findSelf ( ) const
protected

Get the sheetpath of this sheet.

NB: REQUIRES that the current sheet hierarchy contains the given sheet.

Definition at line 935 of file sch_sheet.cpp.

936{
937 wxCHECK_MSG( Schematic(), SCH_SHEET_PATH(), "Can't call findSelf without a schematic" );
938
939 SCH_SHEET_PATH sheetPath = Schematic()->CurrentSheet();
940
941 while( !sheetPath.empty() && sheetPath.Last() != this )
942 sheetPath.pop_back();
943
944 if( sheetPath.empty() )
945 {
946 // If we weren't in the hierarchy, then we must be a child of the current sheet.
947 sheetPath = Schematic()->CurrentSheet();
948 sheetPath.push_back( const_cast<SCH_SHEET*>( this ) );
949 }
950
951 return sheetPath;
952}
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool empty() const
Forwarded method from std::vector.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
void pop_back()
Forwarded method from std::vector.

References SCHEMATIC::CurrentSheet(), SCH_SHEET_PATH::empty(), SCH_SHEET_PATH::Last(), SCH_SHEET_PATH::pop_back(), SCH_SHEET_PATH::push_back(), and SCH_ITEM::Schematic().

Referenced by GetContextualTextVars(), Plot(), and ResolveTextVar().

◆ 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:270
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:63
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
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:60
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42

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

◆ GetBackgroundColor()

◆ GetBodyBoundingBox()

const BOX2I SCH_SHEET::GetBodyBoundingBox ( ) const

Return a bounding box for the sheet body but not the fields.

Definition at line 646 of file sch_sheet.cpp.

647{
648 VECTOR2I end;
649 BOX2I box( m_pos, m_size );
650 int lineWidth = GetPenWidth();
651 int textLength = 0;
652
653 // Calculate bounding box X size:
654 end.x = std::max( m_size.x, textLength );
655
656 // Calculate bounding box pos:
657 end.y = m_size.y;
658 end += m_pos;
659
660 box.SetEnd( end );
661 box.Inflate( lineWidth / 2 );
662
663 return box;
664}

References GetPenWidth(), BOX2< Vec >::Inflate(), m_pos, m_size, BOX2< Vec >::SetEnd(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by GetBoundingBox(), HitTest(), and SCH_EDIT_TOOL::Rotate().

◆ GetBorderColor()

◆ GetBorderWidth()

int SCH_SHEET::GetBorderWidth ( ) const
inline

◆ GetBoundingBox()

const BOX2I SCH_SHEET::GetBoundingBox ( ) const
overridevirtual

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 from EDA_ITEM.

Definition at line 667 of file sch_sheet.cpp.

668{
669 BOX2I bbox = GetBodyBoundingBox();
670
671 for( const SCH_FIELD& field : m_fields )
672 bbox.Merge( field.GetBoundingBox() );
673
674 return bbox;
675}
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:588
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
Definition: sch_sheet.cpp:646

References GetBodyBoundingBox(), m_fields, and BOX2< Vec >::Merge().

Referenced by SCH_EDIT_TOOL::Mirror(), and Plot().

◆ GetClass()

wxString SCH_SHEET::GetClass ( ) const
inlineoverridevirtual

Return the class name.

Reimplemented from SCH_ITEM.

Definition at line 75 of file sch_sheet.h.

76 {
77 return wxT( "SCH_SHEET" );
78 }

Referenced by operator=().

◆ GetConnectionPoints()

std::vector< VECTOR2I > SCH_SHEET::GetConnectionPoints ( ) const
overridevirtual

Add all the connection points for this item to aPoints.

Not all schematic items have connection points so the default method does nothing.

Parameters
aPointsis the list of connection points to add to.

Reimplemented from SCH_ITEM.

Definition at line 979 of file sch_sheet.cpp.

980{
981 std::vector<VECTOR2I> retval;
982
983 for( SCH_SHEET_PIN* sheetPin : m_pins )
984 retval.push_back( sheetPin->GetPosition() );
985
986 return retval;
987}

References m_pins.

◆ GetContextualTextVars()

void SCH_SHEET::GetContextualTextVars ( wxArrayString *  aVars) const

Return the list of system text vars & fields for this sheet.

Definition at line 202 of file sch_sheet.cpp.

203{
204 auto add =
205 [&]( const wxString& aVar )
206 {
207 if( !alg::contains( *aVars, aVar ) )
208 aVars->push_back( aVar );
209 };
210
211 for( int i = 0; i < SHEET_MANDATORY_FIELDS; ++i )
212 add( m_fields[i].GetCanonicalName().Upper() );
213
214 for( size_t i = SHEET_MANDATORY_FIELDS; i < m_fields.size(); ++i )
215 add( m_fields[i].GetName() );
216
217 SCH_SHEET_PATH sheetPath = findSelf();
218
219 if( sheetPath.size() >= 2 )
220 {
221 sheetPath.pop_back();
222 sheetPath.Last()->GetContextualTextVars( aVars );
223 }
224
225 add( wxT( "#" ) );
226 add( wxT( "##" ) );
227 add( wxT( "SHEETPATH" ) );
228
230}
const TITLE_BLOCK & GetTitleBlock() const
Definition: sch_screen.h:154
size_t size() const
Forwarded method from std::vector.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Definition: sch_sheet.cpp:202
SCH_SHEET_PATH findSelf() const
Get the sheetpath of this sheet.
Definition: sch_sheet.cpp:935
static void GetContextualTextVars(wxArrayString *aVars)
Definition: title_block.cpp:74
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:99

References alg::contains(), findSelf(), TITLE_BLOCK::GetContextualTextVars(), GetContextualTextVars(), GetName(), SCH_SCREEN::GetTitleBlock(), SCH_SHEET_PATH::Last(), m_fields, m_screen, SCH_SHEET_PATH::pop_back(), SHEET_MANDATORY_FIELDS, and SCH_SHEET_PATH::size().

Referenced by GetContextualTextVars(), DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded(), and DIALOG_TEXT_PROPERTIES::onScintillaCharAdded().

◆ GetDefaultFieldName()

const wxString SCH_SHEET::GetDefaultFieldName ( int  aFieldNdx,
bool  aTranslated = true 
)
static

Definition at line 55 of file sch_sheet.cpp.

56{
57 if( !aTranslated )
58 {
59 switch( aFieldNdx )
60 {
63 default: return wxString::Format( USER_FIELD_CANONICAL, aFieldNdx );
64 }
65 }
66
67 // Fixed values for the mandatory fields
68 switch( aFieldNdx )
69 {
70 case SHEETNAME: return _( SHEET_NAME_CANONICAL );
71 case SHEETFILENAME: return _( SHEET_FILE_CANONICAL );
72 default: return wxString::Format( _( USER_FIELD_CANONICAL ), aFieldNdx );
73 }
74}
#define _(s)
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
#define USER_FIELD_CANONICAL
Definition: sch_sheet.cpp:52
#define SHEET_NAME_CANONICAL
Definition: sch_sheet.cpp:50
#define SHEET_FILE_CANONICAL
Definition: sch_sheet.cpp:51

References _, Format(), SHEET_FILE_CANONICAL, SHEET_NAME_CANONICAL, SHEETFILENAME, SHEETNAME, and USER_FIELD_CANONICAL.

Referenced by SCH_FIELD::GetName(), FIELDS_GRID_TABLE< T >::GetValue(), DIALOG_SHEET_PROPERTIES::OnAddField(), SCH_SEXPR_PARSER::parseSchField(), and SCH_SHEET().

◆ GetDefaultFont()

const wxString & SCH_ITEM::GetDefaultFont ( ) const
inherited

Definition at line 286 of file sch_item.cpp.

287{
288 EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
289
290 return cfg->m_Appearance.default_font;
291}
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References EESCHEMA_SETTINGS::APPEARANCE::default_font, EESCHEMA_SETTINGS::m_Appearance, and Pgm().

Referenced by SCH_FIELD::GetDrawFont(), SCH_TEXT::GetDrawFont(), and SCH_TEXTBOX::GetDrawFont().

◆ 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 STRUCT_DELETED
flag indication structures to be erased
#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().

◆ GetEffectiveNetClass()

std::shared_ptr< NETCLASS > SCH_ITEM::GetEffectiveNetClass ( const SCH_SHEET_PATH aSheet = nullptr) const
inherited

Definition at line 166 of file sch_item.cpp.

167{
168 static std::shared_ptr<NETCLASS> nullNetclass = std::make_shared<NETCLASS>( wxEmptyString );
169
170 SCHEMATIC* schematic = Schematic();
171
172 if( schematic )
173 {
174 std::shared_ptr<NET_SETTINGS>& netSettings = schematic->Prj().GetProjectFile().m_NetSettings;
175 SCH_CONNECTION* connection = Connection( aSheet );
176
177 if( connection )
178 return netSettings->GetEffectiveNetClass( connection->Name() );
179 else
180 return netSettings->m_DefaultNetClass;
181 }
182
183 return nullNetclass;
184}
std::shared_ptr< NET_SETTINGS > m_NetSettings
Net settings for this project (owned here)
Definition: project_file.h:168
virtual PROJECT_FILE & GetProjectFile() const
Definition: project.h:148
Holds all the data relating to one schematic.
Definition: schematic.h:60
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:75
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
wxString Name(bool aIgnoreSheet=false) const
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:146

References SCH_ITEM::Connection(), PROJECT::GetProjectFile(), PROJECT_FILE::m_NetSettings, SCH_CONNECTION::Name(), SCHEMATIC::Prj(), and SCH_ITEM::Schematic().

Referenced by SCH_BUS_ENTRY_BASE::GetBusEntryColor(), SCH_LINE::GetEffectiveLineStyle(), SCH_JUNCTION::getEffectiveShape(), SCH_FIELD::GetFieldColor(), SCH_JUNCTION::GetJunctionColor(), SCH_LABEL_BASE::GetLabelColor(), SCH_LINE::GetLineColor(), SCH_BUS_ENTRY_BASE::GetLineStyle(), SCH_BUS_ENTRY_BASE::GetMsgPanelInfo(), SCH_LABEL_BASE::GetMsgPanelInfo(), SCH_LINE::GetMsgPanelInfo(), SCH_BUS_WIRE_ENTRY::GetPenWidth(), SCH_BUS_BUS_ENTRY::GetPenWidth(), SCH_LINE::GetPenWidth(), SCH_LABEL_BASE::Plot(), SCH_LINE::Plot(), and SCH_LABEL_BASE::ResolveTextVar().

◆ GetEndPoints()

void SCH_SHEET::GetEndPoints ( std::vector< DANGLING_END_ITEM > &  aItemList)
overridevirtual

Add the schematic item end points to aItemList if the item has end points.

The default version doesn't do anything since many of the schematic object cannot be tested for dangling ends. If you add a new schematic item that can have a dangling end ( no connect ), override this method to provide the correct end points.

Parameters
aItemListis the list of DANGLING_END_ITEMS to add to.

Reimplemented from SCH_ITEM.

Definition at line 955 of file sch_sheet.cpp.

956{
957 for( SCH_SHEET_PIN* sheetPin : m_pins )
958 {
959 wxCHECK2_MSG( sheetPin->Type() == SCH_SHEET_PIN_T, continue,
960 wxT( "Invalid item in schematic sheet pin list. Bad programmer!" ) );
961
962 sheetPin->GetEndPoints( aItemList );
963 }
964}

References m_pins, and SCH_SHEET_PIN_T.

◆ GetFields() [1/2]

◆ GetFields() [2/2]

const std::vector< SCH_FIELD > & SCH_SHEET::GetFields ( ) const
inline

Definition at line 92 of file sch_sheet.h.

92{ return m_fields; }

References m_fields.

◆ GetFieldsAutoplaced()

FIELDS_AUTOPLACED SCH_ITEM::GetFieldsAutoplaced ( ) const
inlineinherited

Return whether the fields have been automatically placed.

Definition at line 424 of file sch_item.h.

424{ return m_fieldsAutoplaced; }

References SCH_ITEM::m_fieldsAutoplaced.

Referenced by SCH_ITEM::AutoAutoplaceFields(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), and EE_POINT_EDITOR::updateParentItem().

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

256{ return GetPosition(); }
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:249

References EDA_ITEM::GetPosition().

Referenced by SCH_EDIT_FRAME::FocusOnItem().

◆ GetInstances()

const std::vector< SCH_SHEET_INSTANCE > & SCH_SHEET::GetInstances ( ) const
inline
Returns
the list of SCH_SHEET_INSTANCE objects for this sheet.

Definition at line 378 of file sch_sheet.h.

378{ return m_instances; }

References m_instances.

◆ GetLayer()

◆ GetMenuImage()

BITMAPS SCH_SHEET::GetMenuImage ( ) const
overridevirtual

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 from EDA_ITEM.

Definition at line 1044 of file sch_sheet.cpp.

1045{
1047}
@ add_hierarchical_subsheet

References add_hierarchical_subsheet.

◆ GetMinHeight()

int SCH_SHEET::GetMinHeight ( bool  aFromTop) const

Return the minimum height that the sheet can be resized based on the sheet pin positions.

The minimum width of a sheet is determined by the Y axis location of the bottom most sheet pin. If at some point in the future sheet objects can be rotated or pins can be placed in the vertical orientation, this function will need to be changed.

Returns
The minimum height the sheet can be resized.

Definition at line 506 of file sch_sheet.cpp.

507{
508 int pinsTop = m_pos.y + m_size.y;
509 int pinsBottom = m_pos.y;
510
511 for( size_t i = 0; i < m_pins.size(); i++ )
512 {
513 SHEET_SIDE edge = m_pins[i]->GetSide();
514
515 if( edge == SHEET_SIDE::RIGHT || edge == SHEET_SIDE::LEFT )
516 {
517 BOX2I pinRect = m_pins[i]->GetBoundingBox();
518
519 pinsTop = std::min( pinsTop, pinRect.GetTop() );
520 pinsBottom = std::max( pinsBottom, pinRect.GetBottom() );
521 }
522 }
523
524 pinsTop = bumpToNextGrid( pinsTop, -1 );
525 pinsBottom = bumpToNextGrid( pinsBottom, 1 );
526
527 int pinMinHeight;
528
529 if( pinsTop >= pinsBottom )
530 pinMinHeight = 0;
531 else if( aFromTop )
532 pinMinHeight = pinsBottom - m_pos.y;
533 else
534 pinMinHeight = m_pos.y + m_size.y - pinsTop;
535
536 return std::max( pinMinHeight, schIUScale.MilsToIU( MIN_SHEET_HEIGHT ) );
537}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
coord_type GetTop() const
Definition: box2.h:194
coord_type GetBottom() const
Definition: box2.h:190
int bumpToNextGrid(const int aVal, const int aDirection)
Definition: sch_sheet.cpp:450
#define MIN_SHEET_HEIGHT
Definition: sch_sheet.h:38
SHEET_SIDE
Define the edge of the sheet that the sheet pin is positioned.
Definition: sch_sheet_pin.h:46
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94

References bumpToNextGrid(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetTop(), LEFT, m_pins, m_pos, m_size, EDA_IU_SCALE::MilsToIU(), MIN_SHEET_HEIGHT, RIGHT, schIUScale, and VECTOR2< T >::y.

Referenced by EE_POINT_EDITOR::updateParentItem().

◆ GetMinWidth()

int SCH_SHEET::GetMinWidth ( bool  aFromLeft) const

Return the minimum width of the sheet based on the widths of the sheet pin text.

The minimum sheet width is determined by the width of the bounding box of each hierarchical sheet pin. If two pins are horizontally adjacent ( same Y position ) to each other, the sum of the bounding box widths is used. If at some point in the future sheet objects can be rotated or pins can be placed in the vertical orientation, this function will need to be changed.

Returns
The minimum width the sheet can be resized.

Definition at line 472 of file sch_sheet.cpp.

473{
474 int pinsLeft = m_pos.x + m_size.x;
475 int pinsRight = m_pos.x;
476
477 for( size_t i = 0; i < m_pins.size(); i++ )
478 {
479 SHEET_SIDE edge = m_pins[i]->GetSide();
480
481 if( edge == SHEET_SIDE::TOP || edge == SHEET_SIDE::BOTTOM )
482 {
483 BOX2I pinRect = m_pins[i]->GetBoundingBox();
484
485 pinsLeft = std::min( pinsLeft, pinRect.GetLeft() );
486 pinsRight = std::max( pinsRight, pinRect.GetRight() );
487 }
488 }
489
490 pinsLeft = bumpToNextGrid( pinsLeft, -1 );
491 pinsRight = bumpToNextGrid( pinsRight, 1 );
492
493 int pinMinWidth;
494
495 if( pinsLeft >= pinsRight )
496 pinMinWidth = 0;
497 else if( aFromLeft )
498 pinMinWidth = pinsRight - m_pos.x;
499 else
500 pinMinWidth = m_pos.x + m_size.x - pinsLeft;
501
502 return std::max( pinMinWidth, schIUScale.MilsToIU( MIN_SHEET_WIDTH ) );
503}
coord_type GetRight() const
Definition: box2.h:189
coord_type GetLeft() const
Definition: box2.h:193
#define MIN_SHEET_WIDTH
Definition: sch_sheet.h:37

References BOTTOM, bumpToNextGrid(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), m_pins, m_pos, m_size, EDA_IU_SCALE::MilsToIU(), MIN_SHEET_WIDTH, schIUScale, TOP, and VECTOR2< T >::x.

Referenced by EE_POINT_EDITOR::updateParentItem().

◆ GetMsgPanelInfo()

void SCH_SHEET::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 781 of file sch_sheet.cpp.

782{
783 aList.emplace_back( _( "Sheet Name" ), m_fields[ SHEETNAME ].GetText() );
784
785 if( SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( aFrame ) )
786 {
787 SCH_SHEET_PATH path = schframe->GetCurrentSheet();
788 path.push_back( this );
789
790 aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable( false ) );
791 }
792
793 aList.emplace_back( _( "File Name" ), m_fields[ SHEETFILENAME ].GetText() );
794}
Schematic editor (Eeschema) main window.
wxString GetText(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
Definition: eda_units.cpp:102

References _, EDA_UNIT_UTILS::GetText(), m_fields, path, SHEETFILENAME, and SHEETNAME.

◆ GetName()

◆ GetOrInitConnection()

SCH_CONNECTION * SCH_ITEM::GetOrInitConnection ( const SCH_SHEET_PATH aPath,
CONNECTION_GRAPH aGraph 
)
inherited

Definition at line 228 of file sch_item.cpp.

230{
231 if( !IsConnectable() )
232 return nullptr;
233
234 SetConnectivityDirty( false );
235
236 SCH_CONNECTION* connection = Connection( &aSheet );
237
238 if( connection )
239 return connection;
240 else
241 return InitializeConnection( aSheet, aGraph );
242}
SCH_CONNECTION * InitializeConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Create a new connection object associated with this object.
Definition: sch_item.cpp:205
void SetConnectivityDirty(bool aDirty=true)
Definition: sch_item.h:415

References SCH_ITEM::Connection(), SCH_ITEM::InitializeConnection(), SCH_ITEM::IsConnectable(), and SCH_ITEM::SetConnectivityDirty().

◆ GetPageNumber()

wxString SCH_SHEET::GetPageNumber ( const SCH_SHEET_PATH aInstance) const

Return the sheet page number for aInstance.

Warning
The SCH_SHEET_PATH object must be a full hierarchical path which means the SCH_SHEET object at index 0 must be the root sheet. A partial sheet path will raise an assertion on debug builds and silently fail and return an empty page number on release builds.
Returns
the page number for the requested sheet instance.

Definition at line 1230 of file sch_sheet.cpp.

1231{
1232 wxCHECK( aSheetPath.IsFullPath(), wxEmptyString );
1233
1234 wxString pageNumber;
1235 KIID_PATH path = aSheetPath.Path();
1236
1237 for( const SCH_SHEET_INSTANCE& instance : m_instances )
1238 {
1239 if( instance.m_Path == path )
1240 {
1241 pageNumber = instance.m_PageNumber;
1242 break;
1243 }
1244 }
1245
1246 return pageNumber;
1247}

References SCH_SHEET_PATH::IsFullPath(), m_instances, SCH_SHEET_PATH::Path(), and path.

Referenced by SCH_SHEET_LIST::AllSheetPageNumbersEmpty(), HIERARCHY_NAVIG_PANEL::buildHierarchyTree(), SCH_EDITOR_CONTROL::FindNext(), SCH_SHEET_PATH::GetPageNumber(), HIERARCHY_NAVIG_PANEL::getRootString(), SCH_SHEET_LIST::GetSheetInstances(), Plot(), ResolveTextVar(), and DIALOG_SHEET_PROPERTIES::TransferDataToWindow().

◆ GetParent()

◆ GetPenWidth()

int SCH_SHEET::GetPenWidth ( ) const
overridevirtual
Returns
the size of the "pen" that be used to draw or plot this item

Reimplemented from SCH_ITEM.

Definition at line 578 of file sch_sheet.cpp.

579{
580 if( GetBorderWidth() > 0 )
581 return GetBorderWidth();
582
583 if( Schematic() )
585
587}
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:172
int GetBorderWidth() const
Definition: sch_sheet.h:108
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)

References DEFAULT_LINE_WIDTH_MILS, GetBorderWidth(), SCHEMATIC_SETTINGS::m_DefaultLineWidth, EDA_IU_SCALE::MilsToIU(), SCH_ITEM::Schematic(), schIUScale, and SCHEMATIC::Settings().

Referenced by AutoplaceFields(), KIGFX::SCH_PAINTER::draw(), GetBodyBoundingBox(), Plot(), and Print().

◆ GetPin()

SCH_SHEET_PIN * SCH_SHEET::GetPin ( const VECTOR2I aPosition)

Return the sheet pin item found at aPosition in the sheet.

Parameters
aPositionThe position to check for a sheet pin.
Returns
The sheet pin found at aPosition or NULL if no sheet pin is found.

Definition at line 566 of file sch_sheet.cpp.

567{
568 for( SCH_SHEET_PIN* pin : m_pins )
569 {
570 if( pin->HitTest( aPosition ) )
571 return pin;
572 }
573
574 return nullptr;
575}

References m_pins, and pin.

Referenced by SCH_SCREEN::GetSheetPin().

◆ GetPins() [1/2]

◆ GetPins() [2/2]

const std::vector< SCH_SHEET_PIN * > & SCH_SHEET::GetPins ( ) const
inline

Definition at line 173 of file sch_sheet.h.

173{ return m_pins; }

References m_pins.

◆ GetPosition()

◆ GetRotationCenter()

VECTOR2I SCH_SHEET::GetRotationCenter ( ) const

Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer than the edge it's on.

Use this instead, which always returns the center of the sheet itself.

Definition at line 678 of file sch_sheet.cpp.

679{
680 BOX2I box( m_pos, m_size );
681 return box.GetCenter();
682}

References BOX2< Vec >::GetCenter(), m_pos, and m_size.

Referenced by SCH_EDIT_TOOL::Rotate().

◆ GetScreen()

SCH_SCREEN * SCH_SHEET::GetScreen ( ) const
inline

Definition at line 103 of file sch_sheet.h.

103{ return m_screen; }

References m_screen.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_ALTIUM_PLUGIN::AddTextBox(), SCH_SCREENS::buildScreenList(), SCH_EDIT_FRAME::checkForNoFullyDefinedLibIds(), SCH_EDITOR_CONTROL::doCopy(), CONNECTION_GRAPH::ercCheckHierSheets(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), SCHEMATIC::GetFileName(), getSheetBbox(), SCH_DRAWING_TOOLS::importHierLabel(), SCH_EDIT_FRAME::InitSheet(), SCH_SHEET_PATH::LastScreen(), SCH_ALTIUM_PLUGIN::Load(), CADSTAR_SCH_ARCHIVE_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EAGLE_PLUGIN::loadInstance(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), SCH_EAGLE_PLUGIN::loadSegments(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), SCH_EDIT_FRAME::LoadSheetFromFile(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), SCH_LEGACY_PLUGIN::loadSymbol(), SCH_EAGLE_PLUGIN::moveLabels(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), 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::ParseDesignator(), SCH_ALTIUM_PLUGIN::ParseEllipse(), SCH_ALTIUM_PLUGIN::ParseFileHeader(), 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::ParseParameter(), 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_SEXPR_PARSER::parseSchSheetInstances(), SCH_ALTIUM_PLUGIN::ParseSheet(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseSignalHarness(), SCH_ALTIUM_PLUGIN::ParseWire(), SCH_SHEET_PATH::PathHumanReadable(), SCH_EDIT_TOOL::Properties(), SCHEMATIC::RootScreen(), SCH_LEGACY_PLUGIN::Save(), SCH_SEXPR_PLUGIN::Save(), SCH_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::saveSchematicFile(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), and SCH_EDITOR_CONTROL::updatePastedSheet().

◆ GetScreenCount()

int SCH_SHEET::GetScreenCount ( ) const

Return the number of times the associated screen for the sheet is being used.

If no screen is associated with the sheet, then zero is returned.

Definition at line 185 of file sch_sheet.cpp.

186{
187 if( m_screen == nullptr )
188 return 0;
189
190 return m_screen->GetRefCount();
191}

References SCH_SCREEN::GetRefCount(), and m_screen.

Referenced by DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged().

◆ GetSelectMenuText()

wxString SCH_SHEET::GetSelectMenuText ( UNITS_PROVIDER aUnitsProvider) const
overridevirtual

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 from EDA_ITEM.

Definition at line 1037 of file sch_sheet.cpp.

1038{
1039 return wxString::Format( _( "Hierarchical Sheet %s" ),
1040 m_fields[ SHEETNAME ].GetText() );
1041}

References _, Format(), EDA_UNIT_UTILS::GetText(), m_fields, and SHEETNAME.

◆ GetSize()

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

265{ 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:495

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.

◆ GetStoredPos()

VECTOR2I & SCH_ITEM::GetStoredPos ( )
inlineinherited

Definition at line 209 of file sch_item.h.

209{ return m_storedPos; }
VECTOR2I m_storedPos
Definition: sch_item.h:494

References SCH_ITEM::m_storedPos.

◆ GetStroke()

virtual STROKE_PARAMS SCH_ITEM::GetStroke ( ) const
inlinevirtualinherited

Reimplemented in SCH_BUS_ENTRY_BASE, SCH_LINE, and SCH_SHAPE.

Definition at line 457 of file sch_item.h.

457{ wxCHECK( false, STROKE_PARAMS() ); }
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88

Referenced by DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem().

◆ GetTypeDesc()

wxString EDA_ITEM::GetTypeDesc ( )
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:512

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

Referenced by PROPERTIES_PANEL::update().

◆ HasFlag()

◆ HasLineStroke()

virtual bool SCH_ITEM::HasLineStroke ( ) const
inlinevirtualinherited

Check if this schematic item has line stoke properties.

See also
STROKE_PARAMS
Returns
true if this schematic item support line stroke properties. Otherwise, false.

Reimplemented in SCH_BUS_ENTRY_BASE, SCH_LINE, and SCH_SHAPE.

Definition at line 455 of file sch_item.h.

455{ return false; }

Referenced by SCH_EDIT_TOOL::Init(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem().

◆ HasPin()

bool SCH_SHEET::HasPin ( const wxString &  aName) const

Checks if the sheet already has a sheet pin named aName.

Parameters
aNameName of the sheet pin to search for.
Returns
True if sheet pin with aName is found, otherwise false.

Definition at line 381 of file sch_sheet.cpp.

382{
383 for( SCH_SHEET_PIN* pin : m_pins )
384 {
385 if( pin->GetText().CmpNoCase( aName ) == 0 )
386 return true;
387 }
388
389 return false;
390}

References m_pins, and pin.

Referenced by SCH_DRAWING_TOOLS::importHierLabel().

◆ HasPins()

bool SCH_SHEET::HasPins ( ) const
inline

Definition at line 207 of file sch_sheet.h.

207{ return !m_pins.empty(); }

References m_pins.

◆ HasUndefinedPins()

bool SCH_SHEET::HasUndefinedPins ( ) const

Check all sheet labels against schematic for undefined hierarchical labels.

Returns
True if there are any undefined labels.

Definition at line 426 of file sch_sheet.cpp.

427{
428 for( SCH_SHEET_PIN* pin : m_pins )
429 {
430 /* Search the schematic for a hierarchical label corresponding to this sheet label. */
431 const SCH_HIERLABEL* HLabel = nullptr;
432
433 for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_HIER_LABEL_T ) )
434 {
435 if( !pin->GetText().CmpNoCase( static_cast<SCH_HIERLABEL*>( aItem )->GetText() ) )
436 {
437 HLabel = static_cast<SCH_HIERLABEL*>( aItem );
438 break;
439 }
440 }
441
442 if( HLabel == nullptr ) // Corresponding hierarchical label not found.
443 return true;
444 }
445
446 return false;
447}

References EDA_TEXT::GetText(), SCH_SCREEN::Items(), m_pins, m_screen, EE_RTREE::OfType(), pin, and SCH_HIER_LABEL_T.

Referenced by SCH_EDIT_TOOL::CleanupSheetPins().

◆ HitTest() [1/2]

bool SCH_SHEET::HitTest ( const BOX2I aRect,
bool  aContained,
int  aAccuracy = 0 
) const
overridevirtual

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 from EDA_ITEM.

Definition at line 1060 of file sch_sheet.cpp.

1061{
1062 BOX2I rect = aRect;
1063
1064 rect.Inflate( aAccuracy );
1065
1066 if( aContained )
1067 return rect.Contains( GetBodyBoundingBox() );
1068
1069 return rect.Intersects( GetBodyBoundingBox() );
1070}
bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:269
bool Contains(const Vec &aPoint) const
Definition: box2.h:141
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 >::Contains(), GetBodyBoundingBox(), BOX2< Vec >::Inflate(), and BOX2< Vec >::Intersects().

◆ HitTest() [2/2]

bool SCH_SHEET::HitTest ( const VECTOR2I aPosition,
int  aAccuracy 
) const
overridevirtual

Test if aPosition is inside or on the boundary of this item.

Parameters
aPositionA reference to a VECTOR2I object containing the coordinates to test.
aAccuracyIncrease the item bounding box by this amount.
Returns
True if aPosition is within the item bounding box.

Reimplemented from EDA_ITEM.

Definition at line 1050 of file sch_sheet.cpp.

1051{
1052 BOX2I rect = GetBodyBoundingBox();
1053
1054 rect.Inflate( aAccuracy );
1055
1056 return rect.Contains( aPosition );
1057}

References BOX2< Vec >::Contains(), GetBodyBoundingBox(), and BOX2< Vec >::Inflate().

◆ InitializeConnection()

SCH_CONNECTION * SCH_ITEM::InitializeConnection ( const SCH_SHEET_PATH aPath,
CONNECTION_GRAPH aGraph 
)
inherited

Create a new connection object associated with this object.

Parameters
aPathis the sheet path to initialize.

Definition at line 205 of file sch_item.cpp.

207{
208 SetConnectivityDirty( false );
209
210 SCH_CONNECTION* connection = Connection( &aSheet );
211
212 if( connection )
213 {
214 connection->Reset();
215 }
216 else
217 {
218 connection = new SCH_CONNECTION( this );
219 m_connection_map.insert( std::make_pair( aSheet, connection ) );
220 }
221
222 connection->SetGraph( aGraph );
223 connection->SetSheet( aSheet );
224 return connection;
225}
void Reset()
Clears connectivity information.
void SetGraph(CONNECTION_GRAPH *aGraph)
void SetSheet(SCH_SHEET_PATH aSheet)

References SCH_ITEM::Connection(), SCH_ITEM::m_connection_map, SCH_CONNECTION::Reset(), SCH_ITEM::SetConnectivityDirty(), SCH_CONNECTION::SetGraph(), and SCH_CONNECTION::SetSheet().

Referenced by SCH_ITEM::GetOrInitConnection().

◆ IsBrightened()

◆ IsConnectable()

bool SCH_SHEET::IsConnectable ( ) const
inlineoverridevirtual
Returns
true if the schematic item can connect to another schematic item.

Reimplemented from SCH_ITEM.

Definition at line 338 of file sch_sheet.h.

338{ return true; }

◆ IsConnected()

bool SCH_ITEM::IsConnected ( const VECTOR2I aPoint) const
inherited

Test the item to see if it is connected to aPoint.

Parameters
aPointis a reference to a VECTOR2I object containing the coordinates to test.
Returns
True if connection to aPoint exists.

Definition at line 137 of file sch_item.cpp.

138{
139 if(( m_flags & STRUCT_DELETED ) || ( m_flags & SKIP_STRUCT ) )
140 return false;
141
142 return doIsConnected( aPosition );
143}
virtual bool doIsConnected(const VECTOR2I &aPosition) const
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_item.h:488

References SCH_ITEM::doIsConnected(), EDA_ITEM::m_flags, SKIP_STRUCT, and STRUCT_DELETED.

Referenced by SCH_SCREEN::doIsJunction(), SCH_MOVE_TOOL::getConnectedItems(), SCH_SCREEN::IsTerminalPoint(), and SCH_SCREEN::MarkConnections().

◆ IsConnectivityDirty()

◆ IsDangling()

virtual bool SCH_ITEM::IsDangling ( ) const
inlinevirtualinherited

Reimplemented in SCH_BUS_ENTRY_BASE, SCH_LABEL_BASE, SCH_LINE, and SCH_PIN.

Definition at line 342 of file sch_item.h.

342{ return false; }

Referenced by SCH_EDIT_TOOL::ChangeTextType(), and KIGFX::SCH_PAINTER::draw().

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

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

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

References EDA_ITEM::m_forceVisible.

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

◆ IsHypertext()

virtual bool SCH_ITEM::IsHypertext ( ) const
inlinevirtualinherited

Allow items to support hypertext actions when hovered/clicked.

Reimplemented in SCH_FIELD, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 239 of file sch_item.h.

239{ return false; }

Referenced by SCH_ITEM::RenderAsBitmap().

◆ IsLocked()

virtual bool SCH_ITEM::IsLocked ( ) const
inlinevirtualinherited
Returns
true if the object is locked, else false.

Definition at line 229 of file sch_item.h.

229{ return false; }

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

◆ IsMovableFromAnchorPoint()

bool SCH_SHEET::IsMovableFromAnchorPoint ( ) const
inlineoverridevirtual

Return true for items which are moved with the anchor point at mouse cursor and false for items moved with no reference to anchor.

Usually return true for small items (labels, junctions) and false for items which can be large (hierarchical sheets, symbols).

Returns
false for a hierarchical sheet.

Reimplemented from SCH_ITEM.

Definition at line 89 of file sch_sheet.h.

89{ return false; }

◆ IsMoving()

◆ IsNew()

◆ IsPointClickableAnchor()

virtual bool SCH_ITEM::IsPointClickableAnchor ( const VECTOR2I aPos) const
inlinevirtualinherited
Returns
true if the given point can start drawing (usually means the anchor is unused/free/dangling).

Reimplemented in SCH_BUS_ENTRY_BASE, SCH_JUNCTION, SCH_LABEL, SCH_GLOBALLABEL, SCH_HIERLABEL, SCH_LINE, SCH_PIN, SCH_SHEET_PIN, and SCH_SYMBOL.

Definition at line 355 of file sch_item.h.

355{ return false; }

Referenced by EE_SELECTION_TOOL::autostartEvent().

◆ IsReplaceable()

bool SCH_SHEET::IsReplaceable ( ) const
inlineoverridevirtual

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 from EDA_ITEM.

Definition at line 322 of file sch_sheet.h.

322{ return true; }

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

◆ IsRootSheet()

bool SCH_SHEET::IsRootSheet ( ) const
Returns
true if this sheet is the root sheet.

Definition at line 194 of file sch_sheet.cpp.

195{
196 wxCHECK_MSG( Schematic(), false, "Can't call IsRootSheet without setting a schematic" );
197
198 return &Schematic()->Root() == this;
199}
SCH_SHEET & Root() const
Definition: schematic.h:90

References SCHEMATIC::Root(), and SCH_ITEM::Schematic().

Referenced by SCH_SEXPR_PLUGIN::Format(), SCH_SHEET_PATH::IsFullPath(), SCH_EDIT_FRAME::SaveProject(), and SCH_SHEET_LIST::SCH_SHEET_LIST().

◆ 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(), 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(), SCH_SCREEN::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::selectionContains(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), KIGFX::SCH_PAINTER::setDeviceColors(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), GERBVIEW_SELECTION_TOOL::unselect(), 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.

◆ IsType()

bool SCH_ITEM::IsType ( const std::vector< KICAD_T > &  aScanTypes) const
inlineoverridevirtualinherited

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 from EDA_ITEM.

Reimplemented in SCH_LABEL_BASE, and SCH_LINE.

Definition at line 162 of file sch_item.h.

163 {
164 if( EDA_ITEM::IsType( aScanTypes ) )
165 return true;
166
167 for( KICAD_T scanType : aScanTypes )
168 {
169 if( scanType == SCH_ITEM_LOCATE_WIRE_T && m_layer == LAYER_WIRE )
170 return true;
171
172 if ( scanType == SCH_ITEM_LOCATE_BUS_T && m_layer == LAYER_BUS )
173 return true;
174
175 if ( scanType == SCH_ITEM_LOCATE_GRAPHIC_LINE_T
176 && Type() == SCH_LINE_T && m_layer == LAYER_NOTES )
177 {
178 return true;
179 }
180 }
181
182 return false;
183 }
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
@ LAYER_NOTES
Definition: layer_ids.h:358
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_ITEM_LOCATE_WIRE_T
Definition: typeinfo.h:169
@ SCH_ITEM_LOCATE_BUS_T
Definition: typeinfo.h:170
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
Definition: typeinfo.h:171

References EDA_ITEM::IsType(), LAYER_BUS, LAYER_NOTES, LAYER_WIRE, SCH_ITEM::m_layer, SCH_ITEM_LOCATE_BUS_T, SCH_ITEM_LOCATE_GRAPHIC_LINE_T, SCH_ITEM_LOCATE_WIRE_T, SCH_LINE_T, and EDA_ITEM::Type().

Referenced by SCH_EDIT_TOOL::AutoplaceFields(), SCH_EDIT_FRAME::AutoRotateItem(), SCH_FIELD::IsType(), SCH_LABEL_BASE::IsType(), SCH_LINE::IsType(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsVerticalOrientation()

bool SCH_SHEET::IsVerticalOrientation ( ) const

Definition at line 405 of file sch_sheet.cpp.

406{
407 int leftRight = 0;
408 int topBottom = 0;
409
410 for( SCH_SHEET_PIN* pin : m_pins )
411 {
412 switch( pin->GetSide() )
413 {
414 case SHEET_SIDE::LEFT: leftRight++; break;
415 case SHEET_SIDE::RIGHT: leftRight++; break;
416 case SHEET_SIDE::TOP: topBottom++; break;
417 case SHEET_SIDE::BOTTOM: topBottom++; break;
418 default: break;
419 }
420 }
421
422 return topBottom > 0 && leftRight == 0;
423}

References BOTTOM, LEFT, m_pins, pin, RIGHT, and TOP.

Referenced by AutoplaceFields(), and SCH_SHEET_PIN::SCH_SHEET_PIN().

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

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

304 {
305 for( const auto& it : aList )
306 {
307 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
308 testData,
309 scanTypes ) == INSPECT_RESULT::QUIT )
310 {
312 }
313 }
314
316 }
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
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 322 of file eda_item.h.

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

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

◆ LocatePathOfScreen()

bool SCH_SHEET::LocatePathOfScreen ( SCH_SCREEN aScreen,
SCH_SHEET_PATH aList 
)

Search the existing hierarchy for an instance of screen loaded from aFileName.

Don't bother looking at the root sheet, it must be unique. No other references to its m_screen otherwise there would be loops in the hierarchy.

Parameters
[in]aScreenThe SCH_SCREEN* screen that we search for.
[in]aListThe SCH_SHEET_PATH* that must be used.
Returns
true if found.

Definition at line 743 of file sch_sheet.cpp.

744{
745 if( m_screen )
746 {
747 aList->push_back( this );
748
749 if( m_screen == aScreen )
750 return true;
751
752 for( EDA_ITEM* item : m_screen->Items().OfType( SCH_SHEET_T ) )
753 {
754 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
755
756 if( sheet->LocatePathOfScreen( aScreen, aList ) )
757 return true;
758 }
759
760 aList->pop_back();
761 }
762
763 return false;
764}
bool LocatePathOfScreen(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:743

References SCH_SCREEN::Items(), LocatePathOfScreen(), m_screen, EE_RTREE::OfType(), SCH_SHEET_PATH::pop_back(), SCH_SHEET_PATH::push_back(), and SCH_SHEET_T.

Referenced by SCH_EAGLE_PLUGIN::loadInstance(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), LocatePathOfScreen(), SCH_ALTIUM_PLUGIN::ParseDesignator(), SCH_ALTIUM_PLUGIN::ParseHarnessConnector(), SCH_ALTIUM_PLUGIN::ParseParameter(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), and SCH_ALTIUM_PLUGIN::ParseSheetSymbol().

◆ Matches() [1/2]

bool SCH_SHEET::Matches ( const EDA_SEARCH_DATA aSearchData,
void *  aAuxData 
) const
overridevirtual

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 from EDA_ITEM.

Definition at line 916 of file sch_sheet.cpp.

917{
918 // Sheets are searchable via the child field and pin item text.
919 return false;
920}

Referenced by SCH_DRAWING_TOOLS::DrawSheet().

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

◆ MirrorHorizontally()

void SCH_SHEET::MirrorHorizontally ( int  aCenter)
overridevirtual

Mirror item horizontally about aCenter.

Implements SCH_ITEM.

Definition at line 871 of file sch_sheet.cpp.

872{
873 int dx = m_pos.x;
874
875 MIRROR( m_pos.x, aCenter );
876 m_pos.x -= m_size.x;
877 dx -= m_pos.x; // dx,0 is the move vector for this transform
878
879 for( SCH_SHEET_PIN* sheetPin : m_pins )
880 sheetPin->MirrorHorizontally( aCenter );
881
882 for( SCH_FIELD& field : m_fields )
883 {
884 VECTOR2I pos = field.GetTextPos();
885 pos.x -= dx;
886 field.SetTextPos( pos );
887 }
888}
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Definition: mirror.h:40

References m_fields, m_pins, m_pos, m_size, MIRROR(), and VECTOR2< T >::x.

◆ MirrorVertically()

void SCH_SHEET::MirrorVertically ( int  aCenter)
overridevirtual

Mirror item vertically about aCenter.

Implements SCH_ITEM.

Definition at line 851 of file sch_sheet.cpp.

852{
853 int dy = m_pos.y;
854
855 MIRROR( m_pos.y, aCenter );
856 m_pos.y -= m_size.y;
857 dy -= m_pos.y; // 0,dy is the move vector for this transform
858
859 for( SCH_SHEET_PIN* sheetPin : m_pins )
860 sheetPin->MirrorVertically( aCenter );
861
862 for( SCH_FIELD& field : m_fields )
863 {
864 VECTOR2I pos = field.GetTextPos();
865 pos.y -= dy;
866 field.SetTextPos( pos );
867 }
868}

References m_fields, m_pins, m_pos, m_size, MIRROR(), and VECTOR2< T >::y.

◆ Move()

void SCH_SHEET::Move ( const VECTOR2I aMoveVector)
overridevirtual

Move the item by aMoveVector to a new position.

Implements SCH_ITEM.

Definition at line 797 of file sch_sheet.cpp.

798{
799 m_pos += aMoveVector;
800
801 for( SCH_SHEET_PIN* pin : m_pins )
802 pin->Move( aMoveVector );
803
804 for( SCH_FIELD& field : m_fields )
805 field.Move( aMoveVector );
806}

References m_fields, m_pins, m_pos, and pin.

Referenced by SetPosition().

◆ operator<() [1/2]

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}
virtual wxString GetClass() const =0
Return the class name.

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

◆ operator<() [2/2]

bool SCH_SHEET::operator< ( const SCH_ITEM aItem) const
overridevirtual

Reimplemented from SCH_ITEM.

Definition at line 1188 of file sch_sheet.cpp.

1189{
1190 if( Type() != aItem.Type() )
1191 return Type() < aItem.Type();
1192
1193 auto sheet = static_cast<const SCH_SHEET*>( &aItem );
1194
1195 if (m_fields[ SHEETNAME ].GetText() != sheet->m_fields[ SHEETNAME ].GetText() )
1196 return m_fields[ SHEETNAME ].GetText() < sheet->m_fields[ SHEETNAME ].GetText();
1197
1198 if (m_fields[ SHEETFILENAME ].GetText() != sheet->m_fields[ SHEETFILENAME ].GetText() )
1199 return m_fields[ SHEETFILENAME ].GetText() < sheet->m_fields[ SHEETFILENAME ].GetText();
1200
1201 return false;
1202}

References EDA_UNIT_UTILS::GetText(), m_fields, SHEETFILENAME, SHEETNAME, and EDA_ITEM::Type().

◆ operator=()

SCH_SHEET & SCH_SHEET::operator= ( const SCH_ITEM aSheet)

Definition at line 1158 of file sch_sheet.cpp.

1159{
1160 wxCHECK_MSG( Type() == aItem.Type(), *this,
1161 wxT( "Cannot assign object type " ) + aItem.GetClass() + wxT( " to type " ) +
1162 GetClass() );
1163
1164 if( &aItem != this )
1165 {
1166 SCH_ITEM::operator=( aItem );
1167
1168 SCH_SHEET* sheet = (SCH_SHEET*) &aItem;
1169
1170 m_pos = sheet->m_pos;
1171 m_size = sheet->m_size;
1172 m_fields = sheet->m_fields;
1173
1174 for( SCH_SHEET_PIN* pin : sheet->m_pins )
1175 {
1176 m_pins.emplace_back( new SCH_SHEET_PIN( *pin ) );
1177 m_pins.back()->SetParent( this );
1178 }
1179
1180 for( const SCH_SHEET_INSTANCE& instance : sheet->m_instances )
1181 m_instances.emplace_back( instance );
1182 }
1183
1184 return *this;
1185}
SCH_ITEM & operator=(const SCH_ITEM &aPin)
Definition: sch_item.cpp:70
wxString GetClass() const override
Return the class name.
Definition: sch_sheet.h:75

References SCH_ITEM::GetClass(), GetClass(), m_fields, m_instances, m_pins, m_pos, m_size, SCH_ITEM::operator=(), pin, SCH_SHEET_PIN, and EDA_ITEM::Type().

◆ Plot()

void SCH_SHEET::Plot ( PLOTTER aPlotter,
bool  aBackground 
) const
overridevirtual

Plot the schematic item to aPlotter.

Parameters
aPlotteris the PLOTTER object to plot to.
aBackgrounda poor-man's Z-order. The routine will get called twice, first with aBackground true and then with aBackground false.

Reimplemented from SCH_ITEM.

Definition at line 1073 of file sch_sheet.cpp.

1074{
1075 if( aBackground && !aPlotter->GetColorMode() )
1076 return;
1077
1078 auto* settings = dynamic_cast<KIGFX::SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
1079 bool override = settings ? settings->m_OverrideItemColors : false;
1080 COLOR4D borderColor = GetBorderColor();
1081 COLOR4D backgroundColor = GetBackgroundColor();
1082
1083 if( override || borderColor == COLOR4D::UNSPECIFIED )
1084 borderColor = aPlotter->RenderSettings()->GetLayerColor( LAYER_SHEET );
1085
1086 if( override || backgroundColor == COLOR4D::UNSPECIFIED )
1087 backgroundColor = aPlotter->RenderSettings()->GetLayerColor( LAYER_SHEET_BACKGROUND );
1088
1089 if( aBackground )
1090 {
1091 aPlotter->SetColor( backgroundColor );
1092 aPlotter->Rect( m_pos, m_pos + m_size, FILL_T::FILLED_SHAPE, 1 );
1093 }
1094 else
1095 {
1096 aPlotter->SetColor( borderColor );
1097
1098 int penWidth = std::max( GetPenWidth(), aPlotter->RenderSettings()->GetMinPenWidth() );
1099 aPlotter->Rect( m_pos, m_pos + m_size, FILL_T::NO_FILL, penWidth );
1100 }
1101
1102 // Make the sheet object a clickable hyperlink (e.g. for PDF plotter)
1103 std::vector<wxString> properties;
1104
1105 properties.emplace_back( EDA_TEXT::GotoPageHref( GetPageNumber( findSelf() ) ) );
1106
1107 for( const SCH_FIELD& field : GetFields() )
1108 {
1109 properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
1110 field.GetName(),
1111 field.GetShownText() ) );
1112 }
1113
1114 aPlotter->HyperlinkMenu( GetBoundingBox(), properties );
1115
1116 // Plot sheet pins
1117 for( SCH_SHEET_PIN* sheetPin : m_pins )
1118 sheetPin->Plot( aPlotter, aBackground );
1119
1120 // Plot the fields
1121 for( const SCH_FIELD& field : m_fields )
1122 field.Plot( aPlotter, aBackground );
1123}
static wxString GotoPageHref(const wxString &aDestination)
Generate a href to a page in the current schematic.
Definition: eda_text.cpp:1000
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
Store schematic specific render settings.
Definition: sch_painter.h:71
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:141
bool GetColorMode() const
Definition: plotter.h:138
virtual void HyperlinkMenu(const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
Create a clickable hyperlink menu with a rectangular click area.
Definition: plotter.h:446
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetColor(const COLOR4D &color)=0
wxString GetPageNumber(const SCH_SHEET_PATH &aInstance) const
Return the sheet page number for aInstance.
Definition: sch_sheet.cpp:1230
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:91
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_sheet.cpp:667
KIGFX::COLOR4D GetBorderColor() const
Definition: sch_sheet.h:111
KIGFX::COLOR4D GetBackgroundColor() const
Definition: sch_sheet.h:114
@ FILLED_SHAPE
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:373

References FILLED_SHAPE, findSelf(), Format(), GetBackgroundColor(), GetBorderColor(), GetBoundingBox(), PLOTTER::GetColorMode(), GetFields(), KIGFX::RENDER_SETTINGS::GetLayerColor(), KIGFX::RENDER_SETTINGS::GetMinPenWidth(), GetPageNumber(), GetPenWidth(), EDA_TEXT::GotoPageHref(), PLOTTER::HyperlinkMenu(), LAYER_SHEET, LAYER_SHEET_BACKGROUND, m_fields, KIGFX::SCH_RENDER_SETTINGS::m_OverrideItemColors, m_pins, m_pos, m_size, NO_FILL, PLOTTER::Rect(), PLOTTER::RenderSettings(), and PLOTTER::SetColor().

◆ Print()

void SCH_SHEET::Print ( const RENDER_SETTINGS aSettings,
const VECTOR2I aOffset 
)
overridevirtual

Print a schematic item.

Each schematic item should have its own method

Parameters
aOffsetis the drawing offset (usually {0,0} but can be different when moving an object).

Implements SCH_ITEM.

Definition at line 1126 of file sch_sheet.cpp.

1127{
1128 wxDC* DC = aSettings->GetPrintDC();
1129 VECTOR2I pos = m_pos + aOffset;
1130 int lineWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() );
1131 const auto* settings = dynamic_cast<const KIGFX::SCH_RENDER_SETTINGS*>( aSettings );
1132 bool override = settings && settings->m_OverrideItemColors;
1133 COLOR4D border = GetBorderColor();
1134 COLOR4D background = GetBackgroundColor();
1135
1136 if( override || border == COLOR4D::UNSPECIFIED )
1137 border = aSettings->GetLayerColor( LAYER_SHEET );
1138
1139 if( override || background == COLOR4D::UNSPECIFIED )
1140 background = aSettings->GetLayerColor( LAYER_SHEET_BACKGROUND );
1141
1142 if( GetGRForceBlackPenState() ) // printing in black & white
1143 background = COLOR4D::UNSPECIFIED;
1144
1145 if( background != COLOR4D::UNSPECIFIED )
1146 GRFilledRect( DC, pos, pos + m_size, 0, background, background );
1147
1148 GRRect( DC, pos, pos + m_size, lineWidth, border );
1149
1150 for( SCH_FIELD& field : m_fields )
1151 field.Print( aSettings, aOffset );
1152
1153 for( SCH_SHEET_PIN* sheetPin : m_pins )
1154 sheetPin->Print( aSettings, aOffset );
1155}
int GetDefaultPenWidth() const
wxDC * GetPrintDC() const
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
Definition: gr_basic.cpp:387
void GRFilledRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
Definition: gr_basic.cpp:394
bool GetGRForceBlackPenState(void)
Definition: gr_basic.cpp:156

References GetBackgroundColor(), GetBorderColor(), KIGFX::RENDER_SETTINGS::GetDefaultPenWidth(), GetGRForceBlackPenState(), KIGFX::RENDER_SETTINGS::GetLayerColor(), GetPenWidth(), KIGFX::RENDER_SETTINGS::GetPrintDC(), GRFilledRect(), GRRect(), LAYER_SHEET, LAYER_SHEET_BACKGROUND, m_fields, KIGFX::SCH_RENDER_SETTINGS::m_OverrideItemColors, m_pins, m_pos, and m_size.

◆ PrintBackground()

virtual void SCH_ITEM::PrintBackground ( const RENDER_SETTINGS aSettings,
const VECTOR2I aOffset 
)
inlinevirtualinherited

Print the (optional) backaground elements if they exist.

Parameters
aSettingsPrint settings
aOffsetis the drawing offset (usually {0,0} but can be different when moving an object).

Reimplemented in SCH_SHAPE, and SCH_SYMBOL.

Definition at line 286 of file sch_item.h.

286{};

◆ RemovePin()

void SCH_SHEET::RemovePin ( const SCH_SHEET_PIN aSheetPin)

Remove aSheetPin from the sheet.

Parameters
aSheetPinThe sheet pin item to remove from the sheet.

Definition at line 364 of file sch_sheet.cpp.

365{
366 wxASSERT( aSheetPin != nullptr );
367 wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
368
369 for( auto i = m_pins.begin(); i < m_pins.end(); ++i )
370 {
371 if( *i == aSheetPin )
372 {
373 m_pins.erase( i );
374 renumberPins();
375 return;
376 }
377 }
378}

References m_pins, renumberPins(), SCH_SHEET_PIN_T, and EDA_ITEM::Type().

Referenced by SCH_SCREEN::DeleteItem(), and SCH_EDIT_TOOL::DoDelete().

◆ RenderAsBitmap()

bool SCH_ITEM::RenderAsBitmap ( double  aWorldScale) const
overridevirtualinherited

Reimplemented from EDA_ITEM.

Definition at line 294 of file sch_item.cpp.

295{
296 if( IsHypertext() )
297 return false;
298
299 if( const EDA_TEXT* text = dynamic_cast<const EDA_TEXT*>( this ) )
300 return text->GetTextHeight() * aWorldScale < BITMAP_FONT_SIZE_THRESHOLD;
301
302 return false;
303}
virtual bool IsHypertext() const
Allow items to support hypertext actions when hovered/clicked.
Definition: sch_item.h:239
#define BITMAP_FONT_SIZE_THRESHOLD
Definition: sch_item.cpp:46

References BITMAP_FONT_SIZE_THRESHOLD, SCH_ITEM::IsHypertext(), and text.

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

◆ renumberPins()

void SCH_SHEET::renumberPins ( )
protected

Renumber the sheet pins in the sheet.

This method is used internally by SCH_SHEET to update the pin numbering when the pin list changes. Make sure you call this method any time a sheet pin is added or removed.

Definition at line 923 of file sch_sheet.cpp.

924{
925 int id = 2;
926
927 for( SCH_SHEET_PIN* pin : m_pins )
928 {
929 pin->SetNumber( id );
930 id++;
931 }
932}

References m_pins, and pin.

Referenced by AddPin(), and RemovePin().

◆ 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_PIN, SCH_TEXT, SCH_TEXTBOX, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 409 of file eda_item.h.

410 {
411 return false;
412 }

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

◆ Resize()

void SCH_SHEET::Resize ( const wxSize &  aSize)

Resize this sheet to aSize and adjust all of the labels accordingly.

Parameters
[in]aSizeThe new size for this sheet.

Definition at line 899 of file sch_sheet.cpp.

900{
901 if( aSize == m_size )
902 return;
903
904 m_size = aSize;
905
906 // Move the fields if we're in autoplace mode
908 AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
909
910 // Move the sheet labels according to the new sheet size.
911 for( SCH_SHEET_PIN* sheetPin : m_pins )
912 sheetPin->ConstrainOnEdge( sheetPin->GetPosition() );
913}
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:590

References AutoplaceFields(), FIELDS_AUTOPLACED_AUTO, SCH_ITEM::m_fieldsAutoplaced, m_pins, and m_size.

Referenced by SCH_DRAWING_TOOLS::sizeSheet().

◆ ResolveTextVar()

bool SCH_SHEET::ResolveTextVar ( wxString *  token,
int  aDepth = 0 
) const

Resolve any references to system tokens supported by the sheet.

Parameters
aDepthis a counter to limit recursion and circular references.

Definition at line 233 of file sch_sheet.cpp.

234{
235 for( int i = 0; i < SHEET_MANDATORY_FIELDS; ++i )
236 {
237 if( token->IsSameAs( m_fields[i].GetCanonicalName().Upper() ) )
238 {
239 *token = m_fields[i].GetShownText( aDepth + 1 );
240 return true;
241 }
242 }
243
244 for( size_t i = SHEET_MANDATORY_FIELDS; i < m_fields.size(); ++i )
245 {
246 if( token->IsSameAs( m_fields[i].GetName() ) )
247 {
248 *token = m_fields[i].GetShownText( aDepth + 1 );
249 return true;
250 }
251 }
252
253 PROJECT *project = &Schematic()->Prj();
254
255 // We cannot resolve text variables initially on load as we need to first load the screen and
256 // then parse the hierarchy. So skip the resolution if the screen isn't set yet
258 {
259 return true;
260 }
261
262 if( token->IsSameAs( wxT( "#" ) ) )
263 {
264 *token = wxString::Format( "%s", findSelf().GetPageNumber() );
265 return true;
266 }
267 else if( token->IsSameAs( wxT( "##" ) ) )
268 {
269 SCH_SHEET_LIST sheetList = Schematic()->GetSheets();
270 *token = wxString::Format( wxT( "%d" ), (int) sheetList.size() );
271 return true;
272 }
273 else if( token->IsSameAs( wxT( "SHEETPATH" ) ) )
274 {
275 *token = findSelf().PathHumanReadable();
276 return true;
277 }
278 else
279 {
280 // See if any of the sheets up the hierarchy can resolve it:
281
282 SCH_SHEET_PATH sheetPath = findSelf();
283
284 if( sheetPath.size() >= 2 )
285 {
286 sheetPath.pop_back();
287
288 if( sheetPath.Last()->ResolveTextVar( token, aDepth ) )
289 return true;
290 }
291 }
292
293 return false;
294}
Container for project specific data.
Definition: project.h:63
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
Definition: schematic.h:85
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
wxString PathHumanReadable(bool aUseShortRootName=true) const
Return the sheet path in a human readable form made from the sheet names.
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
Definition: sch_sheet.cpp:233
bool TextVarResolver(wxString *aToken, const PROJECT *aProject) const
Definition: title_block.cpp:95

References findSelf(), Format(), GetPageNumber(), SCHEMATIC::GetSheets(), SCH_SCREEN::GetTitleBlock(), SCH_SHEET_PATH::Last(), m_fields, m_screen, SCH_SHEET_PATH::PathHumanReadable(), SCH_SHEET_PATH::pop_back(), SCHEMATIC::Prj(), project, ResolveTextVar(), SCH_ITEM::Schematic(), SHEET_MANDATORY_FIELDS, SCH_SHEET_PATH::size(), and TITLE_BLOCK::TextVarResolver().

Referenced by SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), SCH_TEXTBOX::GetShownText(), SCHEMATIC::ResolveCrossReference(), SCH_LABEL_BASE::ResolveTextVar(), and ResolveTextVar().

◆ Rotate()

void SCH_SHEET::Rotate ( const VECTOR2I aCenter)
overridevirtual

Rotate the item around aCenter 90 degrees in the clockwise direction.

Implements SCH_ITEM.

Definition at line 809 of file sch_sheet.cpp.

810{
811 VECTOR2I prev = m_pos;
812
813 RotatePoint( m_pos, aCenter, ANGLE_90 );
815
816 if( m_size.x < 0 )
817 {
818 m_pos.x += m_size.x;
819 m_size.x = -m_size.x;
820 }
821
822 if( m_size.y < 0 )
823 {
824 m_pos.y += m_size.y;
825 m_size.y = -m_size.y;
826 }
827
828 // Pins must be rotated first as that's how we determine vertical vs horizontal
829 // orientation for auto-placement
830 for( SCH_SHEET_PIN* sheetPin : m_pins )
831 sheetPin->Rotate( aCenter );
832
834 {
835 AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
836 }
837 else
838 {
839 // Move the fields to the new position because the parent itself has moved.
840 for( SCH_FIELD& field : m_fields )
841 {
842 VECTOR2I pos = field.GetTextPos();
843 pos.x -= prev.x - m_pos.x;
844 pos.y -= prev.y - m_pos.y;
845 field.SetTextPos( pos );
846 }
847 }
848}
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:414
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Definition: trigo.cpp:183

References ANGLE_90, AutoplaceFields(), FIELDS_AUTOPLACED_AUTO, m_fields, SCH_ITEM::m_fieldsAutoplaced, m_pins, m_pos, m_size, RotatePoint(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SCH_EDIT_TOOL::Rotate().

◆ RunOnChildren()

void SCH_SHEET::RunOnChildren ( const std::function< void(SCH_ITEM *)> &  aFunction)
overridevirtual

Reimplemented from SCH_ITEM.

Definition at line 1027 of file sch_sheet.cpp.

1028{
1029 for( SCH_FIELD& field : m_fields )
1030 aFunction( &field );
1031
1032 for( SCH_SHEET_PIN* pin : m_pins )
1033 aFunction( pin );
1034}

References m_fields, m_pins, and pin.

◆ Schematic()

SCHEMATIC * SCH_ITEM::Schematic ( ) const
inherited

Searches the item hierarchy to find a SCHEMATIC.

Every SCH_ITEM that lives on a SCH_SCREEN should be parented to either that screen or another SCH_ITEM on the same screen (for example, pins to their symbols).

Every SCH_SCREEN should be parented to the SCHEMATIC.

Note
This hierarchy is not the same as the sheet hierarchy!
Returns
the parent schematic this item lives on, or nullptr.

Definition at line 112 of file sch_item.cpp.

113{
114 EDA_ITEM* parent = GetParent();
115
116 while( parent )
117 {
118 if( parent->Type() == SCHEMATIC_T )
119 return static_cast<SCHEMATIC*>( parent );
120 else
121 parent = parent->GetParent();
122 }
123
124 return nullptr;
125}
EDA_ITEM * GetParent() const
Definition: eda_item.h:99
@ SCHEMATIC_T
Definition: typeinfo.h:187

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

Referenced by SCH_EDIT_TOOL::ChangeTextType(), SCH_ITEM::Connection(), SCH_DRAWING_TOOLS::createSheetPin(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), findSelf(), SCH_MARKER::GetColorLayer(), SCH_ITEM::GetEffectiveNetClass(), SCH_JUNCTION::getEffectiveShape(), SCH_LABEL_BASE::GetIntersheetRefs(), SCH_LABEL_BASE::GetLabelBoxExpansion(), SCH_DIRECTIVE_LABEL::GetPenWidth(), SCH_LINE::GetPenWidth(), SCH_NO_CONNECT::GetPenWidth(), SCH_SHAPE::GetPenWidth(), GetPenWidth(), SCH_SHEET_PIN::GetPenWidth(), SCH_SYMBOL::GetPins(), SCH_MARKER::GetSeverity(), SCH_FIELD::GetShownText(), SCH_LABEL_BASE::GetShownText(), SCH_TEXT::GetShownText(), SCH_TEXTBOX::GetShownText(), SCH_TEXT::GetTextOffset(), SCH_PIN::HitTest(), IsRootSheet(), SCH_LABEL_BASE::IsType(), DIALOG_SYMBOL_PROPERTIES::OnAddField(), DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded(), DIALOG_TEXT_PROPERTIES::onScintillaCharAdded(), SCH_LABEL_BASE::ResolveTextVar(), SCH_GLOBALLABEL::ResolveTextVar(), ResolveTextVar(), SCH_SYMBOL::ResolveTextVar(), SCH_SYMBOL::SetFootprint(), SCH_SYMBOL::SetRef(), SCH_SYMBOL::SetValue(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataToWindow(), DIALOG_SCH_FIELD_PROPERTIES::UpdateField(), and SCH_MARKER::ViewGetLayers().

◆ SearchHierarchy()

bool SCH_SHEET::SearchHierarchy ( const wxString &  aFilename,
SCH_SCREEN **  aScreen 
)

Search the existing hierarchy for an instance of screen loaded from aFileName.

Parameters
aFilenameThe filename to find (MUST be absolute, and in wxPATH_NATIVE encoding).
aScreenA location to return a pointer to the screen (if found).
Returns
true if found, and a pointer to the screen

Definition at line 707 of file sch_sheet.cpp.

708{
709 if( m_screen )
710 {
711 // Only check the root sheet once and don't recurse.
712 if( !GetParent() )
713 {
714 if( m_screen && m_screen->GetFileName().Cmp( aFilename ) == 0 )
715 {
716 *aScreen = m_screen;
717 return true;
718 }
719 }
720
721 for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_SHEET_T ) )
722 {
723 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( aItem );
724 SCH_SCREEN* screen = sheet->m_screen;
725
726 // Must use the screen's path (which is always absolute) rather than the
727 // sheet's (which could be relative).
728 if( screen && screen->GetFileName().Cmp( aFilename ) == 0 )
729 {
730 *aScreen = screen;
731 return true;
732 }
733
734 if( sheet->SearchHierarchy( aFilename, aScreen ) )
735 return true;
736 }
737 }
738
739 return false;
740}
const wxString & GetFileName() const
Definition: sch_screen.h:143
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:707

References SCH_SCREEN::GetFileName(), EDA_ITEM::GetParent(), SCH_SCREEN::Items(), m_screen, EE_RTREE::OfType(), SCH_SHEET_T, and SearchHierarchy().

Referenced by SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), SCH_EDITOR_CONTROL::Paste(), and SearchHierarchy().

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

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

◆ SetBackgroundColor()

◆ SetBorderColor()

◆ SetBorderWidth()

void SCH_SHEET::SetBorderWidth ( int  aWidth)
inline

◆ SetBrightened()

◆ SetConnectivityDirty()

◆ SetFields()

void SCH_SHEET::SetFields ( const std::vector< SCH_FIELD > &  aFields)

Set multiple schematic fields.

Parameters
aFieldsare the fields to set in this symbol.

Definition at line 331 of file sch_sheet.cpp.

332{
333 m_fields = aFields;
334 int next_id = SHEET_MANDATORY_FIELDS;
335
336 for( int ii = 0; ii < int( m_fields.size() ); )
337 {
338 if( m_fields[ii].GetId() < 0 || m_fields[ii].GetId() >= ssize_t( m_fields.size() ) )
339 m_fields[ii].SetId( next_id++ );
340
341 if( m_fields[ii].GetId() != ii )
342 std::swap( m_fields[ii], m_fields[m_fields[ii].GetId()]);
343
344 if( m_fields[ii].GetId() == ii )
345 ++ii;
346 }
347
348 // Make sure that we get the UNIX variant of the file path
350}
void SetFileName(const wxString &aFilename)
Definition: sch_sheet.h:305

References EDA_UNIT_UTILS::GetText(), m_fields, SetFileName(), SHEET_MANDATORY_FIELDS, and SHEETFILENAME.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), DIALOG_SHEET_PROPERTIES::OnUpdateUI(), and DIALOG_SHEET_PROPERTIES::TransferDataFromWindow().

◆ SetFieldsAutoplaced()

void SCH_ITEM::SetFieldsAutoplaced ( )
inlineinherited

◆ SetFileName()

void SCH_SHEET::SetFileName ( const wxString &  aFilename)
inline

Definition at line 305 of file sch_sheet.h.

306 {
307 // Filenames are stored using unix notation
308 wxString tmp = aFilename;
309 tmp.Replace( wxT( "\\" ), wxT( "/" ) );
310 m_fields[ SHEETFILENAME ].SetText( tmp );
311 }

References m_fields, and SHEETFILENAME.

Referenced by SCH_EDIT_FRAME::importFile(), SCH_ALTIUM_PLUGIN::Load(), CADSTAR_SCH_ARCHIVE_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), SCH_EDIT_FRAME::LoadSheetFromFile(), SCH_SHEET_PATH::MakeFilePathRelativeToParentSheet(), SCH_EDIT_FRAME::SaveProject(), and SetFields().

◆ 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(), EDIT_TOOL::doMoveSelection(), 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(), SCH_SCREEN::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::ParseHarnessConnector(), 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().

◆ SetInstances()

void SCH_SHEET::SetInstances ( const std::vector< SCH_SHEET_INSTANCE > &  aInstances)
inline

Definition at line 380 of file sch_sheet.h.

381 {
382 m_instances = aInstances;
383 }

References m_instances.

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

◆ SetLastResolvedState()

virtual void SCH_ITEM::SetLastResolvedState ( const SCH_ITEM aItem)
inlinevirtualinherited

Reimplemented in SCH_BUS_ENTRY_BASE, SCH_FIELD, SCH_JUNCTION, SCH_LABEL_BASE, and SCH_LINE.

Definition at line 417 of file sch_item.h.

417{ }

Referenced by SCH_EDITOR_CONTROL::Paste().

◆ SetLayer()

void SCH_ITEM::SetLayer ( SCH_LAYER_ID  aLayer)
inlineinherited

◆ SetLocked()

virtual void SCH_ITEM::SetLocked ( bool  aLocked)
inlinevirtualinherited

Set the 'lock' status to aLocked for of this item.

Definition at line 234 of file sch_item.h.

234{}

◆ SetModified()

◆ SetPageNumber()

void SCH_SHEET::SetPageNumber ( const SCH_SHEET_PATH aInstance,
const wxString &  aPageNumber 
)

Set the page number for the sheet instance aInstance.

Warning
The SCH_SHEET_PATH object must be a full hierarchical path which means the SCH_SHEET object at index 0 must be the root sheet. A partial sheet path will raise an assertion on debug builds and silently fail and return on release builds.
Parameters
[in]aInstanceis the hierarchical path of the sheet.
[in]aReferenceis the new page number for the sheet.

Definition at line 1250 of file sch_sheet.cpp.

1251{
1252 wxCHECK( aSheetPath.IsFullPath(), /* void */ );
1253
1254 KIID_PATH path = aSheetPath.Path();
1255
1256 for( SCH_SHEET_INSTANCE& instance : m_instances )
1257 {
1258 if( instance.m_Path == path )
1259 {
1260 instance.m_PageNumber = aPageNumber;
1261 break;
1262 }
1263 }
1264}

References SCH_SHEET_PATH::IsFullPath(), m_instances, SCH_SHEET_PATH::Path(), and path.

Referenced by SCH_EDIT_FRAME::CreateScreens(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_ALTIUM_PLUGIN::Load(), SCH_EAGLE_PLUGIN::loadSchematic(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), SCH_ALTIUM_PLUGIN::ParseHarnessConnector(), SCH_ALTIUM_PLUGIN::ParseParameter(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_SHEET_LIST::SetInitialPageNumbers(), SCH_SHEET_PATH::SetPageNumber(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), SCH_EDITOR_CONTROL::updatePastedSheet(), and SCH_SHEET_LIST::UpdateSheetInstances().

◆ 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(), AddPin(), PAD::AddPrimitive(), PAD::AddPrimitiveAnnotationBox(), PAD::AddPrimitiveArc(), PAD::AddPrimitiveCircle(), PAD::AddPrimitiveCurve(), PAD::AddPrimitivePoly(), PAD::AddPrimitiveRect(), PAD::AddPrimitiveSegment(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SCH_SCREEN::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(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), 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(), PIN_TABLE_DATA_MODEL::SetValue(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_LABEL_BASE::SwapData(), SwapData(), SCH_SYMBOL::SwapData(), SwapItemData(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetPosition()

void SCH_SHEET::SetPosition ( const VECTOR2I aPosition)
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 891 of file sch_sheet.cpp.

892{
893 // Remember the sheet and all pin sheet positions must be
894 // modified. So use Move function to do that.
895 Move( aPosition - m_pos );
896}
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.cpp:797

References m_pos, and Move().

Referenced by TEST_EE_ITEM_FIXTURE::TEST_EE_ITEM_FIXTURE(), and EE_POINT_EDITOR::updateParentItem().

◆ SetScreen()

void SCH_SHEET::SetScreen ( SCH_SCREEN aScreen)

Set the SCH_SCREEN associated with this sheet to aScreen.

The screen reference counting is performed by SetScreen. If aScreen is not the same as the current screen, the current screen reference count is decremented and aScreen becomes the screen for the sheet. If the current screen reference count reaches zero, the current screen is deleted. NULL is a valid value for aScreen.

Parameters
aScreenThe new screen to associate with the sheet.

Definition at line 162 of file sch_sheet.cpp.

163{
164 if( aScreen == m_screen )
165 return;
166
167 if( m_screen != nullptr )
168 {
170
171 if( m_screen->GetRefCount() == 0 )
172 {
173 delete m_screen;
174 m_screen = nullptr;
175 }
176 }
177
178 m_screen = aScreen;
179
180 if( m_screen )
182}

References SCH_SCREEN::DecRefCount(), SCH_SCREEN::GetRefCount(), SCH_SCREEN::IncRefCount(), and m_screen.

Referenced by SCH_EDIT_FRAME::CreateScreens(), SCH_DRAWING_TOOLS::DrawSheet(), 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(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), SCH_ALTIUM_PLUGIN::ParseHarnessConnector(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), and SCH_EDITOR_CONTROL::Paste().

◆ SetSelected()

◆ SetSize()

void SCH_SHEET::SetSize ( const wxSize &  aSize)
inline

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

◆ SetStoredPos()

void SCH_ITEM::SetStoredPos ( const VECTOR2I aPos)
inlineinherited

Definition at line 210 of file sch_item.h.

210{ m_storedPos = aPos; }

References SCH_ITEM::m_storedPos.

Referenced by SCH_MOVE_TOOL::Main().

◆ SetStroke()

virtual void SCH_ITEM::SetStroke ( const STROKE_PARAMS aStroke)
inlinevirtualinherited

Reimplemented in SCH_BUS_ENTRY_BASE, SCH_LINE, and SCH_SHAPE.

Definition at line 459 of file sch_item.h.

459{ wxCHECK( false, /* void */ ); }

Referenced by DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem().

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

438{ return *aLeft < *aRight; }

◆ SwapData()

void SCH_SHEET::SwapData ( SCH_ITEM aItem)
overridevirtual

Swap the internal data structures aItem with the schematic item.

Obviously, aItem must have the same type than me.

Parameters
aItemThe item to swap the data structures with.

Reimplemented from SCH_ITEM.

Definition at line 297 of file sch_sheet.cpp.

298{
299 wxCHECK_RET( aItem->Type() == SCH_SHEET_T,
300 wxString::Format( wxT( "SCH_SHEET object cannot swap data with %s object." ),
301 aItem->GetClass() ) );
302
303 SCH_SHEET* sheet = ( SCH_SHEET* ) aItem;
304
305 std::swap( m_pos, sheet->m_pos );
306 std::swap( m_size, sheet->m_size );
307 m_fields.swap( sheet->m_fields );
308 std::swap( m_fieldsAutoplaced, sheet->m_fieldsAutoplaced );
309 m_pins.swap( sheet->m_pins );
310
311 // Update parent pointers after swapping.
312 for( SCH_SHEET_PIN* sheetPin : m_pins )
313 sheetPin->SetParent( this );
314
315 for( SCH_SHEET_PIN* sheetPin : sheet->m_pins )
316 sheetPin->SetParent( sheet );
317
318 for( SCH_FIELD& field : m_fields )
319 field.SetParent( this );
320
321 for( SCH_FIELD& field : sheet->m_fields )
322 field.SetParent( sheet );
323
324 std::swap( m_borderWidth, sheet->m_borderWidth );
325 std::swap( m_borderColor, sheet->m_borderColor );
326 std::swap( m_backgroundColor, sheet->m_backgroundColor );
327 std::swap( m_instances, sheet->m_instances );
328}
virtual wxString GetClass() const override
Return the class name.
Definition: sch_item.h:157

References Format(), SCH_ITEM::GetClass(), m_backgroundColor, m_borderColor, m_borderWidth, m_fields, SCH_ITEM::m_fieldsAutoplaced, m_instances, m_pins, m_pos, m_size, SCH_SHEET_T, EDA_ITEM::SetParent(), and EDA_ITEM::Type().

◆ SymbolCount()

int SCH_SHEET::SymbolCount ( ) const

Count our own symbols, without the power symbols.

Definition at line 685 of file sch_sheet.cpp.

686{
687 int n = 0;
688
689 if( m_screen )
690 {
691 for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_SYMBOL_T ) )
692 {
693 SCH_SYMBOL* symbol = (SCH_SYMBOL*) aItem;
694
695 if( symbol->GetField( VALUE_FIELD )->GetText().GetChar( 0 ) != '#' )
696 n++;
697 }
698
699 for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_SHEET_T ) )
700 n += static_cast<const SCH_SHEET*>( aItem )->SymbolCount();
701 }
702
703 return n;
704}
int SymbolCount() const
Count our own symbols, without the power symbols.
Definition: sch_sheet.cpp:685
Schematic symbol object.
Definition: sch_symbol.h:80
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:892
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".

References SCH_SYMBOL::GetField(), EDA_TEXT::GetText(), SCH_SCREEN::Items(), m_screen, EE_RTREE::OfType(), SCH_SHEET_T, SCH_SYMBOL_T, SymbolCount(), and VALUE_FIELD.

Referenced by SymbolCount().

◆ 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; }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:505

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(), CONNECTION_SUBGRAPH::AddItem(), DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), SCH_MOVE_TOOL::AlignElements(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), SCH_SCREEN::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(), 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(), SCH_SCREEN::ClassOf(), 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(), SCH_SCREEN::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::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(), 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(), SELECTION::GetItemsSortedByTypeAndXY(), 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(), getTopLevelGroup(), EDA_ITEM::GetTypeDesc(), PCB_EXPR_TYPE_REF::GetValue(), 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(), SCH_SCREEN::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<(), operator<(), SCH_SYMBOL::operator<(), SCH_TEXT::operator<(), SCH_TEXTBOX::operator<(), PCB_BITMAP::operator=(), SCH_BITMAP::operator=(), SCH_SYMBOL::operator=(), operator=(), LIB_ITEM::operator==(), PAD::PAD(), EDIT_TOOL::PadFilter(), BOARD_EDITOR_CONTROL::PageSettings(), 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_TEXT_AND_GRAPHICS::processItem(), 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(), SCH_SCREEN::Remove(), KIGFX::PCB_VIEW::Remove(), PCB_POINT_EDITOR::removeCorner(), PCB_POINT_EDITOR::removeCornerCondition(), LIB_SYMBOL::RemoveDrawItem(), 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(), 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(), SCH_SCREEN::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(), SwapData(), SCH_SHEET_PIN::SwapData(), SCH_SYMBOL::SwapData(), SwapItemData(), 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::TransformShapeWithClearanceToPolygon(), 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(), Visit(), GERBER_DRAW_ITEM::Visit(), PCB_TRACK::Visit(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and NETLIST_EXPORTER_CADSTAR::writeListOfNets().

◆ UpdateDanglingState()

bool SCH_SHEET::UpdateDanglingState ( std::vector< DANGLING_END_ITEM > &  aItemList,
const SCH_SHEET_PATH aPath = nullptr 
)
overridevirtual

Test the schematic item to aItemList to check if it's dangling state has changed.

Note that the return value only true when the state of the test has changed. Use the IsDangling() method to get the current dangling state of the item. Some of the schematic objects cannot be tested for a dangling state, the default method always returns false. Only override the method if the item can be tested for a dangling state.

If aSheet is passed a non-null pointer to a SCH_SHEET_PATH, the overridden method can optionally use it to update sheet-local connectivity information

Parameters
aItemListis the list of items to test item against.
aSheetis the sheet path to update connections for.
Returns
True if the dangling state has changed from it's current setting.

Reimplemented from SCH_ITEM.

Definition at line 967 of file sch_sheet.cpp.

969{
970 bool changed = false;
971
972 for( SCH_SHEET_PIN* sheetPin : m_pins )
973 changed |= sheetPin->UpdateDanglingState( aItemList );
974
975 return changed;
976}

References m_pins.

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

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

Returns
the current bounding box.

Implements KIGFX::VIEW_ITEM.

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

Definition at line 254 of file eda_item.cpp.

255{
256 // Basic fallback
257 return GetBoundingBox();
258}
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:74

References EDA_ITEM::GetBoundingBox().

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

◆ ViewDraw()

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

Draw the parts of the object belonging to layer aLayer.

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

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.

Reimplemented in 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 SCH_SHEET::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtual

Return the layers the item is drawn on (which may be more than its "home" layer)

Reimplemented from SCH_ITEM.

Definition at line 633 of file sch_sheet.cpp.

634{
635 aCount = 7;
636 aLayers[0] = LAYER_HIERLABEL;
637 aLayers[1] = LAYER_SHEETNAME;
638 aLayers[2] = LAYER_SHEETFILENAME;
639 aLayers[3] = LAYER_SHEETFIELDS;
640 aLayers[4] = LAYER_SHEET;
641 aLayers[5] = LAYER_SHEET_BACKGROUND;
642 aLayers[6] = LAYER_SELECTION_SHADOWS;
643}
@ LAYER_HIERLABEL
Definition: layer_ids.h:349
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:381

References LAYER_HIERLABEL, LAYER_SELECTION_SHADOWS, LAYER_SHEET, LAYER_SHEET_BACKGROUND, LAYER_SHEETFIELDS, LAYER_SHEETFILENAME, and LAYER_SHEETNAME.

◆ 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 SCH_SHEET::Visit ( INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  aScanTypes 
)
overridevirtual

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 from EDA_ITEM.

Definition at line 990 of file sch_sheet.cpp.

992{
993 for( KICAD_T scanType : aScanTypes )
994 {
995 // If caller wants to inspect my type
996 if( scanType == SCH_LOCATE_ANY_T || scanType == Type() )
997 {
998 if( INSPECT_RESULT::QUIT == aInspector( this, nullptr ) )
1000 }
1001
1002 if( scanType == SCH_LOCATE_ANY_T || scanType == SCH_FIELD_T )
1003 {
1004 // Test the sheet fields.
1005 for( SCH_FIELD& field : m_fields )
1006 {
1007 if( INSPECT_RESULT::QUIT == aInspector( &field, this ) )
1008 return INSPECT_RESULT::QUIT;
1009 }
1010 }
1011
1012 if( scanType == SCH_LOCATE_ANY_T || scanType == SCH_SHEET_PIN_T )
1013 {
1014 // Test the sheet labels.
1015 for( SCH_SHEET_PIN* sheetPin : m_pins )
1016 {
1017 if( INSPECT_RESULT::QUIT == aInspector( sheetPin, this ) )
1018 return INSPECT_RESULT::QUIT;
1019 }
1020 }
1021 }
1022
1024}
@ SCH_FIELD_T
Definition: typeinfo.h:154
@ SCH_LOCATE_ANY_T
Definition: typeinfo.h:182

References CONTINUE, m_fields, m_pins, QUIT, SCH_FIELD_T, SCH_LOCATE_ANY_T, SCH_SHEET_PIN_T, and EDA_ITEM::Type().

Friends And Related Function Documentation

◆ SCH_SHEET_PIN

friend class SCH_SHEET_PIN
friend

Definition at line 459 of file sch_sheet.h.

Referenced by operator=(), and SCH_SHEET().

Member Data Documentation

◆ m_backgroundColor

KIGFX::COLOR4D SCH_SHEET::m_backgroundColor
private

Definition at line 473 of file sch_sheet.h.

Referenced by GetBackgroundColor(), SCH_SHEET(), SetBackgroundColor(), and SwapData().

◆ m_borderColor

KIGFX::COLOR4D SCH_SHEET::m_borderColor
private

Definition at line 472 of file sch_sheet.h.

Referenced by GetBorderColor(), SCH_SHEET(), SetBorderColor(), and SwapData().

◆ m_borderWidth

int SCH_SHEET::m_borderWidth
private

Definition at line 471 of file sch_sheet.h.

Referenced by GetBorderWidth(), SCH_SHEET(), SetBorderWidth(), and SwapData().

◆ m_connected_items

std::map<SCH_SHEET_PATH, SCH_ITEM_SET, SHEET_PATH_CMP> SCH_ITEM::m_connected_items
protectedinherited

Store pointers to other items that are connected to this one, per sheet.

Definition at line 498 of file sch_item.h.

Referenced by SCH_ITEM::AddConnectionTo(), SCH_ITEM::ConnectedItems(), and SCH_LABEL_BASE::IsType().

◆ m_connection_map

std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> SCH_ITEM::m_connection_map
protectedinherited

Store connectivity information, per sheet.

Definition at line 501 of file sch_item.h.

Referenced by SCH_ITEM::Connection(), SCH_ITEM::InitializeConnection(), and SCH_ITEM::~SCH_ITEM().

◆ m_connections

EDA_ITEMS SCH_ITEM::m_connections
protectedinherited

Definition at line 492 of file sch_item.h.

Referenced by SCH_ITEM::ClearConnections(), and SCH_ITEM::~SCH_ITEM().

◆ m_connectivity_dirty

bool SCH_ITEM::m_connectivity_dirty
protectedinherited

◆ m_fields

◆ m_fieldsAutoplaced

◆ m_flags

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_instances

std::vector<SCH_SHEET_INSTANCE> SCH_SHEET::m_instances
private

◆ m_layer

◆ m_parent

◆ m_pins

◆ m_pos

◆ m_screen

◆ m_size

◆ m_status

◆ m_storedPos

VECTOR2I SCH_ITEM::m_storedPos
protectedinherited

Definition at line 494 of file sch_item.h.

Referenced by SCH_ITEM::GetStoredPos(), and SCH_ITEM::SetStoredPos().

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

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

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 492 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_SYMBOL::AddHierarchicalReference(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateSymbols(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), KI_TEST::CheckFpPad(), KI_TEST::CheckFpShape(), KI_TEST::CheckFpText(), KI_TEST::CheckFpZone(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), 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(), 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(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), SCH_LEGACY_PLUGIN::loadSymbol(), SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic(), LEGACY_PLUGIN::loadTrackList(), PNS::LOGGER::Log(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), 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_SYMBOL::SCH_SYMBOL(), RC_ITEM::SetItems(), FIELDS_EDITOR_GRID_DATA_MODEL::SetValue(), SwapItemData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), SCH_EDITOR_CONTROL::updatePastedSheet(), SCH_EDITOR_CONTROL::updatePastedSymbol(), BOARD::UpdateRatsnestExclusions(), SCH_SHEET_LIST::UpdateSymbolInstances(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().

◆ m_viewPrivData

VIEW_ITEM_DATA* KIGFX::VIEW_ITEM::m_viewPrivData
privateinherited

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