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 LINE_READER;
33 class SCH_SCREEN;
34 class SCH_SHEET;
35 class SCH_SHEET_PIN;
36 class SCH_SHEET_PATH;
37 class DANGLING_END_ITEM;
38 class SCH_EDIT_FRAME;
40 
41 
42 #define MIN_SHEET_WIDTH 500 // Units are mils.
43 #define MIN_SHEET_HEIGHT 150 // Units are mils.
44 
45 
56 {
62 };
63 
64 
66  SHEETNAME = 0,
68 
71 };
72 
73 
85 {
86 private:
87  int m_number;
88 
93 
94 public:
95  SCH_SHEET_PIN( SCH_SHEET* parent,
96  const wxPoint& pos = wxPoint( 0, 0 ),
97  const wxString& text = wxEmptyString );
98 
99  // Do not create a copy constructor. The one generated by the compiler is adequate.
100 
102 
103  static inline bool ClassOf( const EDA_ITEM* aItem )
104  {
105  return aItem && SCH_SHEET_PIN_T == aItem->Type();
106  }
107 
108  wxString GetClass() const override
109  {
110  return wxT( "SCH_SHEET_PIN" );
111  }
112 
113  bool operator ==( const SCH_SHEET_PIN* aPin ) const;
114 
121  bool IsMovableFromAnchorPoint() override { return true; }
122 
123  void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
124 
131  void CreateGraphicShape( RENDER_SETTINGS* aSettings,
132  std::vector <wxPoint>& aPoints, const wxPoint& aPos ) override;
133 
134  void SwapData( SCH_ITEM* aItem ) override;
135 
136  int GetPenWidth() const override;
137 
143  int GetNumber() const { return m_number; }
144 
150  void SetNumber( int aNumber );
151 
152  void SetEdge( SHEET_SIDE aEdge );
153 
154  SHEET_SIDE GetEdge() const;
155 
160  void ConstrainOnEdge( wxPoint Pos );
161 
168  SCH_SHEET* GetParent() const { return (SCH_SHEET*) m_Parent; }
169 
170 #if defined(DEBUG)
171  void Show( int nestLevel, std::ostream& os ) const override;
172 #endif
173 
174  // Geometric transforms (used in block operations):
175 
176  void Move( const wxPoint& aMoveVector ) override
177  {
178  Offset( aMoveVector );
179  }
180 
181  void MirrorX( int aXaxis_position ) override;
182  void MirrorY( int aYaxis_position ) override;
183  void Rotate( wxPoint aPosition ) override;
184 
185  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
186  {
187  return SCH_ITEM::Matches( GetText(), aSearchData );
188  }
189 
190  bool Replace( wxFindReplaceData& aSearchData, void* aAuxData = NULL ) override
191  {
192  return EDA_TEXT::Replace( aSearchData );
193  }
194 
195  bool IsReplaceable() const override { return true; }
196 
197  void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) override;
198 
199  bool IsConnectable() const override { return true; }
200 
201  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
202 
203  BITMAP_DEF GetMenuImage() const override;
204 
205  void SetPosition( const wxPoint& aPosition ) override { ConstrainOnEdge( aPosition ); }
206 
207  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
208 
209  EDA_ITEM* Clone() const override;
210 };
211 
212 
216 class SCH_SHEET : public SCH_ITEM
217 {
218  friend class SCH_SHEET_PIN;
219 
220 
221  SCH_SCREEN* m_screen; // Screen that contains the physical data for the sheet. In
222  // complex hierarchies multiple sheets can share a common screen.
223 
224  std::vector<SCH_SHEET_PIN*> m_pins; // The list of sheet connection points.
225 
226  std::vector<SCH_FIELD> m_fields;
227  FIELDS_AUTOPLACED m_fieldsAutoplaced; // Indicates status of field autoplacement.
228 
229  wxPoint m_pos; // The position of the sheet.
230  wxSize m_size; // The size of the sheet.
231 
235 
236 public:
237  SCH_SHEET( EDA_ITEM* aParent = nullptr, const wxPoint& pos = wxPoint( 0, 0 ) );
238 
243  SCH_SHEET( const SCH_SHEET& aSheet );
244 
245  ~SCH_SHEET();
246 
247  static inline bool ClassOf( const EDA_ITEM* aItem )
248  {
249  return aItem && SCH_SHEET_T == aItem->Type();
250  }
251 
252  wxString GetClass() const override
253  {
254  return wxT( "SCH_SHEET" );
255  }
256 
266  bool IsMovableFromAnchorPoint() override { return false; }
267 
268  std::vector<SCH_FIELD>& GetFields() { return m_fields; }
269 
275  void SetFields( const std::vector<SCH_FIELD>& aFields )
276  {
277  m_fields = aFields; // vector copying, length is changed possibly
278  }
279 
280  wxString GetName() const { return m_fields[ SHEETNAME ].GetText(); }
281 
282  SCH_SCREEN* GetScreen() const { return m_screen; }
283 
284  wxSize GetSize() { return m_size; }
285  void SetSize( const wxSize& aSize ) { m_size = aSize; }
286 
287  int GetBorderWidth() const { return m_borderWidth; }
288  void SetBorderWidth( int aWidth ) { m_borderWidth = aWidth; }
289 
291  void SetBorderColor( KIGFX::COLOR4D aColor ) { m_borderColor = aColor; }
292 
295 
306  bool UsesDefaultStroke() const;
307 
311  bool IsRootSheet() const;
312 
324  void SetScreen( SCH_SCREEN* aScreen );
325 
331  int GetScreenCount() const;
332 
336  void GetContextualTextVars( wxArrayString* aVars ) const;
337 
342  bool ResolveTextVar( wxString* token, int aDepth = 0 ) const;
343 
344  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
345 
346  /* there is no member for orientation in sch_sheet, to preserve file
347  * format, we detect orientation based on pin edges
348  */
349  bool IsVerticalOrientation() const;
350 
360  void AddPin( SCH_SHEET_PIN* aSheetPin );
361 
362  std::vector<SCH_SHEET_PIN*>& GetPins() { return m_pins; }
363 
364  std::vector<SCH_SHEET_PIN*>& GetPins() const
365  {
366  return const_cast< std::vector<SCH_SHEET_PIN*>& >( m_pins );
367  }
368 
374  void RemovePin( SCH_SHEET_PIN* aSheetPin );
375 
382  void CleanupSheet();
383 
391  SCH_SHEET_PIN* GetPin( const wxPoint& aPosition );
392 
400  bool HasPin( const wxString& aName );
401 
402  bool HasPins() { return !m_pins.empty(); }
403 
409  bool HasUndefinedPins();
410 
422  int GetMinWidth() const;
423 
434  int GetMinHeight() const;
435 
436  int GetPenWidth() const override;
437 
438  void Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
439 
443  const EDA_RECT GetBodyBoundingBox() const;
444 
445  const EDA_RECT GetBoundingBox() const override;
446 
452  wxPoint GetRotationCenter() const;
453 
454  void SwapData( SCH_ITEM* aItem ) override;
455 
461  int ComponentCount() const;
462 
470  bool SearchHierarchy( const wxString& aFilename, SCH_SCREEN** aScreen );
471 
482  bool LocatePathOfScreen( SCH_SCREEN* aScreen, SCH_SHEET_PATH* aList );
483 
489  int CountSheets() const;
490 
496  wxString GetFileName() const
497  {
498  return m_fields[ SHEETFILENAME ].GetText();
499  }
500 
501  // Set a new filename without changing anything else
502  void SetFileName( wxString aFilename )
503  {
504  // Filenames are stored using unix notation
505  aFilename.Replace( wxT("\\"), wxT("/") );
506  m_fields[ SHEETFILENAME ].SetText( aFilename );
507  }
508 
509  // Geometric transforms (used in block operations):
510 
511  void Move( const wxPoint& aMoveVector ) override
512  {
513  m_pos += aMoveVector;
514 
515  for( SCH_SHEET_PIN* pin : m_pins )
516  pin->Move( aMoveVector );
517 
518  for( SCH_FIELD& field : m_fields )
519  field.Move( aMoveVector );
520  }
521 
522  void MirrorY( int aYaxis_position ) override;
523  void MirrorX( int aXaxis_position ) override;
524  void Rotate( wxPoint aPosition ) override;
525 
526  bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override;
527 
528  bool IsReplaceable() const override { return true; }
529 
535  void Resize( const wxSize& aSize );
536 
537  void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
538 
539  void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ) override;
540 
541  bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
542  const SCH_SHEET_PATH* aPath = nullptr ) override;
543 
544  bool IsConnectable() const override { return true; }
545 
546  bool CanConnect( const SCH_ITEM* aItem ) const override
547  {
548  return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
549  ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) ||
550  ( aItem->Type() == SCH_NO_CONNECT_T );
551  }
552 
553  void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const override;
554 
555  SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
556 
557  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
558 
559  BITMAP_DEF GetMenuImage() const override;
560 
561  void GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
562  SCH_SHEET_PATH* aSheetPath ) override;
563 
564  SCH_SHEET& operator=( const SCH_ITEM& aSheet );
565 
566  bool operator <( const SCH_ITEM& aItem ) const override;
567 
568  void ViewGetLayers( int aLayers[], int& aCount ) const override;
569 
570  wxPoint GetPosition() const override { return m_pos; }
571  void SetPosition( const wxPoint& aPosition ) override;
572 
573  bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
574  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
575 
576  void Plot( PLOTTER* aPlotter ) override;
577 
578  EDA_ITEM* Clone() const override;
579 
580 #if defined(DEBUG)
581  void Show( int nestLevel, std::ostream& os ) const override;
582 #endif
583 
584  static const wxString GetDefaultFieldName( int aFieldNdx );
585 
586 protected:
594  void renumberPins();
595 
596 private:
597  bool doIsConnected( const wxPoint& aPosition ) const override;
598 };
599 
600 
601 //typedef std::vector< SCH_SHEET* > SCH_SHEETS; // no ownership over contained SCH_SHEETs
602 
603 #endif // SCH_SHEEET_H
EDA_UNITS
Definition: common.h:198
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:253
LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived to re...
Definition: richio.h:81
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:55
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:546
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:174
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:635
SCH_SHEET_PIN * GetPin(const wxPoint &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:483
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:168
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
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:275
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition: sch_sheet.h:70
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:364
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:838
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData) override
Function Matches compares the item against the search criteria in aSearchData.
Definition: sch_sheet.cpp:817
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:151
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Definition: sch_sheet.cpp:191
wxSize m_size
Definition: sch_sheet.h:230
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_sheet.h:108
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition: sch_sheet.cpp:322
bool IsConnectable() const override
Definition: sch_sheet.h:199
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:121
KIGFX::COLOR4D GetBorderColor() const
Definition: sch_sheet.h:290
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:246
Schematic editor (Eeschema) main window.
bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_sheet.h:195
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:907
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_sheet.cpp:1047
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:282
wxPoint m_pos
Definition: sch_sheet.h:229
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:190
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected items in a...
KIGFX::COLOR4D GetBackgroundColor() const
Definition: sch_sheet.h:293
void SetBorderWidth(int aWidth)
Definition: sch_sheet.h:288
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:268
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:105
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
Definition: sch_sheet.cpp:174
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:826
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:711
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_sheet.h:252
void RemovePin(SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:290
int GetBorderWidth() const
Definition: sch_sheet.h:287
void SetFileName(wxString aFilename)
Definition: sch_sheet.h:502
void SetBackgroundColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:294
bool IsConnectable() const override
Definition: sch_sheet.h:544
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_sheet.cpp:595
wxString GetName() const
Definition: sch_sheet.h:280
#define NULL
SCH_SHEET(EDA_ITEM *aParent=nullptr, const wxPoint &pos=wxPoint(0, 0))
Definition: sch_sheet.cpp:72
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
Definition: sch_sheet.cpp:772
bool IsReplaceable() const override
Function IsReplaceable.
Definition: sch_sheet.h:528
bool HasPins()
Definition: sch_sheet.h:402
int m_borderWidth
Definition: sch_sheet.h:232
int GetPenWidth() const override
Definition: sch_sheet.cpp:495
bool IsRootSheet() const
Definition: sch_sheet.cpp:183
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:266
std::vector< SCH_SHEET_PIN * > m_pins
Definition: sch_sheet.h:224
int GetMinHeight() const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
Definition: sch_sheet.cpp:418
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:869
void SetBorderColor(KIGFX::COLOR4D aColor)
Definition: sch_sheet.h:291
const EDA_RECT GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
Definition: sch_sheet.cpp:574
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.h:176
static const wxString GetDefaultFieldName(int aFieldNdx)
Definition: sch_sheet.cpp:45
SHEET_FIELD_TYPE
Definition: sch_sheet.h:65
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:84
SCH_SHEET_PATH.
int GetNumber() const
Get the sheet label number.
Definition: sch_sheet.h:143
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:496
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:457
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_sheet.h:570
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_sheet.cpp:730
int ComponentCount() const
Count our own components, without the power components.
Definition: sch_sheet.cpp:613
int GetPenWidth() const override
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:216
void SetSize(const wxSize &aSize)
Definition: sch_sheet.h:285
FIELDS_AUTOPLACED
Definition: sch_item.h:56
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
std::vector< SCH_SHEET_PIN * > & GetPins()
Definition: sch_sheet.h:362
std::vector< SCH_FIELD > m_fields
Definition: sch_sheet.h:226
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
Definition: sch_sheet.cpp:697
void GetConnectionPoints(std::vector< wxPoint > &aPoints) const override
Add all the connection points for this item to aPoints.
Definition: sch_sheet.cpp:862
bool HasUndefinedPins()
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:355
int GetMinWidth() const
Return the minimum width of the sheet based on the widths of the sheet pin text.
Definition: sch_sheet.cpp:378
void SetPosition(const wxPoint &aPosition) override
Set the schematic item position to aPosition.
Definition: sch_sheet.h:205
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:671
Base plotter engine class.
Definition: plotter.h:114
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_sheet.cpp:252
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_sheet.cpp:145
void SetNumber(int aNumber)
Set the sheet label number.
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
Definition: sch_sheet.cpp:965
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:87
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:850
void Print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
Definition: sch_sheet.cpp:556
bool CanConnect(const SCH_ITEM *aItem) const override
Definition: sch_sheet.h:546
bool Replace(wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:178
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:334
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
Definition: sch_sheet.cpp:782
void SetPosition(const wxPoint &aPosition) override
Set the schematic item position to aPosition.
Definition: sch_sheet.cpp:792
KIGFX::COLOR4D m_backgroundColor
Definition: sch_sheet.h:234
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:185
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:247
SCH_SCREEN * m_screen
Definition: sch_sheet.h:221
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
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:913
bool HasPin(const wxString &aName)
Checks if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:310
wxPoint GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
Definition: sch_sheet.cpp:606
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:204
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:501
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_sheet.h:103
SEARCH_RESULT
Definition: base_struct.h:51
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:457
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:187
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_sheet.h:511
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:127
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:284
SHEET_SIDE m_edge
Definition: sch_sheet.h:92
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
Definition: sch_sheet.cpp:1018
FIELDS_AUTOPLACED m_fieldsAutoplaced
Definition: sch_sheet.h:227
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
void Resize(const wxSize &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
Definition: sch_sheet.cpp:800
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99
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:919
void GetNetListItem(NETLIST_OBJECT_LIST &aNetListItems, SCH_SHEET_PATH *aSheetPath) override
Create a new NETLIST_OBJECT for the schematic object and adds it to aNetListItems.
Definition: sch_sheet.cpp:942