46 const wxString&
text ) :
126 pos.
y = bbox.
GetTop() + margin;
161 pos.
y = bbox.
GetTop() + margin;
226 const TRANSFORM& aTransform,
bool aDimmed )
231 bool forceNoFill =
static_cast<bool>( aData );
241 if( !forceNoFill &&
GetFillMode() == FILL_T::FILLED_WITH_COLOR && !blackAndWhiteMode )
248 if( blackAndWhiteMode ||
color == COLOR4D::UNSPECIFIED )
262 if( lineStyle == PLOT_DASH_TYPE::DEFAULT )
263 lineStyle = PLOT_DASH_TYPE::SOLID;
265 if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
273 for(
SHAPE* shape : shapes )
284 for(
SHAPE* shape : shapes )
293 if( blackAndWhiteMode ||
color == COLOR4D::UNSPECIFIED )
325 text.GetTextSize(),
text.GetHorizJustify(),
text.GetVertJustify(), penWidth,
376 return wxString::Format(
_(
"Graphic Text Box" ) );
382 return BITMAPS::add_textbox;
387 const TRANSFORM& aTransform,
bool aDimmed )
const
389 wxASSERT( aPlotter !=
nullptr );
396 LIB_SHAPE::Plot( aPlotter, aBackground, aOffset, aTransform, aDimmed );
405 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->
GetColorMode() )
417 if( lineStyle == PLOT_DASH_TYPE::DEFAULT )
418 lineStyle = PLOT_DASH_TYPE::DASH;
427 aPlotter->
SetDash( penWidth, lineStyle );
428 aPlotter->
Rect( start, end, FILL_T::NO_FILL, penWidth );
429 aPlotter->
SetDash( penWidth, PLOT_DASH_TYPE::SOLID );
462 std::vector<VECTOR2I> positions;
463 wxArrayString strings_list;
465 positions.reserve( strings_list.Count() );
467 text.GetLinePositions( positions, (
int) strings_list.Count() );
473 for(
unsigned ii = 0; ii < strings_list.Count(); ii++ )
475 aPlotter->
PlotText( positions[ii],
color, strings_list.Item( ii ), attrs, font,
486 aList.emplace_back(
_(
"Font" ),
GetFont() ?
GetFont()->GetName() :
_(
"Default" ) );
488 wxString textStyle[] = {
_(
"Normal" ),
_(
"Italic" ),
_(
"Bold" ),
_(
"Bold Italic" ) };
490 aList.emplace_back(
_(
"Style" ), textStyle[style] );
494 aList.emplace_back(
_(
"Box Width" ),
497 aList.emplace_back(
_(
"Box Height" ),
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
bool Intersects(const BOX2< Vec > &aRect) const
coord_type GetTop() 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.
coord_type GetRight() const
coord_type GetLeft() const
coord_type GetBottom() const
int AsTenthsOfADegree() const
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
FILL_T GetFillMode() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
COLOR4D GetFillColor() const
int Compare(const EDA_SHAPE *aOther) const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
int GetTextHeight() const
COLOR4D GetTextColor() const
void SetTextSize(VECTOR2I aNewSize)
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
KIFONT::FONT * GetFont() const
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
const TEXT_ATTRIBUTES & GetAttributes() const
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
int GetTextThickness() const
void SetMultilineAllowed(bool aAllow)
VECTOR2I GetTextSize() const
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
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)
void LinebreakText(wxString &aText, int aColumnWidth, const VECTOR2I &aGlyphSize, int aThickness, bool aBold, bool aItalic) const
Insert characters into text to ensure that no lines are wider than aColumnWidth.
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 GetMinPenWidth() const
const wxString & GetDefaultFont() 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.
wxDC * GetPrintDC() const
Store schematic specific render settings.
The base class for drawable items used by schematic library symbols.
const wxString & GetDefaultFont() const
virtual int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
virtual int GetEffectivePenWidth(const RENDER_SETTINGS *aSettings) const
const KIFONT::METRICS & GetFontMetrics() const
STROKE_PARAMS GetStroke() const
void Plot(PLOTTER *aPlotter, bool aBackground, const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed) const override
Plot the draw item using the plot object.
const BOX2I GetBoundingBox() const override
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const override
Make a set of SHAPE objects representing the LIB_SHAPE.
Define a library symbol object.
void print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, void *aData, const TRANSFORM &aTransform, bool aDimmed) override
Print the item to aDC.
VECTOR2I GetDrawPos() const override
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
int GetTextMargin() const
void MirrorHorizontally(const VECTOR2I ¢er)
KIFONT::FONT * getDrawFont() const override
LIB_TEXTBOX(LIB_SYMBOL *aParent, int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL, const wxString &aText=wxEmptyString)
void Plot(PLOTTER *aPlotter, bool aBackground, const VECTOR2I &offset, const TRANSFORM &aTransform, bool aDimmed) const override
Plot the draw item using the plot object.
int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the object about aCenter point.
void MirrorVertically(const VECTOR2I ¢er)
wxString GetShownText(bool aAllowExtraText, int aDepth=0) const override
Return the string actually shown after processing of the base text.
Base plotter engine class.
virtual void SetDash(int aLineWidth, PLOT_DASH_TYPE aLineStyle)=0
RENDER_SETTINGS * RenderSettings()
bool GetColorMode() const
virtual void PlotText(const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const TEXT_ATTRIBUTES &aAttributes, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics, void *aData=nullptr)
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetColor(const COLOR4D &color)=0
An abstract shape on 2D plane.
void GetMsgPanelInfo(UNITS_PROVIDER *aUnitsProvider, std::vector< MSG_PANEL_ITEM > &aList, bool aIncludeStyle=true, bool aIncludeWidth=true)
static void Stroke(const SHAPE *aShape, PLOT_DASH_TYPE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS *aRenderSettings, std::function< void(const VECTOR2I &a, const VECTOR2I &b)> aStroker)
KIGFX::COLOR4D GetColor() const
PLOT_DASH_TYPE GetPlotStyle() const
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
static constexpr EDA_ANGLE & ANGLE_VERTICAL
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
void GRFilledRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
bool GetGRForceBlackPenState(void)
void GRPrintText(wxDC *aDC, const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics)
Print a graphic text through wxDC.
@ LAYER_DEVICE_BACKGROUND
@ LAYER_SELECTION_SHADOWS
#define MINIMUM_SELECTION_DISTANCE
Message panel definition file.
wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
PLOT_DASH_TYPE
Dashed line types.
constexpr int MilsToIU(int mils) const
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".