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
46class SCH_SHEET : public SCH_ITEM
47{
48public:
49 SCH_SHEET( EDA_ITEM* aParent = nullptr, const VECTOR2I& aPos = VECTOR2I( 0, 0 ),
50 VECTOR2I aSize = VECTOR2I( schIUScale.MilsToIU( MIN_SHEET_WIDTH ),
51 schIUScale.MilsToIU( MIN_SHEET_HEIGHT ) ) );
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
135 bool IsVirtualRootSheet() const;
136
144 bool IsTopLevelSheet() const;
145
157 void SetScreen( SCH_SCREEN* aScreen );
158
164 int GetScreenCount() const;
165
169 void GetContextualTextVars( wxArrayString* aVars ) const;
170
176 bool ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, int aDepth = 0 ) const;
177
178 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
179
180 /* there is no member for orientation in sch_sheet, to preserve file
181 * format, we detect orientation based on pin edges
182 */
183 bool IsVerticalOrientation() const;
184
185 void SetPositionIgnoringPins( const VECTOR2I& aPosition );
186
196 void AddPin( SCH_SHEET_PIN* aSheetPin );
197
198 std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; }
199 const std::vector<SCH_SHEET_PIN*>& GetPins() const { return m_pins; }
200
206 void RemovePin( const SCH_SHEET_PIN* aSheetPin );
207
214 void CleanupSheet();
215
223 SCH_SHEET_PIN* GetPin( const VECTOR2I& aPosition );
224
231 bool HasPin( const wxString& aName ) const;
232
233 bool HasPins() const { return !m_pins.empty(); }
234
240 bool HasUndefinedPins() const;
241
253 int GetMinWidth( bool aFromLeft ) const;
254
265 int GetMinHeight( bool aFromTop ) const;
266
267 int GetPenWidth() const override;
268
272 const BOX2I GetBodyBoundingBox() const;
273
274 const BOX2I GetBoundingBox() const override;
275
283
284 void swapData( SCH_ITEM* aItem ) override;
285
289 int SymbolCount() const;
290
298 bool SearchHierarchy( const wxString& aFilename, SCH_SCREEN** aScreen );
299
310 bool LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList );
311
317 int CountSheets() const;
318
326 int CountActiveSheets() const;
327
334 int CountSheets( const wxString& aFileName ) const;
335
341 wxString GetFileName() const
342 {
344 }
345
346 // Set a new filename without changing anything else
347 void SetFileName( const wxString& aFilename )
348 {
349 // Filenames are stored using unix notation
350 wxString tmp = aFilename;
351 tmp.Replace( wxT( "\\" ), wxT( "/" ) );
353 }
354
355 // Geometric transforms (used in block operations):
356
357 void Move( const VECTOR2I& aMoveVector ) override;
358 void MirrorHorizontally( int aCenter ) override;
359 void MirrorVertically( int aCenter ) override;
360 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) override;
361
362 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override;
363
364 bool IsReplaceable() const override { return true; }
365
371 void Resize( const VECTOR2I& aSize );
372
373 void AutoplaceFields( SCH_SCREEN* aScreen, AUTOPLACE_ALGO aAlgo ) override;
374
375 void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ) override;
376
377 bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListByType,
378 std::vector<DANGLING_END_ITEM>& aItemListByPos,
379 const SCH_SHEET_PATH* aPath = nullptr ) override;
380
381 bool IsConnectable() const override { return true; }
382
383 bool HasConnectivityChanges( const SCH_ITEM* aItem,
384 const SCH_SHEET_PATH* aInstance = nullptr ) const override;
385
386 bool CanConnect( const SCH_ITEM* aItem ) const override
387 {
388 return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE )
389 || ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS )
390 || ( aItem->Type() == SCH_NO_CONNECT_T )
391 || ( aItem->Type() == SCH_SYMBOL_T );
392 }
393
394 std::vector<VECTOR2I> GetConnectionPoints() const override;
395
396 INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
397 const std::vector<KICAD_T>& aScanTypes ) override;
398
399 void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction, RECURSE_MODE aMode ) override;
400
404 void SetExcludedFromSim( bool aExcludeFromSim, const SCH_SHEET_PATH* aInstance = nullptr,
405 const wxString& aVariantName = wxEmptyString ) override
406 {
407 m_excludedFromSim = aExcludeFromSim;
408 }
409
410 bool GetExcludedFromSim( const SCH_SHEET_PATH* aInstance = nullptr,
411 const wxString& aVariantName = wxEmptyString ) const override
412 {
413 return m_excludedFromSim;
414 }
415
416 bool GetExcludedFromSimProp() const;
417 void SetExcludedFromSimProp( bool aEnable );
418
422 void SetExcludedFromBOM( bool aExcludeFromBOM, const SCH_SHEET_PATH* aInstance = nullptr,
423 const wxString& aVariantName = wxEmptyString ) override
424 {
425 m_excludedFromBOM = aExcludeFromBOM;
426 }
427
428 bool GetExcludedFromBOM( const SCH_SHEET_PATH* aInstance = nullptr,
429 const wxString& aVariantName = wxEmptyString ) const override
430 {
431 return m_excludedFromBOM;
432 }
433
434 bool GetExcludedFromBOMProp() const;
435 void SetExcludedFromBOMProp( bool aEnable );
436
440 void SetExcludedFromBoard( bool aExcludeFromBoard ) override { m_excludedFromBoard = aExcludeFromBoard; }
441 bool GetExcludedFromBoard() const override { return m_excludedFromBoard; }
442
446 bool GetDNP( const SCH_SHEET_PATH* aInstance = nullptr,
447 const wxString& aVariantName = wxEmptyString ) const override { return m_DNP; }
448 void SetDNP( bool aDNP, const SCH_SHEET_PATH* aInstance = nullptr,
449 const wxString& aVariantName = wxEmptyString ) override { m_DNP = aDNP; }
450 bool GetDNPProp() const;
451 void SetDNPProp( bool aEnable );
452
453 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
454
455 BITMAPS GetMenuImage() const override;
456
457 SCH_SHEET& operator=( const SCH_ITEM& aSheet );
458
459 bool operator <( const SCH_ITEM& aItem ) const override;
460
461 std::vector<int> ViewGetLayers() const override;
462
463 VECTOR2I GetPosition() const override { return m_pos; }
464 void SetPosition( const VECTOR2I& aPosition ) override;
465
466 bool HitTest( const VECTOR2I& aPosition, int aAccuracy ) const override;
467 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
468 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
469
470 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
471 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
472
473 EDA_ITEM* Clone() const override;
474
478 const std::vector<SCH_SHEET_INSTANCE>& GetInstances() const { return m_instances; }
479
489 bool HasRootInstance() const;
490
499 const SCH_SHEET_INSTANCE& GetRootInstance() const;
500
501 void RemoveInstance( const KIID_PATH& aInstancePath );
502
503 void AddInstance( const SCH_SHEET_INSTANCE& aInstance );
504
511 bool HasPageNumberChanges( const SCH_SHEET& aOther ) const;
512
518 static int ComparePageNum( const wxString& aPageNumberA, const wxString& aPageNumberB );
519
520 double Similarity( const SCH_ITEM& aOther ) const override;
521
522 bool operator==( const SCH_ITEM& aOther ) const override;
523
524#if defined(DEBUG)
525 void Show( int nestLevel, std::ostream& os ) const override;
526#endif
527
528protected:
531
532 void setInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances )
533 {
534 m_instances = aInstances;
535 }
536
550 bool addInstance( const KIID_PATH& aInstance );
551
561 wxString getPageNumber( const KIID_PATH& aParentPath ) const;
562
572 void setPageNumber( const KIID_PATH& aInstance, const wxString& aPageNumber );
573
574 bool getInstance( SCH_SHEET_INSTANCE& aInstance, const KIID_PATH& aSheetPath,
575 bool aTestFromEnd = false ) const;
576
584 void renumberPins();
585
590 SCH_SHEET_PATH findSelf() const;
591
592private:
593 bool doIsConnected( const VECTOR2I& aPosition ) const override;
594
595 friend class SCH_SHEET_PIN;
596 friend class SCH_SHEET_LIST;
597
598private:
599 SCH_SCREEN* m_screen; // Screen that contains the physical data for the
600 // sheet. In complex hierarchies multiple sheets
601 // can share a common screen.
602
603 std::vector<SCH_SHEET_PIN*> m_pins; // The list of sheet connection points.
604 std::vector<SCH_FIELD> m_fields;
605
609 bool m_DNP;
610
611 VECTOR2I m_pos; // The position of the sheet.
612 VECTOR2I m_size; // The size of the sheet.
616
617 std::vector<SCH_SHEET_INSTANCE> m_instances;
618};
619
620
621#endif // SCH_SHEEET_H
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:114
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
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
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:39
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:121
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
void SetText(const wxString &aText) override
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:321
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:51
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.
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.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
friend SCH_SHEET_PATH
Definition sch_sheet.h:529
bool GetExcludedFromBoard() const override
Definition sch_sheet.h:441
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition sch_sheet.h:125
const std::vector< SCH_SHEET_PIN * > & GetPins() const
Definition sch_sheet.h:199
friend class SCH_SHEET_PIN
Definition sch_sheet.h:595
VECTOR2I m_size
Definition sch_sheet.h:612
void SetExcludedFromBoard(bool aExcludeFromBoard) override
Set or clear exclude from board netlist flag.
Definition sch_sheet.h:440
void SetFileName(const wxString &aFilename)
Definition sch_sheet.h:347
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition sch_sheet.h:341
bool getInstance(SCH_SHEET_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetExcludedFromSim(bool aExcludeFromSim, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear the exclude from simulation flag.
Definition sch_sheet.h:404
void SetSize(const VECTOR2I &aSize)
Definition sch_sheet.h:119
void RemoveInstance(const KIID_PATH &aInstancePath)
void SetDNP(bool aDNP, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Definition sch_sheet.h:448
bool addInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
bool HasRootInstance() const
Check to see if this sheet has a root sheet instance.
wxString GetClass() const override
Return the class name.
Definition sch_sheet.h:68
wxString getPageNumber(const KIID_PATH &aParentPath) const
Return the sheet page number for aParentPath.
void SetExcludedFromBOM(bool aExcludeFromBOM, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear the exclude from schematic bill of materials flag.
Definition sch_sheet.h:422
int GetPenWidth() const override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool IsConnectable() const override
Definition sch_sheet.h:381
bool IsTopLevelSheet() const
Check if this sheet is a top-level sheet.
SCH_SHEET_PATH findSelf() const
Get the sheetpath of this sheet.
bool GetDNPProp() const
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
bool GetExcludedFromBOMProp() const
VECTOR2I m_pos
Definition sch_sheet.h:611
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:614
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
bool m_excludedFromBOM
Definition sch_sheet.h:607
wxString GetName() const
Definition sch_sheet.h:113
void renumberPins()
Renumber the sheet pins in the sheet.
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
bool GetExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
Definition sch_sheet.h:428
bool operator<(const SCH_ITEM &aItem) const override
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
void SetPositionIgnoringPins(const VECTOR2I &aPosition)
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
bool GetExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
Definition sch_sheet.h:410
bool LocatePathOfScreen(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
Search the existing hierarchy for an instance of screen loaded from aFileName.
std::vector< SCH_SHEET_INSTANCE > m_instances
Definition sch_sheet.h:617
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
bool m_excludedFromSim
Definition sch_sheet.h:606
void SetPosition(const VECTOR2I &aPosition) override
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition sch_sheet.h:128
int SymbolCount() const
Count our own symbols, without the power symbols.
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.
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition sch_sheet.h:364
void SetDNPProp(bool aEnable)
void AddInstance(const SCH_SHEET_INSTANCE &aInstance)
int GetMinWidth(bool aFromLeft) const
Return the minimum width of the sheet based on the widths of the sheet pin text.
bool operator==(const SCH_ITEM &aOther) const override
SCH_SCREEN * m_screen
Definition sch_sheet.h:599
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
std::vector< SCH_FIELD > m_fields
Definition sch_sheet.h:604
VECTOR2I GetSize() const
Definition sch_sheet.h:118
KIGFX::COLOR4D m_backgroundColor
Definition sch_sheet.h:615
SCH_SHEET(EDA_ITEM *aParent=nullptr, const VECTOR2I &aPos=VECTOR2I(0, 0), VECTOR2I aSize=VECTOR2I(schIUScale.MilsToIU(MIN_SHEET_WIDTH), schIUScale.MilsToIU(MIN_SHEET_HEIGHT)))
Definition sch_sheet.cpp:54
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.
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this sheet.
SCH_SCREEN * GetScreen() const
Definition sch_sheet.h:116
void SetExcludedFromSimProp(bool aEnable)
bool HasPins() const
Definition sch_sheet.h:233
VECTOR2I GetPosition() const override
Definition sch_sheet.h:463
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
bool HasPin(const wxString &aName) const
Check if the sheet already has a sheet pin named aName.
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compare page numbers of schematic sheets.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
int CountActiveSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
bool HasPageNumberChanges(const SCH_SHEET &aOther) const
Check if the instance data of this sheet has any changes compared to aOther.
const SCH_SHEET_INSTANCE & GetRootInstance() const
Return the root sheet instance data.
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
bool m_excludedFromBoard
Definition sch_sheet.h:608
void setInstances(const std::vector< SCH_SHEET_INSTANCE > &aInstances)
Definition sch_sheet.h:532
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
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.
KIGFX::COLOR4D GetBorderColor() const
Definition sch_sheet.h:124
std::vector< SCH_SHEET_PIN * > m_pins
Definition sch_sheet.h:603
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:386
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...
friend class SCH_SHEET_LIST
Definition sch_sheet.h:596
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.
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
bool IsVirtualRootSheet() const
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
int GetMinHeight(bool aFromTop) const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
bool GetDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
Set or clear the 'Do Not Populate' flags.
Definition sch_sheet.h:446
bool GetExcludedFromSimProp() const
int m_borderWidth
Definition sch_sheet.h:613
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
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.
void Resize(const VECTOR2I &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
int GetBorderWidth() const
Definition sch_sheet.h:121
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.
bool m_DNP
Definition sch_sheet.h:609
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition sch_sheet.h:198
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
void SetExcludedFromBOMProp(bool aEnable)
wxString GetShownName(bool aAllowExtraText) const
Definition sch_sheet.h:109
friend SCH_IO_KICAD_SEXPR_PARSER
Definition sch_sheet.h:530
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
Definition sch_sheet.h:478
bool IsVerticalOrientation() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
KIGFX::COLOR4D GetBackgroundColor() const
Definition sch_sheet.h:127
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
RECURSE_MODE
Definition eda_item.h:50
INSPECT_RESULT
Definition eda_item.h:44
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:91
@ LAYER_WIRE
Definition layer_ids.h:452
@ LAYER_BUS
Definition layer_ids.h:453
AUTOPLACE_ALGO
Definition sch_item.h:68
#define MIN_SHEET_HEIGHT
Definition sch_sheet.h:40
#define MIN_SHEET_WIDTH
Definition sch_sheet.h:39
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:167
@ SCH_NO_CONNECT_T
Definition typeinfo.h:164
@ SCH_SYMBOL_T
Definition typeinfo.h:176
@ SCH_SHEET_T
Definition typeinfo.h:179
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695