KiCad PCB EDA Suite
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 (C) 1992-2020 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 <boost/ptr_container/ptr_vector.hpp>
29 #include <sch_text.h>
30 #include <sch_field.h>
31 
32 class KIID;
33 class LINE_READER;
34 class SCH_SCREEN;
35 class SCH_SHEET;
36 class SCH_SHEET_PIN;
37 class SCH_SHEET_PATH;
38 class DANGLING_END_ITEM;
39 class SCH_EDIT_FRAME;
40 class NETLIST_OBJECT_LIST;
41 
42 
43 #define MIN_SHEET_WIDTH 500 // Units are mils.
44 #define MIN_SHEET_HEIGHT 150 // Units are mils.
45 
46 
57 {
63 };
64 
65 
67  SHEETNAME = 0,
69 
72 };
73 
74 
86 {
87 private:
88  int m_number;
89 
94 
95 public:
96  SCH_SHEET_PIN( SCH_SHEET* parent,
97  const wxPoint& pos = wxPoint( 0, 0 ),
98  const wxString& text = wxEmptyString );
99 
100  // Do not create a copy constructor. The one generated by the compiler is adequate.
101 
103 
104  static inline bool ClassOf( const EDA_ITEM* aItem )
105  {
106  return aItem && SCH_SHEET_PIN_T == aItem->Type();
107  }
108 
109  wxString GetClass() const override
110  {
111  return wxT( "SCH_SHEET_PIN" );
112  }
113 
114  bool operator ==( const SCH_SHEET_PIN* aPin ) const;
115 
122  bool IsMovableFromAnchorPoint() const override { return true; }
123 
124  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
125 
132  void CreateGraphicShape( const RENDER_SETTINGS* aSettings,
133  std::vector <wxPoint>& aPoints, const wxPoint& aPos ) override;
134 
135  void SwapData( SCH_ITEM* aItem ) override;
136 
137  int GetPenWidth() const override;
138 
144  int GetNumber() const { return m_number; }
145 
151  void SetNumber( int aNumber );
152 
153  void SetEdge( SHEET_SIDE aEdge );
154 
155  SHEET_SIDE GetEdge() const;
156 
161  void ConstrainOnEdge( wxPoint Pos );
162 
169  SCH_SHEET* GetParent() const { return (SCH_SHEET*) m_parent; }
170 
171 #if defined(DEBUG)
172  void Show( int nestLevel, std::ostream& os ) const override;
173 #endif
174 
175  // Geometric transforms (used in block operations):
176 
177  void Move( const wxPoint& aMoveVector ) override
178  {
179  Offset( aMoveVector );
180  }
181 
182  void MirrorVertically( int aCenter ) override;
183  void MirrorHorizontally( int aCenter ) override;
184  void Rotate( wxPoint aPosition ) override;
185 
186  bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override
187  {
188  return SCH_ITEM::Matches( GetText(), aSearchData );
189  }
190 
191  bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData = NULL ) override
192  {
193  return EDA_TEXT::Replace( aSearchData );
194  }
195 
196  bool IsReplaceable() const override { return true; }
197 
198  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
199 
200  bool IsConnectable() const override { return true; }
201 
202  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
203 
204  BITMAP_DEF GetMenuImage() const override;
205 
206  void SetPosition( const wxPoint& aPosition ) override { ConstrainOnEdge( aPosition ); }
207 
208  bool IsPointClickableAnchor( const wxPoint& aPos ) const override { return m_isDangling && GetPosition() == aPos; }
209 
210  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
211 
212  EDA_ITEM* Clone() const override;
213 };
214 
215 
219 class SCH_SHEET : public SCH_ITEM
220 {
221  friend class SCH_SHEET_PIN;
222 
223 
224  SCH_SCREEN* m_screen; // Screen that contains the physical data for the sheet. In
225  // complex hierarchies multiple sheets can share a common screen.
226 
227  std::vector<SCH_SHEET_PIN*> m_pins; // The list of sheet connection points.
228  std::vector<SCH_FIELD> m_fields;
229 
230  wxPoint m_pos; // The position of the sheet.
231  wxSize m_size; // The size of the sheet.
235 
236  std::vector<SCH_SHEET_INSTANCE> m_instances;
237 
238 public:
239  SCH_SHEET( EDA_ITEM* aParent = nullptr, const wxPoint& pos = wxPoint( 0, 0 ) );
240 
245  SCH_SHEET( const SCH_SHEET& aSheet );
246 
247  ~SCH_SHEET();
248 
249  static inline bool ClassOf( const EDA_ITEM* aItem )
250  {
251  return aItem && SCH_SHEET_T == aItem->Type();
252  }
253 
254  wxString GetClass() const override
255  {
256  return wxT( "SCH_SHEET" );
257  }
258 
268  bool IsMovableFromAnchorPoint() const override { return false; }
269 
270  std::vector<SCH_FIELD>& GetFields() { return m_fields; }
271  const std::vector<SCH_FIELD>& GetFields() const { return m_fields; }
272 
278  void SetFields( const std::vector<SCH_FIELD>& aFields )
279  {
280  m_fields = aFields; // vector copying, length is changed possibly
281  }
282 
283  wxString GetName() const { return m_fields[ SHEETNAME ].GetText(); }
284 
285  SCH_SCREEN* GetScreen() const { return m_screen; }
286 
287  wxSize GetSize() const { return m_size; }
288  void SetSize( const wxSize& aSize ) { m_size = aSize; }
289 
290  int GetBorderWidth() const { return m_borderWidth; }
291  void SetBorderWidth( int aWidth ) { m_borderWidth = aWidth; }
292 
294  void SetBorderColor( KIGFX::COLOR4D aColor ) { m_borderColor = aColor; }
295 
298 
309  bool UsesDefaultStroke() const;
310 
314  bool IsRootSheet() const;
315 
327  void SetScreen( SCH_SCREEN* aScreen );
328 
334  int GetScreenCount() const;
335 
339  void GetContextualTextVars( wxArrayString* aVars ) const;
340 
345  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
346 
347  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
348 
349  /* there is no member for orientation in sch_sheet, to preserve file
350  * format, we detect orientation based on pin edges
351  */
352  bool IsVerticalOrientation() const;
353 
363  void AddPin( SCH_SHEET_PIN* aSheetPin );
364 
365  std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; }
366 
367  const std::vector<SCH_SHEET_PIN*>& GetPins() const
368  {
369  return m_pins;
370  }
371 
377  void RemovePin( const SCH_SHEET_PIN* aSheetPin );
378 
385  void CleanupSheet();
386 
394  SCH_SHEET_PIN* GetPin( const wxPoint& aPosition );
395 
403  bool HasPin( const wxString& aName ) const;
404 
405  bool HasPins() const { return !m_pins.empty(); }
406 
412  bool HasUndefinedPins() const;
413 
425  int GetMinWidth() const;
426 
437  int GetMinHeight() const;
438 
439  int GetPenWidth() const override;
440 
441  void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
442 
446  const EDA_RECT GetBodyBoundingBox() const;
447 
448  const EDA_RECT GetBoundingBox() const override;
449 
455  wxPoint GetRotationCenter() const;
456 
457  void SwapData( SCH_ITEM* aItem ) override;
458 
464  int SymbolCount() const;
465 
473  bool SearchHierarchy( const wxString& aFilename, SCH_SCREEN** aScreen );
474 
485  bool LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList );
486 
492  int CountSheets() const;
493 
499  wxString GetFileName() const
500  {
501  return m_fields[ SHEETFILENAME ].GetText();
502  }
503 
504  // Set a new filename without changing anything else
505  void SetFileName( wxString aFilename )
506  {
507  // Filenames are stored using unix notation
508  aFilename.Replace( wxT("\\"), wxT("/") );
509  m_fields[ SHEETFILENAME ].SetText( aFilename );
510  }
511 
512  // Geometric transforms (used in block operations):
513 
514  void Move( const wxPoint& aMoveVector ) override
515  {
516  m_pos += aMoveVector;
517 
518  for( SCH_SHEET_PIN* pin : m_pins )
519  pin->Move( aMoveVector );
520 
521  for( SCH_FIELD& field : m_fields )
522  field.Move( aMoveVector );
523  }
524 
525  void MirrorHorizontally( int aYaxis_position ) override;
526  void MirrorVertically( int aXaxis_position ) override;
527  void Rotate( wxPoint aPosition ) override;
528 
529  bool Matches( const wxFindReplaceData& aSearchData, void* aAuxData ) const override;
530 
531  bool IsReplaceable() const override { return true; }
532 
538  void Resize( const wxSize& aSize );
539 
540  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
541 
542  void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ) override;
543 
544  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
545  const SCH_SHEET_PATH* aPath = nullptr ) override;
546 
547  bool IsConnectable() const override { return true; }
548 
549  bool CanConnect( const SCH_ITEM* aItem ) const override
550  {
551  return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
552  ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) ||
553  ( aItem->Type() == SCH_NO_CONNECT_T );
554  }
555 
556  std::vector<wxPoint> GetConnectionPoints() const override;
557 
558  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
559 
560  void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
561 
562  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
563 
564  BITMAP_DEF GetMenuImage() const override;
565 
566  SCH_SHEET& operator=( const SCH_ITEM& aSheet );
567 
568  bool operator <( const SCH_ITEM& aItem ) const override;
569 
570  void ViewGetLayers( int aLayers[], int& aCount ) const override;
571 
572  wxPoint GetPosition() const override { return m_pos; }
573  void SetPosition( const wxPoint& aPosition ) override;
574 
575  bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
576  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
577 
578  void Plot( PLOTTER* aPlotter ) override;
579 
580  EDA_ITEM* Clone() const override;
581 
585  const std::vector<SCH_SHEET_INSTANCE> GetInstances() const;
586 
597  bool AddInstance( const KIID_PATH& aInstance );
598 
604  wxString GetPageNumber( const SCH_SHEET_PATH& aInstance ) const;
605 
612  void SetPageNumber( const SCH_SHEET_PATH& aInstance, const wxString& aPageNumber );
613 
620  static int ComparePageNum( const wxString& aPageNumberA, const wxString aPageNumberB );
621 
622 #if defined(DEBUG)
623  void Show( int nestLevel, std::ostream& os ) const override;
624 #endif
625 
626  static const wxString GetDefaultFieldName( int aFieldNdx );
627 
628 protected:
636  void renumberPins();
637 
638 private:
639  bool doIsConnected( const wxPoint& aPosition ) const override;
640 };
641 
642 
643 //typedef std::vector< SCH_SHEET* > SCH_SHEETS; // no ownership over contained SCH_SHEETs
644 
645 #endif // SCH_SHEEET_H
const std::vector< SCH_SHEET_INSTANCE > GetInstances() const
bool IsPointClickableAnchor(const wxPoint &aPos) const override
Definition: sch_sheet.h:208
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:51
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:259
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:528
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:80
SHEET_SIDE
Defines the edge of the sheet that the sheet pin is positioned SHEET_LEFT_SIDE = 0: pin on left side ...
Definition: sch_sheet.h:56
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition: sch_sheet.cpp:559
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition: eda_item.h:414
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:630
SCH_SHEET_PIN * GetPin(const wxPoint &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:498
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
SCH_SHEET * GetParent() const
Get the parent sheet object of this sheet pin.
Definition: sch_sheet.h:169
PNG memory record (file in memory).
Definition: bitmap_def.h:29
KIGFX::COLOR4D m_borderColor
Definition: sch_sheet.h:233
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
Definition: sch_sheet.h:278
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition: sch_sheet.h:71
SCH_SHEET_PIN(SCH_SHEET *parent, const wxPoint &pos=wxPoint(0, 0), const wxString &text=wxEmptyString)
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:172
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:830
bool Replace(const wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:178
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:154
void MirrorVertically(int aXaxis_position) override
Mirror item vertically about aCenter.
Definition: sch_sheet.cpp:764
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Definition: sch_sheet.cpp:194
wxSize m_size
Definition: sch_sheet.h:231
wxString GetClass() const override
Return the class name.
Definition: sch_sheet.h:109
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_sheet.cpp:337
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:370
bool IsConnectable() const override
Definition: sch_sheet.h:200
KIGFX::COLOR4D GetBorderColor() const
Definition: sch_sheet.h:293
SHEET_SIDE GetEdge() const
bool UsesDefaultStroke() const
Test this sheet to see if the default stroke is used to draw the outline.
Definition: sch_sheet.cpp:257
Schematic editor (Eeschema) main window.
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_sheet.h:196
static int ComparePageNum(const wxString &aPageNumberA, const wxString aPageNumberB)
Compares page numbers of schematic sheets.
Definition: sch_sheet.cpp:1139
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_sheet.h:186
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: sch_sheet.cpp:913
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_sheet.cpp:1065
The base class for create windows for drawing purpose.
SCH_SCREEN * GetScreen() const
Definition: sch_sheet.h:285
wxPoint m_pos
Definition: sch_sheet.h:230
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
Definition: sch_sheet.cpp:297
void SetPageNumber(const SCH_SHEET_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
Definition: sch_sheet.cpp:1124
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:94
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
std::vector< SCH_SHEET_INSTANCE > m_instances
Definition: sch_sheet.h:236
KIGFX::COLOR4D GetBackgroundColor() const
Definition: sch_sheet.h:296
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:291
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:270
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
Definition: sch_sheet.cpp:177
Definition: kiid.h:44
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:818
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:706
wxString GetClass() const override
Return the class name.
Definition: sch_sheet.h:254
int GetBorderWidth() const
Definition: sch_sheet.h:290
void SetFileName(wxString aFilename)
Definition: sch_sheet.h:505
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:297
bool IsConnectable() const override
Definition: sch_sheet.h:547
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_sheet.cpp:590
wxString GetName() const
Definition: sch_sheet.h:283
#define NULL
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:122
SCH_SHEET(EDA_ITEM *aParent=nullptr, const wxPoint &pos=wxPoint(0, 0))
Definition: sch_sheet.cpp:71
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_sheet.h:531
int m_borderWidth
Definition: sch_sheet.h:232
int GetPenWidth() const override
Definition: sch_sheet.cpp:510
bool IsRootSheet() const
Definition: sch_sheet.cpp:186
std::vector< SCH_SHEET_PIN * > m_pins
Definition: sch_sheet.h:227
int GetMinHeight() const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
Definition: sch_sheet.cpp:433
void SetEdge(SHEET_SIDE aEdge)
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) 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:865
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:294
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:268
const EDA_RECT GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
Definition: sch_sheet.cpp:569
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.h:177
static const wxString GetDefaultFieldName(int aFieldNdx)
Definition: sch_sheet.cpp:44
SHEET_FIELD_TYPE
Definition: sch_sheet.h:66
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:85
int SymbolCount() const
Count our own components, without the power components.
Definition: sch_sheet.cpp:608
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
int GetNumber() const
Get the sheet label number.
Definition: sch_sheet.h:144
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:499
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_sheet.cpp:854
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:472
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void ConstrainOnEdge(wxPoint Pos)
Adjust label position to edge based on proximity to vertical or horizontal edge of the parent sheet.
wxPoint GetPosition() const override
Definition: sch_text.h:312
wxPoint GetPosition() const override
Definition: sch_sheet.h:572
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_sheet.cpp:722
int GetPenWidth() const override
void MirrorHorizontally(int aYaxis_position) override
Mirror item horizontally about aCenter.
Definition: sch_sheet.cpp:774
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:308
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:219
void SetSize(const wxSize &aSize)
Definition: sch_sheet.h:288
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
Definition: sch_sheet.cpp:999
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:287
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:365
std::vector< SCH_FIELD > m_fields
Definition: sch_sheet.h:228
EDA_UNITS
Definition: eda_units.h:38
bool Replace(const wxFindReplaceData &aSearchData, void *aAuxData=NULL) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
Definition: sch_sheet.h:191
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
Definition: sch_sheet.cpp:692
int GetMinWidth() const
Return the minimum width of the sheet based on the widths of the sheet pin text.
Definition: sch_sheet.cpp:393
void SetPosition(const wxPoint &aPosition) override
Definition: sch_sheet.h:206
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:666
Base plotter engine class.
Definition: plotter.h:121
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_sheet.cpp:263
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
Definition: sch_sheet.cpp:903
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_sheet.cpp:148
void SetNumber(int aNumber)
Set the sheet label number.
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
Definition: sch_sheet.cpp:949
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
int m_number
Label number use for saving sheet label to file.
Definition: sch_sheet.h:88
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, 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:842
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_sheet.h:549
wxSize GetSize() const
Definition: sch_sheet.h:287
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:349
void SetPosition(const wxPoint &aPosition) override
Definition: sch_sheet.cpp:784
KIGFX::COLOR4D m_backgroundColor
Definition: sch_sheet.h:234
Handle the component boundary box.
Definition: eda_rect.h:42
bool operator==(const SCH_SHEET_PIN *aPin) const
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:249
SCH_SCREEN * m_screen
Definition: sch_sheet.h:224
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_sheet.cpp:920
bool HasPins() const
Definition: sch_sheet.h:405
wxPoint GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
Definition: sch_sheet.cpp:601
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
const std::vector< SCH_FIELD > & GetFields() const
Definition: sch_sheet.h:271
Helper class used to store the state of schematic items that can be connected to other schematic item...
Definition: sch_item.h:87
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
Definition: sch_sheet.cpp:208
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:516
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &aPos) override
Calculate the graphic shape (a polygon) associated to the text.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:104
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_sheet.cpp:809
bool HasPin(const wxString &aName) const
Checks if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:325
SEARCH_RESULT
Definition: eda_item.h:40
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:196
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.h:514
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
wxString GetPageNumber(const SCH_SHEET_PATH &aInstance) const
Return the sheet page number for aInstance.
Definition: sch_sheet.cpp:1106
SHEET_SIDE m_edge
Definition: sch_sheet.h:93
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
Definition: sch_sheet.cpp:1035
bool AddInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
Definition: sch_sheet.cpp:1082
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162
void Resize(const wxSize &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
Definition: sch_sheet.cpp:792
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: sch_sheet.cpp:926
const std::vector< SCH_SHEET_PIN * > & GetPins() const
Definition: sch_sheet.h:367