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 The 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 SCH_COMMIT;
46class SYMBOL;
47class LINE_READER;
48class SCH_EDIT_FRAME;
49class SCH_RULE_AREA;
50struct SCH_PLOT_OPTS;
51
52namespace KIFONT
53{
54class METRICS;
55}
56
57
58enum BODY_STYLE : int
59{
60 BASE = 1,
61 DEMORGAN = 2
62};
63
64
65#define MINIMUM_SELECTION_DISTANCE 2 // Minimum selection distance in mils
66
67
69{
70 AUTOPLACE_NONE, // No autoplacement
71 AUTOPLACE_AUTO, // A minimalist placement algorithm.
72 AUTOPLACE_MANUAL // A more involved routine that can be annoying if done from the get go.
73 // Initiated by a hotkey or menu item.
74};
75
76
78{
89};
90
91
97{
98public:
99 DANGLING_END_ITEM( DANGLING_END_T aType, EDA_ITEM* aItem, const VECTOR2I& aPosition )
100 {
101 m_item = aItem;
102 m_type = aType;
103 m_pos = aPosition;
104 m_parent = aItem;
105 }
106
107 DANGLING_END_ITEM( DANGLING_END_T aType, EDA_ITEM* aItem, const VECTOR2I& aPosition,
108 const EDA_ITEM* aParent )
109 {
110 m_item = aItem;
111 m_type = aType;
112 m_pos = aPosition;
113 m_parent = aParent;
114 }
115
116 bool operator==( const DANGLING_END_ITEM& aB ) const
117 {
118 return GetItem() == aB.GetItem()
119 && GetPosition() == aB.GetPosition()
120 && GetType() == aB.GetType()
121 && GetParent() == aB.GetParent();
122 }
123
124 bool operator<( const DANGLING_END_ITEM& rhs ) const
125 {
126 return( m_pos.x < rhs.m_pos.x || ( m_pos.x == rhs.m_pos.x && m_pos.y < rhs.m_pos.y )
127 || ( m_pos == rhs.m_pos && m_item < rhs.m_item ) );
128 }
129
130 VECTOR2I GetPosition() const { return m_pos; }
131 EDA_ITEM* GetItem() const { return m_item; }
132 const EDA_ITEM* GetParent() const { return m_parent; }
133 DANGLING_END_T GetType() const { return m_type; }
134
135private:
140};
141
142
144{
145public:
146 static std::vector<DANGLING_END_ITEM>::iterator
147 get_lower_pos( std::vector<DANGLING_END_ITEM>& aItemListByPos, const VECTOR2I& aPos );
148
149 static std::vector<DANGLING_END_ITEM>::iterator
150 get_lower_type( std::vector<DANGLING_END_ITEM>& aItemListByType, const DANGLING_END_T& aType );
151
153 static void sort_dangling_end_items( std::vector<DANGLING_END_ITEM>& aItemListByType,
154 std::vector<DANGLING_END_ITEM>& aItemListByPos );
155};
156
157typedef std::vector<SCH_ITEM*> SCH_ITEM_VEC;
158
159
167class SCH_ITEM : public EDA_ITEM
168{
169public:
170 SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType, int aUnit = 0, int aBodyStyle = 0 );
171
172 SCH_ITEM( const SCH_ITEM& aItem );
173
174 SCH_ITEM& operator=( const SCH_ITEM& aPin );
175
176 virtual ~SCH_ITEM();
177
178 wxString GetClass() const override
179 {
180 return wxT( "SCH_ITEM" );
181 }
182
183 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
184 {
185 if( EDA_ITEM::IsType( aScanTypes ) )
186 return true;
187
188 for( KICAD_T scanType : aScanTypes )
189 {
190 if( scanType == SCH_ITEM_LOCATE_WIRE_T && m_layer == LAYER_WIRE )
191 return true;
192
193 if ( scanType == SCH_ITEM_LOCATE_BUS_T && m_layer == LAYER_BUS )
194 return true;
195
196 if ( scanType == SCH_ITEM_LOCATE_GRAPHIC_LINE_T
197 && Type() == SCH_LINE_T && m_layer == LAYER_NOTES )
198 {
199 return true;
200 }
201 }
202
203 return false;
204 }
205
206 bool IsGroupableType() const;
207
218 void SwapItemData( SCH_ITEM* aImage );
219
223 void SwapFlags( SCH_ITEM* aItem );
224
236 SCH_ITEM* Duplicate( bool addToParentGroup, SCH_COMMIT* aCommit = nullptr, bool doClone = false ) const;
237
238 virtual void SetUnit( int aUnit ) { m_unit = aUnit; }
239 int GetUnit() const { return m_unit; }
240
241 virtual wxString GetUnitDisplayName( int aUnit, bool aLabel ) const;
242 virtual wxString GetBodyStyleDescription( int aBodyStyle, bool aLabel ) const;
243
244 virtual void SetUnitProp( const wxString& aUnit );
245 virtual wxString GetUnitProp() const;
246
247 virtual void SetBodyStyle( int aBodyStyle ) { m_bodyStyle = aBodyStyle; }
248 int GetBodyStyle() const { return m_bodyStyle; }
249
250 virtual void SetBodyStyleProp( const wxString& aBodyStyle );
251 virtual wxString GetBodyStyleProp() const;
252
253 void SetPrivate( bool aPrivate ) { m_private = aPrivate; }
254 bool IsPrivate() const { return m_private; }
255
256 virtual void SetExcludedFromSim( bool aExclude ) { }
257 virtual bool GetExcludedFromSim() const { return false; }
258 bool ResolveExcludedFromSim() const;
259
260 virtual void SetExcludedFromBOM( bool aExcludeFromBOM ) { }
261 virtual bool GetExcludedFromBOM() const { return false; }
262 bool ResolveExcludedFromBOM() const;
263
264 virtual void SetExcludedFromBoard( bool aExcludeFromBoard ) { }
265 virtual bool GetExcludedFromBoard() const { return false; }
266 bool ResolveExcludedFromBoard() const;
267
268 virtual void SetDNP( bool aDNP ) { }
269 virtual bool GetDNP() const { return false; }
270 bool ResolveDNP() const;
271
281 virtual bool IsMovableFromAnchorPoint() const { return true; }
282
284 void SetStoredPos( const VECTOR2I& aPos ) { m_storedPos = aPos; }
285
298 SCHEMATIC* Schematic() const;
299
300 const SYMBOL* GetParentSymbol() const;
302
306 virtual bool IsHypertext() const { return false; }
307
308 virtual void DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const { }
309
313 SCH_LAYER_ID GetLayer() const { return m_layer; }
314 void SetLayer( SCH_LAYER_ID aLayer ) { m_layer = aLayer; }
315
319 std::vector<int> ViewGetLayers() const override;
320
324 virtual int GetPenWidth() const { return 0; }
325
326 int GetEffectivePenWidth( const SCH_RENDER_SETTINGS* aSettings ) const;
327
328 const wxString& GetDefaultFont( const RENDER_SETTINGS* aSettings ) const;
329
330 const KIFONT::METRICS& GetFontMetrics() const;
331
332 bool RenderAsBitmap( double aWorldScale ) const override;
333
340 virtual double Similarity( const SCH_ITEM& aItem ) const
341 {
342 wxCHECK_MSG( false, 0.0, wxT( "Similarity not implemented in " ) + GetClass() );
343 }
344
350 double SimilarityBase( const SCH_ITEM& aItem ) const
351 {
352 double similarity = 1.0;
353
354 if( m_unit != aItem.m_unit )
355 similarity *= 0.9;
356
357 if( m_bodyStyle != aItem.m_bodyStyle )
358 similarity *= 0.9;
359
360 if( m_private != aItem.m_private )
361 similarity *= 0.9;
362
363 return similarity;
364 }
365
369 virtual void Move( const VECTOR2I& aMoveVector )
370 {
371 wxCHECK_MSG( false, /*void*/, wxT( "Move not implemented in " ) + GetClass() );
372 }
373
377 virtual void MirrorHorizontally( int aCenter )
378 {
379 wxCHECK_MSG( false, /*void*/,
380 wxT( "MirrorHorizontally not implemented in " ) + GetClass() );
381 }
382
386 virtual void MirrorVertically( int aCenter )
387 {
388 wxCHECK_MSG( false, /*void*/, wxT( "MirrorVertically not implemented in " ) + GetClass() );
389 }
390
394 virtual void Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
395 {
396 wxCHECK_MSG( false, /*void*/, wxT( "Rotate not implemented in " ) + GetClass() );
397 }
398
408 virtual void BeginEdit( const VECTOR2I& aPosition ) {}
409
420 virtual bool ContinueEdit( const VECTOR2I& aPosition ) { return false; }
421
427 virtual void EndEdit( bool aClosed = false ) {}
428
438 virtual void CalcEdit( const VECTOR2I& aPosition ) {}
439
450 virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
451
470 virtual bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListByType,
471 std::vector<DANGLING_END_ITEM>& aItemListByPos,
472 const SCH_SHEET_PATH* aSheet = nullptr )
473 {
474 return false;
475 }
476
489 virtual bool IsEndPoint( const VECTOR2I& aPt ) const { return false; }
490
491 virtual bool IsDangling() const { return false; }
492
493 virtual bool CanConnect( const SCH_ITEM* aItem ) const { return m_layer == aItem->GetLayer(); }
494
498 virtual bool IsConnectable() const { return false; }
499
504 virtual bool IsPointClickableAnchor( const VECTOR2I& aPos ) const { return false; }
505
513 virtual std::vector<VECTOR2I> GetConnectionPoints() const { return {}; }
514
521 bool IsConnected( const VECTOR2I& aPoint ) const;
522
528 SCH_CONNECTION* Connection( const SCH_SHEET_PATH* aSheet = nullptr ) const;
529
533 const SCH_ITEM_VEC& ConnectedItems( const SCH_SHEET_PATH& aPath );
534
538 void AddConnectionTo( const SCH_SHEET_PATH& aPath, SCH_ITEM* aItem );
539
543 void ClearConnectedItems( const SCH_SHEET_PATH& aPath );
544
551
553
557 virtual bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const { return true; }
558
560
561 void SetConnectivityDirty( bool aDirty = true ) { m_connectivity_dirty = aDirty; }
562
578 virtual bool HasConnectivityChanges( const SCH_ITEM* aItem,
579 const SCH_SHEET_PATH* aInstance = nullptr ) const
580 {
581 return false;
582 }
583
585 void SetConnectionGraph( CONNECTION_GRAPH* aGraph );
586
587 virtual bool HasCachedDriverName() const { return false; }
588 virtual const wxString& GetCachedDriverName() const;
589
590 virtual void SetLastResolvedState( const SCH_ITEM* aItem ) { }
591
592 std::shared_ptr<NETCLASS> GetEffectiveNetClass( const SCH_SHEET_PATH* aSheet = nullptr ) const;
593
599
600 virtual void AutoplaceFields( SCH_SCREEN* aScreen, AUTOPLACE_ALGO aAlgo ) { }
601
602 virtual void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction, RECURSE_MODE aMode ) { }
603
604 virtual void ClearCaches();
605
613 virtual bool HasLineStroke() const { return false; }
614
615 virtual STROKE_PARAMS GetStroke() const { wxCHECK( false, STROKE_PARAMS() ); }
616
617 virtual void SetStroke( const STROKE_PARAMS& aStroke ) { wxCHECK( false, /* void */ ); }
618
619 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
620
631 virtual void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
632 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed)
633 {
634 wxCHECK_MSG( false, /*void*/, wxT( "Plot not implemented in " ) + GetClass() );
635 }
636
641
645 void AddRuleAreaToCache( SCH_RULE_AREA* aRuleArea ) { m_rule_areas_cache.insert( aRuleArea ); }
646
650 const std::unordered_set<SCH_RULE_AREA*>& GetRuleAreaCache() const
651 {
652 return m_rule_areas_cache;
653 }
654
655 const std::vector<wxString>* GetEmbeddedFonts() override;
656
671 enum COMPARE_FLAGS : int
672 {
673 UNIT = 0x01,
674 EQUALITY = 0x02,
675 ERC = 0x04,
676 SKIP_TST_POS = 0x08
677 };
678
679 virtual bool operator==( const SCH_ITEM& aOther ) const;
680
681 virtual bool operator<( const SCH_ITEM& aItem ) const;
682
683protected:
691 virtual void swapData( SCH_ITEM* aItem );
692
694 {
695 return static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
696 }
697
699 {
700 bool operator()( const SCH_ITEM* aFirst, const SCH_ITEM* aSecond ) const;
701 };
702
723 virtual int compare( const SCH_ITEM& aOther, int aCompareFlags = 0 ) const;
724
725private:
726 friend class CONNECTION_GRAPH;
727
741 virtual bool doIsConnected( const VECTOR2I& aPosition ) const { return false; }
742
743protected:
745 int m_unit; // set to 0 if common to all units
746 int m_bodyStyle; // set to 0 if common to all body styles
747 bool m_private; // only shown in Symbol Editor
748 AUTOPLACE_ALGO m_fieldsAutoplaced; // indicates status of field autoplacement
749 VECTOR2I m_storedPos; // temp variable used in some move commands to store
750 // an initial position of the item or mouse cursor
751
753 std::map<SCH_SHEET_PATH, SCH_ITEM_VEC, SHEET_PATH_CMP> m_connected_items;
754
756 std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> m_connection_map;
757
759
761 std::unordered_set<SCH_RULE_AREA*> m_rule_areas_cache;
762
763private:
764 friend class LIB_SYMBOL;
765};
766
767#ifndef SWIG
769#endif
770
771#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:806
static std::vector< DANGLING_END_ITEM >::iterator get_lower_pos(std::vector< DANGLING_END_ITEM > &aItemListByPos, const VECTOR2I &aPos)
Definition: sch_item.cpp:795
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:816
Helper class used to store the state of schematic items that can be connected to other schematic item...
Definition: sch_item.h:97
const EDA_ITEM * m_parent
A pointer to the parent object (in the case of pins).
Definition: sch_item.h:139
bool operator==(const DANGLING_END_ITEM &aB) const
Definition: sch_item.h:116
DANGLING_END_T m_type
The type of connection of m_item.
Definition: sch_item.h:138
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const VECTOR2I &aPosition)
Definition: sch_item.h:99
DANGLING_END_T GetType() const
Definition: sch_item.h:133
bool operator<(const DANGLING_END_ITEM &rhs) const
Definition: sch_item.h:124
DANGLING_END_ITEM(DANGLING_END_T aType, EDA_ITEM *aItem, const VECTOR2I &aPosition, const EDA_ITEM *aParent)
Definition: sch_item.h:107
VECTOR2I m_pos
The position of the connection point.
Definition: sch_item.h:137
const EDA_ITEM * GetParent() const
Definition: sch_item.h:132
EDA_ITEM * GetItem() const
Definition: sch_item.h:131
EDA_ITEM * m_item
A pointer to the connectable object.
Definition: sch_item.h:136
VECTOR2I GetPosition() const
Definition: sch_item.h:130
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:98
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:110
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition: eda_item.h:192
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Define a library symbol object.
Definition: lib_symbol.h:85
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:121
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:152
Holds all the data relating to one schematic.
Definition: schematic.h:88
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:168
virtual bool GetExcludedFromSim() const
Definition: sch_item.h:257
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.
Definition: sch_item.cpp:661
void SetStoredPos(const VECTOR2I &aPos)
Definition: sch_item.h:284
VECTOR2I m_storedPos
Definition: sch_item.h:749
SCH_ITEM * Duplicate(bool addToParentGroup, SCH_COMMIT *aCommit=nullptr, bool doClone=false) const
Routine to create a new copy of given item.
Definition: sch_item.cpp:137
virtual void SetBodyStyle(int aBodyStyle)
Definition: sch_item.h:247
virtual bool CanConnect(const SCH_ITEM *aItem) const
Definition: sch_item.h:493
virtual bool IsEndPoint(const VECTOR2I &aPt) const
Test if aPt is an end point of this schematic object.
Definition: sch_item.h:489
virtual bool IsConnectable() const
Definition: sch_item.h:498
virtual void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo)
Definition: sch_item.h:600
int m_unit
Definition: sch_item.h:745
virtual int GetPenWidth() const
Definition: sch_item.h:324
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:411
SCH_ITEM & operator=(const SCH_ITEM &aPin)
Definition: sch_item.cpp:75
void ClearConnectedItems(const SCH_SHEET_PATH &aPath)
Clear all connections to this item.
Definition: sch_item.cpp:402
virtual bool doIsConnected(const VECTOR2I &aPosition) const
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_item.h:741
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode)
Definition: sch_item.h:602
virtual wxString GetUnitProp() const
Definition: sch_item.cpp:212
int m_bodyStyle
Definition: sch_item.h:746
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:450
virtual void SetExcludedFromBoard(bool aExcludeFromBoard)
Definition: sch_item.h:264
const std::vector< wxString > * GetEmbeddedFonts() override
Definition: sch_item.cpp:679
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
Definition: sch_item.h:693
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:470
virtual ~SCH_ITEM()
Definition: sch_item.cpp:88
const SYMBOL * GetParentSymbol() const
Definition: sch_item.cpp:252
virtual wxString GetBodyStyleDescription(int aBodyStyle, bool aLabel) const
Definition: sch_item.cpp:201
void SetPrivate(bool aPrivate)
Definition: sch_item.h:253
virtual void swapData(SCH_ITEM *aItem)
Swap the internal data structures aItem with the schematic item.
Definition: sch_item.cpp:479
virtual const wxString & GetCachedDriverName() const
Definition: sch_item.cpp:472
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:246
virtual void SetLastResolvedState(const SCH_ITEM *aItem)
Definition: sch_item.h:590
int GetBodyStyle() const
Definition: sch_item.h:248
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:340
virtual bool IsDangling() const
Definition: sch_item.h:491
virtual bool IsPointClickableAnchor(const VECTOR2I &aPos) const
Definition: sch_item.h:504
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition: sch_item.cpp:336
virtual bool ContinueEdit(const VECTOR2I &aPosition)
Continue an edit in progress at aPosition.
Definition: sch_item.h:420
virtual void MirrorHorizontally(int aCenter)
Mirror item horizontally about aCenter.
Definition: sch_item.h:377
bool ResolveExcludedFromBOM() const
Definition: sch_item.cpp:291
const std::unordered_set< SCH_RULE_AREA * > & GetRuleAreaCache() const
Get the cache of rule areas enclosing this item.
Definition: sch_item.h:650
SCH_CONNECTION * InitializeConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Create a new connection object associated with this object.
Definition: sch_item.cpp:433
virtual wxString GetUnitDisplayName(int aUnit, bool aLabel) const
Definition: sch_item.cpp:190
void AddConnectionTo(const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
Add a connection link between this item and another.
Definition: sch_item.cpp:417
virtual void SetUnitProp(const wxString &aUnit)
Definition: sch_item.cpp:168
virtual void Move(const VECTOR2I &aMoveVector)
Move the item by aMoveVector to a new position.
Definition: sch_item.h:369
COMPARE_FLAGS
The list of flags used by the compare function.
Definition: sch_item.h:672
@ SKIP_TST_POS
Definition: sch_item.h:676
@ EQUALITY
Definition: sch_item.h:674
int GetUnit() const
Definition: sch_item.h:239
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
Definition: sch_item.cpp:381
bool ResolveExcludedFromBoard() const
Definition: sch_item.cpp:306
virtual void CalcEdit(const VECTOR2I &aPosition)
Calculate the attributes of an item at aPosition when it is being edited.
Definition: sch_item.h:438
virtual bool GetDNP() const
Definition: sch_item.h:269
virtual bool operator==(const SCH_ITEM &aOther) const
Definition: sch_item.cpp:541
bool m_connectivity_dirty
Definition: sch_item.h:758
virtual bool GetExcludedFromBOM() const
Definition: sch_item.h:261
bool IsPrivate() const
Definition: sch_item.h:254
virtual void ClearCaches()
Definition: sch_item.cpp:521
void SetLayer(SCH_LAYER_ID aLayer)
Definition: sch_item.h:314
void AddRuleAreaToCache(SCH_RULE_AREA *aRuleArea)
Add a rule area to the item's cache.
Definition: sch_item.h:645
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:313
void ClearRuleAreasCache()
Reset the cache of rule areas (called prior to schematic connectivity computation)
Definition: sch_item.h:640
virtual bool GetExcludedFromBoard() const
Definition: sch_item.h:265
virtual void SetStroke(const STROKE_PARAMS &aStroke)
Definition: sch_item.h:617
virtual void SetBodyStyleProp(const wxString &aBodyStyle)
Definition: sch_item.cpp:218
void SetConnectivityDirty(bool aDirty=true)
Definition: sch_item.h:561
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:565
virtual wxString GetBodyStyleProp() const
Definition: sch_item.cpp:240
void SetFieldsAutoplaced(AUTOPLACE_ALGO aAlgo)
Definition: sch_item.h:598
bool RenderAsBitmap(double aWorldScale) const override
Definition: sch_item.cpp:649
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:631
virtual void Rotate(const VECTOR2I &aCenter, bool aRotateCCW)
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_item.h:394
const wxString & GetDefaultFont(const RENDER_SETTINGS *aSettings) const
Definition: sch_item.cpp:604
bool IsConnectivityDirty() const
Definition: sch_item.h:559
virtual void SetExcludedFromSim(bool aExclude)
Definition: sch_item.h:256
virtual void SetExcludedFromBOM(bool aExcludeFromBOM)
Definition: sch_item.h:260
void SetConnectionGraph(CONNECTION_GRAPH *aGraph)
Update the connection graph for all connections in this item.
Definition: sch_item.cpp:369
virtual void SetUnit(int aUnit)
Definition: sch_item.h:238
AUTOPLACE_ALGO m_fieldsAutoplaced
Definition: sch_item.h:748
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:761
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
Definition: sch_item.cpp:500
bool IsConnected(const VECTOR2I &aPoint) const
Test the item to see if it is connected to aPoint.
Definition: sch_item.cpp:343
std::unordered_map< SCH_SHEET_PATH, SCH_CONNECTION * > m_connection_map
Store connectivity information, per sheet.
Definition: sch_item.h:756
virtual bool HasCachedDriverName() const
Definition: sch_item.h:587
virtual bool operator<(const SCH_ITEM &aItem) const
Definition: sch_item.cpp:550
bool m_private
Definition: sch_item.h:747
virtual bool IsHypertext() const
Allow items to support hypertext actions when hovered/clicked.
Definition: sch_item.h:306
SCH_CONNECTION * GetOrInitConnection(const SCH_SHEET_PATH &aPath, CONNECTION_GRAPH *aGraph)
Definition: sch_item.cpp:457
virtual bool IsMovableFromAnchorPoint() const
Check if object is movable from the anchor point.
Definition: sch_item.h:281
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:578
AUTOPLACE_ALGO GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
Definition: sch_item.h:597
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:352
virtual void DoHypertextAction(EDA_DRAW_FRAME *aFrame) const
Definition: sch_item.h:308
wxString GetClass() const override
Return the class name.
Definition: sch_item.h:178
VECTOR2I & GetStoredPos()
Definition: sch_item.h:283
bool ResolveExcludedFromSim() const
Definition: sch_item.cpp:276
virtual void EndEdit(bool aClosed=false)
End an object editing action.
Definition: sch_item.h:427
const KIFONT::METRICS & GetFontMetrics() const
Definition: sch_item.cpp:617
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:753
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
Definition: sch_item.cpp:626
virtual STROKE_PARAMS GetStroke() const
Definition: sch_item.h:615
virtual void BeginEdit(const VECTOR2I &aPosition)
Begin drawing a symbol library draw item at aPosition.
Definition: sch_item.h:408
virtual void SetDNP(bool aDNP)
Definition: sch_item.h:268
bool IsGroupableType() const
Definition: sch_item.cpp:105
void SwapItemData(SCH_ITEM *aImage)
Swap data between aItem and aImage.
Definition: sch_item.cpp:485
SCH_LAYER_ID m_layer
Definition: sch_item.h:744
virtual bool HasLineStroke() const
Check if this schematic item has line stoke properties.
Definition: sch_item.h:613
virtual bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const
Return true if this item should propagate connection info to aItem.
Definition: sch_item.h:557
virtual std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
Definition: sch_item.h:513
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:350
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition: sch_item.h:183
virtual void MirrorVertically(int aCenter)
Mirror item vertically about aCenter.
Definition: sch_item.h:386
bool ResolveDNP() const
Definition: sch_item.cpp:321
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:94
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition: symbol.h:63
RECURSE_MODE
Definition: eda_item.h:50
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:439
@ LAYER_WIRE
Definition: layer_ids.h:442
@ LAYER_NOTES
Definition: layer_ids.h:457
@ LAYER_BUS
Definition: layer_ids.h:443
#define DECLARE_ENUM_TO_WXANY(type)
Definition: property.h:763
AUTOPLACE_ALGO
Definition: sch_item.h:69
@ AUTOPLACE_MANUAL
Definition: sch_item.h:72
@ AUTOPLACE_NONE
Definition: sch_item.h:70
@ AUTOPLACE_AUTO
Definition: sch_item.h:71
DANGLING_END_T
Definition: sch_item.h:78
@ NO_CONNECT_END
Definition: sch_item.h:88
@ SHEET_LABEL_END
Definition: sch_item.h:87
@ LABEL_END
Definition: sch_item.h:84
@ JUNCTION_END
Definition: sch_item.h:82
@ BUS_END
Definition: sch_item.h:81
@ PIN_END
Definition: sch_item.h:83
@ BUS_ENTRY_END
Definition: sch_item.h:85
@ WIRE_END
Definition: sch_item.h:80
@ WIRE_ENTRY_END
Definition: sch_item.h:86
@ DANGLING_END_UNKNOWN
Definition: sch_item.h:79
std::vector< SCH_ITEM * > SCH_ITEM_VEC
Definition: sch_item.h:157
BODY_STYLE
Definition: sch_item.h:59
@ BASE
Definition: sch_item.h:60
@ DEMORGAN
Definition: sch_item.h:61
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:559
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LINE_T
Definition: typeinfo.h:164
@ SCH_ITEM_LOCATE_WIRE_T
Definition: typeinfo.h:187
@ SCH_ITEM_LOCATE_BUS_T
Definition: typeinfo.h:188
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
Definition: typeinfo.h:189