54#include <magic_enum.hpp>
57#include <api/schematic/schematic_types.pb.h>
67static int TemplateIN_HN[] = { 6, 0, 0, -1, -1, -2, -1, -2, 1, -1, 1, 0, 0 };
68static int TemplateIN_HI[] = { 6, 0, 0, 1, 1, 2, 1, 2, -1, 1, -1, 0, 0 };
69static int TemplateIN_UP[] = { 6, 0, 0, 1, -1, 1, -2, -1, -2, -1, -1, 0, 0 };
70static int TemplateIN_BOTTOM[] = { 6, 0, 0, 1, 1, 1, 2, -1, 2, -1, 1, 0, 0 };
72static int TemplateOUT_HN[] = { 6, -2, 0, -1, 1, 0, 1, 0, -1, -1, -1, -2, 0 };
73static int TemplateOUT_HI[] = { 6, 2, 0, 1, -1, 0, -1, 0, 1, 1, 1, 2, 0 };
74static int TemplateOUT_UP[] = { 6, 0, -2, 1, -1, 1, 0, -1, 0, -1, -1, 0, -2 };
75static int TemplateOUT_BOTTOM[] = { 6, 0, 2, 1, 1, 1, 0, -1, 0, -1, 1, 0, 2 };
77static int TemplateUNSPC_HN[] = { 5, 0, -1, -2, -1, -2, 1, 0, 1, 0, -1 };
78static int TemplateUNSPC_HI[] = { 5, 0, -1, 2, -1, 2, 1, 0, 1, 0, -1 };
79static int TemplateUNSPC_UP[] = { 5, 1, 0, 1, -2, -1, -2, -1, 0, 1, 0 };
80static int TemplateUNSPC_BOTTOM[] = { 5, 1, 0, 1, 2, -1, 2, -1, 0, 1, 0 };
82static int TemplateBIDI_HN[] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 };
83static int TemplateBIDI_HI[] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 };
84static int TemplateBIDI_UP[] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 };
85static int TemplateBIDI_BOTTOM[] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 };
87static int Template3STATE_HN[] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 };
88static int Template3STATE_HI[] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 };
89static int Template3STATE_UP[] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 };
90static int Template3STATE_BOTTOM[] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 };
108 default:
return wxT(
"???" );
163 return ( ( (
int)
m_spin - (
int) aOther.
m_spin ) % 4 + 4 ) % 4;
196 field.SetParent(
this );
209 if( aFields.empty() )
231 field.SetParent(
this );
246 if( aName == wxT(
"Intersheetrefs" ) )
247 return _(
"Sheet References" );
248 else if( aName == wxT(
"Netclass" ) )
249 return _(
"Net Class" );
250 else if( aName.IsEmpty() && aUseDefaultName )
271 for(
KICAD_T scanType : aScanTypes )
279 wxCHECK_MSG( schematic,
false, wxT(
"No parent SCHEMATIC set for SCH_LABEL!" ) );
281 std::vector<SCH_ITEM*> publishedItems;
282 const std::vector<SCH_ITEM*>* connectedItems = &publishedItems;
288 publishedItems = connection->ConnectedItems();
299 connectedItems = &found->second;
302 const std::vector<SCH_ITEM*>& item_set = *connectedItems;
304 for(
KICAD_T scanType : aScanTypes )
308 for(
SCH_ITEM* connection : item_set )
310 if( connection->IsType( wireAndPinTypes ) )
317 for(
SCH_ITEM* connection : item_set )
319 if( connection->IsType( busTypes ) )
338 field.SetParent(
this );
366 static bool s_inUpdate =
false;
399 pin->SetLabelShape( aShape );
412 const wxString&
text =
pin->GetText();
428 if( other !=
pin && other->GetText() ==
text )
429 other->SetLabelShape( aShape );
527 field.Offset( aMoveVector );
542 field.SetTextPos( field.GetTextPos() + offset );
568 if( ( aLeftRight && field.GetTextAngle().IsHorizontal() )
569 || ( !aLeftRight && field.GetTextAngle().IsVertical() ) )
585 field.SetTextPos( pos );
598 field.FlipHJustify();
604 field.SetPosition( pos );
617 field.FlipHJustify();
623 field.SetPosition( pos );
658 for(
size_t ii = 0; ii <
m_fields.size(); ++ii )
680 if(
typeid( *
this ) !=
typeid( aOther ) )
689 for(
size_t ii = 0; ii <
m_fields.size(); ++ii )
699 similarity *= std::pow( 0.9, diff );
726 offset.
x = -( labelLen + margin );
728 offset.
y = accumulated + field.GetTextHeight() / 2;
737 offset.
y = -( labelLen + margin );
739 offset.
x = accumulated + field.GetTextHeight() / 2;
748 offset.
x = labelLen + margin;
750 offset.
y = accumulated + field.GetTextHeight() / 2;
759 offset.
y = labelLen + margin;
761 offset.
x = accumulated + field.GetTextHeight() / 2;
769 accumulated += field.GetTextHeight() + margin;
789 std::vector<int> pageListCopy;
791 pageListCopy.insert( pageListCopy.end(), it->second.begin(), it->second.end() );
793 if( !
Schematic()->Settings().m_IntersheetRefsListOwnPage )
795 int currentPage =
path.GetVirtualPageNumber();
796 std::erase( pageListCopy, currentPage );
798 if( pageListCopy.empty() )
802 std::sort( pageListCopy.begin(), pageListCopy.end() );
807 for(
int pageNum : pageListCopy )
808 pages->push_back( { sheetPages[pageNum], sheetNames[pageNum] } );
818 if( field.IsMandatory() )
819 aVars->push_back( field.GetUntranslatedName().Upper() );
821 aVars->push_back( field.GetName() );
824 aVars->push_back( wxT(
"OP" ) );
825 aVars->push_back( wxT(
"CONNECTION_TYPE" ) );
826 aVars->push_back( wxT(
"SHORT_NET_NAME" ) );
827 aVars->push_back( wxT(
"NET_NAME" ) );
828 aVars->push_back( wxT(
"NET_CLASS" ) );
836 thread_local wxRegEx operatingPoint( wxT(
"^"
838 "(.([0-9])?([a-zA-Z]*))?"
841 wxCHECK( aPath,
false );
851 && ( operatingPoint.Matches( *token ) || token->IsSameAs( wxS(
"NET_NAME" ) )
852 || token->IsSameAs( wxS(
"SHORT_NET_NAME" ) ) || token->IsSameAs( wxS(
"NET_CLASS" ) )
854 && ( token->IsSameAs( wxS(
"EXCLUDE_FROM_BOM" ) )
855 || token->IsSameAs( wxS(
"EXCLUDE_FROM_BOARD" ) )
856 || token->IsSameAs( wxS(
"EXCLUDE_FROM_SIM" ) ) || token->IsSameAs( wxS(
"DNP" ) ) ) ) ) )
862 if( operatingPoint.Matches( *token ) )
865 wxString precisionStr( operatingPoint.GetMatch( *token, 2 ) );
866 wxString range( operatingPoint.GetMatch( *token, 3 ) );
868 if( !precisionStr.IsEmpty() )
869 precision = precisionStr[0] -
'0';
871 if( range.IsEmpty() )
880 if( token->Contains(
':' ) )
887 && token->IsSameAs( wxT(
"CONNECTION_TYPE" ) ) )
893 else if( token->IsSameAs( wxT(
"SHORT_NET_NAME" ) ) )
899 else if( token->IsSameAs( wxT(
"NET_NAME" ) ) )
905 else if( token->IsSameAs( wxT(
"NET_CLASS" ) ) )
914 *token = wxEmptyString;
918 if( ruleArea->GetExcludedFromBOM( aPath, variant ) )
919 *token = wxS(
"Excluded from BOM" );
927 *token = wxEmptyString;
931 if( ruleArea->GetExcludedFromBoard( aPath, variant ) )
932 *token = wxS(
"Excluded from board" );
940 *token = wxEmptyString;
944 if( ruleArea->GetExcludedFromSim( aPath, variant ) )
945 *token = wxS(
"Excluded from simulation" );
953 *token = wxEmptyString;
957 if( ruleArea->GetDNP( aPath, variant ) )
958 *token = wxS(
"DNP" );
966 if( token->IsSameAs( field.GetName() ) )
968 *token = field.GetShownText( aPath,
INTERNAL, variant, aDepth + 1 );
985 if(
path.Last() != sheet )
986 path.push_back( sheet );
1020 : std::vector<TEXT_VAR_REF_KEY>();
1040 std::function<bool( wxString* )> textResolver =
1041 [&]( wxString* token ) ->
bool
1061 aFunction( &field );
1092 if(
IsType( aScanTypes ) )
1098 for(
KICAD_T scanType : aScanTypes )
1117 aItemList.push_back( item );
1153 std::vector<VECTOR2I> pts;
1174 if( field.IsVisible() && field.GetText() != wxEmptyString )
1176 BOX2I fieldBBox = field.GetBoundingBox();
1181 box.
Merge( fieldBBox );
1201 if( field.IsVisible() )
1203 BOX2I fieldBBox = field.GetBoundingBox();
1204 fieldBBox.
Inflate( aAccuracy );
1209 if( fieldBBox.
Contains( aPosition ) )
1235 if( field.IsVisible() )
1237 BOX2I fieldBBox = field.GetBoundingBox();
1265 if( field.IsVisible() )
1267 BOX2I fieldBBox = field.GetBoundingBox();
1283 std::vector<DANGLING_END_ITEM>& aItemListByPos,
const SCH_SHEET_PATH* aPath )
1287 bool pinOrNoConnect =
false;
1292 it < aItemListByPos.end() && it->GetPosition() == text_pos; it++ )
1303 pinOrNoConnect =
true;
1318 if( pinOrNoConnect )
1324 if( !pinOrNoConnect )
1327 it < aItemListByType.end() && it->GetType() ==
BUS_END; it++ )
1346 sch_item->AddConnectionTo( *aPath,
this );
1355 it < aItemListByType.end() && it->GetType() ==
WIRE_END; it++ )
1374 sch_item->AddConnectionTo( *aPath,
this );
1398 wxCHECK( label,
false );
1406 std::vector<wxString> netclasses;
1407 std::vector<wxString> otherNetclasses;
1411 if( field.GetUntranslatedName() == wxT(
"Netclass" ) )
1412 netclasses.push_back( field.GetText() );
1418 otherNetclasses.push_back( field.
GetText() );
1421 return netclasses != otherNetclasses;
1446 aList.emplace_back(
_(
"Font" ),
GetFont() ?
GetFont()->GetName() :
_(
"Default" ) );
1448 wxString textStyle[] = {
_(
"Normal" ),
_(
"Italic" ),
_(
"Bold" ),
_(
"Bold Italic" ) };
1450 aList.emplace_back(
_(
"Style" ), textStyle[style] );
1460 default: msg = wxT(
"???" );
break;
1463 aList.emplace_back(
_(
"Justification" ), msg );
1471 int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
1473 static std::vector<VECTOR2I> s_poly;
1494 color = color.
Mix( bg, 0.5f );
1531 shapeColor = shapeColor.
Mix( bg, 0.5f );
1539 aPlotter->
MoveTo( s_poly[0] );
1540 aPlotter->
LineTo( s_poly[1] );
1543 int diameter = ( s_poly[2] - s_poly[1] ).EuclideanNorm() * 2;
1544 aPlotter->
FilledCircle( s_poly[2], diameter,
nullptr );
1548 aPlotter->
MoveTo( s_poly[0] );
1549 aPlotter->
LineTo( s_poly[1] );
1552 int diameter = ( s_poly[2] - s_poly[1] ).EuclideanNorm() * 2;
1553 aPlotter->
ThickCircle( s_poly[2], diameter, penWidth,
nullptr );
1557 if( !s_poly.empty() )
1562 bool linkAlreadyPlotted =
false;
1569 if( sheet->
size() >= 2 )
1574 linkAlreadyPlotted =
true;
1581 path.push_back( parent );
1583 linkAlreadyPlotted =
true;
1590 std::vector<wxString> properties;
1594 properties.emplace_back( wxString::Format( wxT(
"!%s = %s" ),
_(
"Net" ), *netName ) );
1596 properties.emplace_back( wxString::Format( wxT(
"!%s = %s" ),
_(
"Resolved netclass" ),
1602 properties.emplace_back( wxString::Format( wxT(
"!%s = %s" ),
1604 field.GetShownText(
FOR_GUI ) ) );
1607 if( !properties.empty() )
1616 field.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
1641template<
typename LabelProto>
1648 aOutput.set_locked( aLabel.
IsLocked() ? kiapi::common::types::LockedState::LS_LOCKED
1649 : kiapi::common::types::LockedState::LS_UNLOCKED );
1651 aLabel.EDA_TEXT::Serialize( *aOutput.mutable_text(),
schIUScale );
1657 if( field.IsMandatory() )
1660 field.Serialize( *aOutput.add_fields(),
schIUScale );
1665template<
typename LabelProto>
1674 screen->BumpConnectivityRevision();
1676 const_cast<KIID&
>( aLabel.
m_Uuid ) =
KIID( aInput.id().value() );
1677 aLabel.
SetLocked( aInput.locked() == kiapi::common::types::LockedState::LS_LOCKED );
1679 if( !aLabel.EDA_TEXT::Deserialize( aInput.text(),
schIUScale ) )
1691 switch( aLabel.
Type() )
1703 for(
const types::SchematicField& field : aInput.fields() )
1708 switch( aLabel.
Type() )
1711 if( wxString::FromUTF8( field.name() ) == intersheetRefsName )
1731 kiapi::schematic::types::LocalLabel label;
1736 aContainer.PackFrom( label );
1742 kiapi::schematic::types::LocalLabel label;
1744 if( !aContainer.UnpackTo( &label ) )
1828 ruleArea->RemoveDirective(
this );
1834 kiapi::schematic::types::DirectiveLabel label;
1842 aContainer.PackFrom( label );
1848 kiapi::schematic::types::DirectiveLabel label;
1850 if( !aContainer.UnpackTo( &label ) )
1860 if( label.has_pin_length() )
1863 if( label.has_symbol_size() )
1872 if( !SCH_LABEL_BASE::operator==( aOther ) )
1904 if( ( aLeftRight && field.GetTextAngle().IsHorizontal() )
1905 || ( !aLeftRight && field.GetTextAngle().IsVertical() ) )
1921 field.SetTextPos( pos );
1949 field.SetPosition( pos );
1971 field.SetPosition( pos );
1989 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
2000 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
2006 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
2010 symbolSize =
KiROUND( symbolSize * 0.8 );
2012 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
2019 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
2052 margin =
KiROUND( margin * 1.5 );
2058 if( field.GetText() == wxEmptyString )
2066 offset = { symbolWidth + margin, origin };
2071 offset = { -origin, -( symbolWidth + margin ) };
2076 offset = { symbolWidth + margin, -origin };
2081 offset = { origin, -( symbolWidth + margin ) };
2088 origin -= field.GetTextHeight() + margin;
2100 return _(
"Directive Label" );
2107 if( content.IsEmpty() )
2146 bool success =
true;
2150 if( field.GetUntranslatedName() == wxT(
"Netclass" )
2151 || field.GetUntranslatedName() == wxT(
"Component Class" ) )
2153 wxString
text = field.GetText();
2156 field.SetText(
text );
2177 m_fields.back().SetText( wxT(
"${INTERSHEET_REFS}" ) );
2178 m_fields.back().SetVisible(
false );
2194 types::GlobalLabel label;
2196 label.mutable_id()->set_value(
m_Uuid.AsStdString() );
2198 label.set_locked(
IsLocked() ? kiapi::common::types::LockedState::LS_LOCKED
2199 : kiapi::common::types::LockedState::LS_UNLOCKED );
2209 if( field.IsMandatory() )
2212 field.Serialize( *label.add_fields(),
schIUScale );
2216 field->Serialize( *label.mutable_intersheet_refs_field(),
schIUScale );
2219 aContainer.PackFrom( label );
2225 kiapi::schematic::types::GlobalLabel label;
2227 if( !aContainer.UnpackTo( &label ) )
2238 if( label.has_intersheet_refs_field() )
2250 m_fields.emplace_back(
this, aFieldType );
2301 wxCHECK( aPath,
false );
2308 if( token->IsSameAs( wxT(
"INTERSHEET_REFS" ) ) )
2311 std::map<wxString, std::set<int>>& pageRefs =
schematic->GetPageRefsMap();
2313 auto it = pageRefs.end();
2320 if( it == pageRefs.end() )
2326 std::vector<int> pageListCopy;
2328 pageListCopy.insert( pageListCopy.end(), it->second.begin(), it->second.end() );
2329 std::sort( pageListCopy.begin(), pageListCopy.end() );
2334 std::erase( pageListCopy, currentPage );
2337 std::map<int, wxString> sheetPages =
schematic->GetVirtualPageToSheetPagesMap();
2341 ref.Append( wxString::Format( wxT(
"%s..%s" ),
2342 sheetPages[pageListCopy.front()],
2343 sheetPages[pageListCopy.back()] ) );
2347 for(
const int& pageNo : pageListCopy )
2348 ref.Append( wxString::Format( wxT(
"%s," ), sheetPages[pageNo] ) );
2350 if( !ref.IsEmpty() && ref.Last() ==
',' )
2378 int x = symb_len + linewidth + 3;
2379 int y = halfSize + linewidth + 3;
2384 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
2385 aPoints.emplace_back(
VECTOR2I( 0, -y ) );
2386 aPoints.emplace_back(
VECTOR2I( -x, -y ) );
2387 aPoints.emplace_back(
VECTOR2I( -x, 0 ) );
2388 aPoints.emplace_back(
VECTOR2I( -x, y ) );
2389 aPoints.emplace_back(
VECTOR2I( 0, y ) );
2396 x_offset = -halfSize;
2397 aPoints[0].x += halfSize;
2404 x_offset = -halfSize;
2405 aPoints[0].x += halfSize;
2406 aPoints[3].x -= halfSize;
2416 aPoint.x += x_offset;
2430 aPoints.push_back( aPoints[0] );
2458 kiapi::schematic::types::HierarchicalLabel label;
2464 aContainer.PackFrom( label );
2470 kiapi::schematic::types::HierarchicalLabel label;
2472 if( !aContainer.UnpackTo( &label ) )
2505 int imax = *Template;
2510 for(
int ii = 0; ii < imax; ii++ )
2513 corner.
x = ( halfSize * ( *Template ) ) + aPos.
x;
2516 corner.
y = ( halfSize * ( *Template ) ) + aPos.
y;
2519 aPoints.push_back( corner );
2617 wxSize sz( 320, 320 );
2619 dlg->SetMinSize( dlg->ConvertDialogToPixels( sz ) );
2637 if( labelShapeEnum.Choices().GetCount() == 0 )
2668 auto hasLabelShape = [](
INSPECTABLE* aItem ) ->
bool
2691 if( flagShapeEnum.Choices().GetCount() == 0 )
KICOMMON_API types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
KICOMMON_API KICAD_T FromProtoEnum(types::KiCadObjectType aValue)
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
constexpr int GetSizeMax() const
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 void SetOrigin(const Vec &pos)
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr size_type GetWidth() const
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr bool Contains(const Vec &aPoint) const
constexpr const Vec & GetOrigin() const
constexpr void SetEnd(coord_type x, coord_type y)
constexpr void Offset(coord_type dx, coord_type dy)
constexpr bool Intersects(const BOX2< Vec > &aRect) const
static const COLOR4D WHITE
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
static std::vector< DANGLING_END_ITEM >::iterator get_lower_type(std::vector< DANGLING_END_ITEM > &aItemListByType, const DANGLING_END_T &aType)
static std::vector< DANGLING_END_ITEM >::iterator get_lower_pos(std::vector< DANGLING_END_ITEM > &aItemListByPos, const VECTOR2I &aPos)
Helper class used to store the state of schematic items that can be connected to other schematic item...
DANGLING_END_T GetType() const
EDA_ITEM * GetItem() const
VECTOR2I GetPosition() const
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
EDA_ITEM * GetParent() const
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM * m_parent
Owner.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
virtual VECTOR2I GetTextSize() const
COLOR4D GetTextColor() const
virtual VECTOR2I GetTextPos() const
const std::vector< TEXT_VAR_REF_KEY > & GetTextVarReferences() const
Return the set of ${...} references extracted from the source text.
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void SetTextPos(const VECTOR2I &aPoint)
virtual void SetTextX(int aX)
virtual int GetTextHeight() const
KIFONT::FONT * GetFont() const
virtual void SetTextY(int aY)
BOX2I GetTextBox(const RENDER_SETTINGS *aSettings, int aLine=-1) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
virtual wxString GetShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const
Return the string actually shown after processing of the base text.
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
virtual int GetTextWidth() const
GR_TEXT_H_ALIGN_T GetHorizJustify() const
bool Replace(const EDA_SEARCH_DATA &aSearchData)
Helper function used in search and replace dialog.
bool HasTextVars() const
Indicates the ShownText has text var references which need to be processed.
static wxString GotoPageHref(const wxString &aDestination)
Generate a href to a page in the current schematic.
virtual void cacheShownText()
virtual EDA_ANGLE GetTextAngle() const
const TEXT_ATTRIBUTES & GetAttributes() const
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetMultilineAllowed(bool aAllow)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
EE_TYPE OfType(KICAD_T aType) const
static ENUM_MAP< T > & Instance()
void SetDialogSizeInDU(int aWidth, int aHeight)
Set the dialog size, using a "logical" value.
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
void ShowModeless()
Show a modeless version of the dialog (without an OK button).
Class that other classes need to inherit from, in order to be inspectable.
FONT is an abstract base class for both outline and stroke fonts.
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.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
int GetMinPenWidth() 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.
std::string AsStdString() const
const wxString GetName() const
Gets the name of this (maybe aggregate) netclass in a format for internal usage or for export to exte...
COLOR4D GetSchematicColor(bool aIsForSave=false) const
Base plotter engine class.
virtual void FilledCircle(const VECTOR2I &pos, int diametre, void *aData)
void MoveTo(const VECTOR2I &pos)
RENDER_SETTINGS * RenderSettings()
virtual void Bookmark(const BOX2I &aBox, const wxString &aName, const wxString &aGroupName=wxEmptyString)
Create a bookmark to a symbol.
virtual void HyperlinkBox(const BOX2I &aBox, const wxString &aDestinationURL)
Create a clickable hyperlink with a rectangular click area.
bool GetColorMode() const
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
void LineTo(const VECTOR2I &pos)
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont=nullptr, const KIFONT::METRICS &aFontMetrics=KIFONT::METRICS::Default(), void *aData=nullptr)
virtual void PlotPoly(const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth, void *aData)=0
Draw a polygon ( filled or not ).
virtual void HyperlinkMenu(const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
Create a clickable hyperlink menu with a rectangular click area.
virtual void ThickCircle(const VECTOR2I &pos, int diametre, int width, void *aData)
virtual void SetColor(const COLOR4D &color)=0
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
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()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
These are loaded from Eeschema settings but then overwritten by the project settings.
wxString m_IntersheetRefsPrefix
wxString m_IntersheetRefsSuffix
bool m_IntersheetRefsFormatShort
bool m_IntersheetRefsListOwnPage
Holds all the data relating to one schematic.
wxString GetOperatingPoint(const wxString &aNetName, int aPrecision, const wxString &aRange)
SCHEMATIC_SETTINGS & Settings() const
std::map< wxString, std::set< int > > & GetPageRefsMap()
SCH_CONNECTIVITY::FACADE & Connectivity() const
wxString GetCurrentVariant() const
Return the current variant being edited.
std::map< int, wxString > GetVirtualPageToSheetPagesMap() const
std::map< int, wxString > GetVirtualPageToSheetNamesMap() const
SCH_SHEET_PATH & CurrentSheet() const
bool ResolveCrossReference(wxString *token, int aDepth) const
Resolves text vars that refer to other items.
std::optional< ITEM_VIEW > Connection(const KIID &aItem, const KIID_PATH &aPath) const
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void MirrorSpinStyle(bool aLeftRight) override
void RemoveConnectedRuleArea(SCH_RULE_AREA *aRuleArea)
Removes a specific rule area from the cache.
void ClearConnectedRuleAreas()
Removes all rule areas from the cache.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
SCH_DIRECTIVE_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0))
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
FLAG_SHAPE GetFlagShape() const
int GetPenWidth() const override
std::unordered_set< SCH_RULE_AREA * > m_connected_rule_areas
Cache of any rule areas with borders which this label connects to.
~SCH_DIRECTIVE_LABEL() override
bool operator==(const SCH_ITEM &aOther) const override
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void SetPinLength(int aLength)
virtual bool IsDangling() const override
Determines dangling state from connectivity and cached connected rule areas.
void AddConnectedRuleArea(SCH_RULE_AREA *aRuleArea)
Adds an entry to the connected rule area cache.
void SetFlagShape(FLAG_SHAPE aShape)
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
bool IncrementLabel(int aIncrement) override
Increment the netclass and component class labels if possible.
const std::unordered_set< SCH_RULE_AREA * > GetConnectedRuleAreas() const
Schematic editor (Eeschema) main window.
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
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this label.
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
void CreateGraphicShape(const RENDER_SETTINGS *aRenderSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const override
Resolve any references to system tokens supported by the label.
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...
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
SCH_GLOBALLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
const BOX2I GetBodyBoundingBox(const RENDER_SETTINGS *aSettings) const override
Return the bounding box of the label only, without taking in account its fields.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
SCH_HIERLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
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...
virtual bool IsConnectable() const
void SetLocked(bool aLocked) override
bool MatchesNetName(const EDA_SEARCH_DATA &aSearchData, const SCH_SHEET_PATH *aSheet) const
Match aSearchData against the connection of this item on aSheet.
SCH_ITEM & operator=(const SCH_ITEM &aPin)
std::map< SCH_SHEET_PATH, std::vector< SCH_ITEM * >, SHEET_PATH_CMP > m_connected_items
Store pointers to other items that are connected to this one, per sheet.
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,...
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
bool IsLocked() const override
void AddConnectionTo(const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
Add a connection link between this item and another.
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
void SetFieldsAutoplaced(AUTOPLACE_ALGO aAlgo)
bool IsConnectivityDirty() const
std::optional< wxString > GetConnectionName(const SCH_SHEET_PATH *aSheet=nullptr, bool aLocal=false, bool aIgnoreSheet=false) const
Return the active connection name; absent for missing or stale published rows.
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
const KIFONT::METRICS & GetFontMetrics() const
bool HasBusConnection(const SCH_SHEET_PATH *aSheet=nullptr) const
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
bool operator==(const SCH_ITEM &aItem) const override
const wxString & GetCachedDriverName() const override
SCH_LABEL_BASE(const VECTOR2I &aPos, const wxString &aText, KICAD_T aType)
COLOR4D m_lastResolvedColor
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
void AddFields(const std::vector< SCH_FIELD > &aFields)
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
void AddField(const SCH_FIELD &aField)
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
bool HasCachedDriverName() const override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
bool AutoRotateOnPlacement() const
autoRotateOnPlacement
SCH_LABEL_BASE & operator=(const SCH_LABEL_BASE &aLabel)
std::vector< SCH_FIELD > m_fields
CONNECTION_TYPE m_connectionType
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this label.
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 SetLabelShape(LABEL_SHAPE aShape)
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
SPIN_STYLE GetSpinStyle() const
void GetIntersheetRefs(const SCH_SHEET_PATH *aPath, std::vector< std::pair< wxString, wxString > > *pages)
Build an array of { pageNumber, pageName } pairs.
void MirrorSpinStyle(bool aLeftRight) override
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
COLOR4D GetLabelColor() const
void SetShape(LABEL_FLAG_SHAPE aShape)
LABEL_FLAG_SHAPE GetShape() const
const BOX2I GetBoundingBox() const override
Return the bounding box of the label including its fields.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void SetPosition(const VECTOR2I &aPosition) override
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
virtual bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
LABEL_SHAPE GetLabelShape() const
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
bool m_autoRotateOnPlacement
wxString m_cached_driver_name
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
int GetLabelBoxExpansion(const RENDER_SETTINGS *aSettings=nullptr) const
virtual bool IncrementLabel(int aIncrement)
Increment the label text if it ends with a number.
void SetAutoRotateOnPlacement(bool autoRotate=true)
void cacheShownText() override
void Rotate90(bool aClockwise) override
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.
static const wxString GetDefaultFieldName(const wxString &aName, bool aUseDefaultName)
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, int aDepth=0) const override
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
virtual const BOX2I GetBodyBoundingBox(const RENDER_SETTINGS *aSettings) const
Return the bounding box of the label only, without taking in account its fields.
virtual void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &Pos) const
Calculate the graphic shape (a polygon) associated to the text.
virtual int GetMandatoryFieldCount() const
std::vector< SCH_FIELD > & GetFields()
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.
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...
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
const BOX2I GetBodyBoundingBox(const RENDER_SETTINGS *aSettings) const override
Return the bounding box of the label only, without taking in account its fields.
SCH_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
size_t size() const
Forwarded method from std::vector.
int GetVirtualPageNumber() const
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_SCREEN * GetScreen() const
std::vector< SCH_SHEET_PIN * > & GetPins()
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const override
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
VECTOR2I GetPosition() const override
virtual void Rotate90(bool aClockwise)
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
int GetPenWidth() const override
virtual void MirrorSpinStyle(bool aLeftRight)
bool operator==(const SCH_ITEM &aItem) const override
int GetTextOffset(const RENDER_SETTINGS *aSettings=nullptr) const
SCH_TEXT(const VECTOR2I &aPos={ 0, 0 }, const wxString &aText=wxEmptyString, SCH_LAYER_ID aLayer=LAYER_NOTES, KICAD_T aType=SCH_TEXT_T)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Spin style for labels of all kinds on schematics.
SPIN_STYLE MirrorX()
Mirror the label spin style across the X axis or simply swaps up and bottom.
SPIN_STYLE MirrorY()
Mirror the label spin style across the Y axis or simply swaps left and right.
unsigned CCWRotationsTo(const SPIN_STYLE &aOther) const
Get CCW rotation needed to get to the given spin style.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
void FinalizeTextVarExpansion(wxString &aText, RESOLUTION_CONTEXT aContext)
wxString ResolveTextVars(const wxString &aSource, const std::function< bool(wxString *)> *aResolver, int &aDepth)
Multi-pass text variable expansion and math expression evaluation.
#define DEFAULT_LABEL_SIZE_RATIO
Ratio of the font height to space around global labels.
#define DANGLING_SYMBOL_SIZE
The size of the rectangle indicating an unconnected wire or label.
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
static constexpr EDA_ANGLE ANGLE_270
static constexpr EDA_ANGLE ANGLE_180
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
a few functions useful in geometry calculations.
KICOMMON_API bool IncrementString(wxString &name, int aIncrement)
Generic string incrementer.
@ LAYER_SELECTION_SHADOWS
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
constexpr T MIRRORVAL(T aPoint, T aMirrorRef)
Returns 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.
std::optional< wxString > AppendConnectionInfo(const SCH_ITEM &aItem, std::vector< MSG_PANEL_ITEM > &aList, const SCH_SHEET_PATH *aPath=nullptr)
Append connection details; return its name for a signal, or no value for a bus/missing row.
KICOMMON_API int UnpackDistance(const types::Distance &aInput, const EDA_IU_SCALE &aScale)
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 ENUM_TO_WXANY(type)
@ PT_SIZE
Size expressed in distance units (mm/inch)
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names.
@ BUS
This item represents a bus vector.
@ NET
This item represents a net.
@ NONE
No connection to this item.
const SCH_FIELD * FindField(const std::vector< SCH_FIELD > &aFields, FIELD_T aFieldId)
int NextFieldOrdinal(const std::vector< SCH_FIELD > &aFields)
static int TemplateIN_HI[]
static int TemplateUNSPC_HI[]
static int TemplateOUT_HN[]
static int Template3STATE_HN[]
static int TemplateBIDI_HN[]
static int * TemplateShape[5][4]
static int TemplateIN_HN[]
static int TemplateIN_BOTTOM[]
static int TemplateUNSPC_HN[]
static int Template3STATE_BOTTOM[]
bool unpackLabel(const LabelProto &aInput, SCH_LABEL_BASE &aLabel)
static int TemplateBIDI_BOTTOM[]
static struct SCH_LABEL_DESC _SCH_LABEL_DESC
static int Template3STATE_UP[]
static int TemplateOUT_UP[]
static int TemplateOUT_HI[]
static int TemplateUNSPC_UP[]
static int TemplateUNSPC_BOTTOM[]
static int TemplateOUT_BOTTOM[]
static int Template3STATE_HI[]
static int TemplateIN_UP[]
void packLabel(LabelProto &aOutput, const SCH_LABEL_BASE &aLabel)
wxString getElectricalTypeLabel(LABEL_FLAG_SHAPE aType)
static int TemplateBIDI_UP[]
static int TemplateBIDI_HI[]
static struct SCH_DIRECTIVE_LABEL_DESC _SCH_DIRECTIVE_LABEL_DESC
LABEL_FLAG_SHAPE
Label and flag shapes used with text objects.
LABEL_SHAPE
Specific enums for property manager (not used elsewhere)
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)
SCH_DIRECTIVE_LABEL_DESC()
bool m_PDFHierarchicalLinks
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...
@ USER
The field ID hasn't been set yet; field is invalid.
@ INTERSHEET_REFS
Global label cross-reference page numbers.
bool TestSegmentHit(const VECTOR2I &aRefPoint, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
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.
@ SCH_LABEL_LOCATE_WIRE_T
VECTOR2< int32_t > VECTOR2I