KiCad PCB EDA Suite
sch_sheet.cpp
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) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2017 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 
30 #include <fctsys.h>
31 #include <sch_draw_panel.h>
32 #include <draw_graphic_text.h>
33 #include <trigo.h>
34 #include <richio.h>
35 #include <sch_edit_frame.h>
36 #include <plotter.h>
37 #include <kicad_string.h>
38 #include <msgpanel.h>
39 
40 #include <sch_sheet.h>
41 #include <sch_sheet_path.h>
42 #include <sch_component.h>
43 #include <netlist_object.h>
44 #include <trace_helpers.h>
45 
46 
47 SCH_SHEET::SCH_SHEET( const wxPoint& pos ) :
48  SCH_ITEM( NULL, SCH_SHEET_T )
49 {
51  m_pos = pos;
56  m_screen = NULL;
57  m_name.Printf( wxT( "Sheet%8.8lX" ), (long) m_TimeStamp );
58  m_fileName.Printf( wxT( "file%8.8lX.sch" ), (long) m_TimeStamp );
59 }
60 
61 
62 SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) :
63  SCH_ITEM( aSheet )
64 {
65  m_pos = aSheet.m_pos;
66  m_size = aSheet.m_size;
67  m_Layer = aSheet.m_Layer;
68  SetTimeStamp( aSheet.m_TimeStamp );
71  m_screen = aSheet.m_screen;
72  m_name = aSheet.m_name;
73  m_fileName = aSheet.m_fileName;
74  m_pins = aSheet.m_pins;
75 
76  for( size_t i = 0; i < m_pins.size(); i++ )
77  m_pins[i].SetParent( this );
78 
79  if( m_screen )
81 }
82 
83 
85 {
86  // also, look at the associated sheet & its reference count
87  // perhaps it should be deleted also.
88  if( m_screen )
89  {
91 
92  if( m_screen->GetRefCount() == 0 )
93  delete m_screen;
94  }
95 }
96 
97 
99 {
100  return new SCH_SHEET( *this );
101 }
102 
103 
105 {
106  if( aScreen == m_screen )
107  return;
108 
109  if( m_screen != NULL )
110  {
112 
113  if( m_screen->GetRefCount() == 0 )
114  {
115  delete m_screen;
116  m_screen = NULL;
117  }
118  }
119 
120  m_screen = aScreen;
121 
122  if( m_screen )
124 }
125 
126 
128 {
129  if( m_screen == NULL )
130  return 0;
131 
132  return m_screen->GetRefCount();
133 }
134 
135 
137 {
138  SCH_SHEET* sheet = dynamic_cast< SCH_SHEET* >( GetParent() );
139 
140  if( sheet == NULL )
141  return this;
142 
143  // Recurse until a sheet is found with no parent which is the root sheet.
144  return sheet->GetRootSheet();
145 }
146 
147 
149 {
150  wxCHECK_RET( aItem->Type() == SCH_SHEET_T,
151  wxString::Format( wxT( "SCH_SHEET object cannot swap data with %s object." ),
152  GetChars( aItem->GetClass() ) ) );
153 
154  SCH_SHEET* sheet = ( SCH_SHEET* ) aItem;
155 
156  std::swap( m_pos, sheet->m_pos );
157  std::swap( m_size, sheet->m_size );
158  std::swap( m_name, sheet->m_name );
159  std::swap( m_sheetNameSize, sheet->m_sheetNameSize );
160  std::swap( m_fileNameSize, sheet->m_fileNameSize );
161  m_pins.swap( sheet->m_pins );
162 
163  // Ensure sheet labels have their .m_Parent member pointing really on their
164  // parent, after swapping.
165  for( SCH_SHEET_PIN& sheetPin : m_pins )
166  {
167  sheetPin.SetParent( this );
168  }
169 
170  for( SCH_SHEET_PIN& sheetPin : sheet->m_pins )
171  {
172  sheetPin.SetParent( sheet );
173  }
174 }
175 
176 
178 {
179  wxASSERT( aSheetPin != NULL );
180  wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
181 
182  m_pins.push_back( aSheetPin );
183  renumberPins();
184 }
185 
186 
188 {
189  wxASSERT( aSheetPin != NULL );
190  wxASSERT( aSheetPin->Type() == SCH_SHEET_PIN_T );
191 
192  SCH_SHEET_PINS::iterator i;
193 
194  for( i = m_pins.begin(); i < m_pins.end(); ++i )
195  {
196  if( *i == aSheetPin )
197  {
198  m_pins.erase( i );
199  renumberPins();
200  return;
201  }
202  }
203 
204  wxLogDebug( wxT( "Fix me: attempt to remove label %s which is not in sheet %s." ),
205  GetChars( aSheetPin->GetShownText() ), GetChars( m_name ) );
206 }
207 
208 
209 bool SCH_SHEET::HasPin( const wxString& aName )
210 {
211  for( const SCH_SHEET_PIN& pin : m_pins )
212  {
213  if( pin.GetText().CmpNoCase( aName ) == 0 )
214  return true;
215  }
216 
217  return false;
218 }
219 
220 
222 {
223  for( const SCH_SHEET_PIN& pin : m_pins )
224  {
225  if( pin.GetEdge() > 1 )
226  return true;
227  }
228  return false;
229 }
230 
231 
233 {
234  for( const SCH_SHEET_PIN& pin : m_pins )
235  {
236  /* Search the schematic for a hierarchical label corresponding to this sheet label. */
237  EDA_ITEM* DrawStruct = m_screen->GetDrawItems();
238  const SCH_HIERLABEL* HLabel = NULL;
239 
240  for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
241  {
242  if( DrawStruct->Type() != SCH_HIERARCHICAL_LABEL_T )
243  continue;
244 
245  HLabel = static_cast<SCH_HIERLABEL*>( DrawStruct );
246 
247  if( pin.GetText().CmpNoCase( HLabel->GetText() ) == 0 )
248  break; // Found!
249 
250  HLabel = NULL;
251  }
252 
253  if( HLabel == NULL ) // Corresponding hierarchical label not found.
254  return true;
255  }
256 
257  return false;
258 }
259 
260 
262 {
263  int width = MIN_SHEET_WIDTH;
264 
265  for( size_t i = 0; i < m_pins.size(); i++ )
266  {
267  int edge = m_pins[i].GetEdge();
268  EDA_RECT pinRect = m_pins[i].GetBoundingBox();
269 
270  wxASSERT( edge != SCH_SHEET_PIN::SHEET_UNDEFINED_SIDE );
271 
273  {
274  if( width < pinRect.GetRight() - m_pos.x )
275  width = pinRect.GetRight() - m_pos.x;
276  }
277  else
278  {
279  if( width < pinRect.GetWidth() )
280  width = pinRect.GetWidth();
281 
282  for( size_t j = 0; j < m_pins.size(); j++ )
283  {
284  // Check for pin directly across from the current pin.
285  if( (i == j) || (m_pins[i].GetPosition().y != m_pins[j].GetPosition().y) )
286  continue;
287 
288  if( width < pinRect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth() )
289  {
290  width = pinRect.GetWidth() + m_pins[j].GetBoundingBox().GetWidth();
291  break;
292  }
293  }
294  }
295  }
296 
297  return width;
298 }
299 
300 
302 {
303  int height = MIN_SHEET_HEIGHT;
304 
305  for( size_t i = 0; i < m_pins.size(); i++ )
306  {
307  int edge = m_pins[i].GetEdge();
308  EDA_RECT pinRect = m_pins[i].GetBoundingBox();
309 
310  // Make sure pin is on top or bottom side of sheet.
312  {
313  if( height < pinRect.GetBottom() - m_pos.y )
314  height = pinRect.GetBottom() - m_pos.y;
315  }
316  else
317  {
318  if( height < pinRect.GetHeight() )
319  height = pinRect.GetHeight();
320 
321  for( size_t j = 0; j < m_pins.size(); j++ )
322  {
323  // Check for pin directly above or below the current pin.
324  if( (i == j) || (m_pins[i].GetPosition().x != m_pins[j].GetPosition().x) )
325  continue;
326 
327  if( height < pinRect.GetHeight() + m_pins[j].GetBoundingBox().GetHeight() )
328  {
329  height = pinRect.GetHeight() + m_pins[j].GetBoundingBox().GetHeight();
330  break;
331  }
332  }
333  }
334  }
335 
336  return height;
337 }
338 
339 
341 {
342  SCH_SHEET_PINS::iterator i = m_pins.begin();
343 
344  while( i != m_pins.end() )
345  {
346  /* Search the schematic for a hierarchical label corresponding to this sheet label. */
347  EDA_ITEM* DrawStruct = m_screen->GetDrawItems();
348  const SCH_HIERLABEL* HLabel = NULL;
349 
350  for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Next() )
351  {
352  if( DrawStruct->Type() != SCH_HIERARCHICAL_LABEL_T )
353  continue;
354 
355  HLabel = static_cast<SCH_HIERLABEL*>( DrawStruct );
356 
357  if( i->GetText().CmpNoCase( HLabel->GetText() ) == 0 )
358  break; // Found!
359 
360  HLabel = NULL;
361  }
362 
363  if( HLabel == NULL ) // Hlabel not found: delete sheet label.
364  i = m_pins.erase( i );
365  else
366  ++i;
367  }
368 }
369 
370 
371 SCH_SHEET_PIN* SCH_SHEET::GetPin( const wxPoint& aPosition )
372 {
373  for( SCH_SHEET_PIN& pin : m_pins )
374  {
375  if( pin.HitTest( aPosition, 0 ) )
376  return &pin;
377  }
378 
379  return NULL;
380 }
381 
382 
384 {
385  return GetDefaultLineThickness();
386 }
387 
388 
390 {
391  wxPoint pos = m_pos;
392  int margin = KiROUND( GetPenSize() / 2.0 + 4 + m_sheetNameSize * 0.3 );
393 
394  if( IsVerticalOrientation() )
395  {
396  pos.x -= margin;
397  pos.y += m_size.y;
398  }
399  else
400  {
401  pos.y -= margin;
402  }
403 
404  return pos;
405 }
406 
407 
409 {
410  wxPoint pos = m_pos;
411  int margin = KiROUND( GetPenSize() / 2.0 + 4 + m_fileNameSize * 0.4 );
412 
413  if( IsVerticalOrientation() )
414  {
415  pos.x += m_size.x + margin;
416  pos.y += m_size.y;
417  }
418  else
419  {
420  pos.y += m_size.y + margin;
421  }
422 
423  return pos;
424 }
425 
426 
427 void SCH_SHEET::ViewGetLayers( int aLayers[], int& aCount ) const
428 {
429  aCount = 3;
430  aLayers[0] = LAYER_HIERLABEL;
431  aLayers[1] = LAYER_SHEET;
432  aLayers[2] = LAYER_SHEET_BACKGROUND;
433 }
434 
435 
436 void SCH_SHEET::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
437  const wxPoint& aOffset, GR_DRAWMODE aDrawMode, COLOR4D aColor )
438 {
439  COLOR4D txtcolor;
440  wxString Text;
441  COLOR4D color;
442  int name_orientation;
443  wxPoint pos_sheetname,pos_filename;
444  wxPoint pos = m_pos + aOffset;
445  int lineWidth = GetPenSize();
446  int textWidth;
447  wxSize textSize;
448  EDA_RECT* clipbox = aPanel? aPanel->GetClipBox() : NULL;
449 
450  if( aColor != COLOR4D::UNSPECIFIED )
451  color = aColor;
452  else
454 
455  GRSetDrawMode( aDC, aDrawMode );
456 
457  GRRect( clipbox, aDC, pos.x, pos.y,
458  pos.x + m_size.x, pos.y + m_size.y, lineWidth, color );
459 
460  pos_sheetname = GetSheetNamePosition() + aOffset;
461  pos_filename = GetFileNamePosition() + aOffset;
462 
463  if( IsVerticalOrientation() )
464  name_orientation = TEXT_ANGLE_VERT;
465  else
466  name_orientation = TEXT_ANGLE_HORIZ;
467 
468  /* Draw text : SheetName */
469  if( aColor != COLOR4D::UNSPECIFIED )
470  txtcolor = aColor;
471  else
472  txtcolor = GetLayerColor( LAYER_SHEETNAME );
473 
474  Text = wxT( "Sheet: " ) + m_name;
475  textSize = wxSize( m_sheetNameSize, m_sheetNameSize );
476  textWidth = Clamp_Text_PenSize( lineWidth, textSize, false );
477  DrawGraphicText( clipbox, aDC, pos_sheetname,
478  txtcolor, Text, name_orientation,
479  textSize,
481  false, false );
482 
483  /* Draw text : FileName */
484  if( aColor != COLOR4D::UNSPECIFIED )
485  txtcolor = aColor;
486  else
487  txtcolor = GetLayerColor( LAYER_SHEETFILENAME );
488 
489  Text = wxT( "File: " ) + m_fileName;
490  textSize = wxSize( m_fileNameSize, m_fileNameSize );
491  textWidth = Clamp_Text_PenSize( lineWidth, textSize, false );
492  DrawGraphicText( clipbox, aDC, pos_filename,
493  txtcolor, Text, name_orientation,
494  textSize,
496  false, false );
497 
498  /* Draw text : SheetLabel */
499  for( SCH_SHEET_PIN& sheetPin : m_pins )
500  {
501  if( !sheetPin.IsMoving() )
502  sheetPin.Draw( aPanel, aDC, aOffset, aDrawMode, aColor );
503  }
504 
505 
506 #if 0
507  // Only for testing purposes, draw the component bounding box
509  GRRect( aPanel->GetClipBox(), aDC, boundingBox, 0, BROWN );
510  GRFilledCircle( aPanel->GetClipBox(), aDC, m_pos.x, m_pos.y, 10, 0, color, color );
511 #endif
512 }
513 
514 
516 {
517  wxPoint end;
518  EDA_RECT box( m_pos, m_size );
519  int lineWidth = GetPenSize();
520 
521  // Determine length of texts
522  wxString text = wxT( "Sheet: " ) + m_name;
523  int textlen = GraphicTextWidth( text, wxSize( m_sheetNameSize, m_sheetNameSize ),
524  false, false );
525 
526  text = wxT( "File: " ) + m_fileName;
527  int textlen2 = GraphicTextWidth( text, wxSize( m_fileNameSize, m_fileNameSize ),
528  false, false );
529 
530  // Calculate bounding box X size:
531  textlen = std::max( textlen, textlen2 );
532  end.x = std::max( m_size.x, textlen );
533 
534  // Calculate bounding box pos:
535  end.y = m_size.y;
536  end += m_pos;
537 
538  // Move upper and lower limits to include texts:
539  box.SetY( box.GetY() - ( KiROUND( m_sheetNameSize * 1.3 ) + 8 ) );
540  end.y += KiROUND( m_fileNameSize * 1.3 ) + 8;
541 
542  box.SetEnd( end );
543  box.Inflate( lineWidth / 2 );
544 
545  return box;
546 }
547 
548 
550 {
551  int n = 0;
552 
553  if( m_screen )
554  {
555  EDA_ITEM* bs;
556 
557  for( bs = m_screen->GetDrawItems(); bs != NULL; bs = bs->Next() )
558  {
559  if( bs->Type() == SCH_COMPONENT_T )
560  {
561  SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
562 
563  if( Cmp->GetField( VALUE )->GetText().GetChar( 0 ) != '#' )
564  n++;
565  }
566 
567  if( bs->Type() == SCH_SHEET_T )
568  {
569  SCH_SHEET* sheet = (SCH_SHEET*) bs;
570  n += sheet->ComponentCount();
571  }
572  }
573  }
574 
575  return n;
576 }
577 
578 
579 bool SCH_SHEET::SearchHierarchy( const wxString& aFilename, SCH_SCREEN** aScreen )
580 {
581  if( m_screen )
582  {
583  EDA_ITEM* item = m_screen->GetDrawItems();
584 
585  while( item )
586  {
587  if( item->Type() == SCH_SHEET_T )
588  {
589  SCH_SHEET* sheet = (SCH_SHEET*) item;
590 
591  if( sheet->m_screen
592  && sheet->m_screen->GetFileName().CmpNoCase( aFilename ) == 0 )
593  {
594  *aScreen = sheet->m_screen;
595  return true;
596  }
597 
598  if( sheet->SearchHierarchy( aFilename, aScreen ) )
599  return true;
600  }
601 
602  item = item->Next();
603  }
604  }
605 
606  return false;
607 }
608 
609 
611 {
612  if( m_screen )
613  {
614  aList->push_back( this );
615 
616  if( m_screen == aScreen )
617  return true;
618 
619  EDA_ITEM* strct = m_screen->GetDrawItems();
620 
621  while( strct )
622  {
623  if( strct->Type() == SCH_SHEET_T )
624  {
625  SCH_SHEET* ss = (SCH_SHEET*) strct;
626 
627  if( ss->LocatePathOfScreen( aScreen, aList ) )
628  return true;
629  }
630 
631  strct = strct->Next();
632  }
633 
634  aList->pop_back();
635  }
636 
637  return false;
638 }
639 
640 
642 {
643  int count = 1; //1 = this!!
644 
645  if( m_screen )
646  {
647  EDA_ITEM* strct = m_screen->GetDrawItems();
648 
649  for( ; strct; strct = strct->Next() )
650  {
651  if( strct->Type() == SCH_SHEET_T )
652  {
653  SCH_SHEET* subsheet = (SCH_SHEET*) strct;
654  count += subsheet->CountSheets();
655  }
656  }
657  }
658  return count;
659 }
660 
661 
662 wxString SCH_SHEET::GetFileName( void ) const
663 {
664  return m_fileName;
665 }
666 
667 
669 {
670  aList.push_back( MSG_PANEL_ITEM( _( "Sheet Name" ), m_name, CYAN ) );
671  aList.push_back( MSG_PANEL_ITEM( _( "File Name" ), m_fileName, BROWN ) );
672 
673 #if 0 // Set to 1 to display the sheet time stamp (mainly for test)
674  wxString msg;
675  msg.Printf( wxT( "%.8X" ), m_TimeStamp );
676  aList.push_back( MSG_PANEL_ITEM( _( "Time Stamp" ), msg, BLUE ) );
677 #endif
678 }
679 
680 
681 void SCH_SHEET::Rotate(wxPoint aPosition)
682 {
683  RotatePoint( &m_pos, aPosition, 900 );
684  RotatePoint( &m_size.x, &m_size.y, 900 );
685 
686  if( m_size.x < 0 )
687  {
688  m_pos.x += m_size.x;
689  m_size.x = -m_size.x;
690  }
691 
692  if( m_size.y < 0 )
693  {
694  m_pos.y += m_size.y;
695  m_size.y = -m_size.y;
696  }
697 
698  for( SCH_SHEET_PIN& sheetPin : m_pins )
699  {
700  sheetPin.Rotate( aPosition );
701  }
702 }
703 
704 
705 void SCH_SHEET::MirrorX( int aXaxis_position )
706 {
707  MIRROR( m_pos.y, aXaxis_position );
708  m_pos.y -= m_size.y;
709 
710  for( SCH_SHEET_PIN& sheetPin : m_pins )
711  {
712  sheetPin.MirrorX( aXaxis_position );
713  }
714 }
715 
716 
717 void SCH_SHEET::MirrorY( int aYaxis_position )
718 {
719  MIRROR( m_pos.x, aYaxis_position );
720  m_pos.x -= m_size.x;
721 
722  for( SCH_SHEET_PIN& label : m_pins )
723  {
724  label.MirrorY( aYaxis_position );
725  }
726 }
727 
728 void SCH_SHEET::SetPosition( const wxPoint& aPosition )
729 {
730  // Remember the sheet and all pin sheet positions must be
731  // modified. So use Move function to do that.
732  Move( aPosition - m_pos );
733 }
734 
735 
736 
737 void SCH_SHEET::Resize( const wxSize& aSize )
738 {
739  if( aSize == m_size )
740  return;
741 
742  m_size = aSize;
743 
744  /* Move the sheet labels according to the new sheet size. */
745  for( SCH_SHEET_PIN& label : m_pins )
746  {
747  label.ConstrainOnEdge( label.GetPosition() );
748  }
749 }
750 
751 
752 bool SCH_SHEET::Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation )
753 {
754  wxLogTrace( traceFindItem, wxT( " item " ) + GetSelectMenuText( MILLIMETRES ) );
755 
756  // Ignore the sheet file name if searching to replace.
757  if( !(aSearchData.GetFlags() & FR_SEARCH_REPLACE)
758  && SCH_ITEM::Matches( m_fileName, aSearchData ) )
759  {
760  if( aFindLocation )
761  *aFindLocation = GetFileNamePosition();
762 
763  return true;
764  }
765 
766  if( SCH_ITEM::Matches( m_name, aSearchData ) )
767  {
768  if( aFindLocation )
769  *aFindLocation = GetSheetNamePosition();
770 
771  return true;
772  }
773 
774  return false;
775 }
776 
777 
778 bool SCH_SHEET::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
779 {
780  return EDA_ITEM::Replace( aSearchData, m_name );
781 }
782 
783 
785 {
786  int id = 2;
787 
788  for( SCH_SHEET_PIN& pin : m_pins )
789  {
790  pin.SetNumber( id );
791  id++;
792  }
793 }
794 
795 
796 void SCH_SHEET::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
797 {
798  for( unsigned ii = 0; ii < GetPins().size(); ii++ )
799  {
800  SCH_SHEET_PIN &pinsheet = GetPins()[ii];
801 
802  wxCHECK2_MSG( pinsheet.Type() == SCH_SHEET_PIN_T, continue,
803  wxT( "Invalid item in schematic sheet pin list. Bad programmer!" ) );
804 
805  pinsheet.GetEndPoints( aItemList );
806  }
807 }
808 
809 
810 bool SCH_SHEET::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList )
811 {
812  bool changed = false;
813 
814  for( SCH_SHEET_PIN& pinsheet : GetPins() )
815  changed |= pinsheet.UpdateDanglingState( aItemList );
816 
817  return changed;
818 }
819 
820 
821 bool SCH_SHEET::IsSelectStateChanged( const wxRect& aRect )
822 {
823  bool previousState = IsSelected();
824 
826 
827  if( aRect.Intersects( boundingBox ) )
828  SetFlags( SELECTED );
829  else
830  ClearFlags( SELECTED );
831 
832  return previousState != IsSelected();
833 }
834 
835 
836 void SCH_SHEET::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const
837 {
838  for( size_t i = 0; i < GetPins().size(); i++ )
839  aPoints.push_back( GetPins()[i].GetPosition() );
840 }
841 
842 
843 SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICAD_T aFilterTypes[] )
844 {
845  KICAD_T stype;
846 
847  for( const KICAD_T* p = aFilterTypes; (stype = *p) != EOT; ++p )
848  {
849  // If caller wants to inspect my type
850  if( stype == Type() )
851  {
852  if( SEARCH_QUIT == aInspector( this, NULL ) )
853  return SEARCH_QUIT;
854  }
855  else if( stype == SCH_SHEET_PIN_T )
856  {
857  // Test the sheet labels.
858  for( size_t i = 0; i < m_pins.size(); i++ )
859  {
860  if( SEARCH_QUIT == aInspector( &m_pins[ i ], this ) )
861  return SEARCH_QUIT;
862  }
863  }
864  }
865 
866  return SEARCH_CONTINUE;
867 }
868 
869 
871 {
872  return wxString::Format( _( "Hierarchical Sheet %s" ), m_name );
873 }
874 
875 
876 BITMAP_DEF SCH_SHEET::GetMenuImage() const
877 {
878  return add_hierarchical_subsheet_xpm;
879 }
880 
881 
882 bool SCH_SHEET::HitTest( const wxPoint& aPosition, int aAccuracy ) const
883 {
884  EDA_RECT rect = GetBoundingBox();
885 
886  rect.Inflate( aAccuracy );
887 
888  return rect.Contains( aPosition );
889 }
890 
891 
892 bool SCH_SHEET::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
893 {
894  EDA_RECT rect = aRect;
895 
896  rect.Inflate( aAccuracy );
897 
898  if( aContained )
899  return rect.Contains( GetBoundingBox() );
900 
901  return rect.Intersects( GetBoundingBox() );
902 }
903 
904 
906 {
907  return wxPoint( m_pos.x + m_size.GetWidth(), m_pos.y + m_size.GetHeight() );
908 }
909 
910 
912  SCH_SHEET_PATH* aSheetPath )
913 {
914  SCH_SHEET_PATH sheetPath = *aSheetPath;
915  sheetPath.push_back( this );
916 
917  for( size_t i = 0; i < m_pins.size(); i++ )
918  {
919  NETLIST_OBJECT* item = new NETLIST_OBJECT();
920  item->m_SheetPathInclude = sheetPath;
921  item->m_SheetPath = *aSheetPath;
922  item->m_Comp = &m_pins[i];
923  item->m_Link = this;
924  item->m_Type = NET_SHEETLABEL;
925  item->m_Label = m_pins[i].GetText();
926  item->m_Start = item->m_End = m_pins[i].GetPosition();
927  aNetListItems.push_back( item );
928 
929  if( IsBusLabel( m_pins[i].GetText() ) )
930  item->ConvertBusToNetListItems( aNetListItems );
931  }
932 }
933 
934 
935 void SCH_SHEET::Plot( PLOTTER* aPlotter )
936 {
937  COLOR4D txtcolor = COLOR4D::UNSPECIFIED;
938  wxSize size;
939  wxString Text;
940  int name_orientation;
941  wxPoint pos_sheetname, pos_filename;
942  wxPoint pos;
943 
944  aPlotter->SetColor( GetLayerColor( GetLayer() ) );
945 
946  int thickness = GetPenSize();
947  aPlotter->SetCurrentLineWidth( thickness );
948 
949  aPlotter->MoveTo( m_pos );
950  pos = m_pos;
951  pos.x += m_size.x;
952 
953  aPlotter->LineTo( pos );
954  pos.y += m_size.y;
955 
956  aPlotter->LineTo( pos );
957  pos = m_pos;
958  pos.y += m_size.y;
959 
960  aPlotter->LineTo( pos );
961  aPlotter->FinishTo( m_pos );
962 
963  if( IsVerticalOrientation() )
964  {
965  pos_sheetname = wxPoint( m_pos.x - 8, m_pos.y + m_size.y );
966  pos_filename = wxPoint( m_pos.x + m_size.x + 4, m_pos.y + m_size.y );
967  name_orientation = TEXT_ANGLE_VERT;
968  }
969  else
970  {
971  pos_sheetname = wxPoint( m_pos.x, m_pos.y - 4 );
972  pos_filename = wxPoint( m_pos.x, m_pos.y + m_size.y + 4 );
973  name_orientation = TEXT_ANGLE_HORIZ;
974  }
975 
976  /* Draw texts: SheetName */
977  Text = m_name;
978  size = wxSize( m_sheetNameSize, m_sheetNameSize );
979 
980  //pos = m_pos; pos.y -= 4;
981  thickness = GetDefaultLineThickness();
982  thickness = Clamp_Text_PenSize( thickness, size, false );
983 
984  aPlotter->SetColor( GetLayerColor( LAYER_SHEETNAME ) );
985 
986  bool italic = false;
987  aPlotter->Text( pos_sheetname, txtcolor, Text, name_orientation, size,
989  thickness, italic, false );
990 
991  /*Draw texts : FileName */
992  Text = GetFileName();
993  size = wxSize( m_fileNameSize, m_fileNameSize );
994  thickness = GetDefaultLineThickness();
995  thickness = Clamp_Text_PenSize( thickness, size, false );
996 
998 
999  aPlotter->Text( pos_filename, txtcolor, Text, name_orientation, size,
1001  thickness, italic, false );
1002 
1003  aPlotter->SetColor( GetLayerColor( GetLayer() ) );
1004 
1005  /* Draw texts : SheetLabel */
1006  for( size_t i = 0; i < m_pins.size(); i++ )
1007  {
1008  m_pins[i].Plot( aPlotter );
1009  }
1010 }
1011 
1012 
1014 {
1015  wxLogDebug( wxT( "Sheet assignment operator." ) );
1016 
1017  wxCHECK_MSG( Type() == aItem.Type(), *this,
1018  wxT( "Cannot assign object type " ) + aItem.GetClass() + wxT( " to type " ) +
1019  GetClass() );
1020 
1021  if( &aItem != this )
1022  {
1023  SCH_ITEM::operator=( aItem );
1024 
1025  SCH_SHEET* sheet = (SCH_SHEET*) &aItem;
1026 
1027  m_pos = sheet->m_pos;
1028  m_size = sheet->m_size;
1029  m_name = sheet->m_name;
1031  m_fileNameSize = sheet->m_fileNameSize;
1032  m_pins = sheet->m_pins;
1033 
1034  // Ensure sheet labels have their #m_Parent member pointing really on their
1035  // parent, after assigning.
1036  for( SCH_SHEET_PIN& sheetPin : m_pins )
1037  {
1038  sheetPin.SetParent( this );
1039  }
1040  }
1041 
1042  return *this;
1043 }
1044 
1045 
1046 #if defined(DEBUG)
1047 
1048 void SCH_SHEET::Show( int nestLevel, std::ostream& os ) const
1049 {
1050  // XML output:
1051  wxString s = GetClass();
1052 
1053  NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << ">" << " sheet_name=\""
1054  << TO_UTF8( m_name ) << '"' << ">\n";
1055 
1056  // show all the pins, and check the linked list integrity
1057  for( const SCH_SHEET_PIN& label : m_pins )
1058  {
1059  label.Show( nestLevel + 1, os );
1060  }
1061 
1062  NestedSpace( nestLevel, os ) << "</" << s.Lower().mb_str() << ">\n" << std::flush;
1063 }
1064 
1065 #endif
Definition: colors.h:57
#define TEXT_ANGLE_HORIZ
void FinishTo(const wxPoint &pos)
Definition: plotter.h:251
Definition of the SCH_SHEET class for Eeschema.
SCH_LAYER_ID m_Layer
SCH_ITEM & operator=(const SCH_ITEM &aSheet)
Definition: sch_sheet.cpp:1013
const wxString & GetFileName() const
Definition: sch_screen.h:131
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers returns the layers the item is drawn on (which may be more than its "home" lay...
Definition: sch_sheet.cpp:427
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize As a rule, pen width should not be >1/4em, otherwise the character will b...
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
Definition: sch_sheet.cpp:579
SCH_SHEET_PIN * GetPin(const wxPoint &aPosition)
Return the sheet pin item found at aPosition in the sheet.
Definition: sch_sheet.cpp:371
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
SCH_SHEET_PINS & GetPins()
Definition: sch_sheet.h:334
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:121
bool IsSelected() const
Definition: base_struct.h:224
#define TEXT_ANGLE_VERT
SCH_SHEET_PATH m_SheetPathInclude
bool Replace(wxFindReplaceData &aSearchData, wxString &aText)
Helper function used in search and replace dialog Function Replace performs a text replace on aText u...
virtual void SetColor(COLOR4D color)=0
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Function GetEndPoints adds the schematic item end points to aItemList if the item has end points.
Definition: sch_sheet.cpp:796
int CountSheets()
Count the number of sheets found in "this" sheet includeing all of the subsheets.
Definition: sch_sheet.cpp:641
virtual bool Matches(wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
Function Matches compares the item against the search criteria in aSearchData.
Definition: base_struct.h:420
int color
Definition: DXF_plotter.cpp:62
int m_sheetNameSize
The height of the text used to draw the sheet name.
Definition: sch_sheet.h:229
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Definition: sch_sheet.cpp:104
int GetWidth() const
Definition: eda_rect.h:117
wxSize m_size
The size of the sheet.
Definition: sch_sheet.h:238
wxString m_name
This is equivalent to the reference designator for components and is stored in F0 sheet pin in the sc...
Definition: sch_sheet.h:226
SCH_SHEET * GetRootSheet()
Return the root sheet of this SCH_SHEET object.
Definition: sch_sheet.cpp:136
int ComponentCount()
Count our own components, without the power components.
Definition: sch_sheet.cpp:549
SCH_SHEET_PATH m_SheetPath
virtual EDA_RECT * GetClipBox()
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
bool Matches(wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation) override
Function Matches compares the item against the search criteria in aSearchData.
Definition: sch_sheet.cpp:752
NETLIST_ITEM_T m_Type
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Definition: eeschema.cpp:174
int GetPenSize() const override
Function GetPenSize virtual pure.
Definition: sch_sheet.cpp:383
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:778
wxPoint m_pos
The position of the sheet.
Definition: sch_sheet.h:235
EDA_ITEM * m_Comp
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
Definition: sch_sheet.cpp:177
bool Contains(const wxPoint &aPoint) const
Function Contains.
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
#define MIN_SHEET_WIDTH
Definition: sch_sheet.h:47
void DrawGraphicText(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
int GetBottom() const
Definition: eda_rect.h:122
wxString m_fileName
The file name is also in the SCH_SCREEN object associated with the sheet.
Definition: sch_sheet.h:222
Class NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected item...
EDA_ITEM * Next() const
Definition: base_struct.h:209
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
const INSPECTOR_FUNC & INSPECTOR
Definition: base_struct.h:102
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
Definition: sch_sheet.cpp:127
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:47
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:114
#define SELECTED
Definition: base_struct.h:121
void LineTo(const wxPoint &pos)
Definition: plotter.h:246
void renumberPins()
Renumber the sheet pins in the sheet.
Definition: sch_sheet.cpp:784
timestamp_t GetNewTimeStamp()
Definition: common.cpp:216
#define VALUE
wxString GetClass() const override
Function GetClass returns the class name.
Definition: sch_sheet.h:251
void RemovePin(SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
Definition: sch_sheet.cpp:187
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1003
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:256
EDA_RECT const GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: sch_sheet.cpp:515
void MirrorX(int aXaxis_position) override
Function MirrorX mirrors item relative to the X axis about aXaxis_position.
Definition: sch_sheet.cpp:705
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:216
SCH_SHEET_PINS m_pins
The list of sheet connection points.
Definition: sch_sheet.h:218
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
void SetEnd(int x, int y)
Definition: eda_rect.h:134
int GetRight() const
Definition: eda_rect.h:119
Definition: colors.h:59
int GetMinHeight() const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
Definition: sch_sheet.cpp:301
wxPoint GetResizePosition() const
Return the position of the lower right corner of the sheet in drawing units.
Definition: sch_sheet.cpp:905
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:843
int GraphicTextWidth(const wxString &aText, const wxSize &aSize, bool aItalic, bool aBold)
Function GraphicTextWidth.
EDA_ITEM * GetParent() const
Definition: base_struct.h:211
wxLogTrace helper definitions.
void GetMsgPanelInfo(EDA_UNITS_T aUnits, 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:668
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:61
Class SCH_SHEET_PATH.
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
Definition: sch_sheet.cpp:340
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_sheet.h:547
void Rotate(wxPoint aPosition) override
Function Rotate rotates the item around aPosition 90 degrees in the clockwise direction.
Definition: sch_sheet.cpp:681
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Operator assignment is used to assign the members of aItem to another object.
int GetHeight() const
Definition: eda_rect.h:118
void SetY(int val)
Definition: eda_rect.h:131
bool IsBusLabel(const wxString &aLabel)
Function IsBusLabel test if aLabel has a bus notation.
wxPoint GetFileNamePosition()
Definition: sch_sheet.cpp:408
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:662
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
void MoveTo(const wxPoint &pos)
Definition: plotter.h:241
SCH_SHEET(const wxPoint &pos=wxPoint(0, 0))
Definition: sch_sheet.cpp:47
void GetConnectionPoints(std::vector< wxPoint > &aPoints) const override
Function GetConnectionPoints add all the connection points for this item to aPoints.
Definition: sch_sheet.cpp:836
bool HasUndefinedPins()
Check all sheet labels against schematic for undefined hierarchical labels.
Definition: sch_sheet.cpp:232
int GetMinWidth() const
Return the minimum width of the sheet based on the widths of the sheet pin text.
Definition: sch_sheet.cpp:261
void DecRefCount()
Definition: sch_screen.cpp:139
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:610
Base plotter engine class.
Definition: plotter.h:97
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, GR_DRAWMODE aDrawMode, COLOR4D aColor=COLOR4D::UNSPECIFIED) override
Function Draw Draw a schematic item.
Definition: sch_sheet.cpp:436
Definition the SCH_COMPONENT class for Eeschema.
int m_fileNameSize
The height of the text used to draw the file name.
Definition: sch_sheet.h:232
void SwapData(SCH_ITEM *aItem) override
Function SwapData swap the internal data structures aItem with the schematic item.
Definition: sch_sheet.cpp:148
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: sch_sheet.cpp:98
void Plot(PLOTTER *aPlotter) override
Function Plot plots the schematic item to aPlotter.
Definition: sch_sheet.cpp:935
const wxChar *const traceFindItem
Flag to enable find debug tracing.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Function GetEndPoints adds the schematic item end points to aItemList if the item has end points.
#define max(a, b)
Definition: auxiliary.h:86
bool IsVerticalOrientation() const
Definition: sch_sheet.cpp:221
void MirrorY(int aYaxis_position) override
Function MirrorY mirrors item relative to the Y axis about aYaxis_position.
Definition: sch_sheet.cpp:717
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
Definition: sch_sheet.cpp:728
wxPoint GetSheetNamePosition()
Definition: sch_sheet.cpp:389
size_t i
Definition: json11.cpp:597
Perform a search for a item that has replaceable text.
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
SCH_SCREEN * m_screen
Screen that contains the physical data for the sheet.
Definition: sch_sheet.h:215
int GetY() const
Definition: eda_rect.h:110
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
#define MIN_SHEET_HEIGHT
Definition: sch_sheet.h:48
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
virtual wxString GetClass() const override
Function GetClass returns the class name.
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: sch_sheet.cpp:876
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
bool HasPin(const wxString &aName)
Checks if the sheet already has a sheet pin named aName.
Definition: sch_sheet.cpp:209
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: sch_sheet.cpp:870
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:148
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
SEARCH_RESULT
Definition: base_struct.h:66
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
Definition of the NETLIST_OBJECT class.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList) override
Function IsDanglingStateChanged tests the schematic item to aItemList to check if it's dangling state...
Definition: sch_sheet.cpp:810
Message panel definition file.
bool IsSelectStateChanged(const wxRect &aRect) override
Function IsSelectStateChanged checks if the selection state of an item inside aRect has changed.
Definition: sch_sheet.cpp:821
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.cpp:778
SCH_ITEM * m_Link
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
void Move(const wxPoint &aMoveVector) override
Function Move moves the item by aMoveVector to a new position.
Definition: sch_sheet.h:478
EDA_UNITS_T
Definition: common.h:160
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
void IncRefCount()
Definition: sch_screen.cpp:133
void ConvertBusToNetListItems(NETLIST_OBJECT_LIST &aNetListItems)
Function ConvertBusToNetListItems breaks the text of a bus label type net list object into as many me...
int GetDefaultTextSize()
Default size for text in general.
int GetRefCount() const
Definition: sch_screen.h:144
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:206
void Resize(const wxSize &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
Definition: sch_sheet.cpp:737
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
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:882
void GetNetListItem(NETLIST_OBJECT_LIST &aNetListItems, SCH_SHEET_PATH *aSheetPath) override
Function GetNetListItem creates a new NETLIST_OBJECT for the schematic object and adds it to aNetList...
Definition: sch_sheet.cpp:911
Definition: colors.h:62
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160