57 std::function<bool( wxString* )> pcbTextResolver =
58 [&]( wxString* token ) ->
bool 60 if( token->IsSameAs( wxT(
"LAYER" ) ) )
66 if( token->Contains(
':' ) )
69 wxString ref = token->BeforeFirst(
':', &remainder );
74 FOOTPRINT* refFP = static_cast<FOOTPRINT*>( refItem );
86 std::function<bool( wxString* )> boardTextResolver =
87 [&]( wxString* token ) ->
bool 92 bool processTextVars =
false;
95 if( board && processTextVars && aDepth < 10 )
116 aList.emplace_back(
_(
"Status" ),
_(
"locked" ) );
120 aList.emplace_back(
_(
"Mirror" ),
IsMirrored() ?
_(
"Yes" ) :
_(
"No" ) );
161 aFlipLeftRight = !aFlipLeftRight;
174 MIRROR( left, aCentre.x );
175 MIRROR( right, aCentre.x );
176 std::swap( left, right );
178 MIRROR( pos.x, aCentre.x );
183 MIRROR( bottom, aCentre.y );
184 std::swap( top, bottom );
186 MIRROR( pos.y, aCentre.y );
197 if( !aFlipLeftRight )
void SetMirrored(bool isMirrored)
BOARD_ITEM * GetItem(const KIID &aID) const
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
static PROPERTY_MANAGER & Instance()
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
PNG memory record (file in memory).
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
const EDA_RECT GetBoundingBoxRotated(wxPoint aRotCenter, double aAngle) const
Useful to calculate bounding box of rotated items, when rotation if not k*90 degrees.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Implementation of conversion functions that require both schematic and board internal units.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetTextAngle(double aAngle) override
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
EDA_RECT GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
void SetTextPos(const wxPoint &aPoint)
PROJECT * GetProject() const
const BITMAP_OPAQUE text_xpm[1]
double GetTextAngle() const
class PCB_TEXT, text on a layer
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.
void RotatePoint(int *pX, int *pY, double angle)
static struct TEXTE_PCB_DESC _TEXTE_PCB_DESC
int GetTextThickness() const
The base class for create windows for drawing purpose.
PCB_TEXT(BOARD_ITEM *parent)
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
int GetTextHeight() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
PCB specific render settings.
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
PCB_LAYER_ID
A quick note on layer IDs:
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void SetMultilineAllowed(bool aAllow)
class FOOTPRINT, a footprint
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
virtual bool IsLocked() const
double GetTextAngleDegrees() const
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape() const
Information pertinent to a Pcbnew printed circuit board.
wxString UnescapeString(const wxString &aSource)
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
Handle the component boundary box.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
A base class for most all the KiCad significant classes used in schematics and boards.
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
const wxPoint & GetTextPos() const
Provide class metadata.Helper macro to map type hashes to names.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
virtual void SetTextAngle(double aAngle)
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
T NormalizeAngle360Min(T Angle)
Normalize angle to be > -360.0 and < 360.0 Angle equal to -360 or +360 are set to 0.
bool ResolveTextVar(wxString *token, int aDepth) const
BOARD_ITEM_CONTAINER * GetParent() const
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual wxString GetShownText(int aDepth=0) const
Return the string actually shown after processing of the base text.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
KICAD_T Type() const
Returns the type of object.