39 EDA_SHAPE( aShape, aDefaultLineWidth, aFillType, true )
94 flip( aCenter,
true );
100 flip( aCenter,
false );
106 int rot_angle = aRotateCCW ? -900 : 900;
108 rotate( aCenter, rot_angle );
123 static std::vector<wxPoint> cornerList;
145 aTransform.
MapAngles( &startAngle, &endAngle );
155 aPlotter->
Arc( center, -endAngle, -startAngle,
GetRadius(), fill, 0 );
163 aPlotter->
Rect( start, end, fill, 0 );
168 aPlotter->
PlotPoly( cornerList, fill, 0 );
186 aPlotter->
Arc( center, -endAngle, -startAngle,
GetRadius(), fill, pen_size );
194 aPlotter->
Rect( start, end, fill, pen_size );
199 aPlotter->
PlotPoly( cornerList, fill, pen_size );
215 void* aData,
const TRANSFORM& aTransform )
217 bool forceNoFill = static_cast<bool>( aData );
220 if( forceNoFill &&
IsFilled() && penWidth == 0 )
230 unsigned ptCount = 0;
231 wxPoint* buffer =
nullptr;
238 buffer =
new wxPoint[ ptCount ];
240 for(
unsigned ii = 0; ii < ptCount; ++ii )
246 buffer =
new wxPoint[ ptCount ];
248 for(
size_t ii = 0; ii < ptCount; ++ii )
261 bool transformed = aTransform.
MapAngles( &t1, &t2 );
264 if( transformed == transformed2 )
265 std::swap( pt1, pt2 );
275 GRArc1(
nullptr, DC, pt1, pt2, c, penWidth,
color );
283 GRRect(
nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth,
color );
309 GRFilledArc1(
nullptr, DC, pt1, pt2, c, 0, fillColor, fillColor );
311 GRArc1(
nullptr, DC, pt1, pt2, c, penWidth,
color );
319 GRFilledRect(
nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth,
color, fillColor );
324 GRPoly(
nullptr, DC, ptCount, buffer,
true, 0, fillColor, fillColor );
327 GRPoly(
nullptr, DC, ptCount, buffer,
false, penWidth,
color, fillColor );
333 GRPoly(
nullptr, DC, ptCount, buffer,
true, penWidth,
color, fillColor );
335 GRPoly(
nullptr, DC, ptCount, buffer,
true, 0, fillColor, fillColor );
392 return wxEmptyString;
425 wxFAIL_MSG( wxT(
"LIB_SHAPE::AddPoint not implemented for " ) +
SHAPE_T_asString() );
444 if( ( aEndAngle - aStartAngle ) > 1800 )
446 else if( ( aEndAngle - aStartAngle ) <= -1800 )
449 while( ( aEndAngle - aStartAngle ) >= 1800 )
455 while( ( aStartAngle - aEndAngle ) >= 1800 )
void CalcArcAngles(int &aStartAngle, int &aEndAngle) const
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.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
void AddPoint(const wxPoint &aPosition)
Plot settings, and plotting engines (PostScript, Gerber, HPGL and DXF)
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
virtual size_t GetPointCount() const override
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
wxPoint getCenter() const
Implementation of conversion functions that require both schematic and board internal units.
void GRFilledRect(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, const COLOR4D &Color, const COLOR4D &BgColor)
const wxPoint & GetStart() const
Return the starting point of the graphic.
virtual void PlotPoly(const std::vector< wxPoint > &aCornerList, FILL_T aFill, int aWidth=USE_DEFAULT_LINE_WIDTH, void *aData=nullptr)=0
Draw a polygon ( filled or not ).
bool hitTest(const wxPoint &aPosition, int aAccuracy=0) const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void Rotate(const wxPoint &aCenter, bool aRotateCCW=true) override
Rotate the object about aCenter point.
void GRRect(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color)
void NORMALIZE_ANGLE_POS(T &Angle)
void ShapeGetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
The base class for create windows for drawing purpose.
Define a library symbol object.
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
The base class for drawable items used by schematic library symbols.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
This file contains miscellaneous commonly used macros and functions.
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
int GetPenWidth() const override
void rotate(const wxPoint &aRotCentre, double aAngle)
T NormalizeAngle180(T Angle)
Normalize angle to be in the -180.0 .. 180.0 range.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
virtual int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const
Provide the draw object specific comparison called by the == and < operators.
int GetEffectivePenWidth(const RENDER_SETTINGS *aSettings) const override
const wxPoint & GetEnd() const
Return the ending point of the graphic.
const std::vector< VECTOR2I > & CPoints() const
void move(const wxPoint &aMoveVector)
SHAPE_LINE_CHAIN & Outline(int aIndex)
std::vector< wxPoint > m_bezierPoints
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, const COLOR4D &Color)
Draw a circle onto the drawing context aDC centered at the user coordinates (x,y).
#define MINIMUM_SELECTION_DISTANCE
int compare(const LIB_ITEM &aOther, int aCompareFlags=0) const override
Provide the draw object specific comparison called by the == and < operators.
#define UNIMPLEMENTED_FOR(type)
void MirrorVertical(const wxPoint &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
#define STRUCT_DELETED
flag indication structures to be erased
wxDC * GetPrintDC() const
void Plot(PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) const override
Plot the draw item using the plot object.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
wxPoint GetCenter() const
wxString SHAPE_T_asString() const
void setPosition(const wxPoint &aPos)
int NewOutline()
Creates a new hole in a given outline.
void Offset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
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.
int Compare(const EDA_SHAPE *aOther) const
const EDA_RECT GetBoundingBox() const override
virtual void SetColor(const COLOR4D &color)=0
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
void print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform) override
Print the item to aDC.
const EDA_RECT getBoundingBox() const
Base plotter engine class.
void MoveTo(const wxPoint &aPosition) override
Move a draw object to aPosition.
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 GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, int width, const COLOR4D &Color)
RENDER_SETTINGS * RenderSettings()
TRANSFORM DefaultTransform
#define SKIP_STRUCT
flag indicating that the structure should be ignored
BITMAPS
A list of all bitmap identifiers.
void GRFilledArc1(EDA_RECT *ClipBox, wxDC *DC, const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &aCenter, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
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.
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
LIB_SHAPE(LIB_SYMBOL *aParent, SHAPE_T aShape, int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL)
virtual void Arc(const wxPoint ¢re, double StAngle, double EndAngle, int rayon, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)
Generic fallback: arc rendered as a polyline.
int GetDefaultPenWidth() const
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in drawing space.
double ArcTangente(int dy, int dx)
Message panel definition file.
void flip(const wxPoint &aCentre, bool aFlipLeftRight)
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
FILL_T GetFillType() const
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, const COLOR4D &Color, const COLOR4D &BgColor)
A color representation with 4 components: red, green, blue, alpha.