KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_item.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004 Jean-Pierre Charras, [email protected]
5 * Copyright (C) 2004-2024 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef SCH_ITEM_H
26#define SCH_ITEM_H
27
28#include <unordered_map>
29#include <unordered_set>
30#include <map>
31#include <set>
32
33#include <eda_item.h>
34#include <sch_sheet_path.h>
35#include <netclass.h>
36#include <stroke_params.h>
37#include <layer_ids.h>
38#include <sch_render_settings.h>
39#include <plotters/plotter.h>
40
42class SCH_CONNECTION;
43class SCH_SHEET_PATH;
44class SCHEMATIC;
45class SYMBOL;
46class LINE_READER;
47class SCH_EDIT_FRAME;
48class SCH_RULE_AREA;
49struct SCH_PLOT_OPTS;
50
51namespace KIFONT
52{
53class METRICS;
54}
55
56
57enum BODY_STYLE : int
58{
59 BASE = 1,
60 DEMORGAN = 2
61};
62
63
64#define MINIMUM_SELECTION_DISTANCE 2 // Minimum selection distance in mils
65
66
68{
72};
73
74
76{
87};
88
89
95{
96public:
97 DANGLING_END_ITEM( DANGLING_END_T aType, EDA_ITEM* aItem, const VECTOR2I& aPosition )
98 {
99 m_item = aItem;
100 m_type = aType;
101 m_pos = aPosition;
102 m_parent = aItem;
103 }
104
105 DANGLING_END_ITEM( DANGLING_END_T aType, EDA_ITEM* aItem, const VECTOR2I& aPosition,
106 const EDA_ITEM* aParent )
107 {
108 m_item = aItem;
109 m_type = aType;
110 m_pos = aPosition;
111 m_parent = aParent;
112 }
113
114 bool operator==( const DANGLING_END_ITEM& aB ) const
115 {
116 return GetItem() == aB.GetItem()
117 && GetPosition() == aB.GetPosition()
118 && GetType() == aB.GetType()
119 && GetParent() == aB.GetParent();
120 }
121
122 bool operator<( const DANGLING_END_ITEM& rhs ) const
123 {
124 return( m_pos.x < rhs.m_pos.x || ( m_pos.x == rhs.m_pos.x && m_pos.y < rhs.m_pos.y )
125 || ( m_pos == rhs.m_pos && m_item < rhs.m_item ) );
126 }
127
128 VECTOR2I GetPosition() const { return m_pos; }
129 EDA_ITEM* GetItem() const { return m_item; }
130 const EDA_ITEM* GetParent() const { return m_parent; }
131 DANGLING_END_T GetType() const { return m_type; }
132
133private:
138};
139
140
142{
143public:
144 static std::vector<DANGLING_END_ITEM>::iterator
145 get_lower_pos( std::vector<DANGLING_END_ITEM>& aItemListByPos, const VECTOR2I& aPos );
146
147 static std::vector<DANGLING_END_ITEM>::iterator
148 get_lower_type( std::vector<DANGLING_END_ITEM>& aItemListByType, const DANGLING_END_T& aType );
149
151 static void sort_dangling_end_items( std::vector<DANGLING_END_ITEM>& aItemListByType,
152 std::vector<DANGLING_END_ITEM>& aItemListByPos );
153};
154
155typedef std::vector<SCH_ITEM*> SCH_ITEM_VEC;
156
157
165class SCH_ITEM : public EDA_ITEM
166{
167public:
168 SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType, int aUnit = 0, int aBodyStyle = 0 );
169
170 SCH_ITEM( const SCH_ITEM& aItem );
171
172 SCH_ITEM& operator=( const SCH_ITEM& aPin );
173
174 virtual ~SCH_ITEM();
175
176 wxString GetClass() const override
177 {
178 return wxT( "SCH_ITEM" );
179 }
180
181 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
182 {
183 if( EDA_ITEM::IsType( aScanTypes ) )
184 return true;
185
186 for( KICAD_T scanType : aScanTypes )
187 {
188 if( scanType == SCH_ITEM_LOCATE_WIRE_T && m_layer == LAYER_WIRE )
189 return true;
190
191 if ( scanType == SCH_ITEM_LOCATE_BUS_T && m_layer == LAYER_BUS )
192 return true;
193
194 if ( scanType == SCH_ITEM_LOCATE_GRAPHIC_LINE_T
195 && Type() == SCH_LINE_T && m_layer == LAYER_NOTES )
196 {
197 return true;
198 }
199 }
200
201 return false;
202 }
203
209 virtual void SwapData( SCH_ITEM* aItem );
210
214 void SwapFlags( SCH_ITEM* aItem );
215
223 SCH_ITEM* Duplicate( bool doClone = false ) const;
224
225 static wxString GetUnitDescription( int aUnit );
226 static wxString GetBodyStyleDescription( int aBodyStyle );
227
228 virtual void SetUnit( int aUnit ) { m_unit = aUnit; }
229 int GetUnit() const { return m_unit; }
230
231 virtual void SetBodyStyle( int aBodyStyle ) { m_bodyStyle = aBodyStyle; }
232 int GetBodyStyle() const { return m_bodyStyle; }
233
234 void SetPrivate( bool aPrivate ) { m_private = aPrivate; }
235 bool IsPrivate() const { return m_private; }
236
237 virtual void SetExcludedFromSim( bool aExclude ) { }
238 virtual bool GetExcludedFromSim() const { return false; }
239
246 virtual bool IsMovableFromAnchorPoint() const { return true; }
247
249 void SetStoredPos( const VECTOR2I& aPos ) { m_storedPos = aPos; }
250
263 SCHEMATIC* Schematic() const;
264
265 const SYMBOL* GetParentSymbol() const;
267
268 virtual bool IsLocked() const { return false; }
269 virtual void SetLocked( bool aLocked ) {}
270
274 virtual bool IsHypertext() const { return false; }
275
276 virtual void DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const { }
277
281 SCH_LAYER_ID GetLayer() const { return m_layer; }
282 void SetLayer( SCH_LAYER_ID aLayer ) { m_layer = aLayer; }
283
287 void ViewGetLayers( int aLayers[], int& aCount ) const override;
288
292 virtual int GetPenWidth() const { return 0; }
293
294 int GetEffectivePenWidth( const SCH_RENDER_SETTINGS* aSettings ) const;
295
296 const wxString& GetDefaultFont() const;
297
298 const KIFONT::METRICS& GetFontMetrics() const;
299
300 bool RenderAsBitmap( double aWorldScale ) const override;
301
306 virtual double Similarity( const SCH_ITEM& aItem ) const
307 {
308 wxCHECK_MSG( false, 0.0, wxT( "Similarity not implemented in " ) + GetClass() );
309 }
310
316 double SimilarityBase( const SCH_ITEM& aItem ) const
317 {
318 double similarity = 1.0;
319
320 if( m_unit != aItem.m_unit )
321 similarity *= 0.9;
322
323 if( m_bodyStyle != aItem.m_bodyStyle )
324 similarity *= 0.9;
325
326 if( m_private != aItem.m_private )
327 similarity *= 0.9;
328
329 return similarity;
330 }
331
335 virtual void Move( const VECTOR2I& aMoveVector )
336 {
337 wxCHECK_MSG( false, /*void*/, wxT( "Move not implemented in " ) + GetClass() );
338 }
339
343 virtual void MirrorHorizontally( int aCenter )
344 {
345 wxCHECK_MSG( false, /*void*/, wxT( "MirrorHorizontally not implemented in " ) + GetClass() );
346 }
347
351 virtual void MirrorVertically( int aCenter )
352 {
353 wxCHECK_MSG( false, /*void*/, wxT( "MirrorVertically not implemented in " ) + GetClass() );
354 }
355
359 virtual void Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
360 {
361 wxCHECK_MSG( false, /*void*/, wxT( "Rotate not implemented in " ) + GetClass() );
362 }
363
373 virtual void BeginEdit( const VECTOR2I& aPosition ) {}
374
385 virtual bool ContinueEdit( const VECTOR2I& aPosition ) { return false; }
386
392 virtual void EndEdit( bool aClosed = false ) {}
393
403 virtual void CalcEdit( const VECTOR2I& aPosition ) {}
404
415 virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
416
435 virtual bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListByType,
436 std::vector<DANGLING_END_ITEM>& aItemListByPos,
437 const SCH_SHEET_PATH* aSheet = nullptr )
438 {
439 return false;
440 }
441
442 virtual bool IsDangling() const { return false; }
443
444 virtual bool CanConnect( const SCH_ITEM* aItem ) const { return m_layer == aItem->GetLayer(); }
445
449 virtual bool IsConnectable() const { return false; }
450
455 virtual bool IsPointClickableAnchor( const VECTOR2I& aPos ) const { return false; }
456
464 virtual std::vector<VECTOR2I> GetConnectionPoints() const { return {}; }
465
472 bool IsConnected( const VECTOR2I& aPoint ) const;
473
479 SCH_CONNECTION* Connection( const SCH_SHEET_PATH* aSheet = nullptr ) const;
480
484 const SCH_ITEM_VEC& ConnectedItems( const SCH_SHEET_PATH& aPath );
485
489 void AddConnectionTo( const SCH_SHEET_PATH& aPath, SCH_ITEM* aItem );
490
494 void ClearConnectedItems( const SCH_SHEET_PATH& aPath );
495
502
504
508 virtual bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const { return true; }
509
511
512 void SetConnectivityDirty( bool aDirty = true ) { m_connectivity_dirty = aDirty; }
513
529 virtual bool HasConnectivityChanges( const SCH_ITEM* aItem,
530 const SCH_SHEET_PATH* aInstance = nullptr ) const
531 {
532 return false;
533 }
534
536 void SetConnectionGraph( CONNECTION_GRAPH* aGraph );
537
538 virtual bool HasCachedDriverName() const { return false; }
539 virtual const wxString& GetCachedDriverName() const;
540
541 virtual void SetLastResolvedState( const SCH_ITEM* aItem ) { }
542
543 std::shared_ptr<NETCLASS> GetEffectiveNetClass( const SCH_SHEET_PATH* aSheet = nullptr ) const;
544
549
552
561 {
562 if( GetFieldsAutoplaced() )
564 }
565
566 virtual void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) { }
567
568 virtual void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) { }
569
570 virtual void ClearCaches();
571
579 virtual bool HasLineStroke() const { return false; }
580
581 virtual STROKE_PARAMS GetStroke() const { wxCHECK( false, STROKE_PARAMS() ); }
582
583 virtual void SetStroke( const STROKE_PARAMS& aStroke ) { wxCHECK( false, /* void */ ); }
584
594 virtual void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
595 const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed )
596 {
597 wxCHECK_MSG( false, /*void*/, wxT( "Print not implemented in " ) + GetClass() );
598 }
599
603 virtual void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
604 const VECTOR2I& aOffset, bool aDimmed )
605 {
606 wxCHECK_MSG( false, /*void*/, wxT( "PrintBackground not implemented in " ) + GetClass() );
607 }
608
619 virtual void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
620 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed)
621 {
622 wxCHECK_MSG( false, /*void*/, wxT( "Plot not implemented in " ) + GetClass() );
623 }
624
629
633 void AddRuleAreaToCache( SCH_RULE_AREA* aRuleArea ) { m_rule_areas_cache.insert( aRuleArea ); }
634
638 const std::unordered_set<SCH_RULE_AREA*>& GetRuleAreaCache() const
639 {
640 return m_rule_areas_cache;
641 }
642
657 enum COMPARE_FLAGS : int
658 {
659 UNIT = 0x01,
660 EQUALITY = 0x02,
661 ERC = 0x04,
662 SKIP_TST_POS = 0x08
663 };
664
665 virtual bool operator==( const SCH_ITEM& aOther ) const;
666
667 virtual bool operator<( const SCH_ITEM& aItem ) const;
668
669protected:
671 {
672 return static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
673 }
674
676 {
677 bool operator()( const SCH_ITEM* aFirst, const SCH_ITEM* aSecond ) const;
678 };
679
680 void getSymbolEditorMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
681
702 virtual int compare( const SCH_ITEM& aOther, int aCompareFlags = 0 ) const;
703
704private:
705 friend class CONNECTION_GRAPH;
706
720 virtual bool doIsConnected( const VECTOR2I& aPosition ) const { return false; }
721
722protected:
724 int m_unit; // set to 0 if common to all units
725 int m_bodyStyle; // set to 0 if common to all body styles
726 bool m_private; // only shown in Symbol Editor
727 FIELDS_AUTOPLACED m_fieldsAutoplaced; // indicates status of field autoplacement
728 VECTOR2I m_storedPos; // temp variable used in some move commands to store
729 // an initial position of the item or mouse cursor
730
732 std::map<SCH_SHEET_PATH, SCH_ITEM_VEC, SHEET_PATH_CMP> m_connected_items;
733
735 std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> m_connection_map;
736
738
740 std::unordered_set<SCH_RULE_AREA*> m_rule_areas_cache;
741
742private:
743 friend class LIB_SYMBOL;
744};
745
746#ifndef SWIG
748#endif
749
750#endif /* SCH_ITEM_H */
Calculate the connectivity of a schematic and generates netlists.
static std::vector< DANGLING_END_ITEM >::iterator get_lower_type(std::vector< DANGLING_END_ITEM > &aItemListByType, const DANGLING_END_T &aType)
Definition: sch_item.cpp:605
static std::vector< DANGLING_END_ITEM >::iterator get_lower_pos(std::vector< DANGLING_END_ITEM > &aItemListByPos, const VECTOR2I &aPos)
Definition: sch_item.cpp:594
static void sort_dangling_end_items(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos)
Both contain the same information.
Definition: sch_item.cpp:615
Helper class used to store the state of schematic items that can be connected to other schematic item...
Definition: sch_item.h:95
const EDA_ITEM * m_parent
The type of connection of m_item.
Definition: sch_item.h:137
bool operator==(const DANGLING_END_ITEM &aB) const
Definition: sch_item.h:114
DANGLING_END_T m_type
The position of the connection point.
Definition: sch_item.h:136
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const VECTOR2I &aPosition)
Definition: sch_item.h:97
DANGLING_END_T GetType() const
Definition: sch_item.h:131
bool operator<(const DANGLING_END_ITEM &rhs) const
Definition: sch_item.h:122
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const VECTOR2I &aPosition, const EDA_ITEM *aParent)
Definition: sch_item.h:105
VECTOR2I m_pos
A pointer to the connectable object.
Definition: sch_item.h:135
const EDA_ITEM * GetParent() const
Definition: sch_item.h:130
EDA_ITEM * GetItem() const
Definition: sch_item.h:129
EDA_ITEM * m_item
Definition: sch_item.h:134
VECTOR2I GetPosition() const
Definition: sch_item.h:128
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition: eda_item.h:176
Define a library symbol object.
Definition: lib_symbol.h:78
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:93
Base plotter engine class.
Definition: plotter.h:105
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:136
Holds all the data relating to one schematic.
Definition: schematic.h:77
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:166
virtual bool GetExcludedFromSim() const
Definition: sch_item.h:238
virtual void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed)
Print an item.
Definition: sch_item.h:594
void SetStoredPos(const VECTOR2I &aPos)
Definition: sch_item.h:249
virtual void PrintBackground(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed)
Print just the background fills.
Definition: sch_item.h:603
VECTOR2I m_storedPos
Definition: sch_item.h:728
virtual void SetBodyStyle(int aBodyStyle)
Definition: sch_item.h:231
virtual bool CanConnect(const SCH_ITEM *aItem) const
Definition: sch_item.h:444
virtual bool IsConnectable() const
Definition: sch_item.h:449
int m_unit
Definition: sch_item.h:724
virtual bool IsLocked() const
Definition: sch_item.h:268
virtual int GetPenWidth() const
Definition: sch_item.h:292
const SCH_ITEM_VEC & ConnectedItems(const SCH_SHEET_PATH &aPath)
Retrieve the set of items connected to this item on the given sheet.
Definition: sch_item.cpp:280
SCH_ITEM & operator=(const SCH_ITEM &aPin)
Definition: sch_item.cpp:101
void ClearConnectedItems(const SCH_SHEET_PATH &aPath)
Clear all connections to this item.
Definition: sch_item.cpp:271
virtual bool doIsConnected(const VECTOR2I &aPosition) const
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_item.h:720
int m_bodyStyle
Definition: sch_item.h:725
virtual void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList)
Add the schematic item end points to aItemList if the item has end points.
Definition: sch_item.h:415
const wxString & GetDefaultFont() const
Definition: sch_item.cpp:458
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
Definition: sch_item.h:670
virtual bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aSheet=nullptr)
Test the schematic item to aItemList to check if it's dangling state has changed.
Definition: sch_item.h:435
virtual ~SCH_ITEM()
Definition: sch_item.cpp:114
const SYMBOL * GetParentSymbol() const
Definition: sch_item.cpp:166
void SetPrivate(bool aPrivate)
Definition: sch_item.h:234
virtual const wxString & GetCachedDriverName() const
Definition: sch_item.cpp:341
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:150
virtual void SetLastResolvedState(const SCH_ITEM *aItem)
Definition: sch_item.h:541
int GetBodyStyle() const
Definition: sch_item.h:232
virtual double Similarity(const SCH_ITEM &aItem) const
Return a measure of how likely the other object is to represent the same object.
Definition: sch_item.h:306
virtual bool IsDangling() const
Definition: sch_item.h:442
virtual bool IsPointClickableAnchor(const VECTOR2I &aPos) const
Definition: sch_item.h:455
virtual bool ContinueEdit(const VECTOR2I &aPosition)
Continue an edit in progress at aPosition.
Definition: sch_item.h:385
virtual void MirrorHorizontally(int aCenter)
Mirror item horizontally about aCenter.
Definition: sch_item.h:343
static wxString GetUnitDescription(int aUnit)
Definition: sch_item.cpp:52
const std::unordered_set< SCH_RULE_AREA * > & GetRuleAreaCache() const
Gets the cache of rule areas enclosing this item.
Definition: sch_item.h:638
SCH_CONNECTION * InitializeConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Create a new connection object associated with this object.
Definition: sch_item.cpp:302
void AddConnectionTo(const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
Add a connection link between this item and another.
Definition: sch_item.cpp:286
virtual void SetLocked(bool aLocked)
Definition: sch_item.h:269
virtual void Move(const VECTOR2I &aMoveVector)
Move the item by aMoveVector to a new position.
Definition: sch_item.h:335
COMPARE_FLAGS
The list of flags used by the compare function.
Definition: sch_item.h:658
@ SKIP_TST_POS
Definition: sch_item.h:662
@ EQUALITY
Definition: sch_item.h:660
int GetUnit() const
Definition: sch_item.h:229
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
Definition: sch_item.cpp:250
virtual void CalcEdit(const VECTOR2I &aPosition)
Calculate the attributes of an item at aPosition when it is being edited.
Definition: sch_item.h:403
virtual bool operator==(const SCH_ITEM &aOther) const
Definition: sch_item.cpp:395
bool m_connectivity_dirty
Definition: sch_item.h:737
void ClearFieldsAutoplaced()
Definition: sch_item.h:551
bool IsPrivate() const
Definition: sch_item.h:235
virtual void ClearCaches()
Definition: sch_item.cpp:375
void SetLayer(SCH_LAYER_ID aLayer)
Definition: sch_item.h:282
void AddRuleAreaToCache(SCH_RULE_AREA *aRuleArea)
Adds a rule area to the item's cache.
Definition: sch_item.h:633
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:281
void ClearRuleAreasCache()
Reset the cache of rule areas (called prior to schematic connectivity recomputation)
Definition: sch_item.h:628
FIELDS_AUTOPLACED GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
Definition: sch_item.h:548
virtual void SetStroke(const STROKE_PARAMS &aStroke)
Definition: sch_item.h:583
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
Definition: sch_item.h:568
virtual void SwapData(SCH_ITEM *aItem)
Swap the internal data structures aItem with the schematic item.
Definition: sch_item.cpp:348
void SetConnectivityDirty(bool aDirty=true)
Definition: sch_item.h:512
virtual int compare(const SCH_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
Definition: sch_item.cpp:419
void SetFieldsAutoplaced()
Definition: sch_item.h:550
FIELDS_AUTOPLACED m_fieldsAutoplaced
Definition: sch_item.h:727
bool RenderAsBitmap(double aWorldScale) const override
Definition: sch_item.cpp:489
virtual void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed)
Plot the item to aPlotter.
Definition: sch_item.h:619
virtual void Rotate(const VECTOR2I &aCenter, bool aRotateCCW)
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_item.h:359
bool IsConnectivityDirty() const
Definition: sch_item.h:510
virtual void SetExcludedFromSim(bool aExclude)
Definition: sch_item.h:237
static wxString GetBodyStyleDescription(int aBodyStyle)
Definition: sch_item.cpp:61
void SetConnectionGraph(CONNECTION_GRAPH *aGraph)
Updates the connection graph for all connections in this item.
Definition: sch_item.cpp:238
virtual void SetUnit(int aUnit)
Definition: sch_item.h:228
std::unordered_set< SCH_RULE_AREA * > m_rule_areas_cache
Store pointers to rule areas which this item is contained within.
Definition: sch_item.h:740
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Definition: sch_item.h:566
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
Definition: sch_item.cpp:354
bool IsConnected(const VECTOR2I &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:212
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition: sch_item.cpp:202
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
Store connectivity information, per sheet.
Definition: sch_item.h:735
virtual bool HasCachedDriverName() const
Definition: sch_item.h:538
virtual bool operator<(const SCH_ITEM &aItem) const
Definition: sch_item.cpp:404
bool m_private
Definition: sch_item.h:726
virtual bool IsHypertext() const
Allow items to support hypertext actions when hovered/clicked.
Definition: sch_item.h:274
SCH_CONNECTION * GetOrInitConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Definition: sch_item.cpp:326
virtual bool IsMovableFromAnchorPoint() const
Definition: sch_item.h:246
virtual bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const
Check if aItem has connectivity changes against this object.
Definition: sch_item.h:529
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:221
virtual void DoHypertextAction(EDA_DRAW_FRAME *aFrame) const
Definition: sch_item.h:276
wxString GetClass() const override
Return the class name.
Definition: sch_item.h:176
VECTOR2I & GetStoredPos()
Definition: sch_item.h:248
virtual void EndEdit(bool aClosed=false)
End an object editing action.
Definition: sch_item.h:392
const KIFONT::METRICS & GetFontMetrics() const
Definition: sch_item.cpp:466
std::map< SCH_SHEET_PATH, SCH_ITEM_VEC, SHEET_PATH_CMP > m_connected_items
Store pointers to other items that are connected to this one, per sheet.
Definition: sch_item.h:732
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
Definition: sch_item.cpp:475
virtual STROKE_PARAMS GetStroke() const
Definition: sch_item.h:581
virtual void BeginEdit(const VECTOR2I &aPosition)
Begin drawing a symbol library draw item at aPosition.
Definition: sch_item.h:373
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
Definition: sch_item.h:560
SCH_LAYER_ID m_layer
Definition: sch_item.h:723
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
Definition: sch_item.h:579
virtual bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const
Return true if this item should propagate connection info to aItem.
Definition: sch_item.h:508
virtual std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Definition: sch_item.h:464
double SimilarityBase(const SCH_ITEM &aItem) const
Calculate the boilerplate similarity for all LIB_ITEMs without preventing the use above of a pure vir...
Definition: sch_item.h:316
SCH_ITEM * Duplicate(bool doClone=false) const
Routine to create a new copy of given item.
Definition: sch_item.cpp:131
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_item.h:181
virtual void MirrorVertically(int aCenter)
Mirror item vertically about aCenter.
Definition: sch_item.h:351
void getSymbolEditorMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Definition: sch_item.cpp:501
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Simple container to manage line stroke parameters.
Definition: stroke_params.h:79
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition: symbol.h:34
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:353
@ LAYER_WIRE
Definition: layer_ids.h:356
@ LAYER_NOTES
Definition: layer_ids.h:371
@ LAYER_BUS
Definition: layer_ids.h:357
#define DECLARE_ENUM_TO_WXANY(type)
Definition: property.h:729
DANGLING_END_T
Definition: sch_item.h:76
@ NO_CONNECT_END
Definition: sch_item.h:86
@ SHEET_LABEL_END
Definition: sch_item.h:85
@ LABEL_END
Definition: sch_item.h:82
@ JUNCTION_END
Definition: sch_item.h:80
@ BUS_END
Definition: sch_item.h:79
@ PIN_END
Definition: sch_item.h:81
@ BUS_ENTRY_END
Definition: sch_item.h:83
@ WIRE_END
Definition: sch_item.h:78
@ WIRE_ENTRY_END
Definition: sch_item.h:84
@ DANGLING_END_UNKNOWN
Definition: sch_item.h:77
std::vector< SCH_ITEM * > SCH_ITEM_VEC
Definition: sch_item.h:155
FIELDS_AUTOPLACED
Definition: sch_item.h:68
@ FIELDS_AUTOPLACED_NO
Definition: sch_item.h:69
@ FIELDS_AUTOPLACED_AUTO
Definition: sch_item.h:70
@ FIELDS_AUTOPLACED_MANUAL
Definition: sch_item.h:71
BODY_STYLE
Definition: sch_item.h:58
@ BASE
Definition: sch_item.h:59
@ DEMORGAN
Definition: sch_item.h:60
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
bool operator()(const SCH_ITEM *aFirst, const SCH_ITEM *aSecond) const
Definition: sch_item.cpp:413
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LINE_T
Definition: typeinfo.h:163
@ SCH_ITEM_LOCATE_WIRE_T
Definition: typeinfo.h:185
@ SCH_ITEM_LOCATE_BUS_T
Definition: typeinfo.h:186
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
Definition: typeinfo.h:187