KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
44{
47
50};
51
52#define SHEET_MANDATORY_FIELDS { SHEETNAME, SHEETFILENAME }
53
54
58class SCH_SHEET : public SCH_ITEM
59{
60public:
61 SCH_SHEET( EDA_ITEM* aParent = nullptr, const VECTOR2I& aPos = VECTOR2I( 0, 0 ),
64
71 SCH_SHEET( const SCH_SHEET& aSheet );
72
73 ~SCH_SHEET();
74
75 static inline bool ClassOf( const EDA_ITEM* aItem )
76 {
77 return aItem && SCH_SHEET_T == aItem->Type();
78 }
79
80 wxString GetClass() const override
81 {
82 return wxT( "SCH_SHEET" );
83 }
84
94 bool IsMovableFromAnchorPoint() const override { return false; }
95
96 std::vector<SCH_FIELD>& GetFields() { return m_fields; }
97 const std::vector<SCH_FIELD>& GetFields() const { return m_fields; }
98
104 void SetFields( const std::vector<SCH_FIELD>& aFields );
105
106 wxString GetShownName( bool aAllowExtraText ) const
107 {
108 return m_fields[SHEETNAME].GetShownText( aAllowExtraText );
109 }
110 wxString GetName() const { return m_fields[ SHEETNAME ].GetText(); }
111 void SetName( const wxString& aName ) { m_fields[ SHEETNAME ].SetText( aName ); }
112
113 SCH_SCREEN* GetScreen() const { return m_screen; }
114
115 VECTOR2I GetSize() const { return m_size; }
116 void SetSize( const VECTOR2I& aSize ) { m_size = aSize; }
117
118 int GetBorderWidth() const { return m_borderWidth; }
119 void SetBorderWidth( int aWidth ) { m_borderWidth = aWidth; }
120
122 void SetBorderColor( KIGFX::COLOR4D aColor ) { m_borderColor = aColor; }
123
126
130 bool IsRootSheet() const;
131
143 void SetScreen( SCH_SCREEN* aScreen );
144
150 int GetScreenCount() const;
151
155 void GetContextualTextVars( wxArrayString* aVars ) const;
156
162 bool ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, int aDepth = 0 ) const;
163
164 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
165
166 /* there is no member for orientation in sch_sheet, to preserve file
167 * format, we detect orientation based on pin edges
168 */
169 bool IsVerticalOrientation() const;
170
171 void SetPositionIgnoringPins( const VECTOR2I& aPosition );
172
182 void AddPin( SCH_SHEET_PIN* aSheetPin );
183
184 std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; }
185 const std::vector<SCH_SHEET_PIN*>& GetPins() const { return m_pins; }
186
192 void RemovePin( const SCH_SHEET_PIN* aSheetPin );
193
200 void CleanupSheet();
201
209 SCH_SHEET_PIN* GetPin( const VECTOR2I& aPosition );
210
217 bool HasPin( const wxString& aName ) const;
218
219 bool HasPins() const { return !m_pins.empty(); }
220
226 bool HasUndefinedPins() const;
227
239 int GetMinWidth( bool aFromLeft ) const;
240
251 int GetMinHeight( bool aFromTop ) const;
252
253 int GetPenWidth() const override;
254
258 const BOX2I GetBodyBoundingBox() const;
259
260 const BOX2I GetBoundingBox() const override;
261
269
270 void SwapData( SCH_ITEM* aItem ) override;
271
275 int SymbolCount() const;
276
284 bool SearchHierarchy( const wxString& aFilename, SCH_SCREEN** aScreen );
285
296 bool LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList );
297
303 int CountSheets() const;
304
310 wxString GetFileName() const
311 {
312 return m_fields[ SHEETFILENAME ].GetText();
313 }
314
315 // Set a new filename without changing anything else
316 void SetFileName( const wxString& aFilename )
317 {
318 // Filenames are stored using unix notation
319 wxString tmp = aFilename;
320 tmp.Replace( wxT( "\\" ), wxT( "/" ) );
321 m_fields[ SHEETFILENAME ].SetText( tmp );
322 }
323
324 // Geometric transforms (used in block operations):
325
326 void Move( const VECTOR2I& aMoveVector ) override;
327 void MirrorHorizontally( int aCenter ) override;
328 void MirrorVertically( int aCenter ) override;
329 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) override;
330
331 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
332
333 bool IsReplaceable() const override { return true; }
334
340 void Resize( const VECTOR2I& aSize );
341
342 void AutoplaceFields( SCH_SCREEN* aScreen, AUTOPLACE_ALGO aAlgo ) override;
343
344 void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ) override;
345
346 bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListByType,
347 std::vector<DANGLING_END_ITEM>& aItemListByPos,
348 const SCH_SHEET_PATH* aPath = nullptr ) override;
349
350 bool IsConnectable() const override { return true; }
351
352 bool HasConnectivityChanges( const SCH_ITEM* aItem,
353 const SCH_SHEET_PATH* aInstance = nullptr ) const override;
354
355 bool CanConnect( const SCH_ITEM* aItem ) const override
356 {
357 return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE )
358 || ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS )
359 || ( aItem->Type() == SCH_NO_CONNECT_T )
360 || ( aItem->Type() == SCH_SYMBOL_T );
361 }
362
363 std::vector<VECTOR2I> GetConnectionPoints() const override;
364
365 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
366 const std::vector<KICAD_T>& aScanTypes ) override;
367
368 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
369
373 void SetExcludedFromSim( bool aExcludeFromSim ) override { m_excludedFromSim = aExcludeFromSim; }
374 bool GetExcludedFromSim() const override { return m_excludedFromSim; }
375
379 void SetExcludedFromBOM( bool aExcludeFromBOM ) { m_excludedFromBOM = aExcludeFromBOM; }
380 bool GetExcludedFromBOM() const { return m_excludedFromBOM; }
381
385 void SetExcludedFromBoard( bool aExcludeFromBoard ) { m_excludedFromBoard = aExcludeFromBoard; }
387
391 bool GetDNP() const { return m_DNP; }
392 void SetDNP( bool aDNP ) { m_DNP = aDNP; }
393
394 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
395
396 BITMAPS GetMenuImage() const override;
397
398 SCH_SHEET& operator=( const SCH_ITEM& aSheet );
399
400 bool operator <( const SCH_ITEM& aItem ) const override;
401
402 std::vector<int> ViewGetLayers() const override;
403
404 VECTOR2I GetPosition() const override { return m_pos; }
405 void SetPosition( const VECTOR2I& aPosition ) override;
406
407 bool HitTest( const VECTOR2I& aPosition, int aAccuracy ) const override;
408 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
409
410 void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
411 const VECTOR2I& aOffset, bool aForceNoFill, bool aDimmed ) override;
412
413 void PrintBackground( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
414 const VECTOR2I& aOffset, bool aDimmed ) override {}
415
416 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
417 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
418
419 EDA_ITEM* Clone() const override;
420
424 const std::vector<SCH_SHEET_INSTANCE>& GetInstances() const { return m_instances; }
425
435 bool HasRootInstance() const;
436
445 const SCH_SHEET_INSTANCE& GetRootInstance() const;
446
447 void RemoveInstance( const KIID_PATH& aInstancePath );
448
449 void AddInstance( const SCH_SHEET_INSTANCE& aInstance );
450
457 bool HasPageNumberChanges( const SCH_SHEET& aOther ) const;
458
464 static int ComparePageNum( const wxString& aPageNumberA, const wxString& aPageNumberB );
465
466 double Similarity( const SCH_ITEM& aOther ) const override;
467
468 bool operator==( const SCH_ITEM& aOther ) const override;
469
470#if defined(DEBUG)
471 void Show( int nestLevel, std::ostream& os ) const override;
472#endif
473
474 static const wxString GetDefaultFieldName( int aFieldNdx, bool aTranslated );
475
476protected:
479
480 void setInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances )
481 {
482 m_instances = aInstances;
483 }
484
498 bool addInstance( const KIID_PATH& aInstance );
499
508 wxString getPageNumber( const KIID_PATH& aInstance ) const;
509
519 void setPageNumber( const KIID_PATH& aInstance, const wxString& aPageNumber );
520
521 bool getInstance( SCH_SHEET_INSTANCE& aInstance, const KIID_PATH& aSheetPath,
522 bool aTestFromEnd = false ) const;
523
531 void renumberPins();
532
537 SCH_SHEET_PATH findSelf() const;
538
539private:
540 bool doIsConnected( const VECTOR2I& aPosition ) const override;
541
542 friend class SCH_SHEET_PIN;
543 friend class SCH_SHEET_LIST;
544
545private:
546 SCH_SCREEN* m_screen; // Screen that contains the physical data for the
547 // sheet. In complex hierarchies multiple sheets
548 // can share a common screen.
549
550 std::vector<SCH_SHEET_PIN*> m_pins; // The list of sheet connection points.
551 std::vector<SCH_FIELD> m_fields;
552
556 bool m_DNP;
557
558 VECTOR2I m_pos; // The position of the sheet.
559 VECTOR2I m_size; // The size of the sheet.
563
564 std::vector<SCH_SHEET_INSTANCE> m_instances;
565};
566
567
568#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:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Base plotter engine class.
Definition: plotter.h:105
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:167
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:288
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:59
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:1060
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Definition: sch_sheet.cpp:211
friend SCH_SHEET_PATH
Definition: sch_sheet.h:477
bool GetExcludedFromBOM() const
Definition: sch_sheet.h:380
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:122
const std::vector< SCH_SHEET_PIN * > & GetPins() const
Definition: sch_sheet.h:185
VECTOR2I m_size
Definition: sch_sheet.h:559
void SetFileName(const wxString &aFilename)
Definition: sch_sheet.h:316
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:1085
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:310
bool IsRootSheet() const
Definition: sch_sheet.cpp:203
bool getInstance(SCH_SHEET_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
Definition: sch_sheet.cpp:1455
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated)
Definition: sch_sheet.cpp:59
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_sheet.cpp:1185
void SetSize(const VECTOR2I &aSize)
Definition: sch_sheet.h:116
void RemoveInstance(const KIID_PATH &aInstancePath)
Definition: sch_sheet.cpp:1399
bool addInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
Definition: sch_sheet.cpp:1432
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
Definition: sch_sheet.cpp:426
bool HasRootInstance() const
Check to see if this sheet has a root sheet instance.
Definition: sch_sheet.cpp:1479
wxString GetClass() const override
Return the class name.
Definition: sch_sheet.h:80
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
Definition: sch_sheet.cpp:1167
int GetPenWidth() const override
Definition: sch_sheet.cpp:651
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_sheet.cpp:165
bool IsConnectable() const override
Definition: sch_sheet.h:350
SCH_SHEET_PATH findSelf() const
Get the sheetpath of this sheet.
Definition: sch_sheet.cpp:1040
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_sheet.cpp:1021
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:1673
VECTOR2I m_pos
Definition: sch_sheet.h:558
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:96
KIGFX::COLOR4D m_borderColor
Definition: sch_sheet.h:561
bool m_excludedFromBOM
Definition: sch_sheet.h:554
wxString GetName() const
Definition: sch_sheet.h:110
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:1028
void SetExcludedFromBOM(bool aExcludeFromBOM)
Set or clear the exclude from schematic bill of materials flag.
Definition: sch_sheet.h:379
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
Definition: sch_sheet.cpp:747
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:639
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_sheet.cpp:1382
bool GetExcludedFromBoard() const
Definition: sch_sheet.h:386
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:613
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
Definition: sch_sheet.cpp:1298
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:437
void SetPositionIgnoringPins(const VECTOR2I &aPosition)
Definition: sch_sheet.cpp:891
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:776
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:812
std::vector< SCH_SHEET_INSTANCE > m_instances
Definition: sch_sheet.h:564
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:499
bool m_excludedFromSim
Definition: sch_sheet.h:553
void SetPosition(const VECTOR2I &aPosition) override
Definition: sch_sheet.cpp:996
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:125
int SymbolCount() const
Count our own symbols, without the power symbols.
Definition: sch_sheet.cpp:754
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:1214
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_sheet.h:333
void AddInstance(const SCH_SHEET_INSTANCE &aInstance)
Definition: sch_sheet.cpp:1420
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:545
bool operator==(const SCH_ITEM &aOther) const override
Definition: sch_sheet.cpp:1626
SCH_SCREEN * m_screen
Definition: sch_sheet.h:546
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:707
std::vector< SCH_FIELD > m_fields
Definition: sch_sheet.h:551
void SetDNP(bool aDNP)
Definition: sch_sheet.h:392
VECTOR2I GetSize() const
Definition: sch_sheet.h:115
KIGFX::COLOR4D m_backgroundColor
Definition: sch_sheet.h:562
void SetName(const wxString &aName)
Definition: sch_sheet.h:111
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
Definition: sch_sheet.cpp:836
SCH_SCREEN * GetScreen() const
Definition: sch_sheet.h:113
bool HasPins() const
Definition: sch_sheet.h:219
VECTOR2I GetPosition() const override
Definition: sch_sheet.h:404
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
Definition: sch_sheet.cpp:715
bool HasPin(const wxString &aName) const
Check if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:454
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compare page numbers of schematic sheets.
Definition: sch_sheet.cpp:1590
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_sheet.cpp:976
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
Definition: sch_sheet.cpp:403
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
Definition: sch_sheet.cpp:194
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:171
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
Definition: sch_sheet.cpp:1352
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:1537
const SCH_SHEET_INSTANCE & GetRootInstance() const
Return the root sheet instance data.
Definition: sch_sheet.cpp:1491
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_sheet.cpp:466
bool m_excludedFromBoard
Definition: sch_sheet.h:555
void setInstances(const std::vector< SCH_SHEET_INSTANCE > &aInstances)
Definition: sch_sheet.h:480
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_sheet.cpp:736
const std::vector< SCH_FIELD > & GetFields() const
Definition: sch_sheet.h:97
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_sheet.cpp:1119
KIGFX::COLOR4D GetBorderColor() const
Definition: sch_sheet.h:121
std::vector< SCH_SHEET_PIN * > m_pins
Definition: sch_sheet.h:550
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:94
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_sheet.h:355
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:1130
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:119
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:75
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_sheet.cpp:956
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
Definition: sch_sheet.cpp:1524
bool GetExcludedFromSim() const override
Definition: sch_sheet.h:374
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
Definition: sch_sheet.cpp:663
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_sheet.cpp:362
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:579
int m_borderWidth
Definition: sch_sheet.h:560
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: sch_sheet.cpp:1177
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:1072
void Resize(const VECTOR2I &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
Definition: sch_sheet.cpp:1004
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.cpp:902
int GetBorderWidth() const
Definition: sch_sheet.h:118
void SetExcludedFromBoard(bool aExcludeFromBoard)
Set or clear exclude from board netlist flag.
Definition: sch_sheet.h:385
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:850
bool m_DNP
Definition: sch_sheet.h:556
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:184
wxString GetShownName(bool aAllowExtraText) const
Definition: sch_sheet.h:106
friend SCH_IO_KICAD_SEXPR_PARSER
Definition: sch_sheet.h:478
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_sheet.cpp:914
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:254
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
Definition: sch_sheet.h:424
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:478
void SetExcludedFromSim(bool aExcludeFromSim) override
Set or clear the exclude from simulation flag.
Definition: sch_sheet.h:373
void PrintBackground(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Print just the background fills.
Definition: sch_sheet.h:413
bool GetDNP() const
Set or clear the 'Do Not Populate' flags.
Definition: sch_sheet.h:391
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:1191
KIGFX::COLOR4D GetBackgroundColor() const
Definition: sch_sheet.h:124
wxString getPageNumber(const KIID_PATH &aInstance) const
Return the sheet page number for aInstance.
Definition: sch_sheet.cpp:1507
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:82
@ LAYER_WIRE
Definition: layer_ids.h:441
@ LAYER_BUS
Definition: layer_ids.h:442
AUTOPLACE_ALGO
Definition: sch_item.h:68
SHEET_FIELD_TYPE
Definition: sch_sheet.h:44
@ SHEET_MANDATORY_FIELD_COUNT
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition: sch_sheet.h:49
@ SHEETNAME
Definition: sch_sheet.h:45
@ SHEETFILENAME
Definition: sch_sheet.h:46
#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.
@ 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