KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
sch_sheet.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
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_SHEEET_H
26#define SCH_SHEEET_H
27
28#include <sch_field.h>
29
30class KIID_PATH;
31class SCH_SCREEN;
33class SCH_SHEET_LIST;
34class SCH_SHEET_PIN;
35class SCH_SHEET_PATH;
36class EDA_DRAW_FRAME;
37
38
39#define MIN_SHEET_WIDTH 500 // Units are mils.
40#define MIN_SHEET_HEIGHT 150 // Units are mils.
41
42
46class SCH_SHEET : public SCH_ITEM
47{
48public:
49 SCH_SHEET( EDA_ITEM* aParent = nullptr, const VECTOR2I& aPos = VECTOR2I( 0, 0 ),
52
59 SCH_SHEET( const SCH_SHEET& aSheet );
60
61 ~SCH_SHEET();
62
63 static inline bool ClassOf( const EDA_ITEM* aItem )
64 {
65 return aItem && SCH_SHEET_T == aItem->Type();
66 }
67
68 wxString GetClass() const override
69 {
70 return wxT( "SCH_SHEET" );
71 }
72
82 bool IsMovableFromAnchorPoint() const override { return false; }
83
87 std::vector<SCH_FIELD>& GetFields() { return m_fields; }
88 const std::vector<SCH_FIELD>& GetFields() const { return m_fields; }
89
94 SCH_FIELD* GetField( FIELD_T aFieldType );
95 const SCH_FIELD* GetField( FIELD_T aFieldNdx ) const;
96
100 int GetNextFieldOrdinal() const;
101
107 void SetFields( const std::vector<SCH_FIELD>& aFields );
108
109 wxString GetShownName( bool aAllowExtraText ) const
110 {
111 return GetField( FIELD_T::SHEET_NAME )->GetShownText( aAllowExtraText );
112 }
113 wxString GetName() const { return GetField( FIELD_T::SHEET_NAME )->GetText(); }
114 void SetName( const wxString& aName ) { GetField( FIELD_T::SHEET_NAME )->SetText( aName ); }
115
116 SCH_SCREEN* GetScreen() const { return m_screen; }
117
118 VECTOR2I GetSize() const { return m_size; }
119 void SetSize( const VECTOR2I& aSize ) { m_size = aSize; }
120
121 int GetBorderWidth() const { return m_borderWidth; }
122 void SetBorderWidth( int aWidth ) { m_borderWidth = aWidth; }
123
125 void SetBorderColor( KIGFX::COLOR4D aColor ) { m_borderColor = aColor; }
126
129
133 bool IsRootSheet() const;
134
146 void SetScreen( SCH_SCREEN* aScreen );
147
153 int GetScreenCount() const;
154
158 void GetContextualTextVars( wxArrayString* aVars ) const;
159
165 bool ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, int aDepth = 0 ) const;
166
167 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
168
169 /* there is no member for orientation in sch_sheet, to preserve file
170 * format, we detect orientation based on pin edges
171 */
172 bool IsVerticalOrientation() const;
173
174 void SetPositionIgnoringPins( const VECTOR2I& aPosition );
175
185 void AddPin( SCH_SHEET_PIN* aSheetPin );
186
187 std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; }
188 const std::vector<SCH_SHEET_PIN*>& GetPins() const { return m_pins; }
189
195 void RemovePin( const SCH_SHEET_PIN* aSheetPin );
196
203 void CleanupSheet();
204
212 SCH_SHEET_PIN* GetPin( const VECTOR2I& aPosition );
213
220 bool HasPin( const wxString& aName ) const;
221
222 bool HasPins() const { return !m_pins.empty(); }
223
229 bool HasUndefinedPins() const;
230
242 int GetMinWidth( bool aFromLeft ) const;
243
254 int GetMinHeight( bool aFromTop ) const;
255
256 int GetPenWidth() const override;
257
261 const BOX2I GetBodyBoundingBox() const;
262
263 const BOX2I GetBoundingBox() const override;
264
272
273 void swapData( SCH_ITEM* aItem ) override;
274
278 int SymbolCount() const;
279
287 bool SearchHierarchy( const wxString& aFilename, SCH_SCREEN** aScreen );
288
299 bool LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList );
300
306 int CountSheets() const;
307
314 int CountSheets( const wxString& aFileName ) const;
315
321 wxString GetFileName() const
322 {
323 return GetField( FIELD_T::SHEET_FILENAME )->GetText();
324 }
325
326 // Set a new filename without changing anything else
327 void SetFileName( const wxString& aFilename )
328 {
329 // Filenames are stored using unix notation
330 wxString tmp = aFilename;
331 tmp.Replace( wxT( "\\" ), wxT( "/" ) );
332 GetField( FIELD_T::SHEET_FILENAME )->SetText( tmp );
333 }
334
335 // Geometric transforms (used in block operations):
336
337 void Move( const VECTOR2I& aMoveVector ) override;
338 void MirrorHorizontally( int aCenter ) override;
339 void MirrorVertically( int aCenter ) override;
340 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) override;
341
342 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
343
344 bool IsReplaceable() const override { return true; }
345
351 void Resize( const VECTOR2I& aSize );
352
353 void AutoplaceFields( SCH_SCREEN* aScreen, AUTOPLACE_ALGO aAlgo ) override;
354
355 void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ) override;
356
357 bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListByType,
358 std::vector<DANGLING_END_ITEM>& aItemListByPos,
359 const SCH_SHEET_PATH* aPath = nullptr ) override;
360
361 bool IsConnectable() const override { return true; }
362
363 bool HasConnectivityChanges( const SCH_ITEM* aItem,
364 const SCH_SHEET_PATH* aInstance = nullptr ) const override;
365
366 bool CanConnect( const SCH_ITEM* aItem ) const override
367 {
368 return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE )
369 || ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS )
370 || ( aItem->Type() == SCH_NO_CONNECT_T )
371 || ( aItem->Type() == SCH_SYMBOL_T );
372 }
373
374 std::vector<VECTOR2I> GetConnectionPoints() const override;
375
376 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
377 const std::vector<KICAD_T>& aScanTypes ) override;
378
379 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction, RECURSE_MODE aMode ) override;
380
384 void SetExcludedFromSim( bool aExcludeFromSim ) override { m_excludedFromSim = aExcludeFromSim; }
385 bool GetExcludedFromSim() const override { return m_excludedFromSim; }
386
390 void SetExcludedFromBOM( bool aExcludeFromBOM ) { m_excludedFromBOM = aExcludeFromBOM; }
391 bool GetExcludedFromBOM() const { return m_excludedFromBOM; }
392
396 void SetExcludedFromBoard( bool aExcludeFromBoard ) { m_excludedFromBoard = aExcludeFromBoard; }
398
402 bool GetDNP() const { return m_DNP; }
403 void SetDNP( bool aDNP ) { m_DNP = aDNP; }
404
405 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
406
407 BITMAPS GetMenuImage() const override;
408
409 SCH_SHEET& operator=( const SCH_ITEM& aSheet );
410
411 bool operator <( const SCH_ITEM& aItem ) const override;
412
413 std::vector<int> ViewGetLayers() const override;
414
415 VECTOR2I GetPosition() const override { return m_pos; }
416 void SetPosition( const VECTOR2I& aPosition ) override;
417
418 bool HitTest( const VECTOR2I& aPosition, int aAccuracy ) const override;
419 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
420
421 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
422 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
423
424 EDA_ITEM* Clone() const override;
425
429 const std::vector<SCH_SHEET_INSTANCE>& GetInstances() const { return m_instances; }
430
440 bool HasRootInstance() const;
441
450 const SCH_SHEET_INSTANCE& GetRootInstance() const;
451
452 void RemoveInstance( const KIID_PATH& aInstancePath );
453
454 void AddInstance( const SCH_SHEET_INSTANCE& aInstance );
455
462 bool HasPageNumberChanges( const SCH_SHEET& aOther ) const;
463
469 static int ComparePageNum( const wxString& aPageNumberA, const wxString& aPageNumberB );
470
471 double Similarity( const SCH_ITEM& aOther ) const override;
472
473 bool operator==( const SCH_ITEM& aOther ) const override;
474
475#if defined(DEBUG)
476 void Show( int nestLevel, std::ostream& os ) const override;
477#endif
478
479protected:
482
483 void setInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances )
484 {
485 m_instances = aInstances;
486 }
487
501 bool addInstance( const KIID_PATH& aInstance );
502
511 wxString getPageNumber( const KIID_PATH& aInstance ) const;
512
522 void setPageNumber( const KIID_PATH& aInstance, const wxString& aPageNumber );
523
524 bool getInstance( SCH_SHEET_INSTANCE& aInstance, const KIID_PATH& aSheetPath,
525 bool aTestFromEnd = false ) const;
526
534 void renumberPins();
535
540 SCH_SHEET_PATH findSelf() const;
541
542private:
543 bool doIsConnected( const VECTOR2I& aPosition ) const override;
544
545 friend class SCH_SHEET_PIN;
546 friend class SCH_SHEET_LIST;
547
548private:
549 SCH_SCREEN* m_screen; // Screen that contains the physical data for the
550 // sheet. In complex hierarchies multiple sheets
551 // can share a common screen.
552
553 std::vector<SCH_SHEET_PIN*> m_pins; // The list of sheet connection points.
554 std::vector<SCH_FIELD> m_fields;
555
559 bool m_DNP;
560
561 VECTOR2I m_pos; // The position of the sheet.
562 VECTOR2I m_size; // The size of the sheet.
566
567 std::vector<SCH_SHEET_INSTANCE> m_instances;
568};
569
570
571#endif // SCH_SHEEET_H
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:110
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
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:95
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:107
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:98
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Base plotter engine class.
Definition: plotter.h:105
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
Definition: sch_field.cpp:192
void SetText(const wxString &aText) override
Definition: sch_field.cpp:1069
Object to parser s-expression symbol library and schematic file formats.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:168
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:295
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:47
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
Definition: sch_sheet.cpp:1052
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Definition: sch_sheet.cpp:177
friend SCH_SHEET_PATH
Definition: sch_sheet.h:480
bool GetExcludedFromBOM() const
Definition: sch_sheet.h:391
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:125
const std::vector< SCH_SHEET_PIN * > & GetPins() const
Definition: sch_sheet.h:188
VECTOR2I m_size
Definition: sch_sheet.h:562
void SetFileName(const wxString &aFilename)
Definition: sch_sheet.h:327
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
Definition: sch_sheet.cpp:1077
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:321
bool IsRootSheet() const
Definition: sch_sheet.cpp:169
bool getInstance(SCH_SHEET_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
Definition: sch_sheet.cpp:1395
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_sheet.cpp:1179
void SetSize(const VECTOR2I &aSize)
Definition: sch_sheet.h:119
void RemoveInstance(const KIID_PATH &aInstancePath)
Definition: sch_sheet.cpp:1339
bool addInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
Definition: sch_sheet.cpp:1372
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
Definition: sch_sheet.cpp:400
bool HasRootInstance() const
Check to see if this sheet has a root sheet instance.
Definition: sch_sheet.cpp:1419
wxString GetClass() const override
Return the class name.
Definition: sch_sheet.h:68
int GetPenWidth() const override
Definition: sch_sheet.cpp:625
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_sheet.cpp:131
bool IsConnectable() const override
Definition: sch_sheet.h:361
SCH_SHEET_PATH findSelf() const
Get the sheetpath of this sheet.
Definition: sch_sheet.cpp:1032
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_sheet.cpp:1013
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
Definition: sch_sheet.cpp:1613
VECTOR2I m_pos
Definition: sch_sheet.h:561
std::vector< SCH_FIELD > & GetFields()
Return a reference to the vector holding the sheet's fields.
Definition: sch_sheet.h:87
KIGFX::COLOR4D m_borderColor
Definition: sch_sheet.h:564
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
Definition: sch_sheet.cpp:369
bool m_excludedFromBOM
Definition: sch_sheet.h:557
wxString GetName() const
Definition: sch_sheet.h:113
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:1020
void SetExcludedFromBOM(bool aExcludeFromBOM)
Set or clear the exclude from schematic bill of materials flag.
Definition: sch_sheet.h:390
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
Definition: sch_sheet.cpp:724
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:613
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_sheet.cpp:1322
bool GetExcludedFromBoard() const
Definition: sch_sheet.h:397
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:587
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:411
void SetPositionIgnoringPins(const VECTOR2I &aPosition)
Definition: sch_sheet.cpp:883
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:753
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:789
std::vector< SCH_SHEET_INSTANCE > m_instances
Definition: sch_sheet.h:567
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:473
bool m_excludedFromSim
Definition: sch_sheet.h:556
void SetPosition(const VECTOR2I &aPosition) override
Definition: sch_sheet.cpp:988
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:128
int SymbolCount() const
Count our own symbols, without the power symbols.
Definition: sch_sheet.cpp:731
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
Definition: sch_sheet.cpp:1208
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_sheet.h:344
void AddInstance(const SCH_SHEET_INSTANCE &aInstance)
Definition: sch_sheet.cpp:1360
int GetMinWidth(bool aFromLeft) const
Return the minimum width of the sheet based on the widths of the sheet pin text.
Definition: sch_sheet.cpp:519
bool operator==(const SCH_ITEM &aOther) const override
Definition: sch_sheet.cpp:1566
SCH_SCREEN * m_screen
Definition: sch_sheet.h:549
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition: sch_sheet.cpp:684
std::vector< SCH_FIELD > m_fields
Definition: sch_sheet.h:554
void SetDNP(bool aDNP)
Definition: sch_sheet.h:403
VECTOR2I GetSize() const
Definition: sch_sheet.h:118
KIGFX::COLOR4D m_backgroundColor
Definition: sch_sheet.h:565
void SetName(const wxString &aName)
Definition: sch_sheet.h:114
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
Definition: sch_sheet.cpp:830
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this sheet.
Definition: sch_sheet.cpp:385
SCH_SCREEN * GetScreen() const
Definition: sch_sheet.h:116
bool HasPins() const
Definition: sch_sheet.h:222
VECTOR2I GetPosition() const override
Definition: sch_sheet.h:415
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
Definition: sch_sheet.cpp:692
bool HasPin(const wxString &aName) const
Check if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:428
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compare page numbers of schematic sheets.
Definition: sch_sheet.cpp:1530
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_sheet.cpp:968
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
Definition: sch_sheet.cpp:391
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
Definition: sch_sheet.cpp:160
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:137
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
Definition: sch_sheet.cpp:1292
bool HasPageNumberChanges(const SCH_SHEET &aOther) const
Check if the instance data of this sheet has any changes compared to aOther.
Definition: sch_sheet.cpp:1477
const SCH_SHEET_INSTANCE & GetRootInstance() const
Return the root sheet instance data.
Definition: sch_sheet.cpp:1431
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_sheet.cpp:440
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_sheet.cpp:328
bool m_excludedFromBoard
Definition: sch_sheet.h:558
void setInstances(const std::vector< SCH_SHEET_INSTANCE > &aInstances)
Definition: sch_sheet.h:483
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_sheet.cpp:713
const std::vector< SCH_FIELD > & GetFields() const
Definition: sch_sheet.h:88
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_sheet.cpp:1111
KIGFX::COLOR4D GetBorderColor() const
Definition: sch_sheet.h:124
std::vector< SCH_SHEET_PIN * > m_pins
Definition: sch_sheet.h:553
bool IsMovableFromAnchorPoint() const override
Return true for items which are moved with the anchor point at mouse cursor and false for items moved...
Definition: sch_sheet.h:82
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_sheet.h:366
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 dat...
Definition: sch_sheet.cpp:1122
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:122
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:63
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_sheet.cpp:948
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
Definition: sch_sheet.cpp:1464
bool GetExcludedFromSim() const override
Definition: sch_sheet.h:385
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
Definition: sch_sheet.cpp:637
int GetMinHeight(bool aFromTop) const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
Definition: sch_sheet.cpp:553
int m_borderWidth
Definition: sch_sheet.h:563
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: sch_sheet.cpp:1169
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
Definition: sch_sheet.cpp:1064
void Resize(const VECTOR2I &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
Definition: sch_sheet.cpp:996
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.cpp:894
int GetBorderWidth() const
Definition: sch_sheet.h:121
void SetExcludedFromBoard(bool aExcludeFromBoard)
Set or clear exclude from board netlist flag.
Definition: sch_sheet.h:396
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_sheet.cpp:844
bool m_DNP
Definition: sch_sheet.h:559
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:187
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
Definition: sch_sheet.cpp:1159
wxString GetShownName(bool aAllowExtraText) const
Definition: sch_sheet.h:109
friend SCH_IO_KICAD_SEXPR_PARSER
Definition: sch_sheet.h:481
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_sheet.cpp:906
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
Definition: sch_sheet.cpp:220
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
Definition: sch_sheet.h:429
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:452
void SetExcludedFromSim(bool aExcludeFromSim) override
Set or clear the exclude from simulation flag.
Definition: sch_sheet.h:384
bool GetDNP() const
Set or clear the 'Do Not Populate' flags.
Definition: sch_sheet.h:402
bool HitTest(const VECTOR2I &aPosition, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_sheet.cpp:1185
KIGFX::COLOR4D GetBackgroundColor() const
Definition: sch_sheet.h:127
wxString getPageNumber(const KIID_PATH &aInstance) const
Return the sheet page number for aInstance.
Definition: sch_sheet.cpp:1447
RECURSE_MODE
Definition: eda_item.h:49
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition: eda_item.h:88
@ LAYER_WIRE
Definition: layer_ids.h:441
@ LAYER_BUS
Definition: layer_ids.h:442
AUTOPLACE_ALGO
Definition: sch_item.h:69
#define MIN_SHEET_HEIGHT
Definition: sch_sheet.h:40
#define MIN_SHEET_WIDTH
Definition: sch_sheet.h:39
constexpr int MilsToIU(int mils) const
Definition: base_units.h:93
A simple container for sheet instance information.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ SCH_LINE_T
Definition: typeinfo.h:163
@ SCH_NO_CONNECT_T
Definition: typeinfo.h:160
@ SCH_SYMBOL_T
Definition: typeinfo.h:172
@ SCH_SHEET_T
Definition: typeinfo.h:174
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:695