KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_field.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2004-2023 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/*
26 * Fields are texts attached to a symbol, some of which have a special meaning.
27 * Fields 0 and 1 are very important: reference and value.
28 * Field 2 is used as default footprint name.
29 * Field 3 is used to point to a datasheet (usually a URL).
30 * Fields 4+ are user fields. They can be renamed and can appear in reports.
31 */
32
33#include <wx/log.h>
34#include <wx/menu.h>
35#include <base_units.h>
36#include <common.h> // for ExpandTextVars
37#include <eda_item.h>
38#include <sch_edit_frame.h>
39#include <plotters/plotter.h>
40#include <bitmaps.h>
41#include <core/kicad_algo.h>
42#include <core/mirror.h>
43#include <kiway.h>
44#include <general.h>
45#include <symbol_library.h>
46#include <sch_symbol.h>
47#include <sch_field.h>
48#include <sch_label.h>
49#include <schematic.h>
51#include <string_utils.h>
52#include <trace_helpers.h>
53#include <trigo.h>
54#include <eeschema_id.h>
55#include <tool/tool_manager.h>
57#include <font/outline_font.h>
58#include "sim/sim_lib_mgr.h"
59
60SCH_FIELD::SCH_FIELD( const VECTOR2I& aPos, int aFieldId, SCH_ITEM* aParent,
61 const wxString& aName ) :
62 SCH_ITEM( aParent, SCH_FIELD_T ),
63 EDA_TEXT( schIUScale, wxEmptyString ),
64 m_id( 0 ),
65 m_showName( false ),
66 m_allowAutoPlace( true ),
67 m_renderCacheValid( false ),
68 m_lastResolvedColor( COLOR4D::UNSPECIFIED )
69{
70 SetName( aName );
71 SetTextPos( aPos );
72 SetId( aFieldId ); // will also set the layer
73 SetVisible( false );
74}
75
76
77SCH_FIELD::SCH_FIELD( SCH_ITEM* aParent, int aFieldId, const wxString& aName ) :
78 SCH_FIELD( VECTOR2I(), aFieldId, aParent, aName )
79{
80}
81
82
84 SCH_ITEM( aField ),
85 EDA_TEXT( aField )
86{
87 m_id = aField.m_id;
88 m_name = aField.m_name;
89 m_showName = aField.m_showName;
92
93 m_renderCache.clear();
94
95 for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aField.m_renderCache )
96 {
97 if( KIFONT::OUTLINE_GLYPH* outline = dynamic_cast<KIFONT::OUTLINE_GLYPH*>( glyph.get() ) )
98 m_renderCache.emplace_back( std::make_unique<KIFONT::OUTLINE_GLYPH>( *outline ) );
99 else if( KIFONT::STROKE_GLYPH* stroke = dynamic_cast<KIFONT::STROKE_GLYPH*>( glyph.get() ) )
100 m_renderCache.emplace_back( std::make_unique<KIFONT::STROKE_GLYPH>( *stroke ) );
101 }
102
105
107}
108
109
111{
112 EDA_TEXT::operator=( aField );
113
114 m_id = aField.m_id;
115 m_name = aField.m_name;
116 m_showName = aField.m_showName;
119
120 m_renderCache.clear();
121
122 for( const std::unique_ptr<KIFONT::GLYPH>& glyph : aField.m_renderCache )
123 {
124 if( KIFONT::OUTLINE_GLYPH* outline = dynamic_cast<KIFONT::OUTLINE_GLYPH*>( glyph.get() ) )
125 m_renderCache.emplace_back( std::make_unique<KIFONT::OUTLINE_GLYPH>( *outline ) );
126 else if( KIFONT::STROKE_GLYPH* stroke = dynamic_cast<KIFONT::STROKE_GLYPH*>( glyph.get() ) )
127 m_renderCache.emplace_back( std::make_unique<KIFONT::STROKE_GLYPH>( *stroke ) );
128 }
129
132
134
135 return *this;
136}
137
138
140{
141 return new SCH_FIELD( *this );
142}
143
144
145void SCH_FIELD::SetId( int aId )
146{
147 m_id = aId;
148
149 if( m_parent && m_parent->Type() == SCH_SHEET_T )
150 {
151 switch( m_id )
152 {
153 case SHEETNAME: SetLayer( LAYER_SHEETNAME ); break;
155 default: SetLayer( LAYER_SHEETFIELDS ); break;
156 }
157 }
158 else if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
159 {
160 switch( m_id )
161 {
163 case VALUE_FIELD: SetLayer( LAYER_VALUEPART ); break;
164 default: SetLayer( LAYER_FIELDS ); break;
165 }
166 }
167 else if( m_parent && m_parent->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
168 {
169 // We can't use defined IDs for labels because there can be multiple net class
170 // assignments.
171
172 if( GetCanonicalName() == wxT( "Netclass" ) )
174 else if( GetCanonicalName() == wxT( "Intersheetrefs" ) )
176 else
178 }
179}
180
181
183{
185}
186
187
188wxString SCH_FIELD::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraText,
189 int aDepth ) const
190{
191 std::function<bool( wxString* )> symbolResolver =
192 [&]( wxString* token ) -> bool
193 {
194 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( m_parent );
195 return symbol->ResolveTextVar( aPath, token, aDepth + 1 );
196 };
197
198 std::function<bool( wxString* )> sheetResolver =
199 [&]( wxString* token ) -> bool
200 {
201 SCH_SHEET* sheet = static_cast<SCH_SHEET*>( m_parent );
202
203 SCH_SHEET_PATH path = *aPath;
204 path.push_back( sheet );
205
206 return sheet->ResolveTextVar( &path, token, aDepth + 1 );
207 };
208
209 std::function<bool( wxString* )> labelResolver =
210 [&]( wxString* token ) -> bool
211 {
212 SCH_LABEL_BASE* label = static_cast<SCH_LABEL_BASE*>( m_parent );
213 return label->ResolveTextVar( aPath, token, aDepth + 1 );
214 };
215
216 wxString text = EDA_TEXT::GetShownText( aAllowExtraText, aDepth );
217
218 if( IsNameShown() && aAllowExtraText )
219 text = GetShownName() << wxS( ": " ) << text;
220
221 if( text == wxS( "~" ) ) // Legacy placeholder for empty string
222 {
223 text = wxS( "" );
224 }
225 else if( HasTextVars() )
226 {
227 if( aDepth < 10 )
228 {
229 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
230 text = ExpandTextVars( text, &symbolResolver );
231 else if( m_parent && m_parent->Type() == SCH_SHEET_T )
232 text = ExpandTextVars( text, &sheetResolver );
233 else if( m_parent && m_parent->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
234 text = ExpandTextVars( text, &labelResolver );
235 else if( Schematic() )
237 }
238 }
239
240 // WARNING: the IDs of FIELDS and SHEETS overlap, so one must check *both* the
241 // id and the parent's type.
242
243 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
244 {
245 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
246
247 if( m_id == REFERENCE_FIELD )
248 {
249 // For more than one part per package, we must add the part selection
250 // A, B, ... or 1, 2, .. to the reference.
251 if( parentSymbol->GetUnitCount() > 1 )
252 text << parentSymbol->SubReference( parentSymbol->GetUnitSelection( aPath ) );
253 }
254 }
255 else if( m_parent && m_parent->Type() == SCH_SHEET_T )
256 {
257 if( m_id == SHEETFILENAME && aAllowExtraText && !IsNameShown() )
258 text = _( "File:" ) + wxS( " " ) + text;
259 }
260
261 return text;
262}
263
264
265wxString SCH_FIELD::GetShownText( bool aAllowExtraText, int aDepth ) const
266{
267 if( SCHEMATIC* schematic = Schematic() )
268 return GetShownText( &schematic->CurrentSheet(), aAllowExtraText, aDepth );
269 else
270 return EDA_TEXT::GetShownText( aAllowExtraText, aDepth );
271}
272
273
274
276{
278}
279
280
282{
284
285 if( !font )
287
288 return font;
289}
290
291
293{
296}
297
298
300{
302 m_renderCacheValid = false;
303}
304
305
306std::vector<std::unique_ptr<KIFONT::GLYPH>>*
307SCH_FIELD::GetRenderCache( const wxString& forResolvedText, const VECTOR2I& forPosition,
308 TEXT_ATTRIBUTES& aAttrs ) const
309{
310 KIFONT::FONT* font = GetFont();
311
312 if( !font )
314
315 if( font->IsOutline() )
316 {
317 KIFONT::OUTLINE_FONT* outlineFont = static_cast<KIFONT::OUTLINE_FONT*>( font );
318
319 if( m_renderCache.empty() || !m_renderCacheValid )
320 {
321 m_renderCache.clear();
322
323 outlineFont->GetLinesAsGlyphs( &m_renderCache, forResolvedText, forPosition, aAttrs,
324 GetFontMetrics() );
325
326 m_renderCachePos = forPosition;
327 m_renderCacheValid = true;
328 }
329
330 if( m_renderCachePos != forPosition )
331 {
332 VECTOR2I delta = forPosition - m_renderCachePos;
333
334 for( std::unique_ptr<KIFONT::GLYPH>& glyph : m_renderCache )
335 {
336 if( glyph->IsOutline() )
337 static_cast<KIFONT::OUTLINE_GLYPH*>( glyph.get() )->Move( delta );
338 else
339 static_cast<KIFONT::STROKE_GLYPH*>( glyph.get() )->Move( delta );
340 }
341
342 m_renderCachePos = forPosition;
343 }
344
345 return &m_renderCache;
346 }
347
348 return nullptr;
349}
350
351
352void SCH_FIELD::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
353{
354 wxDC* DC = aSettings->GetPrintDC();
356 bool blackAndWhiteMode = GetGRForceBlackPenState();
357 VECTOR2I textpos;
358 int penWidth = GetEffectiveTextPenWidth( aSettings->GetDefaultPenWidth() );
359
360 if( ( !IsVisible() && !IsForceVisible() ) || GetShownText( true ).IsEmpty() )
361 return;
362
363 COLOR4D bg = aSettings->GetBackgroundColor();
364
365 if( bg == COLOR4D::UNSPECIFIED || GetGRForceBlackPenState() )
366 bg = COLOR4D::WHITE;
367
368 if( IsForceVisible() )
369 bg = aSettings->GetLayerColor( LAYER_HIDDEN );
370
371 if( !blackAndWhiteMode && GetTextColor() != COLOR4D::UNSPECIFIED )
373
374 // Calculate the text orientation according to the symbol orientation.
375 EDA_ANGLE orient = GetTextAngle();
376
377 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
378 {
379 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
380
381 if( parentSymbol && parentSymbol->GetTransform().y1 ) // Rotate symbol 90 degrees.
382 {
383 if( orient == ANGLE_HORIZONTAL )
384 orient = ANGLE_VERTICAL;
385 else
386 orient = ANGLE_HORIZONTAL;
387 }
388
389 if( parentSymbol && parentSymbol->GetDNP() )
390 {
391 color.Desaturate();
392 color = color.Mix( bg, 0.5f );
393 }
394 }
395
396 KIFONT::FONT* font = GetFont();
397
398 if( !font )
399 font = KIFONT::FONT::GetFont( aSettings->GetDefaultFont(), IsBold(), IsItalic() );
400
401 /*
402 * Calculate the text justification, according to the symbol orientation/mirror.
403 * This is a bit complicated due to cumulative calculations:
404 * - numerous cases (mirrored or not, rotation)
405 * - the GRText function will also recalculate H and V justifications according to the text
406 * orientation.
407 * - When a symbol is mirrored, the text is not mirrored and justifications are complicated
408 * to calculate so the more easily way is to use no justifications (centered text) and use
409 * GetBoundingBox to know the text coordinate considered as centered
410 */
411 textpos = GetBoundingBox().Centre() + aOffset;
412
413 if( GetParent() && GetParent()->Type() == SCH_GLOBAL_LABEL_T )
414 {
415 SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( GetParent() );
416 textpos += label->GetSchematicTextOffset( aSettings );
417 }
418
419 GRPrintText( DC, textpos, color, GetShownText( true ), orient, GetTextSize(),
421 font, GetFontMetrics() );
422}
423
424
425void SCH_FIELD::ImportValues( const LIB_FIELD& aSource )
426{
427 SetAttributes( aSource );
428 SetNameShown( aSource.IsNameShown() );
429 SetCanAutoplace( aSource.CanAutoplace() );
430}
431
432
434{
435 SCH_ITEM::SwapFlags( aItem );
436
437 wxCHECK_RET( ( aItem != nullptr ) && ( aItem->Type() == SCH_FIELD_T ),
438 wxT( "Cannot swap field data with invalid item." ) );
439
440 SCH_FIELD* item = (SCH_FIELD*) aItem;
441
442 std::swap( m_layer, item->m_layer );
443 std::swap( m_showName, item->m_showName );
444 std::swap( m_allowAutoPlace, item->m_allowAutoPlace );
445 std::swap( m_isNamedVariable, item->m_isNamedVariable );
446 SwapText( *item );
447 SwapAttributes( *item );
448
449 std::swap( m_lastResolvedColor, item->m_lastResolvedColor );
450}
451
452
454{
455 if( GetTextColor() != COLOR4D::UNSPECIFIED )
456 {
458 }
459 else
460 {
461 SCH_LABEL_BASE* parentLabel = dynamic_cast<SCH_LABEL_BASE*>( GetParent() );
462
463 if( parentLabel && !parentLabel->IsConnectivityDirty() )
464 m_lastResolvedColor = parentLabel->GetEffectiveNetClass()->GetSchematicColor();
465 else
467 }
468
469 return m_lastResolvedColor;
470}
471
472
473void SCH_FIELD::ViewGetLayers( int aLayers[], int& aCount ) const
474{
475 aCount = 2;
476
477 switch( m_id )
478 {
479 case REFERENCE_FIELD: aLayers[0] = LAYER_REFERENCEPART; break;
480 case VALUE_FIELD: aLayers[0] = LAYER_VALUEPART; break;
481 default: aLayers[0] = LAYER_FIELDS; break;
482 }
483
484 aLayers[1] = LAYER_SELECTION_SHADOWS;
485}
486
487
489{
490 // Calculate the text orientation according to the symbol orientation.
491 EDA_ANGLE orient = GetTextAngle();
492
493 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
494 {
495 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
496
497 if( parentSymbol && parentSymbol->GetTransform().y1 ) // Rotate symbol 90 degrees.
498 {
499 if( orient.IsHorizontal() )
500 orient = ANGLE_VERTICAL;
501 else
502 orient = ANGLE_HORIZONTAL;
503 }
504 }
505
506 return orient;
507}
508
509
511{
512 // Calculate the text bounding box:
513 BOX2I bbox = GetTextBox();
514
515 // Calculate the bounding box position relative to the parent:
516 VECTOR2I origin = GetParentPosition();
517 VECTOR2I pos = GetTextPos() - origin;
518 VECTOR2I begin = bbox.GetOrigin() - origin;
519 VECTOR2I end = bbox.GetEnd() - origin;
520 RotatePoint( begin, pos, GetTextAngle() );
521 RotatePoint( end, pos, GetTextAngle() );
522
523 // Now, apply the symbol transform (mirror/rot)
524 TRANSFORM transform;
525
526 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
527 {
528 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
529
530 // Due to the Y axis direction, we must mirror the bounding box,
531 // relative to the text position:
532 MIRROR( begin.y, pos.y );
533 MIRROR( end.y, pos.y );
534
535 transform = parentSymbol->GetTransform();
536 }
537 else
538 {
539 transform = TRANSFORM( 1, 0, 0, 1 ); // identity transform
540 }
541
542 bbox.SetOrigin( transform.TransformCoordinate( begin ) );
543 bbox.SetEnd( transform.TransformCoordinate( end ) );
544
545 bbox.Move( origin );
546 bbox.Normalize();
547
548 return bbox;
549}
550
551
553{
554 VECTOR2I render_center = GetBoundingBox().Centre();
555 VECTOR2I pos = GetPosition();
556
557 switch( GetHorizJustify() )
558 {
560 if( GetDrawRotation().IsVertical() )
561 return render_center.y > pos.y;
562 else
563 return render_center.x < pos.x;
565 if( GetDrawRotation().IsVertical() )
566 return render_center.y < pos.y;
567 else
568 return render_center.x > pos.x;
569 default:
570 return false;
571 }
572}
573
574
576{
577 switch( GetHorizJustify() )
578 {
583 default:
585 }
586}
587
588
590{
591 VECTOR2I render_center = GetBoundingBox().Centre();
592 VECTOR2I pos = GetPosition();
593
594 switch( GetVertJustify() )
595 {
597 if( GetDrawRotation().IsVertical() )
598 return render_center.x < pos.x;
599 else
600 return render_center.y < pos.y;
602 if( GetDrawRotation().IsVertical() )
603 return render_center.x > pos.x;
604 else
605 return render_center.y > pos.y;
606 default:
607 return false;
608 }
609}
610
611
613{
614 switch( GetVertJustify() )
615 {
620 default:
622 }
623}
624
625
626bool SCH_FIELD::Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const
627{
628 bool searchHiddenFields = false;
629 bool searchAndReplace = false;
630 bool replaceReferences = false;
631
632 try
633 {
634 const SCH_SEARCH_DATA& schSearchData = dynamic_cast<const SCH_SEARCH_DATA&>( aSearchData ); // downcast
635 searchHiddenFields = schSearchData.searchAllFields;
636 searchAndReplace = schSearchData.searchAndReplace;
637 replaceReferences = schSearchData.replaceReferences;
638 }
639 catch( const std::bad_cast& )
640 {
641 }
642
643 wxString text = UnescapeString( GetText() );
644
645 if( !IsVisible() && !searchHiddenFields )
646 return false;
647
649 {
650 if( searchAndReplace && !replaceReferences )
651 return false;
652
653 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
654 wxASSERT( aAuxData );
655
656 // Take sheet path into account which effects the reference field and the unit for
657 // symbols with multiple parts.
658 if( aAuxData )
659 {
660 SCH_SHEET_PATH* sheet = (SCH_SHEET_PATH*) aAuxData;
661 text = parentSymbol->GetRef( sheet );
662
663 if( SCH_ITEM::Matches( text, aSearchData ) )
664 return true;
665
666 if( parentSymbol->GetUnitCount() > 1 )
667 text << parentSymbol->SubReference( parentSymbol->GetUnitSelection( sheet ) );
668 }
669 }
670
671 return SCH_ITEM::Matches( text, aSearchData );
672}
673
674
676 wxStyledTextEvent &aEvent ) const
677{
678 SCH_ITEM* parent = dynamic_cast<SCH_ITEM*>( GetParent() );
679 SCHEMATIC* schematic = parent ? parent->Schematic() : nullptr;
680
681 if( !schematic )
682 return;
683
684 wxStyledTextCtrl* scintilla = aScintillaTricks->Scintilla();
685 int key = aEvent.GetKey();
686
687 wxArrayString autocompleteTokens;
688 int pos = scintilla->GetCurrentPos();
689 int start = scintilla->WordStartPosition( pos, true );
690 wxString partial;
691
692 // Multi-line fields are not allowed. So remove '\n' if entered.
693 if( key == '\n' )
694 {
695 wxString text = scintilla->GetText();
696 int currpos = scintilla->GetCurrentPos();
697 text.Replace( wxS( "\n" ), wxS( "" ) );
698 scintilla->SetText( text );
699 scintilla->GotoPos( currpos-1 );
700 return;
701 }
702
703 auto textVarRef =
704 [&]( int pt )
705 {
706 return pt >= 2
707 && scintilla->GetCharAt( pt - 2 ) == '$'
708 && scintilla->GetCharAt( pt - 1 ) == '{';
709 };
710
711 // Check for cross-reference
712 if( start > 1 && scintilla->GetCharAt( start - 1 ) == ':' )
713 {
714 int refStart = scintilla->WordStartPosition( start - 1, true );
715
716 if( textVarRef( refStart ) )
717 {
718 partial = scintilla->GetRange( start, pos );
719
720 wxString ref = scintilla->GetRange( refStart, start - 1 );
721
722 if( ref == wxS( "OP" ) )
723 {
724 // SPICE operating points use ':' syntax for ports
725 if( SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( parent ) )
726 {
727 NULL_REPORTER devnull;
728 SCH_SHEET_PATH& sheet = schematic->CurrentSheet();
729 SIM_LIB_MGR mgr( &schematic->Prj() );
730 SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol, devnull ).model;
731
732 for( wxString pin : model.GetPinNames() )
733 {
734 if( pin.StartsWith( '<' ) && pin.EndsWith( '>' ) )
735 autocompleteTokens.push_back( pin.Mid( 1, pin.Length() - 2 ) );
736 else
737 autocompleteTokens.push_back( pin );
738 }
739 }
740 }
741 else
742 {
743 SCH_SHEET_LIST sheets = schematic->GetSheets();
745 SCH_SYMBOL* refSymbol = nullptr;
746
747 sheets.GetSymbols( refs );
748
749 for( size_t jj = 0; jj < refs.GetCount(); jj++ )
750 {
751 if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(), true ) == ref )
752 {
753 refSymbol = refs[ jj ].GetSymbol();
754 break;
755 }
756 }
757
758 if( refSymbol )
759 refSymbol->GetContextualTextVars( &autocompleteTokens );
760 }
761 }
762 }
763 else if( textVarRef( start ) )
764 {
765 partial = scintilla->GetTextRange( start, pos );
766
767 SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( parent );
768 SCH_SHEET* sheet = dynamic_cast<SCH_SHEET*>( parent );
769 SCH_LABEL_BASE* label = dynamic_cast<SCH_LABEL_BASE*>( parent );
770
771 if( symbol )
772 {
773 symbol->GetContextualTextVars( &autocompleteTokens );
774
775 if( schematic->CurrentSheet().Last() )
776 schematic->CurrentSheet().Last()->GetContextualTextVars( &autocompleteTokens );
777 }
778
779 if( sheet )
780 sheet->GetContextualTextVars( &autocompleteTokens );
781
782 if( label )
783 label->GetContextualTextVars( &autocompleteTokens );
784
785 for( std::pair<wxString, wxString> entry : schematic->Prj().GetTextVars() )
786 autocompleteTokens.push_back( entry.first );
787 }
788
789 aScintillaTricks->DoAutocomplete( partial, autocompleteTokens );
790 scintilla->SetFocus();
791}
792
793
795{
796 if( m_parent && m_parent->Type() == SCH_SHEET_T )
797 {
798 // See comments in SCH_FIELD::Replace(), below.
799 if( m_id == SHEETFILENAME )
800 return false;
801 }
802 else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T )
803 {
804 if( m_id == 0 /* IntersheetRefs */ )
805 return false;
806 }
807
808 return true;
809}
810
811
812bool SCH_FIELD::Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData )
813{
814 bool replaceReferences = false;
815
816 try
817 {
818 const SCH_SEARCH_DATA& schSearchData = dynamic_cast<const SCH_SEARCH_DATA&>( aSearchData );
819 replaceReferences = schSearchData.replaceReferences;
820 }
821 catch( const std::bad_cast& )
822 {
823 }
824
825 wxString text;
826 bool isReplaced = false;
827
828 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
829 {
830 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
831
832 switch( m_id )
833 {
834 case REFERENCE_FIELD:
835 wxCHECK_MSG( aAuxData, false, wxT( "Need sheetpath to replace in refdes." ) );
836
837 if( !replaceReferences )
838 return false;
839
840 text = parentSymbol->GetRef( (SCH_SHEET_PATH*) aAuxData );
841 isReplaced = EDA_ITEM::Replace( aSearchData, text );
842
843 if( isReplaced )
844 parentSymbol->SetRef( (SCH_SHEET_PATH*) aAuxData, text );
845
846 break;
847
848 case VALUE_FIELD:
849 wxCHECK_MSG( aAuxData, false, wxT( "Need sheetpath to replace in value field." ) );
850
851 text = parentSymbol->GetField( VALUE_FIELD )->GetText();
852 isReplaced = EDA_ITEM::Replace( aSearchData, text );
853
854 if( isReplaced )
855 parentSymbol->SetValueFieldText( text );
856
857 break;
858
859 case FOOTPRINT_FIELD:
860 wxCHECK_MSG( aAuxData, false, wxT( "Need sheetpath to replace in footprint field." ) );
861
862 text = parentSymbol->GetField( FOOTPRINT_FIELD )->GetText();
863 isReplaced = EDA_ITEM::Replace( aSearchData, text );
864
865 if( isReplaced )
866 parentSymbol->SetFootprintFieldText( text );
867
868 break;
869
870 default:
871 isReplaced = EDA_TEXT::Replace( aSearchData );
872 }
873 }
874 else if( m_parent && m_parent->Type() == SCH_SHEET_T )
875 {
876 isReplaced = EDA_TEXT::Replace( aSearchData );
877
878 if( m_id == SHEETFILENAME && isReplaced )
879 {
880 // If we allowed this we'd have a bunch of work to do here, including warning
881 // about it not being undoable, checking for recursive hierarchies, reloading
882 // sheets, etc. See DIALOG_SHEET_PROPERTIES::TransferDataFromWindow().
883 }
884 }
885 else
886 {
887 isReplaced = EDA_TEXT::Replace( aSearchData );
888 }
889
890 return isReplaced;
891}
892
893
894void SCH_FIELD::Rotate( const VECTOR2I& aCenter )
895{
896 VECTOR2I pt = GetPosition();
897 RotatePoint( pt, aCenter, ANGLE_90 );
898 SetPosition( pt );
899}
900
901
902wxString SCH_FIELD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
903{
904 return wxString::Format( "%s '%s'", GetName(), KIUI::EllipsizeMenuText( GetText() ) );
905}
906
907
908void SCH_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
909{
910 wxString msg;
911
912 aList.emplace_back( _( "Symbol Field" ), UnescapeString( GetName() ) );
913
914 // Don't use GetShownText() here; we want to show the user the variable references
915 aList.emplace_back( _( "Text" ), KIUI::EllipsizeStatusText( aFrame, GetText() ) );
916
917 aList.emplace_back( _( "Visible" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
918
919 aList.emplace_back( _( "Font" ), GetFont() ? GetFont()->GetName() : _( "Default" ) );
920
921 aList.emplace_back( _( "Style" ), GetTextStyleName() );
922
923 aList.emplace_back( _( "Text Size" ), aFrame->MessageTextFromValue( GetTextWidth() ) );
924
925 switch ( GetHorizJustify() )
926 {
927 case GR_TEXT_H_ALIGN_LEFT: msg = _( "Left" ); break;
928 case GR_TEXT_H_ALIGN_CENTER: msg = _( "Center" ); break;
929 case GR_TEXT_H_ALIGN_RIGHT: msg = _( "Right" ); break;
931 }
932
933 aList.emplace_back( _( "H Justification" ), msg );
934
935 switch ( GetVertJustify() )
936 {
937 case GR_TEXT_V_ALIGN_TOP: msg = _( "Top" ); break;
938 case GR_TEXT_V_ALIGN_CENTER: msg = _( "Center" ); break;
939 case GR_TEXT_V_ALIGN_BOTTOM: msg = _( "Bottom" ); break;
941 }
942
943 aList.emplace_back( _( "V Justification" ), msg );
944}
945
946
948{
949 constexpr int START_ID = 1;
950
951 if( IsHypertext() )
952 {
953 SCH_LABEL_BASE* label = static_cast<SCH_LABEL_BASE*>( m_parent );
954 std::vector<std::pair<wxString, wxString>> pages;
955 wxMenu menu;
956 wxString href;
957
958 label->GetIntersheetRefs( &pages );
959
960 for( int i = 0; i < (int) pages.size(); ++i )
961 {
962 menu.Append( i + START_ID, wxString::Format( _( "Go to Page %s (%s)" ),
963 pages[i].first,
964 pages[i].second ) );
965 }
966
967 menu.AppendSeparator();
968 menu.Append( 999 + START_ID, _( "Back to Previous Selected Sheet" ) );
969
970 int sel = aFrame->GetPopupMenuSelectionFromUser( menu ) - START_ID;
971
972 if( sel >= 0 && sel < (int) pages.size() )
973 href = wxT( "#" ) + pages[ sel ].first;
974 else if( sel == 999 )
976
977 if( !href.IsEmpty() )
978 {
980 navTool->HypertextCommand( href );
981 }
982 }
983}
984
985
986void SCH_FIELD::SetName( const wxString& aName )
987{
988 m_name = aName;
989 m_isNamedVariable = m_name.StartsWith( wxT( "${" ) );
990
992 EDA_TEXT::SetText( aName );
993}
994
995
996void SCH_FIELD::SetText( const wxString& aText )
997{
998 // Don't allow modification of text value when using named variables
999 // as field name.
1000 if( m_isNamedVariable )
1001 return;
1002
1003 EDA_TEXT::SetText( aText );
1004}
1005
1006
1007wxString SCH_FIELD::GetName( bool aUseDefaultName ) const
1008{
1009 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
1010 {
1011 if( m_id >= 0 && m_id < MANDATORY_FIELDS )
1012 return GetCanonicalFieldName( m_id );
1013 else if( m_name.IsEmpty() && aUseDefaultName )
1015 else
1016 return m_name;
1017 }
1018 else if( m_parent && m_parent->Type() == SCH_SHEET_T )
1019 {
1020 if( m_id >= 0 && m_id < SHEET_MANDATORY_FIELDS )
1022 else if( m_name.IsEmpty() && aUseDefaultName )
1024 else
1025 return m_name;
1026 }
1027 else if( m_parent && m_parent->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
1028 {
1029 return SCH_LABEL_BASE::GetDefaultFieldName( m_name, aUseDefaultName );
1030 }
1031 else
1032 {
1033 wxFAIL_MSG( "Unhandled field owner type." );
1034 return m_name;
1035 }
1036}
1037
1038
1040{
1041 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
1042 {
1043 if( m_id >= 0 && m_id < MANDATORY_FIELDS )
1044 return GetCanonicalFieldName( m_id );
1045 else
1046 return m_name;
1047 }
1048 else if( m_parent && m_parent->Type() == SCH_SHEET_T )
1049 {
1050 switch( m_id )
1051 {
1052 case SHEETNAME: return wxT( "Sheetname" );
1053 case SHEETFILENAME: return wxT( "Sheetfile" );
1054 default: return m_name;
1055 }
1056 }
1057 else if( m_parent && m_parent->IsType( { SCH_LABEL_LOCATE_ANY_T } ) )
1058 {
1059 // These should be stored in canonical format, but just in case:
1060 if( m_name == _( "Net Class" ) || m_name == wxT( "Net Class" ) )
1061 {
1062 return wxT( "Netclass" );
1063 }
1064 else if( m_name == _( "Sheet References" )
1065 || m_name == wxT( "Sheet References" )
1066 || m_name == wxT( "Intersheet References" ) )
1067 {
1068 return wxT( "Intersheetrefs" );
1069 }
1070 else
1071 {
1072 return m_name;
1073 }
1074 }
1075 else
1076 {
1077 if( m_parent )
1078 {
1079 wxFAIL_MSG( wxString::Format( "Unhandled field owner type (id %d, parent type %d).",
1080 m_id, m_parent->Type() ) );
1081 }
1082
1083 return m_name;
1084 }
1085}
1086
1087
1089{
1090 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
1091 {
1092 switch( m_id )
1093 {
1094 case REFERENCE_FIELD: return BITMAPS::edit_comp_ref;
1095 case VALUE_FIELD: return BITMAPS::edit_comp_value;
1096 case FOOTPRINT_FIELD: return BITMAPS::edit_comp_footprint;
1097 default: return BITMAPS::text;
1098 }
1099 }
1100
1101 return BITMAPS::text;
1102}
1103
1104
1105bool SCH_FIELD::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
1106{
1107 // Do not hit test hidden or empty fields.
1108 if( !IsVisible() || GetShownText( true ).IsEmpty() )
1109 return false;
1110
1111 BOX2I rect = GetBoundingBox();
1112
1113 rect.Inflate( aAccuracy );
1114
1115 if( GetParent() && GetParent()->Type() == SCH_GLOBAL_LABEL_T )
1116 {
1117 SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( GetParent() );
1118 rect.Offset( label->GetSchematicTextOffset( nullptr ) );
1119 }
1120
1121 return rect.Contains( aPosition );
1122}
1123
1124
1125bool SCH_FIELD::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
1126{
1127 // Do not hit test hidden fields.
1128 if( !IsVisible() || GetShownText( true ).IsEmpty() )
1129 return false;
1130
1131 BOX2I rect = aRect;
1132
1133 rect.Inflate( aAccuracy );
1134
1135 if( GetParent() && GetParent()->Type() == SCH_GLOBAL_LABEL_T )
1136 {
1137 SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( GetParent() );
1138 rect.Offset( label->GetSchematicTextOffset( nullptr ) );
1139 }
1140
1141 if( aContained )
1142 return rect.Contains( GetBoundingBox() );
1143
1144 return rect.Intersects( GetBoundingBox() );
1145}
1146
1147
1148void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground,
1149 const SCH_PLOT_SETTINGS& aPlotSettings ) const
1150{
1151 if( GetShownText( true ).IsEmpty() || aBackground )
1152 return;
1153
1154 RENDER_SETTINGS* settings = aPlotter->RenderSettings();
1155 COLOR4D color = settings->GetLayerColor( GetLayer() );
1156 int penWidth = GetEffectiveTextPenWidth( settings->GetDefaultPenWidth() );
1157
1158 COLOR4D bg = settings->GetBackgroundColor();;
1159
1160 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
1161 bg = COLOR4D::WHITE;
1162
1163 if( aPlotter->GetColorMode() && GetTextColor() != COLOR4D::UNSPECIFIED )
1164 color = GetTextColor();
1165
1166 penWidth = std::max( penWidth, settings->GetMinPenWidth() );
1167
1168 // clamp the pen width to be sure the text is readable
1169 penWidth = std::min( penWidth, std::min( GetTextSize().x, GetTextSize().y ) / 4 );
1170
1171 if( !IsVisible() )
1172 return;
1173
1174 // Calculate the text orientation, according to the symbol orientation/mirror
1175 EDA_ANGLE orient = GetTextAngle();
1176 VECTOR2I textpos = GetTextPos();
1178 GR_TEXT_V_ALIGN_T vjustify = GetVertJustify();
1179
1180 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
1181 {
1182 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
1183
1184 if( parentSymbol->GetDNP() )
1185 {
1186 color.Desaturate();
1187 color = color.Mix( bg, 0.5f );
1188 }
1189
1190 if( parentSymbol->GetTransform().y1 ) // Rotate symbol 90 deg.
1191 {
1192 if( orient.IsHorizontal() )
1193 orient = ANGLE_VERTICAL;
1194 else
1195 orient = ANGLE_HORIZONTAL;
1196 }
1197
1198 /*
1199 * Calculate the text justification, according to the symbol orientation/mirror. This is
1200 * a bit complicated due to cumulative calculations:
1201 * - numerous cases (mirrored or not, rotation)
1202 * - the plotter's Text() function will also recalculate H and V justifications according
1203 * to the text orientation
1204 * - when a symbol is mirrored the text is not, and justifications become a nightmare
1205 *
1206 * So the easier way is to use no justifications (centered text) and use GetBoundingBox to
1207 * know the text coordinate considered as centered.
1208 */
1209 hjustify = GR_TEXT_H_ALIGN_CENTER;
1210 vjustify = GR_TEXT_V_ALIGN_CENTER;
1211 textpos = GetBoundingBox().Centre();
1212 }
1213 else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T )
1214 {
1215 SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( m_parent );
1216 textpos += label->GetSchematicTextOffset( settings );
1217 }
1218
1219 KIFONT::FONT* font = GetFont();
1220
1221 if( !font )
1222 font = KIFONT::FONT::GetFont( settings->GetDefaultFont(), IsBold(), IsItalic() );
1223
1225 attrs.m_StrokeWidth = penWidth;
1226 attrs.m_Halign = hjustify;
1227 attrs.m_Valign = vjustify;
1228 attrs.m_Angle = orient;
1229 attrs.m_Multiline = false;
1230
1231 aPlotter->PlotText( textpos, color, GetShownText( true ), attrs, font, GetFontMetrics() );
1232
1233 if( IsHypertext() )
1234 {
1235 SCH_LABEL_BASE* label = static_cast<SCH_LABEL_BASE*>( m_parent );
1236 std::vector<std::pair<wxString, wxString>> pages;
1237 std::vector<wxString> pageHrefs;
1238 BOX2I bbox = GetBoundingBox();
1239
1240 wxCHECK( label, /* void */ );
1241
1242 label->GetIntersheetRefs( &pages );
1243
1244 for( const std::pair<wxString, wxString>& page : pages )
1245 pageHrefs.push_back( wxT( "#" ) + page.first );
1246
1247 bbox.Offset( label->GetSchematicTextOffset( settings ) );
1248
1249 aPlotter->HyperlinkMenu( bbox, pageHrefs );
1250 }
1251}
1252
1253
1254void SCH_FIELD::SetPosition( const VECTOR2I& aPosition )
1255{
1256 // Actual positions are calculated by the rotation/mirror transform of the parent symbol
1257 // of the field. The inverse transform is used to calculate the position relative to the
1258 // parent symbol.
1259 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
1260 {
1261 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
1262 VECTOR2I relPos = aPosition - parentSymbol->GetPosition();
1263
1264 relPos = parentSymbol->GetTransform().InverseTransform().TransformCoordinate( relPos );
1265
1266 SetTextPos( relPos + parentSymbol->GetPosition() );
1267 return;
1268 }
1269
1270 SetTextPos( aPosition );
1271}
1272
1273
1275{
1276 if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
1277 {
1278 SCH_SYMBOL* parentSymbol = static_cast<SCH_SYMBOL*>( m_parent );
1279 VECTOR2I relativePos = GetTextPos() - parentSymbol->GetPosition();
1280
1281 relativePos = parentSymbol->GetTransform().TransformCoordinate( relativePos );
1282
1283 return relativePos + parentSymbol->GetPosition();
1284 }
1285
1286 return GetTextPos();
1287}
1288
1289
1291{
1292 return m_parent ? m_parent->GetPosition() : VECTOR2I( 0, 0 );
1293}
1294
1295
1296bool SCH_FIELD::operator <( const SCH_ITEM& aItem ) const
1297{
1298 if( Type() != aItem.Type() )
1299 return Type() < aItem.Type();
1300
1301 auto field = static_cast<const SCH_FIELD*>( &aItem );
1302
1303 if( GetId() != field->GetId() )
1304 return GetId() < field->GetId();
1305
1306 if( GetText() != field->GetText() )
1307 return GetText() < field->GetText();
1308
1309 if( GetLibPosition().x != field->GetLibPosition().x )
1310 return GetLibPosition().x < field->GetLibPosition().x;
1311
1312 if( GetLibPosition().y != field->GetLibPosition().y )
1313 return GetLibPosition().y < field->GetLibPosition().y;
1314
1315 return GetName() < field->GetName();
1316}
1317
1318bool SCH_FIELD::operator==( const SCH_ITEM& aOther ) const
1319{
1320 if( Type() != aOther.Type() )
1321 return false;
1322
1323 const SCH_FIELD& field = static_cast<const SCH_FIELD&>( aOther );
1324
1325 if( GetId() != field.GetId() )
1326 return false;
1327
1328 if( GetPosition() != field.GetPosition() )
1329 return false;
1330
1331 if( IsNamedVariable() != field.IsNamedVariable() )
1332 return false;
1333
1334 if( IsNameShown() != field.IsNameShown() )
1335 return false;
1336
1337 if( CanAutoplace() != field.CanAutoplace() )
1338 return false;
1339
1340 if( GetText() != field.GetText() )
1341 return false;
1342
1343 return true;
1344}
1345
1346
1347double SCH_FIELD::Similarity( const SCH_ITEM& aOther ) const
1348{
1349 if( Type() != aOther.Type() )
1350 return 0.0;
1351
1352 if( m_Uuid == aOther.m_Uuid )
1353 return 1.0;
1354
1355 const SCH_FIELD& field = static_cast<const SCH_FIELD&>( aOther );
1356
1357 double similarity = 0.99; // The UUIDs are different, so we start with non-identity
1358
1359 if( GetId() != field.GetId() )
1360 {
1361 // We don't allow swapping of mandatory fields, so these cannot be the same item
1362 if( GetId() < MANDATORY_FIELDS || field.GetId() < MANDATORY_FIELDS )
1363 return 0.0;
1364 else
1365 similarity *= 0.5;
1366 }
1367
1368 if( GetPosition() != field.GetPosition() )
1369 similarity *= 0.5;
1370
1371 if( IsNamedVariable() != field.IsNamedVariable() )
1372 similarity *= 0.5;
1373
1374 if( IsNameShown() != field.IsNameShown() )
1375 similarity *= 0.5;
1376
1377 if( CanAutoplace() != field.CanAutoplace() )
1378 similarity *= 0.5;
1379
1380 if( GetText() != field.GetText() )
1381 similarity *= Levenshtein( field );
1382
1383 return similarity;
1384}
1385
1386
1387static struct SCH_FIELD_DESC
1388{
1390 {
1397
1398 propMgr.AddProperty( new PROPERTY<SCH_FIELD, bool>( _HKI( "Show Field Name" ),
1400
1401 propMgr.AddProperty( new PROPERTY<SCH_FIELD, bool>( _HKI( "Allow Autoplacement" ),
1403
1404 propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Hyperlink" ) );
1405 propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Thickness" ) );
1406 propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Mirrored" ) );
1407 propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Width" ) );
1408 propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Height" ) );
1409
1410 propMgr.AddProperty( new PROPERTY<SCH_FIELD, int>( _HKI( "Text Size" ),
1411 &SCH_FIELD::SetSchTextSize, &SCH_FIELD::GetSchTextSize, PROPERTY_DISPLAY::PT_SIZE ),
1412 _HKI( "Text Properties" ) );
1413
1414 propMgr.Mask( TYPE_HASH( SCH_FIELD ), TYPE_HASH( EDA_TEXT ), _HKI( "Orientation" ) );
1415
1416 auto isNotNamedVariable =
1417 []( INSPECTABLE* aItem ) -> bool
1418 {
1419 if( SCH_FIELD* field = dynamic_cast<SCH_FIELD*>( aItem ) )
1420 return !field->IsNamedVariable();
1421
1422 return true;
1423 };
1424
1426 isNotNamedVariable );
1427 }
int color
Definition: DXF_plotter.cpp:58
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
void SetOrigin(const Vec &pos)
Definition: box2.h:203
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
Definition: box2.h:120
const Vec & GetOrigin() const
Definition: box2.h:184
void Offset(coord_type dx, coord_type dy)
Definition: box2.h:225
bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:270
const Vec GetEnd() const
Definition: box2.h:186
void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
Definition: box2.h:112
bool Contains(const Vec &aPoint) const
Definition: box2.h:142
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:507
Vec Centre() const
Definition: box2.h:71
void SetEnd(coord_type x, coord_type y)
Definition: box2.h:256
bool IsHorizontal() const
Definition: eda_angle.h:180
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:239
const KIID m_Uuid
Definition: eda_item.h:482
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition: eda_item.h:372
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition: eda_item.h:172
EDA_ITEM * GetParent() const
Definition: eda_item.h:99
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:485
bool IsForceVisible() const
Definition: eda_item.h:191
static bool Replace(const EDA_SEARCH_DATA &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
Definition: eda_item.cpp:186
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:80
BOX2I GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
Definition: eda_text.cpp:567
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:231
COLOR4D GetTextColor() const
Definition: eda_text.h:228
wxString GetTextStyleName() const
Definition: eda_text.cpp:824
bool IsItalic() const
Definition: eda_text.h:141
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:131
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:95
virtual bool IsVisible() const
Definition: eda_text.h:148
void SetTextPos(const VECTOR2I &aPoint)
Definition: eda_text.cpp:419
KIFONT::FONT * GetFont() const
Definition: eda_text.h:208
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
Definition: eda_text.cpp:292
EDA_TEXT & operator=(const EDA_TEXT &aItem)
Definition: eda_text.cpp:152
int GetTextWidth() const
Definition: eda_text.h:222
GR_TEXT_H_ALIGN_T GetHorizJustify() const
Definition: eda_text.h:161
bool Replace(const EDA_SEARCH_DATA &aSearchData)
Helper function used in search and replace dialog.
Definition: eda_text.cpp:345
bool HasTextVars() const
Indicates the ShownText has text var references which need to be processed.
Definition: eda_text.h:114
virtual void SetVisible(bool aVisible)
Definition: eda_text.cpp:245
virtual void ClearBoundingBoxCache()
Definition: eda_text.cpp:505
virtual void ClearRenderCache()
Definition: eda_text.cpp:499
const TEXT_ATTRIBUTES & GetAttributes() const
Definition: eda_text.h:192
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
Definition: eda_text.cpp:324
void SwapAttributes(EDA_TEXT &aTradingPartner)
Swap the text attributes of the two involved instances.
Definition: eda_text.cpp:311
bool IsBold() const
Definition: eda_text.h:145
GR_TEXT_V_ALIGN_T GetVertJustify() const
Definition: eda_text.h:164
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:106
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:183
double Levenshtein(const EDA_TEXT &aOther) const
Return the levenstein distance between two texts.
Definition: eda_text.cpp:1105
void SwapText(EDA_TEXT &aTradingPartner)
Definition: eda_text.cpp:304
VECTOR2I GetTextSize() const
Definition: eda_text.h:219
Class that other classes need to inherit from, in order to be inspectable.
Definition: inspectable.h:36
FONT is an abstract base class for both outline and stroke fonts.
Definition: font.h:131
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false)
Definition: font.cpp:146
virtual bool IsOutline() const
Definition: font.h:139
Class OUTLINE_FONT implements outline font drawing.
Definition: outline_font.h:52
void GetLinesAsGlyphs(std::vector< std::unique_ptr< GLYPH > > *aGlyphs, const wxString &aText, const VECTOR2I &aPosition, const TEXT_ATTRIBUTES &aAttrs, const METRICS &aFontMetrics) const
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
const wxString & GetDefaultFont() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
wxDC * GetPrintDC() const
Field object used in symbol libraries.
Definition: lib_field.h:62
bool CanAutoplace() const
Definition: lib_field.h:195
bool IsNameShown() const
Definition: lib_field.h:192
A singleton reporter that reports to nowhere.
Definition: reporter.h:223
Base plotter engine class.
Definition: plotter.h:104
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:135
bool GetColorMode() const
Definition: plotter.h:132
virtual void HyperlinkMenu(const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
Create a clickable hyperlink menu with a rectangular click area.
Definition: plotter.h:464
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics, void *aData=nullptr)
Definition: plotter.cpp:753
virtual std::map< wxString, wxString > & GetTextVars() const
Definition: project.cpp:84
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:85
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:87
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void OverrideWriteability(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName, std::function< bool(INSPECTABLE *)> aFunc)
Sets an override writeability functor for a base class property of a given derived class.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
Holds all the data relating to one schematic.
Definition: schematic.h:75
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:136
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
Definition: schematic.h:100
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:90
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:52
void ClearRenderCache() override
Definition: sch_field.cpp:299
COLOR4D m_lastResolvedColor
Definition: sch_field.h:309
GR_TEXT_V_ALIGN_T GetEffectiveVertJustify() const
Definition: sch_field.cpp:612
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_field.cpp:510
std::vector< std::unique_ptr< KIFONT::GLYPH > > m_renderCache
Definition: sch_field.h:307
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: sch_field.cpp:473
VECTOR2I GetPosition() const override
Definition: sch_field.cpp:1274
int GetSchTextSize() const
Definition: sch_field.h:155
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData=nullptr) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
Definition: sch_field.cpp:812
bool m_showName
Render the field name in addition to its value.
Definition: sch_field.h:300
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_field.cpp:894
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
Print a schematic item.
Definition: sch_field.cpp:352
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_field.cpp:139
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_field.cpp:1088
bool IsNameShown() const
Definition: sch_field.h:187
bool IsHypertext() const override
Allow items to support hypertext actions when hovered/clicked.
Definition: sch_field.h:96
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
Definition: sch_field.cpp:1347
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_field.cpp:1105
bool IsHorizJustifyFlipped() const
Return whether the field will be rendered with the horizontal justification inverted due to rotation ...
Definition: sch_field.cpp:552
bool IsVertJustifyFlipped() const
Definition: sch_field.cpp:589
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_field.cpp:902
EDA_ANGLE GetDrawRotation() const override
Adjusters to allow EDA_TEXT to draw/print/etc.
Definition: sch_field.cpp:488
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_field.cpp:626
void SetCanAutoplace(bool aCanPlace)
Definition: sch_field.h:199
bool m_isNamedVariable
If the field name is a variable name, e.g.
Definition: sch_field.h:302
void DoHypertextAction(EDA_DRAW_FRAME *aFrame) const override
Definition: sch_field.cpp:947
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_SETTINGS &aPlotSettings) const override
Plot the schematic item to aPlotter.
Definition: sch_field.cpp:1148
int GetPenWidth() const override
Definition: sch_field.cpp:275
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
Definition: sch_field.cpp:1039
COLOR4D GetFieldColor() const
Definition: sch_field.cpp:453
bool IsNamedVariable() const
Named variables are fields whose names are variables like ${VAR}.
Definition: sch_field.h:196
int GetId() const
Definition: sch_field.h:128
bool operator==(const SCH_ITEM &aItem) const override
Definition: sch_field.cpp:1318
SCH_FIELD & operator=(const SCH_FIELD &aField)
Definition: sch_field.cpp:110
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_field.cpp:1296
wxString GetShownName() const
Gets the fields name as displayed on the schematic or in the symbol fields table.
Definition: sch_field.cpp:182
VECTOR2I GetLibPosition() const
Definition: sch_field.h:265
bool IsEmpty()
Return true if both the name and value of the field are empty.
Definition: sch_field.h:147
SCH_FIELD(const VECTOR2I &aPos, int aFieldId, SCH_ITEM *aParent, const wxString &aName=wxEmptyString)
Definition: sch_field.cpp:60
bool m_renderCacheValid
Definition: sch_field.h:305
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
Definition: sch_field.cpp:794
void SetSchTextSize(int aSize)
Definition: sch_field.h:156
GR_TEXT_H_ALIGN_T GetEffectiveHorizJustify() const
Definition: sch_field.cpp:575
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Definition: sch_field.cpp:1007
void SetPosition(const VECTOR2I &aPosition) override
Definition: sch_field.cpp:1254
void ImportValues(const LIB_FIELD &aSource)
Copy parameters from a LIB_FIELD source.
Definition: sch_field.cpp:425
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_field.cpp:433
void SetName(const wxString &aName)
Definition: sch_field.cpp:986
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
Definition: sch_field.cpp:188
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_field.h:223
VECTOR2I m_renderCachePos
Definition: sch_field.h:306
bool CanAutoplace() const
Definition: sch_field.h:198
std::vector< std::unique_ptr< KIFONT::GLYPH > > * GetRenderCache(const wxString &forResolvedText, const VECTOR2I &forPosition, TEXT_ATTRIBUTES &aAttrs) const
Definition: sch_field.cpp:307
void SetId(int aId)
Definition: sch_field.cpp:145
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: sch_field.cpp:908
void ClearCaches() override
Definition: sch_field.cpp:292
void SetText(const wxString &aText) override
Definition: sch_field.cpp:996
VECTOR2I GetParentPosition() const
Definition: sch_field.cpp:1290
int m_id
Field index,.
Definition: sch_field.h:296
void OnScintillaCharAdded(SCINTILLA_TRICKS *aScintillaTricks, wxStyledTextEvent &aEvent) const
Definition: sch_field.cpp:675
wxString m_name
Definition: sch_field.h:298
void SetNameShown(bool aShown=true)
Definition: sch_field.h:188
KIFONT::FONT * getDrawFont() const override
Definition: sch_field.cpp:281
bool m_allowAutoPlace
This field can be autoplaced.
Definition: sch_field.h:301
VECTOR2I GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
Definition: sch_label.cpp:1790
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:165
const wxString & GetDefaultFont() const
Definition: sch_item.cpp:323
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:113
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
Definition: sch_item.cpp:176
void SetLayer(SCH_LAYER_ID aLayer)
Set the layer this item is on.
Definition: sch_item.h:279
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:272
bool IsConnectivityDirty() const
Definition: sch_item.h:453
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
Definition: sch_item.cpp:267
const KIFONT::METRICS & GetFontMetrics() const
Definition: sch_item.cpp:331
SCH_LAYER_ID m_layer
Definition: sch_item.h:559
void GetIntersheetRefs(std::vector< std::pair< wxString, wxString > > *pages)
Builds an array of { pageNumber, pageName } pairs.
Definition: sch_label.cpp:709
virtual bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
Definition: sch_label.cpp:757
static const wxString GetDefaultFieldName(const wxString &aName, bool aUseDefaultName)
Definition: sch_label.cpp:246
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
Definition: sch_label.cpp:744
VECTOR2I GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
Definition: sch_label.cpp:391
Handle actions specific to the schematic editor.
static wxString g_BackLink
void HypertextCommand(const wxString &href)
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
size_t GetCount() const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Definition: sch_sheet.cpp:202
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated=true)
Definition: sch_sheet.cpp:55
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
Definition: sch_sheet.cpp:237
Schematic symbol object.
Definition: sch_symbol.h:109
int GetUnitCount() const
Return the number of units per package of the symbol.
Definition: sch_symbol.cpp:486
wxString SubReference(int aUnit, bool aAddSeparator=true) const
Definition: sch_symbol.cpp:870
void SetValueFieldText(const wxString &aValue)
Definition: sch_symbol.cpp:931
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
Definition: sch_symbol.cpp:751
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:953
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
Definition: sch_symbol.cpp:793
void SetFootprintFieldText(const wxString &aFootprint)
Definition: sch_symbol.cpp:947
VECTOR2I GetPosition() const override
Definition: sch_symbol.h:816
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
TRANSFORM & GetTransform()
Definition: sch_symbol.h:314
int GetUnitSelection(const SCH_SHEET_PATH *aSheet) const
Return the instance-specific unit selection for the given sheet path.
Definition: sch_symbol.cpp:879
bool GetDNP() const
Definition: sch_symbol.h:867
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
wxStyledTextCtrl * Scintilla() const
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
SIM_MODEL & CreateModel(SIM_MODEL::TYPE aType, const std::vector< LIB_PIN * > &aPins, REPORTER &aReporter)
virtual std::vector< std::string > GetPinNames() const
Definition: sim_model.h:475
GR_TEXT_H_ALIGN_T m_Halign
GR_TEXT_V_ALIGN_T m_Valign
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:46
int y1
Definition: transform.h:49
TRANSFORM InverseTransform() const
Calculate the Inverse mirror/rotation transform.
Definition: transform.cpp:59
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:44
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
Definition: common.cpp:58
wxString GetTextVars(const wxString &aSource)
Returns any variables unexpanded, e.g.
Definition: common.cpp:115
The common library.
#define _HKI(x)
#define _(s)
static constexpr EDA_ANGLE ANGLE_90
Definition: eda_angle.h:437
static constexpr EDA_ANGLE ANGLE_VERTICAL
Definition: eda_angle.h:432
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
Definition: eda_angle.h:431
bool GetGRForceBlackPenState(void)
Definition: gr_basic.cpp:165
void GRPrintText(wxDC *aDC, const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics)
Print a graphic text through wxDC.
Definition: gr_text.cpp:142
PROJECT & Prj()
Definition: kicad.cpp:591
@ LAYER_SHEETNAME
Definition: layer_ids.h:374
@ LAYER_HIDDEN
Definition: layer_ids.h:392
@ LAYER_VALUEPART
Definition: layer_ids.h:364
@ LAYER_FIELDS
Definition: layer_ids.h:365
@ LAYER_SHEETFIELDS
Definition: layer_ids.h:376
@ LAYER_REFERENCEPART
Definition: layer_ids.h:363
@ LAYER_NETCLASS_REFS
Definition: layer_ids.h:367
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:393
@ LAYER_INTERSHEET_REFS
Definition: layer_ids.h:366
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:375
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Definition: mirror.h:40
wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
Definition: ui_common.cpp:210
wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
Definition: ui_common.cpp:192
#define TYPE_HASH(x)
Definition: property.h:67
#define REGISTER_TYPE(x)
Definition: property_mgr.h:366
static struct SCH_FIELD_DESC _SCH_FIELD_DESC
@ SHEET_MANDATORY_FIELDS
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition: sch_sheet.h:49
@ SHEETNAME
Definition: sch_sheet.h:45
@ SHEETFILENAME
Definition: sch_sheet.h:46
wxString UnescapeString(const wxString &aSource)
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslateForHI=false)
Return a default symbol field name for field aFieldNdx for all components.
Definition for symbol library class.
wxString GetCanonicalFieldName(int idx)
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ MANDATORY_FIELDS
The first 5 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
constexpr int delta
GR_TEXT_H_ALIGN_T
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_H_ALIGN_INDETERMINATE
GR_TEXT_V_ALIGN_T
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP
wxLogTrace helper definitions.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
Definition: trigo.cpp:228
@ SCH_SYMBOL_T
Definition: typeinfo.h:160
@ SCH_FIELD_T
Definition: typeinfo.h:159
@ SCH_SHEET_T
Definition: typeinfo.h:162
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:156
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
Definition: ui_common.h:44
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588