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() override { return true; }
123 
124  void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
125 
132  void CreateGraphicShape( 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 MirrorX( int aXaxis_position ) override;
183  void MirrorY( int aYaxis_position ) override;
184  void Rotate( wxPoint aPosition ) override;
185 
186  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
187  {
188  return SCH_ITEM::Matches( GetText(), aSearchData );
189  }
190 
191  bool Replace( 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 
229  std::vector<SCH_FIELD> m_fields;
230  FIELDS_AUTOPLACED m_fieldsAutoplaced; // Indicates status of field autoplacement.
231 
232  wxPoint m_pos; // The position of the sheet.
233  wxSize m_size; // The size of the sheet.
234 
238 
239  std::vector<SCH_SHEET_INSTANCE> m_instances;
240 
241 public:
242  SCH_SHEET( EDA_ITEM* aParent = nullptr, const wxPoint& pos = wxPoint( 0, 0 ) );
243 
248  SCH_SHEET( const SCH_SHEET& aSheet );
249 
250  ~SCH_SHEET();
251 
252  static inline bool ClassOf( const EDA_ITEM* aItem )
253  {
254  return aItem && SCH_SHEET_T == aItem->Type();
255  }
256 
257  wxString GetClass() const override
258  {
259  return wxT( "SCH_SHEET" );
260  }
261 
271  bool IsMovableFromAnchorPoint() override { return false; }
272 
273  std::vector<SCH_FIELD>& GetFields() { return m_fields; }
274 
280  void SetFields( const std::vector<SCH_FIELD>& aFields )
281  {
282  m_fields = aFields; // vector copying, length is changed possibly
283  }
284 
285  wxString GetName() const { return m_fields[ SHEETNAME ].GetText(); }
286 
287  SCH_SCREEN* GetScreen() const { return m_screen; }
288 
289  wxSize GetSize() { return m_size; }
290  void SetSize( const wxSize& aSize ) { m_size = aSize; }
291 
292  int GetBorderWidth() const { return m_borderWidth; }
293  void SetBorderWidth( int aWidth ) { m_borderWidth = aWidth; }
294 
296  void SetBorderColor( KIGFX::COLOR4D aColor ) { m_borderColor = aColor; }
297 
300 
311  bool UsesDefaultStroke() const;
312 
316  bool IsRootSheet() const;
317 
329  void SetScreen( SCH_SCREEN* aScreen );
330 
336  int GetScreenCount() const;
337 
341  void GetContextualTextVars( wxArrayString* aVars ) const;
342 
347  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
348 
349  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
350 
351  /* there is no member for orientation in sch_sheet, to preserve file
352  * format, we detect orientation based on pin edges
353  */
354  bool IsVerticalOrientation() const;
355 
365  void AddPin( SCH_SHEET_PIN* aSheetPin );
366 
367  std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; }
368 
369  std::vector<SCH_SHEET_PIN*>& GetPins() const
370  {
371  return const_cast< std::vector<SCH_SHEET_PIN*>& >( m_pins );
372  }
373 
379  void RemovePin( SCH_SHEET_PIN* aSheetPin );
380 
387  void CleanupSheet();
388 
396  SCH_SHEET_PIN* GetPin( const wxPoint& aPosition );
397 
405  bool HasPin( const wxString& aName );
406 
407  bool HasPins() { return !m_pins.empty(); }
408 
414  bool HasUndefinedPins();
415 
427  int GetMinWidth() const;
428 
439  int GetMinHeight() const;
440 
441  int GetPenWidth() const override;
442 
443  void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
444 
448  const EDA_RECT GetBodyBoundingBox() const;
449 
450  const EDA_RECT GetBoundingBox() const override;
451 
457  wxPoint GetRotationCenter() const;
458 
459  void SwapData( SCH_ITEM* aItem ) override;
460 
466  int ComponentCount() const;
467 
475  bool SearchHierarchy( const wxString& aFilename, SCH_SCREEN** aScreen );
476 
487  bool LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList );
488 
494  int CountSheets() const;
495 
501  wxString GetFileName() const
502  {
503  return m_fields[ SHEETFILENAME ].GetText();
504  }
505 
506  // Set a new filename without changing anything else
507  void SetFileName( wxString aFilename )
508  {
509  // Filenames are stored using unix notation
510  aFilename.Replace( wxT("\\"), wxT("/") );
511  m_fields[ SHEETFILENAME ].SetText( aFilename );
512  }
513 
514  // Geometric transforms (used in block operations):
515 
516  void Move( const wxPoint& aMoveVector ) override
517  {
518  m_pos += aMoveVector;
519 
520  for( SCH_SHEET_PIN* pin : m_pins )
521  pin->Move( aMoveVector );
522 
523  for( SCH_FIELD& field : m_fields )
524  field.Move( aMoveVector );
525  }
526 
527  void MirrorY( int aYaxis_position ) override;
528  void MirrorX( int aXaxis_position ) override;
529  void Rotate( wxPoint aPosition ) override;
530 
531  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
532 
533  bool IsReplaceable() const override { return true; }
534 
540  void Resize( const wxSize& aSize );
541 
542  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
543 
544  void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ) override;
545 
546  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
547  const SCH_SHEET_PATH* aPath = nullptr ) override;
548 
549  bool IsConnectable() const override { return true; }
550 
551  bool CanConnect( const SCH_ITEM* aItem ) const override
552  {
553  return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
554  ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) ||
555  ( aItem->Type() == SCH_NO_CONNECT_T );
556  }
557 
558  std::vector<wxPoint> GetConnectionPoints() const override;
559 
560  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) 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 
614 #if defined(DEBUG)
615  void Show( int nestLevel, std::ostream& os ) const override;
616 #endif
617 
618  static const wxString GetDefaultFieldName( int aFieldNdx );
619 
620 protected:
628  void renumberPins();
629 
630 private:
631  bool doIsConnected( const wxPoint& aPosition ) const override;
632 };
633 
634 
635 //typedef std::vector< SCH_SHEET* > SCH_SHEETS; // no ownership over contained SCH_SHEETs
636 
637 #endif // SCH_SHEEET_H
EDA_UNITS
Definition: common.h:200
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:52
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:254
LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived to re...
Definition: richio.h:82
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:543
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: eda_item.h:162
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:632
SCH_SHEET_PIN * GetPin(const wxPoint &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:480
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns 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:236
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
Definition: sch_sheet.h:280
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)
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
std::vector< SCH_SHEET_PIN * > & GetPins() const
Definition: sch_sheet.h:369
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
Definition: sch_text.h:173
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:835
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
Definition: sch_sheet.cpp:814
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:150
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Definition: sch_sheet.cpp:190
wxSize m_size
Definition: sch_sheet.h:233
wxString GetClass() const override
Function GetClass returns 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:319
bool IsConnectable() const override
Definition: sch_sheet.h:200
bool IsMovableFromAnchorPoint() 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
KIGFX::COLOR4D GetBorderColor() const
Definition: sch_sheet.h:295
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:245
Schematic editor (Eeschema) main window.
bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_sheet.h:196
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_sheet.cpp:908
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_sheet.cpp:1027
The base class for create windows for drawing purpose.
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
void Print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
SCH_SCREEN * GetScreen() const
Definition: sch_sheet.h:287
wxPoint m_pos
Definition: sch_sheet.h:232
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
Definition: sch_sheet.cpp:279
bool Replace(wxFindReplaceData &aSearchData, void *aAuxData=NULL) override
Function Replace performs a text replace using the find and replace criteria in aSearchData on items ...
Definition: sch_sheet.h:191
void SetPageNumber(const SCH_SHEET_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
Definition: sch_sheet.cpp:1086
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:93
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
std::vector< SCH_SHEET_INSTANCE > m_instances
Definition: sch_sheet.h:239
KIGFX::COLOR4D GetBackgroundColor() const
Definition: sch_sheet.h:298
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:293
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:273
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
Definition: sch_sheet.cpp:173
Definition: common.h:70
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:823
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
Definition: sch_sheet.cpp:708
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_sheet.h:257
void RemovePin(SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:290
int GetBorderWidth() const
Definition: sch_sheet.h:292
void SetFileName(wxString aFilename)
Definition: sch_sheet.h:507
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:299
bool IsConnectable() const override
Definition: sch_sheet.h:549
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_sheet.cpp:592
wxString GetName() const
Definition: sch_sheet.h:285
#define NULL
SCH_SHEET(EDA_ITEM *aParent=nullptr, const wxPoint &pos=wxPoint(0, 0))
Definition: sch_sheet.cpp:70
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
Definition: sch_sheet.cpp:769
bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_sheet.h:533
bool HasPins()
Definition: sch_sheet.h:407
int m_borderWidth
Definition: sch_sheet.h:235
int GetPenWidth() const override
Definition: sch_sheet.cpp:492
bool IsRootSheet() const
Definition: sch_sheet.cpp:182
bool IsMovableFromAnchorPoint() override
Return true for items which are moved with the anchor point at mouse cursor and false for items moved...
Definition: sch_sheet.h:271
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:415
void SetEdge(SHEET_SIDE aEdge)
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Definition: sch_sheet.cpp:870
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:296
const EDA_RECT GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
Definition: sch_sheet.cpp:571
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:43
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
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:501
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition: sch_sheet.cpp:859
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:454
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:313
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:727
int ComponentCount() const
Count our own components, without the power components.
Definition: sch_sheet.cpp:610
int GetPenWidth() const override
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:290
FIELDS_AUTOPLACED
Definition: sch_item.h:56
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:279
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:367
std::vector< SCH_FIELD > m_fields
Definition: sch_sheet.h:229
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
Definition: sch_sheet.cpp:694
bool HasUndefinedPins()
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:352
int GetMinWidth() const
Return the minimum width of the sheet based on the widths of the sheet pin text.
Definition: sch_sheet.cpp:375
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:668
Base plotter engine class.
Definition: plotter.h:130
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_sheet.cpp:251
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_sheet.cpp:144
void SetNumber(int aNumber)
Set the sheet label number.
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
Definition: sch_sheet.cpp:944
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:847
void Print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
Definition: sch_sheet.cpp:553
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_sheet.h:551
bool Replace(wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:177
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:331
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
Definition: sch_sheet.cpp:779
void SetPosition(const wxPoint &aPosition) override
Definition: sch_sheet.cpp:789
KIGFX::COLOR4D m_backgroundColor
Definition: sch_sheet.h:237
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool operator==(const SCH_SHEET_PIN *aPin) const
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
Definition: sch_sheet.h:186
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:252
SCH_SCREEN * m_screen
Definition: sch_sheet.h:224
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:147
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_sheet.cpp:915
bool HasPin(const wxString &aName)
Checks if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:307
wxPoint GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
Definition: sch_sheet.cpp:603
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Helper class used to store the state of schematic items that can be connected to other schematic item...
Definition: sch_item.h:85
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
Definition: sch_sheet.cpp:203
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:498
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:104
SEARCH_RESULT
Definition: eda_item.h:39
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: eda_item.h:446
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.h:516
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:128
void CreateGraphicShape(RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &aPos) override
Calculate the graphic shape (a polygon) associated to the text.
wxSize GetSize()
Definition: sch_sheet.h:289
wxString GetPageNumber(const SCH_SHEET_PATH &aInstance) const
Return the sheet page number for aInstance.
Definition: sch_sheet.cpp:1068
SHEET_SIDE m_edge
Definition: sch_sheet.h:93
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
Definition: sch_sheet.cpp:997
bool AddInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
Definition: sch_sheet.cpp:1044
FIELDS_AUTOPLACED m_fieldsAutoplaced
Definition: sch_sheet.h:230
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
void Resize(const wxSize &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
Definition: sch_sheet.cpp:797
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:100
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: sch_sheet.cpp:921