37#define DCODE_DEFAULT_SIZE gerbIUScale.mmToIU( 0.1 )
93 ret = wxT(
"Round" );
break;
96 ret = wxT(
"Rect" );
break;
99 ret = wxT(
"Oval" );
break;
102 ret = wxT(
"Poly" );
break;
105 ret = wxT(
"Macro" );
break;
108 ret = wxT(
"???" );
break;
154 const VECTOR2I& aShapePos,
bool aFilledShape )
189 start.
x = aShapePos.
x -
m_Size.x / 2;
190 start.
y = aShapePos.
y -
m_Size.y / 2;
197 GRRect( aDC, start, end, 0, aColor );
238 GRCSegm( aDC, start, end, radius, aColor );
268 bool aFilled,
const VECTOR2I& aPosition )
274 std::vector<VECTOR2I> points;
275 points.reserve( pointCount );
277 for(
int ii = 0; ii < pointCount; ii++ )
280 points[ii] = p + aPosition;
284 GRClosedPoly( aDC, pointCount, &points[0], aFilled, aColor );
316 initialpos = currpos;
349 initialpos = currpos;
357 currpos = initialpos;
366 currpos = initialpos;
384 initialpos = currpos;
395 currpos = initialpos;
432 currpos.
x = aSize.
x / 2;
433 currpos.
y = aSize.
y / 2;
435 currpos.
x -= aSize.
x;
437 currpos.
y -= aSize.
y;
439 currpos.
x += aSize.
x;
441 currpos.
y += aSize.
y;
constexpr int ARC_HIGH_DEF
Support the "aperture macro" defined within standard RS274X.
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, const VECTOR2I &aShapePos)
Calculate the primitive shape for flashed items.
coord_type GetHeight() const
coord_type GetWidth() const
APERTURE_MACRO * GetMacro() const
void DrawFlashedShape(const GERBER_DRAW_ITEM *aParent, wxDC *aDC, const COLOR4D &aColor, const VECTOR2I &aShapePos, bool aFilledShape)
Draw the dcode shape for flashed items.
int m_Num_Dcode
D code value ( >= 10 )
int GetShapeDim(GERBER_DRAW_ITEM *aParent)
Calculate a value that can be used to evaluate the size of text when displaying the D-Code of an item...
void DrawFlashedPolygon(const GERBER_DRAW_ITEM *aParent, wxDC *aDC, const COLOR4D &aColor, bool aFilled, const VECTOR2I &aPosition)
A helper function used to draw the polygon stored in m_PolyCorners.
EDA_ANGLE m_Rotation
shape rotation
wxSize m_Drill
dimension of the hole (if any) (drill file)
int m_EdgesCount
in aperture definition Polygon only: number of edges for the polygon
static const wxChar * ShowApertureType(APERTURE_T aType)
Return a character string telling what type of aperture type aType is.
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
bool m_Defined
false if the aperture is not defined in the header
APERTURE_DEF_HOLETYPE m_DrillShape
shape of the hole (0 = no hole, round = 1, rect = 2).
bool m_InUse
false if the aperture (previously defined) is not used to draw something
APERTURE_MACRO * m_Macro
no ownership, points to GERBER.m_aperture_macros element.
wxSize m_Size
Horizontal and vertical dimensions.
void ConvertShapeToPolygon(const GERBER_DRAW_ITEM *aParent)
Convert a shape to an equivalent polygon.
VECTOR2I GetABPosition(const VECTOR2I &aXYPosition) const
Return the image position of aPosition for this object.
A color representation with 4 components: red, green, blue, alpha.
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset intersection For aFastMode meaning, see function booleanOp.
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
int VertexCount(int aOutline=-1, int aHole=-1) const
Return the number of points in the shape poly set.
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...
int NewOutline()
Creates a new hole in a given outline.
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the aGlobalIndex-th vertex in the poly set.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
static void addHoleToPolygon(SHAPE_POLY_SET *aPolygon, APERTURE_DEF_HOLETYPE aHoleShape, const VECTOR2I &aSize, const VECTOR2I &aAnchorPos)
#define DCODE_DEFAULT_SIZE
APERTURE_T
The set of all gerber aperture types allowed, according to page 16 of http://gerbv....
static constexpr EDA_ANGLE & ANGLE_360
static constexpr EDA_ANGLE & ANGLE_90
static constexpr EDA_ANGLE & ANGLE_0
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRCSegm(wxDC *DC, const VECTOR2I &A, const VECTOR2I &B, int width, const COLOR4D &Color)
void GRCircle(wxDC *aDC, const VECTOR2I &aPos, int aRadius, int aWidth, const COLOR4D &aColor)
void GRFilledSegment(wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRClosedPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, const COLOR4D &Color)
Draw a closed polyline and fill it if Fill, in object space.
void GRFilledRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
void GRFilledCircle(wxDC *aDC, const VECTOR2I &aPos, int aRadius, int aWidth, const COLOR4D &aStrokeColor, const COLOR4D &aFillColor)
Draw a circle onto the drawing context aDC centered at the user coordinates (x,y).
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)