56 wxString outputFormat;
57 wxString outputNumber;
58 int ii =
name.Len() - 1;
61 while( ii >= 0 && !wxIsdigit(
name.GetChar( ii ) ) )
63 suffix =
name.GetChar( ii ) + suffix;
67 while( ii >= 0 && wxIsdigit(
name.GetChar( ii ) ) )
69 digits =
name.GetChar( ii ) + digits;
74 if( digits.IsEmpty() )
79 if( digits.ToLong( &number ) )
87 name.Remove( ii + 1 );
89 outputFormat.Printf( wxS(
"%%0%dld" ), dCount );
91 outputNumber.Printf( outputFormat, number );
92 name << outputNumber << suffix;
106static int TemplateIN_HN[] = { 6, 0, 0, -1, -1, -2, -1, -2, 1, -1, 1, 0, 0 };
107static int TemplateIN_HI[] = { 6, 0, 0, 1, 1, 2, 1, 2, -1, 1, -1, 0, 0 };
108static int TemplateIN_UP[] = { 6, 0, 0, 1, -1, 1, -2, -1, -2, -1, -1, 0, 0 };
109static int TemplateIN_BOTTOM[] = { 6, 0, 0, 1, 1, 1, 2, -1, 2, -1, 1, 0, 0 };
111static int TemplateOUT_HN[] = { 6, -2, 0, -1, 1, 0, 1, 0, -1, -1, -1, -2, 0 };
112static int TemplateOUT_HI[] = { 6, 2, 0, 1, -1, 0, -1, 0, 1, 1, 1, 2, 0 };
113static int TemplateOUT_UP[] = { 6, 0, -2, 1, -1, 1, 0, -1, 0, -1, -1, 0, -2 };
114static int TemplateOUT_BOTTOM[] = { 6, 0, 2, 1, 1, 1, 0, -1, 0, -1, 1, 0, 2 };
116static int TemplateUNSPC_HN[] = { 5, 0, -1, -2, -1, -2, 1, 0, 1, 0, -1 };
117static int TemplateUNSPC_HI[] = { 5, 0, -1, 2, -1, 2, 1, 0, 1, 0, -1 };
118static int TemplateUNSPC_UP[] = { 5, 1, 0, 1, -2, -1, -2, -1, 0, 1, 0 };
119static int TemplateUNSPC_BOTTOM[] = { 5, 1, 0, 1, 2, -1, 2, -1, 0, 1, 0 };
121static int TemplateBIDI_HN[] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 };
122static int TemplateBIDI_HI[] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 };
123static int TemplateBIDI_UP[] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 };
124static int TemplateBIDI_BOTTOM[] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 };
126static int Template3STATE_HN[] = { 5, 0, 0, -1, -1, -2, 0, -1, 1, 0, 0 };
127static int Template3STATE_HI[] = { 5, 0, 0, 1, -1, 2, 0, 1, 1, 0, 0 };
128static int Template3STATE_UP[] = { 5, 0, 0, -1, -1, 0, -2, 1, -1, 0, 0 };
129static int Template3STATE_BOTTOM[] = { 5, 0, 0, -1, 1, 0, 2, 1, 1, 0, 0 };
150 default:
return wxT(
"???" );
159 m_isDangling( true ),
169 m_shape( aLabel.m_shape ),
170 m_connectionType( aLabel.m_connectionType ),
171 m_isDangling( aLabel.m_isDangling ),
172 m_lastResolvedColor( aLabel.m_lastResolvedColor )
179 field.SetParent(
this );
185 if( aName == wxT(
"Intersheetrefs" ) )
186 return _(
"Sheet References" );
187 else if( aName == wxT(
"Netclass" ) )
188 return _(
"Net Class" );
189 else if( aName.IsEmpty() && aUseDefaultName )
201 for(
KICAD_T scanType : aScanTypes )
207 wxCHECK_MSG(
Schematic(),
false, wxT(
"No parent SCHEMATIC set for SCH_LABEL!" ) );
216 for(
KICAD_T scanType : aScanTypes )
220 for(
SCH_ITEM* connection : item_set )
222 if( connection->IsType( { SCH_ITEM_LOCATE_WIRE_T, SCH_PIN_T } ) )
229 for(
SCH_ITEM* connection : item_set )
231 if( connection->IsType( { SCH_ITEM_LOCATE_BUS_T } ) )
251 field.SetParent(
this );
305 field.SetTextPos( field.GetTextPos() + offset );
321 if( field.GetTextAngle().IsVertical()
329 else if( field.GetTextAngle().IsVertical()
337 else if( field.GetTextAngle().IsHorizontal()
345 else if( field.GetTextAngle().IsHorizontal()
356 field.SetTextPos( pos );
396 if( field.GetCanonicalName() == wxT(
"Intersheetrefs" ) )
397 offset.
x = - ( labelLen + margin );
399 offset.
y = accumulated + field.GetTextHeight() / 2;
407 if( field.GetCanonicalName() == wxT(
"Intersheetrefs" ) )
408 offset.
y = - ( labelLen + margin );
410 offset.
x = accumulated + field.GetTextHeight() / 2;
418 if( field.GetCanonicalName() == wxT(
"Intersheetrefs" ) )
419 offset.
x = labelLen + margin;
421 offset.
y = accumulated + field.GetTextHeight() / 2;
429 if( field.GetCanonicalName() == wxT(
"Intersheetrefs" ) )
430 offset.
y = labelLen + margin;
432 offset.
x = accumulated + field.GetTextHeight() / 2;
439 if( field.GetCanonicalName() != wxT(
"Intersheetrefs" ) )
440 accumulated += field.GetTextHeight() + margin;
455 if( it !=
Schematic()->GetPageRefsMap().end() )
457 std::vector<int> pageListCopy;
459 pageListCopy.insert( pageListCopy.end(), it->second.begin(), it->second.end() );
461 if( !
Schematic()->Settings().m_IntersheetRefsListOwnPage )
466 if( pageListCopy.empty() )
470 std::sort( pageListCopy.begin(), pageListCopy.end() );
475 for(
int pageNum : pageListCopy )
476 pages->push_back( { sheetPages[ pageNum ], sheetNames[ pageNum ] } );
485 aVars->push_back( field.GetCanonicalName().Upper() );
487 aVars->push_back( wxT(
"OP" ) );
488 aVars->push_back( wxT(
"CONNECTION_TYPE" ) );
489 aVars->push_back( wxT(
"SHORT_NET_NAME" ) );
490 aVars->push_back( wxT(
"NET_NAME" ) );
491 aVars->push_back( wxT(
"NET_CLASS" ) );
497 static wxRegEx operatingPoint( wxT(
"^"
499 "(.([0-9])?([a-zA-Z]*))?"
505 if( operatingPoint.Matches( *token ) )
508 wxString precisionStr( operatingPoint.GetMatch( *token, 2 ) );
509 wxString range( operatingPoint.GetMatch( *token, 3 ) );
511 if( !precisionStr.IsEmpty() )
512 precision = precisionStr[0] -
'0';
514 if( range.IsEmpty() )
526 if( token->Contains(
':' ) )
528 if(
Schematic()->ResolveCrossReference( token, aDepth + 1 ) )
533 && token->IsSameAs( wxT(
"CONNECTION_TYPE" ) ) )
539 else if( token->IsSameAs( wxT(
"SHORT_NET_NAME" ) ) )
542 *token = wxEmptyString;
549 else if( token->IsSameAs( wxT(
"NET_NAME" ) ) )
552 *token = wxEmptyString;
555 *token = connection->
Name();
559 else if( token->IsSameAs( wxT(
"NET_CLASS" ) ) )
562 *token = wxEmptyString;
572 if( token->IsSameAs( field.GetName() ) )
574 *token = field.GetShownText( aDepth + 1 );
590 if( sheet->ResolveTextVar( token, aDepth + 1 ) )
600 std::function<bool( wxString* )> textResolver =
601 [&]( wxString* token ) ->
bool
608 if(
text == wxS(
"~" ) )
646 const std::vector<KICAD_T>& aScanTypes )
648 if(
IsType( aScanTypes ) )
654 for(
KICAD_T scanType : aScanTypes )
673 aItemList.push_back( item );
714 std::vector<VECTOR2I> pts;
735 if( field.IsVisible() )
737 BOX2I fieldBBox = field.GetBoundingBox();
742 box.
Merge( fieldBBox );
762 if( field.IsVisible() )
764 BOX2I fieldBBox = field.GetBoundingBox();
765 fieldBBox.
Inflate( aAccuracy );
770 if( fieldBBox.
Contains( aPosition ) )
796 if( field.IsVisible() )
798 BOX2I fieldBBox = field.GetBoundingBox();
820 for(
unsigned ii = 0; ii < aItemList.size(); ii++ )
867 sch_item->AddConnectionTo( *aPath,
this );
909 aList.emplace_back(
_(
"Font" ),
GetFont() ?
GetFont()->GetName() :
_(
"Default" ) );
911 wxString textStyle[] = {
_(
"Normal" ),
_(
"Italic" ),
_(
"Bold" ),
_(
"Bold Italic" ) };
913 aList.emplace_back(
_(
"Style" ), textStyle[style] );
923 default: msg = wxT(
"???" );
break;
926 aList.emplace_back(
_(
"Justification" ), msg );
939 aList.emplace_back(
_(
"Resolved Netclass" ),
948 static std::vector<VECTOR2I> s_poly;
986 std::vector<wxString> properties;
990 properties.emplace_back(
993 properties.emplace_back(
wxString::Format( wxT(
"!%s = %s" ),
_(
"Resolved netclass" ),
999 properties.emplace_back(
1000 wxString::Format( wxT(
"!%s = %s" ), field.GetName(), field.GetShownText() ) );
1003 if( !properties.empty() )
1013 field.Plot( aPlotter, aBackground );
1019 static std::vector<VECTOR2I> s_poly;
1029 if( !blackAndWhiteMode &&
GetTextColor() != COLOR4D::UNSPECIFIED )
1036 if( !s_poly.empty() )
1040 field.Print( aSettings, aOffset );
1144 std::vector<VECTOR2I>& aPoints,
1154 symbolSize =
KiROUND( symbolSize * 0.7 );
1159 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
1169 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
1175 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
1179 symbolSize =
KiROUND( symbolSize * 0.8 );
1181 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
1188 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
1222 margin =
KiROUND( margin * 1.5 );
1233 offset = { symbolWidth + margin, origin };
1238 offset = { -origin, -( symbolWidth + margin ) };
1243 offset = { symbolWidth + margin, -origin };
1248 offset = { origin, -( symbolWidth + margin ) };
1255 origin -= field.GetTextHeight() + margin;
1266 return _(
"Directive Label" );
1287 m_fields[0].SetText( wxT(
"${INTERSHEET_REFS}" ) );
1345 if( ( aLeftRight && field.GetTextAngle().IsHorizontal() )
1346 || ( !aLeftRight && field.GetTextAngle().IsVertical() ) )
1362 field.SetTextPos( pos );
1374 switch( field.GetHorizJustify() )
1392 field.SetPosition( pos );
1408 field.SetPosition( pos );
1415 if( token->IsSameAs( wxT(
"INTERSHEET_REFS" ) ) &&
Schematic() )
1421 if( it ==
Schematic()->GetPageRefsMap().end() )
1427 std::vector<int> pageListCopy;
1429 pageListCopy.insert( pageListCopy.end(), it->second.begin(), it->second.end() );
1430 std::sort( pageListCopy.begin(), pageListCopy.end() );
1443 sheetPages[pageListCopy.front()],
1444 sheetPages[pageListCopy.back()] ) );
1448 for(
const int& pageNo : pageListCopy )
1451 if( !ref.IsEmpty() && ref.Last() ==
',' )
1477 std::vector<VECTOR2I>& aPoints,
1485 int x = symb_len + linewidth + 3;
1486 int y = halfSize + linewidth + 3;
1491 aPoints.emplace_back(
VECTOR2I( 0, 0 ) );
1492 aPoints.emplace_back(
VECTOR2I( 0, -y ) );
1493 aPoints.emplace_back(
VECTOR2I( -x, -y ) );
1494 aPoints.emplace_back(
VECTOR2I( -x, 0 ) );
1495 aPoints.emplace_back(
VECTOR2I( -x, y ) );
1496 aPoints.emplace_back(
VECTOR2I( 0, y ) );
1503 x_offset = -halfSize;
1504 aPoints[0].x += halfSize;
1508 aPoints[3].x -= halfSize;
1513 x_offset = -halfSize;
1514 aPoints[0].x += halfSize;
1515 aPoints[3].x -= halfSize;
1526 aPoint.x += x_offset;
1540 aPoints.push_back( aPoints[0] );
1573 std::vector<VECTOR2I>& aPoints,
const VECTOR2I& aPos )
const
1580 std::vector<VECTOR2I>& aPoints,
const VECTOR2I& aPos,
1585 int imax = *Template;
1590 for(
int ii = 0; ii < imax; ii++ )
1593 corner.
x = ( halfSize * (*Template) ) + aPos.
x;
1596 corner.
y = ( halfSize * (*Template) ) + aPos.
y;
1599 aPoints.push_back( corner );
1697 wxSize sz( 320, 320 );
1699 dlg->SetMinSize( dlg->ConvertDialogToPixels( sz ) );
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
void SetOrigin(const Vec &pos)
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
const Vec & GetOrigin() const
void Offset(coord_type dx, coord_type dy)
bool Intersects(const BOX2< Vec > &aRect) const
coord_type GetWidth() const
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
void SetEnd(coord_type x, coord_type y)
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
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.
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM * m_parent
Linked list: Link (parent struct)
int GetTextHeight() const
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,...
const VECTOR2I & GetTextPos() const
COLOR4D GetTextColor() const
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
void SetTextPos(const VECTOR2I &aPoint)
KIFONT::FONT * GetFont() const
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
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.
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 wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const
Return the string actually shown after processing of the base text.
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor, OUTLINE_MODE aDisplay_mode=FILLED)
Print this text object to the device context aDC.
void SetMultilineAllowed(bool aAllow)
VECTOR2I GetTextSize() const
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).
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false)
A color representation with 4 components: red, green, blue, alpha.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
int GetMinPenWidth() const
const wxString & GetDefaultFont() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
Store schematic specific render settings.
Base plotter engine class.
RENDER_SETTINGS * RenderSettings()
virtual void Bookmark(const BOX2I &aBox, const wxString &aName, const wxString &aGroupName=wxEmptyString)
Create a bookmark to a symbol.
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, void *aData=nullptr)
bool GetColorMode() const
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void PlotPoly(const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)=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.
These settings were stored in SCH_BASE_FRAME previously.
wxString m_IntersheetRefsPrefix
wxString m_IntersheetRefsSuffix
bool m_IntersheetRefsFormatShort
bool m_IntersheetRefsListOwnPage
SCH_SHEET_PATH & CurrentSheet() const override
wxString GetOperatingPoint(const wxString &aNetName, int aPrecision, const wxString &aRange)
SCHEMATIC_SETTINGS & Settings() const
std::map< wxString, std::set< int > > & GetPageRefsMap()
std::map< int, wxString > GetVirtualPageToSheetPagesMap() const
std::map< int, wxString > GetVirtualPageToSheetNamesMap() const
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
wxString LocalName() const
wxString Name(bool aIgnoreSheet=false) const
void AppendInfoToMsgPanel(std::vector< MSG_PANEL_ITEM > &aList) const
Adds information about the connection object to aList.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
SCH_DIRECTIVE_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0))
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.
int GetPenWidth() const override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Schematic editor (Eeschema) main window.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
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.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
bool ResolveTextVar(wxString *token, int aDepth) const override
Resolve any references to system tokens supported by the label.
void MirrorSpinStyle(bool aLeftRight) override
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...
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
SCH_GLOBALLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
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.
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...
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
void AddConnectionTo(const SCH_SHEET_PATH &aPath, SCH_ITEM *aItem)
Add a connection link between this item and another.
std::map< SCH_SHEET_PATH, SCH_ITEM_SET, SHEET_PATH_CMP > m_connected_items
Store pointers to other items that are connected to this one, per sheet.
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
void ClearFieldsAutoplaced()
FIELDS_AUTOPLACED m_fieldsAutoplaced
bool IsConnectivityDirty() const
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
SCH_LABEL_BASE(const VECTOR2I &aPos, const wxString &aText, KICAD_T aType)
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
COLOR4D m_lastResolvedColor
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.
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
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
std::vector< SCH_FIELD > m_fields
CONNECTION_TYPE m_connectionType
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void GetIntersheetRefs(std::vector< std::pair< wxString, wxString > > *pages)
Builds an array of { pageNumber, pageName } pairs.
virtual bool ResolveTextVar(wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
COLOR4D GetLabelColor() 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.
bool m_autoRotateOnPlacement
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &offset) override
Print a schematic item.
int GetLabelBoxExpansion(const RENDER_SETTINGS *aSettings=nullptr) const
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
void SetAutoRotateOnPlacement(bool autoRotate=true)
setAutoRotateOnPlacement
void Rotate90(bool aClockwise) override
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
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)
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
LABEL_FLAG_SHAPE GetShape() const override
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
virtual const BOX2I GetBodyBoundingBox() 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.
std::vector< SCH_FIELD > & GetFields()
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 Plot(PLOTTER *aPlotter, bool aBackground) const override
Plot the schematic item to aPlotter.
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 ...
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
SCH_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
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.
int GetVirtualPageNumber() const
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
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.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
TEXT_SPIN_STYLE GetTextSpinStyle() const
int GetPenWidth() const override
virtual void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
TEXT_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
virtual void MirrorSpinStyle(bool aLeftRight)
int GetTextOffset(const RENDER_SETTINGS *aSettings=nullptr) const
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
#define DEFAULT_LABEL_SIZE_RATIO
The offset of the pin name string from the end of the pin in mils.
#define DANGLING_SYMBOL_SIZE
< The size of the rectangle indicating an unconnected wire or label
static constexpr EDA_ANGLE & ANGLE_180
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
static constexpr EDA_ANGLE & ANGLE_VERTICAL
static constexpr EDA_ANGLE & ANGLE_90
const INSPECTOR_FUNC & INSPECTOR
void GRPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in drawing space.
bool GetGRForceBlackPenState(void)
@ LAYER_SELECTION_SHADOWS
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Message panel definition file.
wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
void delete_matching(_Container &__c, _Value __value)
Covers for the horrifically named std::remove and std::remove_if (neither of which remove anything).
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
@ BUS
This item represents a bus vector.
@ NET
This item represents a net.
@ NONE
No connection to this item.
std::vector< SCH_ITEM * > SCH_ITEM_SET
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]
bool IncrementLabelMember(wxString &name, int aIncrement)
static int TemplateIN_HN[]
static int TemplateIN_BOTTOM[]
static int TemplateUNSPC_HN[]
static int Template3STATE_BOTTOM[]
static int TemplateBIDI_BOTTOM[]
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[]
wxString getElectricalTypeLabel(LABEL_FLAG_SHAPE aType)
static int TemplateBIDI_UP[]
static int TemplateBIDI_HI[]
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)
constexpr int MilsToIU(int mils) const
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)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ SCH_LABEL_LOCATE_WIRE_T
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".