42#include <api/schematic/schematic_types.pb.h>
75 if( !aValue.GetAs( &value ) )
83 return std::make_unique<VALIDATION_ERROR_MSG>( msg );
93 void setter(
void* obj, wxAny& v )
override
97 if( !v.GetAs( &value ) )
103 wxString variantName;
115 field->
SetText( value, sheetPath, variantName );
118 wxAny
getter(
const void* obj )
const override
126 wxString variantName;
137 if( !variantName.IsEmpty() && sheetPath )
142 return wxAny(
text );
182 sheet.mutable_id()->set_value(
m_Uuid.AsStdString() );
185 sheet.set_locked(
IsLocked() ? LockedState::LS_LOCKED : LockedState::LS_UNLOCKED );
190 sheet.set_dnp(
GetDNP() );
192 StrokeAttributes* borderStroke = sheet.mutable_border_stroke();
199 GraphicFillAttributes* fill = sheet.mutable_fill();
201 : GraphicFillType::GFT_FILLED_WITH_COLOR );
211 if( field.IsMandatory() )
214 field.Serialize( *sheet.add_user_fields(),
schIUScale );
218 pin->Serialize( *sheet.add_pins() );
222 if( !aContainer.PackFrom( sheet ) )
223 wxFAIL_MSG( wxT(
"Failed to pack SCH_SHEET" ) );
235 if( !aContainer.UnpackTo( &sheet ) )
239 screen->BumpConnectivityRevision();
244 SetLocked( sheet.locked() == LockedState::LS_LOCKED );
256 if( sheet.fill().fill_type() == GraphicFillType::GFT_UNFILLED || !sheet.fill().has_color() )
273 for(
const auto& field : sheet.user_fields() )
279 for(
const auto& pinProto : sheet.pins() )
281 std::unique_ptr<SCH_SHEET_PIN>
pin = std::make_unique<SCH_SHEET_PIN>(
this );
283 if( !
pin->Deserialize( pinProto ) )
317 m_pins.emplace_back( new SCH_SHEET_PIN( *pin ) );
318 m_pins.back()->SetParent( this );
322 field.SetParent(
this );
349 std::vector<PROPERTY_BASE*> props;
351 auto getOrCreate = [&](
const wxString& aName )
357 auto prop = std::make_unique<SCH_SHEET_FIELD_PROPERTY>( aName );
361 return it->second.get();
367 if( field.IsMandatory() )
369 if( field.IsPrivate() )
372 const wxString&
name = field.GetUntranslatedName();
377 props.push_back( getOrCreate(
name ) );
381 std::vector<const SCH_FIELD*> userFields;
385 if( field.IsMandatory() )
388 if( field.IsPrivate() )
391 userFields.push_back( &field );
394 std::ranges::sort( userFields,
400 for(
const SCH_FIELD* field : userFields )
402 const wxString&
name = field->GetUntranslatedName();
403 props.push_back( getOrCreate(
name ) );
407 props.push_back( prop );
444 wxCHECK_RET(
m_screen, wxS(
"Cannot sync a sheet UUID without a screen" ) );
461 wxCHECK_MSG(
Schematic(),
false,
"Can't call IsVirtualRootSheet without setting a schematic" );
469 wxCHECK_MSG(
Schematic(),
false,
"Can't call IsTopLevelSheet without setting a schematic" );
478 [&](
const wxString& aVar )
481 aVars->push_back( aVar );
486 if( field.IsMandatory() )
487 add( field.GetUntranslatedName().Upper() );
489 add( field.GetName() );
494 if( sheetPath.
size() >= 2 )
506 add( wxT(
"SHEETPATH" ) );
507 add( wxT(
"EXCLUDE_FROM_BOM" ) );
508 add( wxT(
"EXCLUDE_FROM_BOARD" ) );
509 add( wxT(
"EXCLUDE_FROM_SIM" ) );
511 add( wxT(
"ERC_ERROR <message_text>" ) );
512 add( wxT(
"ERC_WARNING <message_text>" ) );
514 m_screen->GetTitleBlock().GetContextualTextVars( aVars );
520 wxCHECK( aPath,
false );
527 if( token->Contains(
':' ) )
529 if(
schematic->ResolveCrossReference( token, aDepth + 1 ) )
535 wxString fieldName = field.IsMandatory() ? field.GetUntranslatedName().Upper()
538 if( token->IsSameAs( fieldName ) )
543 if( !parentPath.
empty() && parentPath.
Last() ==
this )
546 *token = field.GetShownText( &parentPath,
INTERNAL,
schematic->GetCurrentVariant(), aDepth + 1 );
552 wxString variant =
schematic->GetCurrentVariant();
559 if( token->IsSameAs( wxT(
"#" ) ) )
564 else if( token->IsSameAs( wxT(
"##" ) ) )
566 *token = wxString::Format( wxT(
"%d" ), (
int)
schematic->Hierarchy().size() );
569 else if( token->IsSameAs( wxT(
"SHEETPATH" ) ) )
574 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOM" ) ) )
576 *token = wxEmptyString;
578 if( aPath->
GetExcludedFromBOM( variant ) || this->ResolveExcludedFromBOM( aPath, variant ) )
579 *token = wxS(
"Excluded from BOM" );
583 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOARD" ) ) )
585 *token = wxEmptyString;
587 if( aPath->
GetExcludedFromBoard( variant ) || this->ResolveExcludedFromBoard( aPath, variant ) )
588 *token = wxS(
"Excluded from board" );
592 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_SIM" ) ) )
594 *token = wxEmptyString;
596 if( aPath->
GetExcludedFromSim( variant ) || this->ResolveExcludedFromSim( aPath, variant ) )
597 *token = wxS(
"Excluded from simulation" );
601 else if( token->IsSameAs( wxT(
"DNP" ) ) )
603 *token = wxEmptyString;
605 if( aPath->
GetDNP( variant ) || this->ResolveDNP( aPath, variant ) )
606 *token = wxS(
"DNP" );
613 if( aPath->
size() >= 2 )
618 if(
path.Last()->ResolveTextVar( &
path, token, aDepth + 1 ) )
623 if(
schematic->ResolveTextVar( aPath, token, aDepth + 1 ) )
634 wxString::Format( wxT(
"SCH_SHEET object cannot swap data with %s object." ),
646 sheetPin->SetParent(
this );
652 field.SetParent(
this );
674 m_fields.emplace_back(
this, aFieldType );
690 return wxEmptyString;
698 if( aText.IsEmpty() )
699 return wxEmptyString;
706 std::function<bool( wxString* )> resolver =
707 [&]( wxString* aToken ) ->
bool
711 for(
size_t ii = aParentPath.
size(); !field && ii > 0; --ii )
712 field = std::as_const( *aParentPath.
at( ii - 1 ) ).GetField( *aToken );
715 if( !field || field == suffixField || field->
IsMandatory() )
720 if( value.Contains( wxS(
"${" ) ) && depth < maxDepth )
739 const std::function<
bool(
const wxString& )>& aIsTaken )
742 [&](
const wxString& aCandidate )
744 return aInUse.contains( aCandidate ) || ( aIsTaken && aIsTaken( aCandidate ) );
747 if( aSuffix.IsEmpty() || !taken( aSuffix ) )
751 [](
const wxString& aText,
auto aIsTailChar ) ->
size_t
753 size_t stem = aText.length();
755 while( stem > 0 && aIsTailChar( aText[stem - 1] ) )
761 auto isDigit = []( wxUniChar c ) {
return c >=
'0' && c <=
'9'; };
762 auto isUpper = []( wxUniChar c ) {
return c >=
'A' && c <=
'Z'; };
763 auto isLower = []( wxUniChar c ) {
return c >=
'a' && c <=
'z'; };
765 size_t digitStem = splitTail( aSuffix,
isDigit );
767 if( digitStem < aSuffix.length() )
769 wxString stem = aSuffix.Left( digitStem );
770 size_t width = aSuffix.length() - digitStem;
771 wxULongLong_t highest = 0;
773 for(
const wxString& used : aInUse )
775 wxULongLong_t value = 0;
777 if( used.StartsWith( stem ) && used.length() > stem.length()
778 && splitTail( used,
isDigit ) == stem.length()
779 && used.Mid( stem.length() ).ToULongLong( &value ) )
781 highest = std::max( highest, value );
786 for( wxULongLong_t
next = highest + 1; ; ++
next )
788 wxString candidate = stem + wxString::Format( wxS(
"%0*" wxLongLongFmtSpec
"u" ), (
int) width,
next );
790 if( !taken( candidate ) )
797 [&](
auto aIsLetter,
bool aLower ) -> std::optional<wxString>
799 static const wxString alphabet = wxS(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
801 size_t stem = splitTail( aSuffix, aIsLetter );
802 size_t run = aSuffix.length() - stem;
804 if( run == 0 || run > 2 )
807 wxString prefix = aSuffix.Left( stem );
810 for(
const wxString& used : aInUse )
812 size_t usedStem = splitTail( used, aIsLetter );
814 if( usedStem == stem && used.length() - usedStem <= 2 && used.StartsWith( prefix ) )
819 for(
int next = highest + 1; ; ++
next )
826 if( !taken( prefix + letters ) )
827 return prefix + letters;
831 if( std::optional<wxString>
next = letterSeries( isUpper,
false ) )
834 if( std::optional<wxString>
next = letterSeries( isLower,
true ) )
846 return wxEmptyString;
894 switch( aField->
GetId() )
899 wxString tmp = aFieldText;
900 tmp.Replace( wxT(
"\\" ), wxT(
"/" ) );
912 wxString defaultText = aField->
GetText( aPath );
914 if( aVariantName.IsEmpty() )
916 if( aFieldText != defaultText )
923 wxCHECK( instance, );
925 bool changed =
false;
927 if( instance->
m_Variants.contains( aVariantName ) )
929 auto& fields = instance->
m_Variants[aVariantName].m_Fields;
931 if( aFieldText != defaultText )
933 auto [entry, inserted] = fields.try_emplace( aFieldName, aFieldText );
934 changed = inserted || std::exchange( entry->second, aFieldText ) != aFieldText;
938 changed = fields.erase( aFieldName ) != 0;
941 else if( aFieldText != defaultText )
946 newVariant.
m_Fields[aFieldName] = aFieldText;
947 instance->
m_Variants.insert( std::make_pair( aVariantName, newVariant ) );
962 const wxString& aVariantName )
964 wxCHECK_MSG( !aFieldName.IsEmpty(), , wxT(
"Can't set text on a field with no name!" ) );
968 wxCHECK_MSG( field, , wxT(
"Can't set text on a field not yet added to the sheet!" ) );
970 SetFieldText( field, aFieldName, aFieldText, aPath, aVariantName );
975 const wxString& aVariantName )
const
977 switch( aField->
GetId() )
986 if( aVariantName.IsEmpty() )
994 if( instance->
m_Variants.contains( aVariantName )
995 && instance->
m_Variants.at( aVariantName ).m_Fields.contains( aFieldName ) )
997 return instance->
m_Variants.at( aVariantName ).m_Fields.at( aFieldName );
1009 const wxString& aVariantName )
const
1011 wxCHECK_MSG( !aFieldName.IsEmpty(), wxEmptyString, wxT(
"Can't get text from a field with no name!" ) );
1015 wxCHECK_MSG( field, wxEmptyString, wxT(
"Can't get text from a field not yet added to the sheet!" ) );
1017 return GetFieldText( field, aFieldName, aPath, aVariantName );
1023 wxASSERT( aSheetPin !=
nullptr );
1027 screen->BumpConnectivityRevision();
1030 m_pins.push_back( aSheetPin );
1037 wxASSERT( aSheetPin !=
nullptr );
1042 if( *i == aSheetPin )
1045 screen->BumpConnectivityRevision();
1061 if(
pin->GetText().Cmp( aName ) == 0 )
1073 if( sheetPin->GetPosition() == aPosition )
1088 switch(
pin->GetSide() )
1098 return topBottom > 0 && leftRight == 0;
1118 if( HLabel ==
nullptr )
1128 constexpr int gridSize =
schIUScale.MilsToIU( 50 );
1130 int base = aVal / gridSize;
1131 int excess = abs( aVal % gridSize );
1134 if( aVal < 0 && excess > 0 )
1137 if( aDirection > 0 )
1139 return ( base + 1 ) * gridSize;
1141 else if( excess > 0 )
1143 return ( base ) * gridSize;
1147 return ( base - 1 ) * gridSize;
1155 int pinsRight =
m_pos.x;
1163 BOX2I pinRect =
pin->GetBoundingBox();
1165 pinsLeft = std::min( pinsLeft, pinRect.
GetLeft() );
1166 pinsRight = std::max( pinsRight, pinRect.
GetRight() );
1175 if( pinsLeft >= pinsRight )
1177 else if( aFromLeft )
1178 pinMinWidth = pinsRight -
m_pos.x;
1189 int pinsBottom =
m_pos.y;
1197 BOX2I pinRect =
pin->GetBoundingBox();
1199 pinsTop = std::min( pinsTop, pinRect.
GetTop() );
1200 pinsBottom = std::max( pinsBottom, pinRect.
GetBottom() );
1209 if( pinsTop >= pinsBottom )
1212 pinMinHeight = pinsBottom -
m_pos.y;
1223 screen->BumpConnectivityRevision();
1225 std::vector<SCH_SHEET_PIN*> pins =
m_pins;
1255 if(
pin->HitTest( aPosition ) )
1280 int margin = borderMargin +
KiROUND( std::max( textSize.
x, textSize.
y ) * 0.5 );
1300 margin = borderMargin +
KiROUND( std::max( textSize.
x, textSize.
y ) * 0.4 );
1338 end.x = std::max(
m_size.x, textLength );
1356 if( field.IsVisible() )
1357 bbox.
Merge( field.GetBoundingBox() );
1360 bbox.
Merge(
pin->GetBoundingBox() );
1416 if( screen && screen->
GetFileName().Cmp( aFilename ) == 0 )
1461 if(
m_screen->GetFileName().Cmp( aFilename ) == 0 )
1504 wxString currentVariant;
1509 path.push_back(
this );
1513 aList.emplace_back(
_(
"Hierarchical Path" ),
path.PathHumanReadable(
false,
true ) );
1523 msgs.Add(
_(
"Simulation" ) );
1526 msgs.Add(
_(
"BOM" ) );
1529 msgs.Add(
_(
"Board" ) );
1531 if(
GetDNP( currentSheet, currentVariant ) )
1532 msgs.Add(
_(
"DNP" ) );
1534 msg = wxJoin( msgs,
'|' );
1535 msg.Replace(
'|', wxS(
", " ) );
1538 aList.emplace_back(
_(
"Exclude from" ), msg );
1544 std::map<SCH_SHEET_PIN*, SCH_NO_CONNECT*> noConnects;
1553 screen = parentSheet->GetScreen();
1561 noConnects[sheetPin] =
static_cast<SCH_NO_CONNECT*
>( noConnect );
1576 field.Move(
delta );
1582 m_pos += aMoveVector;
1585 pin->Move( aMoveVector );
1588 field.Move( aMoveVector );
1614 sheetPin->Rotate( aCenter, aRotateCCW );
1628 field.SetTextPos( pos );
1643 sheetPin->MirrorVertically( aCenter );
1649 field.SetTextPos( pos );
1663 sheetPin->MirrorHorizontally( aCenter );
1669 field.SetTextPos( pos );
1695 sheetPin->ConstrainOnEdge( sheetPin->GetPosition(),
false );
1712 pin->SetNumber(
id );
1724 while( !sheetPath.
empty() && sheetPath.
Last() !=
this )
1727 if( sheetPath.
empty() )
1743 wxT(
"Invalid item in schematic sheet pin list. Bad programmer!" ) );
1745 sheetPin->GetEndPoints( aItemList );
1751 std::vector<DANGLING_END_ITEM>& aItemListByPos,
1754 bool changed =
false;
1757 changed |= sheetPin->UpdateDanglingState( aItemListByType, aItemListByPos );
1772 wxCHECK( sheet,
false );
1786 for(
size_t i = 0; i <
m_pins.size(); i++ )
1798 std::vector<VECTOR2I> retval;
1801 retval.push_back( sheetPin->GetPosition() );
1809 for(
KICAD_T scanType : aScanTypes )
1846 aFunction( &field );
1857 return wxString::Format(
_(
"Hierarchical Sheet '%s'" ),
1873 rect.Inflate( aAccuracy );
1875 return rect.Contains( aPosition );
1883 rect.Inflate( aAccuracy );
1899 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
1908 wxString variantName;
1916 bool dnp =
GetDNP( &instance, variantName );
1930 if( aDimmed || dnp )
1933 borderColor = borderColor.
Mix( backgroundColor, 0.5f );
1936 if( aBackground && backgroundColor.
a > 0.0 )
1938 aPlotter->
SetColor( backgroundColor );
1956 std::vector<wxString> properties;
1962 properties.emplace_back( wxString::Format( wxT(
"!%s = %s" ),
1964 field.GetShownText(
FOR_GUI ) ) );
1972 sheetPin->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed || dnp );
1976 field.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed || dnp );
1986 margins.
x = std::max( margins.
x * 0.6, margins.
y * 0.3 );
1987 margins.
y = std::max( margins.
y * 0.6, margins.
x * 0.3 );
1996 strokeWidth,
nullptr );
2003 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
2004 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " ) +
GetClass() );
2006 if( &aItem !=
this )
2018 field.SetParent(
this );
2028 m_pins.back()->SetParent(
this );
2062 for(
int ii = (
int)
m_instances.size() - 1; ii >= 0; --ii )
2068 " page %s, from project %s.",
2096 if( instance.m_Path == aPath )
2119 if( instance.m_Path == aSheetPath )
2121 aInstance = instance;
2125 else if( instance.m_Path.EndsWith( aSheetPath ) )
2127 aInstance = instance;
2140 if( instance.m_Path == aSheetPath )
2152 if( instance.m_Path == aSheetPath )
2164 if( instance.m_Path.size() == 0 )
2176 if( instance.m_Path.size() == 0 )
2190 wxString pageNumber;
2194 if( instance.m_Path == aParentPath )
2196 pageNumber = instance.m_PageNumber;
2209 if( instance.m_Path == aPath )
2211 instance.m_PageNumber = aPageNumber;
2242 return a.GetName() == b.GetName() && a.GetText() == b.GetText();
2252 screen->SetContentModified();
2265 if( &aOther ==
this )
2272 std::vector<SCH_SHEET_INSTANCE> instances =
GetInstances();
2273 std::vector<SCH_SHEET_INSTANCE> otherInstances = aOther.
GetInstances();
2279 std::sort( instances.begin(), instances.end(),
2282 if( aLhs.m_Path > aRhs.m_Path )
2287 std::sort( otherInstances.begin(), otherInstances.end(),
2290 if( aLhs.m_Path > aRhs.m_Path )
2296 auto itThis = instances.begin();
2297 auto itOther = otherInstances.begin();
2299 while( itThis != instances.end() )
2301 if( itThis->m_Path == itOther->m_Path
2302 && itThis->m_PageNumber != itOther->m_PageNumber )
2317 if( aPageNumberA == aPageNumberB )
2322 bool isIntegerPageA = aPageNumberA.ToLong( &pageA );
2323 bool isIntegerPageB = aPageNumberB.ToLong( &pageB );
2325 if( isIntegerPageA && isIntegerPageB )
2334 if( isIntegerPageA )
2336 else if( isIntegerPageB )
2343 wxCHECK(
result != 0, 0 );
2388 for(
size_t i = 0; i <
GetFields().size(); ++i )
2397 for(
size_t ii = 0; ii <
GetPins().size(); ++ii )
2429 if( instance->
m_Variants.insert( std::make_pair( aVariant.
m_Name, aVariant ) ).second )
2439 if( !instance || !instance->
m_Variants.contains( aVariantName ) )
2449 const wxString& aFieldName )
2453 if( !instance || !instance->
m_Variants.contains( aVariantName ) )
2456 if( instance->
m_Variants[aVariantName].m_Fields.erase( aFieldName ) )
2466 if( aOldName == aNewName || !instance || !instance->
m_Variants.contains( aOldName ) )
2471 variant.
m_Name = aNewName;
2473 instance->
m_Variants.insert( std::make_pair( aNewName, variant ) );
2484 if( !instance || !instance->
m_Variants.contains( aSourceVariant ) )
2489 variant.
m_Name = aNewVariant;
2491 if( instance->
m_Variants.insert( std::make_pair( aNewVariant, variant ) ).second )
2499 bool* attribute = &( this->*aBase );
2501 if( aInstance && !aVariantName.IsEmpty() )
2505 wxCHECK_MSG( instance, ,
2506 wxString::Format( wxS(
"Cannot set attribute for invalid sheet path '%s'." ),
2509 auto variant = instance->
m_Variants.find( aVariantName );
2513 if( aEnable == this->*aBase )
2518 newVariant.*aOverride = aEnable;
2523 attribute = &( variant->second.*aOverride );
2526 if( *attribute == aEnable )
2529 *attribute = aEnable;
2542 if( !aInstance || aVariantName.IsEmpty() )
2550 if( instance.
m_Variants.contains( aVariantName ) )
2551 return instance.
m_Variants[aVariantName].m_DNP;
2579 if( !aInstance || aVariantName.IsEmpty() )
2587 if( instance.
m_Variants.contains( aVariantName ) )
2588 return instance.
m_Variants[aVariantName].m_ExcludedFromSim;
2616 if( !aInstance || aVariantName.IsEmpty() )
2624 if( instance.
m_Variants.contains( aVariantName ) )
2625 return instance.
m_Variants[aVariantName].m_ExcludedFromBOM;
2646void SCH_SHEET::Show(
int nestLevel, std::ostream& os )
const
2651 NestedSpace( nestLevel, os ) <<
'<' << s.Lower().mb_str() <<
">" <<
" sheet_name=\""
2656 sheetPin->Show( nestLevel + 1, os );
2658 NestedSpace( nestLevel, os ) <<
"</" << s.Lower().mb_str() <<
">\n" << std::flush;
2677 if( !aValue.GetAs( &value ) )
2685 return std::make_unique<VALIDATION_ERROR_MSG>( msg );
2705 const wxString groupAttributes =
_HKI(
"Attributes" );
KICOMMON_API types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
@ add_hierarchical_subsheet
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr const Vec GetEnd() const
constexpr coord_type GetY() const
constexpr size_type GetWidth() const
constexpr coord_type GetX() const
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr const Vec GetCenter() const
constexpr size_type GetHeight() const
constexpr coord_type GetLeft() const
constexpr const Vec & GetOrigin() const
constexpr coord_type GetRight() const
constexpr void SetEnd(coord_type x, coord_type y)
constexpr coord_type GetTop() const
constexpr coord_type GetBottom() const
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
std::vector< PROPERTY_BASE * > GetCustomPropertiesAsInspectables() const
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * GetParent() const
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
virtual VECTOR2I GetTextSize() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void SetTextPos(const VECTOR2I &aPoint)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
static wxString GotoPageHref(const wxString &aDestination)
Generate a href to a page in the current schematic.
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
EE_TYPE Overlapping(const BOX2I &aRect) const
Class that other classes need to inherit from, in order to be inspectable.
A color representation with 4 components: red, green, blue, alpha.
std::shared_ptr< wxString > m_text
COLOR4D & Desaturate()
Removes color (in HSL model)
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxString AsString() const
Base plotter engine class.
RENDER_SETTINGS * RenderSettings()
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width, int aCornerRadius=0)=0
virtual void HyperlinkBox(const BOX2I &aBox, const wxString &aDestinationURL)
Create a clickable hyperlink with a rectangular click area.
bool GetColorMode() const
virtual void ThickSegment(const VECTOR2I &start, const VECTOR2I &end, int width, void *aData)
virtual void HyperlinkMenu(const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
Create a clickable hyperlink menu with a rectangular click area.
virtual void SetColor(const COLOR4D &color)=0
Container for project specific data.
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
PROPERTY_BASE(const wxString &aName, PROPERTY_DISPLAY aDisplay=PT_DEFAULT, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType=ORIGIN_TRANSFORMS::NOT_A_COORD)
Used to generate unique IDs. Must come up front so it's initialized before ctor.
PROPERTY_BASE & SetGroup(const wxString &aGroup)
PROPERTY_BASE & SetValidator(PROPERTY_VALIDATOR_FN &&aValidator)
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
bool IsTopLevelSheet(const SCH_SHEET *aSheet) const
Check if a sheet is a top-level sheet (direct child of virtual root).
SCHEMATIC_SETTINGS & Settings() const
wxString GetCurrentVariant() const
Return the current variant being edited.
void GetContextualTextVars(wxArrayString *aVars) const
SCH_SHEET_PATH & CurrentSheet() const
Schematic editor (Eeschema) main window.
SCH_SHEET_PATH & GetCurrentSheet() const
virtual const wxString & GetText() const override
Return the string associated with the text object.
wxString GetUntranslatedName() const
Get the untranslated field name for storage, variable look-up, etc.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, const wxString &aVariantName=wxEmptyString, int aDepth=0) const
void SetText(const wxString &aText) override
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Base class for any item which can be embedded within the SCHEMATIC container class,...
void SetLocked(bool aLocked) override
SCH_ITEM & operator=(const SCH_ITEM &aPin)
SCH_SCREEN * GetParentScreen() const
void invalidateConnectivity(KICAD_T aChangedType=TYPE_NOT_INIT)
Bump the parent screen's connectivity revision when this item, or the item owning it as a child,...
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
bool IsLocked() const override
void SetFieldsAutoplaced(AUTOPLACE_ALGO aAlgo)
AUTOPLACE_ALGO m_fieldsAutoplaced
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
AUTOPLACE_ALGO GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
wxString ResolveText(const wxString &aText, const SCH_SHEET_PATH *aPath, int aDepth=0) const
wxString GetClass() const override
Return the class name.
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
bool m_OverrideItemColors
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
const wxString & GetFileName() const
size_t BaseHash() const override
Return type-id of the Base class.
SCH_SHEET_FIELD_PROPERTY(const wxString &aName)
wxAny getter(const void *obj) const override
void setter(void *obj, wxAny &v) override
size_t OwnerHash() const override
Return type-id of the Owner class.
size_t TypeHash() const override
Return type-id of the property type.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool GetExcludedFromBOM() const
bool empty() const
Forwarded method from std::vector.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
wxString GetPageNumber() const
SCH_SHEET * at(size_t aIndex) const
Forwarded method from std::vector.
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false, bool aEscapeSheetNames=false) const
Return the sheet path in a human readable form made from the sheet names.
bool GetExcludedFromSim() const
bool GetExcludedFromBoard() const
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
size_t size() const
Forwarded method from std::vector.
void pop_back()
Forwarded method from std::vector.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Variant information for a schematic sheet.
void InitializeAttributes(const SCH_SHEET &aSheet)
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
bool HasPinIdentityChanges(const SCH_SHEET &aOther) const
void SetBorderColor(KIGFX::COLOR4D aColor)
wxString GetFieldText(const SCH_FIELD *aField, const wxString &aFieldName, const SCH_SHEET_PATH *aPath, const wxString &aVariantName) const
friend class SCH_SHEET_PIN
wxString GetRefSuffix(const SCH_SHEET_PATH &aParentPath) const
Return this sheet's own reference suffix with text variables resolved.
void ClearVariantField(const KIID_PATH &aPath, const wxString &aVariantName, const wxString &aFieldName)
void SetFileName(const wxString &aFilename)
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
wxString GetFileName() const
Return the filename corresponding to this sheet.
void SetFieldText(SCH_FIELD *aField, const wxString &aFieldName, const wxString &aFieldText, const SCH_SHEET_PATH *aPath, const wxString &aVariantName)
bool getInstance(SCH_SHEET_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetExcludedFromSim(bool aExcludeFromSim, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear the exclude from simulation flag.
void CopyVariant(const KIID_PATH &aPath, const wxString &aSourceVariant, const wxString &aNewVariant)
void SetSize(const VECTOR2I &aSize)
void RemoveInstance(const KIID_PATH &aInstancePath)
void SetDNP(bool aDNP, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
bool addInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
bool HasRootInstance() const
Check to see if this sheet has a root sheet instance.
void SyncUuidToScreen()
Take the identity of the screen this sheet owns.
void setVariantAttribute(bool aEnable, const SCH_SHEET_PATH *aInstance, const wxString &aVariantName, bool SCH_SHEET::*aBase, bool SCH_SHEET_VARIANT::*aOverride)
wxString GetClass() const override
Return the class name.
wxString getPageNumber(const KIID_PATH &aParentPath) const
Return the sheet page number for aParentPath.
static wxString NextRefSuffix(const wxString &aSuffix, const std::set< wxString > &aInUse, const std::function< bool(const wxString &)> &aIsTaken=nullptr)
Return the suffix a pasted copy of a sheet should take.
void SetExcludedFromBOM(bool aExcludeFromBOM, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear the exclude from schematic bill of materials flag.
int GetPenWidth() const override
std::map< SCH_SHEET_PIN *, SCH_NO_CONNECT * > GetNoConnects() const
wxString GetFullRefSuffixProp() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool IsTopLevelSheet() const
Check if this sheet is a top-level sheet.
SCH_SHEET_PATH findSelf() const
Get the sheetpath of this sheet.
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
bool GetExcludedFromBoardProp() const
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
bool GetExcludedFromBOMProp() const
std::vector< SCH_FIELD > & GetFields()
Return a reference to the vector holding the sheet's fields.
KIGFX::COLOR4D m_borderColor
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
void renumberPins()
Renumber the sheet pins in the sheet.
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
bool HasHierarchyChanges(const SCH_SHEET &aOther) const
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
bool GetExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
bool operator<(const SCH_ITEM &aItem) const override
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
void SetPositionIgnoringPins(const VECTOR2I &aPosition)
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
bool GetExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
bool LocatePathOfScreen(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
Search the existing hierarchy for an instance of screen loaded from aFileName.
std::vector< SCH_SHEET_INSTANCE > m_instances
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
void SetPosition(const VECTOR2I &aPosition) override
void SetBackgroundColor(KIGFX::COLOR4D aColor)
int SymbolCount() const
Count our own symbols, without the power symbols.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
void SetDNPProp(bool aEnable)
void AddInstance(const SCH_SHEET_INSTANCE &aInstance)
int GetMinWidth(bool aFromLeft) const
Return the minimum width of the sheet based on the widths of the sheet pin text.
bool operator==(const SCH_ITEM &aOther) const override
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
std::vector< SCH_FIELD > m_fields
void RenameVariant(const KIID_PATH &aPath, const wxString &aOldName, const wxString &aNewName)
KIGFX::COLOR4D m_backgroundColor
void SetExcludedFromBoard(bool aExclude, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear exclude from board netlist flag.
void DeleteVariant(const KIID_PATH &aPath, const wxString &aVariantName)
SCH_SHEET(EDA_ITEM *aParent=nullptr, const VECTOR2I &aPos=VECTOR2I(0, 0), VECTOR2I aSize=VECTOR2I(schIUScale.MilsToIU(MIN_SHEET_WIDTH), schIUScale.MilsToIU(MIN_SHEET_HEIGHT)))
void SetName(const wxString &aName)
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this sheet.
SCH_SCREEN * GetScreen() const
void SetExcludedFromSimProp(bool aEnable)
VECTOR2I GetPosition() const override
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
bool HasPin(const wxString &aName) const
Check if the sheet already has a sheet pin named aName.
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compare page numbers of schematic sheets.
std::vector< PROPERTY_BASE * > GetDynamicProperties() const override
Return dynamically-computed properties specific to this object instance (e.g.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
wxString ResolveRefSuffix(const wxString &aText, const SCH_SHEET_PATH &aParentPath) const
Resolve aText as if it were this sheet's reference suffix, with the same rules as GetRefSuffix.
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
int CountActiveSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
bool HasPageNumberChanges(const SCH_SHEET &aOther) const
Check if the instance data of this sheet has any changes compared to aOther.
const SCH_SHEET_INSTANCE & GetRootInstance() const
Return the root sheet instance data.
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void SetDescendantsModified()
Flag every screen at or below this sheet as modified.
bool HasRefSuffixChanges(const SCH_SHEET &aOther) const
True when an edit may change the reference suffix this sheet adds to the paths below it.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
KIGFX::COLOR4D GetBorderColor() const
std::vector< SCH_SHEET_PIN * > m_pins
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
void SetBorderWidth(int aWidth)
std::map< wxString, std::unique_ptr< SCH_SHEET_FIELD_PROPERTY > > m_dynamicPropertyCache
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
SCH_FIELD * AddField(const SCH_FIELD &aField)
Add aFieldName to the list of fields.
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
bool IsVirtualRootSheet() const
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
int GetMinHeight(bool aFromTop) const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
bool GetDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
Set or clear the 'Do Not Populate' flags.
bool GetExcludedFromSimProp() const
void SetExcludedFromBoardProp(bool aExclude)
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
bool GetExcludedFromBoard(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
void Resize(const VECTOR2I &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
int GetBorderWidth() const
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.
std::vector< SCH_SHEET_PIN * > & GetPins()
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
void SetExcludedFromBOMProp(bool aEnable)
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
void AddVariant(const SCH_SHEET_PATH &aInstance, const SCH_SHEET_VARIANT &aVariant)
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
bool IsVerticalOrientation() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
KIGFX::COLOR4D GetBackgroundColor() const
bool IsPower() const override
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
std::map< wxString, wxString > m_Fields
void FinalizeTextVarExpansion(wxString &aText, RESOLUTION_CONTEXT aContext)
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, RESOLUTION_CONTEXT aContext)
#define DEFAULT_LINE_WIDTH_MILS
The default line width in mils. (can be changed in preference menu)
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
static constexpr EDA_ANGLE ANGLE_270
@ FILLED_SHAPE
Fill with object color.
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
a few functions useful in geometry calculations.
int m_ResolveTextRecursionDepth
The number of recursions to resolve text variables.
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
KICOMMON_API int IndexFromAlphabetic(const wxString &aStr, const wxString &aAlphabet)
Attempt to convert a string to an integer, assuming it is an alphabetic string like "A",...
wxString KICOMMON_API AlphabeticFromIndex(size_t aN, const wxString &aAlphabet, bool aZeroBasedNonUnitCols)
Get an alphabetic string like A, B, ... Z, AA, AB, ... ZZ, AAA, ...
@ LAYER_SELECTION_SHADOWS
constexpr void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Message panel definition file.
bool BoxHitTest(const VECTOR2I &aHitPoint, const BOX2I &aHittee, int aAccuracy)
Perform a point-to-box hit test.
KICOMMON_API wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
KICOMMON_API wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
KICOMMON_API void PackColor(types::Color &aOutput, const KIGFX::COLOR4D &aInput)
KICOMMON_API int UnpackDistance(const types::Distance &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API KIGFX::COLOR4D UnpackColor(const types::Color &aInput)
KICOMMON_API void PackCustomProperties(google::protobuf::RepeatedPtrField< types::CustomProperty > *aOutput, const EDA_ITEM &aItem)
KICOMMON_API VECTOR2I UnpackVector2(const types::Vector2 &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void PackDistance(types::Distance &aOutput, int aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void PackVector2(types::Vector2 &aOutput, const VECTOR2I &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void UnpackCustomProperties(const google::protobuf::RepeatedPtrField< types::CustomProperty > &aInput, EDA_ITEM &aItem)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
#define TYPE_HASH(x)
Macro to generate unique identifier for a type.
#define NO_SETTER(owner, type)
Macro to define read-only fields (no setter method available)
@ PT_SIZE
Size expressed in distance units (mm/inch)
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names.
std::optional< std::unique_ptr< VALIDATION_ERROR > > VALIDATOR_RESULT
Null optional means validation succeeded.
const SCH_FIELD * FindField(const std::vector< SCH_FIELD > &aFields, FIELD_T aFieldId)
int NextFieldOrdinal(const std::vector< SCH_FIELD > &aFields)
int bumpToNextGrid(const int aVal, const int aDirection)
static struct SCH_SHEET_DESC _SCH_SHEET_DESC
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
SHEET_SIDE
Define the edge of the sheet that the sheet pin is positioned.
std::vector< FAB_LAYER_COLOR > dummy
int StrNumCmp(const wxString &aString1, const wxString &aString2, CMP_T aCaseSensitivity)
Compare two strings with alphanumerical content.
wxString UnescapeString(const wxString &aSource)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
bool m_PDFHierarchicalLinks
A simple container for sheet instance information.
std::map< wxString, SCH_SHEET_VARIANT > m_Variants
A list of sheet variants.
wxString GetDefaultFieldName(FIELD_T aFieldId, TRANSLATION aTranslation)
Return a default symbol field name for a mandatory field type.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ SHEET_REF_SUFFIX
Optional sheet field appended to the references of the sheet's symbols.
@ REFERENCE
Field Reference of part, i.e. "IC21".
wxString result
Test unit parsing edge cases and error handling.
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.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
wxString GetFieldValidationErrorMessage(FIELD_T aFieldId, const wxString &aValue)
Return the error message if aValue is invalid for aFieldId.
Custom text control validator definitions.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
static PIECE rect(double aLeft, double aTop, double aRight, double aBottom, bool aMixed=false)