82 wxPoint location = aPoint;
112 bool needsFlipped = newAngle >= 1800.0;
168 if( aMirrorAroundXAxis )
196 if( parentFootprint )
213 if( parentFootprint )
244 if( parentFootprint )
250 while( rotation > 900 )
253 while( rotation < 0 )
269 static const wxString text_type_msg[3] =
271 _(
"Reference" ),
_(
"Value" ),
_(
"Text" )
286 aList.emplace_back(
_(
"Type" ), text_type_msg[
m_Type] );
289 aList.emplace_back(
_(
"Status" ),
_(
"Locked" ) );
291 aList.emplace_back(
_(
"Display" ),
IsVisible() ?
_(
"Yes" ) :
_(
"No" ) );
296 aList.emplace_back(
_(
"Mirror" ),
IsMirrored() ?
_(
"Yes" ) :
_(
"No" ) );
299 aList.emplace_back(
_(
"Angle" ), msg );
302 aList.emplace_back(
_(
"Thickness" ), msg );
305 aList.emplace_back(
_(
"Width" ), msg );
308 aList.emplace_back(
_(
"Height" ), msg );
318 static_cast<FOOTPRINT*>(
GetParent() )->GetReference() );
323 static_cast<FOOTPRINT*>(
GetParent() )->GetReference() );
328 static_cast<FOOTPRINT*>(
GetParent() )->GetReference() );
370 constexpr
double HIDE = (double)std::numeric_limits<double>::max();
414 wxASSERT( parentFootprint );
417 std::function<bool( wxString* )> footprintResolver =
418 [&]( wxString* token ) ->
bool 420 return parentFootprint && parentFootprint->
ResolveTextVar( token, aDepth );
423 std::function<bool( wxString* )> boardTextResolver =
424 [&]( wxString* token ) ->
bool 435 if( parentFootprint && parentFootprint->
GetParent() )
436 project = static_cast<BOARD*>( parentFootprint->
GetParent() )->GetProject();
476 bool aIgnoreLineWidth )
const 484 if( parentFootprint )
487 dummy.EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( &buffer, aClearance );
489 aCornerBuffer.
Append( buffer );
void SetMirrored(bool isMirrored)
virtual double GetDrawRotation() const override
void Offset(const wxPoint &aOffset)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
void KeepUpright(double aOldOrientation, double aNewOrientation)
Called when rotating the parent footprint.
static PROPERTY_MANAGER & Instance()
void TransformTextShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc) const
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
class FP_TEXT, text in a footprint
Container for project specific data.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject)
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
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.
bool IsKeepUpright() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void Move(const wxPoint &aMoveVector) override
move text in move transform, in footprint editor
show footprints values (when texts are visible)
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)
SHAPE_POLY_SET * m_cornerBuffer
double GetTextAngle() const
void SetDrawCoord()
Set relative coordinates.
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 GRText(wxDC *aDC, const wxPoint &aPos, const COLOR4D &aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Draw a graphic text (like footprint texts).
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
void Rotate(const wxPoint &aOffset, double aAngle) override
Rotate text, in footprint editor (for instance in footprint rotation transform)
A helper for the text to polygon callback function.
void RotatePoint(int *pX, int *pY, double angle)
void NORMALIZE_ANGLE_POS(T &Angle)
int GetTextThickness() const
The base class for create windows for drawing purpose.
void addTextSegmToPoly(int x0, int y0, int xf, int yf, void *aData)
Callback function used to convert text segments to polygons.
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth) const override
Convert the item shape to a closed polygon.
#define NO_SETTER(owner, type)
virtual bool IsLocked() const
void Mirror(const wxPoint &aCentre, bool aMirrorAroundXAxis)
Mirror text position in footprint editing the text itself is not mirrored, and the layer not modified...
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
bool Contains(const wxPoint &aPoint) const
int GetEffectiveTextPenWidth(int aDefaultWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
int GetTextHeight() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
#define DEFAULT_TEXT_WIDTH
wxPoint m_Pos0
text coordinates relative to the footprint anchor, orient 0.
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip entity during footprint flip.
static struct FP_TEXT_DESC _FP_TEXT_DESC
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
FP_TEXT(FOOTPRINT *aParentFootprint, TEXT_TYPE text_type=TEXT_is_DIVERS)
Represent a set of closed polygons.
virtual bool IsVisible() const
bool HasTextVars() const
Indicates the ShownText has text var references which need to be processed.
const wxSize & GetTextSize() const
const wxPoint GetPosition() const
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.
bool m_keepUpright
if true, keep rotation angle between -90 .
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
TEXT_TYPE
Footprint text type: there must be only one (and only one) for each of the reference value texts in o...
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
TEXT_TYPE m_Type
0=ref, 1=val, etc.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
wxString UnescapeString(const wxString &aSource)
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.
show footprints references (when texts are visible)
const EDA_RECT GetBoundingBox() const override
Set absolute coordinates.
double GetTextAngleDegrees() const
BITMAPS
A list of all bitmap identifiers.
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape() const
Information pertinent to a Pcbnew printed circuit board.
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
PCB_LAYER_ID
A quick note on layer IDs:
bool IsParentFlipped() const
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
void AddProperty(PROPERTY_BASE *aProperty)
Register a property.
Handle the component boundary box.
T MIRRORVAL(T aPoint, T aMirrorRef)
Returns the mirror of aPoint relative to the aMirrorRef.
wxString GetParentAsString() const
A base class for most all the KiCad significant classes used in schematics and boards.
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
const wxPoint & GetTextPos() const
bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const override
Test if aPoint is within the bounds of this object.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Provide class metadata.Helper macro to map type hashes to names.
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
#define PCB_EDIT_FRAME_NAME
virtual void SetTextAngle(double aAngle)
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
const EDA_RECT GetBoundingBoxRotated(const wxPoint &aRotCenter, double aAngle) const
Useful to calculate bounding box of rotated items, when rotation if not k*90 degrees.
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
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
static constexpr int Millimeter2iu(double mm)
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.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
const wxSize GetSize() const
KICAD_T Type() const
Returns the type of object.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...