41extern int scaletoIU(
double aCoord,
bool isMetric );
99#define TO_POLY_SHAPE \
101 if( polybuffer.size() > 1 ) \
103 aShapeBuffer.NewOutline(); \
105 for( unsigned jj = 0; jj < polybuffer.size(); jj++ ) \
106 aShapeBuffer.Append( polybuffer[jj].x, polybuffer[jj].y ); \
108 aShapeBuffer.Append( polybuffer[0].x, polybuffer[0].y ); \
114 static std::vector<VECTOR2I> polybuffer;
139 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
146 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
148 polybuffer[ii] += curPos;
175 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
180 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
182 polybuffer[ii] += curPos;
207 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
212 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
214 polybuffer[ii] += curPos;
236 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
241 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
243 polybuffer[ii] += curPos;
261 std::vector<VECTOR2I> subshape_poly;
270 for(
int ii = 0; ii < 4; ii++ )
272 polybuffer = subshape_poly;
275 for(
unsigned jj = 0; jj < polybuffer.size(); jj++ )
279 for(
unsigned jj = 0; jj < polybuffer.size(); jj++ )
281 polybuffer[jj] += curPos;
314 int diamAdjust = ( gap + penThickness ) * 2;
316 for(
int i = 0; i < numCircles; ++i, outerDiam -= diamAdjust )
323 if( outerDiam <= penThickness )
341 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
347 polybuffer[ii] += curPos;
374 int numCorners = (int)
m_Params[1].GetValue( tool );
387 for(
int i = 0; i <= numCorners; ++i )
393 polybuffer.push_back(pos);
398 if( prm_idx >= last_prm )
403 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
409 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
411 polybuffer[ii] += curPos;
438 for(
unsigned ii = 0; ii < polybuffer.size(); ii++ )
441 polybuffer[ii] += curPos;
462 std::vector<VECTOR2I>& aBuffer )
494 aBuffer.push_back( corner );
514 currpt.
y += width / 2;
515 aBuffer.push_back( currpt );
517 aBuffer.push_back( currpt );
519 aBuffer.push_back( currpt );
521 aBuffer.push_back( currpt );
526 for(
unsigned ii = 0; ii < 4; ii++ )
529 aBuffer[ii] += start;
545 aBuffer.push_back( pos );
547 aBuffer.push_back( pos );
549 aBuffer.push_back( pos );
551 aBuffer.push_back( pos );
563 aBuffer.push_back( lowerLeft );
564 lowerLeft.
y += size.
y;
565 aBuffer.push_back( lowerLeft );
566 lowerLeft.
x += size.
x;
567 aBuffer.push_back( lowerLeft );
568 lowerLeft.
y -= size.
y;
569 aBuffer.push_back( lowerLeft );
583 outerRadius = std::max( 1, outerRadius );
584 innerRadius = std::max( 1, innerRadius );
593 startpos.
x = innerRadius;
600 aBuffer.push_back( pos );
606 aBuffer.push_back( pos );
609 startpos.
x = outerRadius;
619 aBuffer.push_back( pos );
625 aBuffer.push_back( pos );
627 aBuffer.push_back( aBuffer[0] );
640 VECTOR2I pos( crossHairThickness / 2, crossHairLength / 2 );
641 aBuffer.push_back( pos );
642 pos.
y = crossHairThickness / 2;
643 aBuffer.push_back( pos );
644 pos.
x = -crossHairLength / 2;
645 aBuffer.push_back( pos );
646 pos.
y = -crossHairThickness / 2;
647 aBuffer.push_back( pos );
650 for(
int jj = 1; jj <= 3; jj ++ )
652 for(
int ii = 0; ii < 4; ii++ )
656 aBuffer.push_back( pos );
673 if( vertexcount < 3 )
676 if( vertexcount > 10 )
679 for(
int ii = 0; ii <= vertexcount; ii++ )
683 aBuffer.push_back( pos );
int scaletoIU(double aCoord, bool isMetric)
Convert a distance given in floating point to our internal units.
static VECTOR2I mapPt(double x, double y, bool isMetric)
Translate a point from the aperture macro coordinate system to our deci-mils coordinate system.
constexpr int ARC_HIGH_DEF
void ConvertShapeToPolygon(const GERBER_DRAW_ITEM *aParent, std::vector< VECTOR2I > &aBuffer)
Convert a shape to an equivalent polygon.
bool IsAMPrimitiveExposureOn(const GERBER_DRAW_ITEM *aParent) const
AM_PARAMS m_Params
A sequence of parameters used by the primitive.
void ConvertBasicShapeToPolygon(const GERBER_DRAW_ITEM *aParent, SHAPE_POLY_SET &aShapeBuffer, const VECTOR2I &aShapePos)
Generate the polygonal shape of the primitive shape of an aperture macro instance.
AM_PRIMITIVE_ID m_Primitive_id
The primitive type.
A gerber DCODE (also called Aperture) definition.
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
VECTOR2I GetABPosition(const VECTOR2I &aXYPosition) const
Return the image position of aPosition for this object.
Represent a set of closed polygons.
void TransformRingToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aCentre, int aRadius, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arcs to multiple straight segments.
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 constexpr EDA_ANGLE & ANGLE_360
static constexpr EDA_ANGLE & ANGLE_90
static constexpr EDA_ANGLE & ANGLE_0
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
double EuclideanNorm(const VECTOR2I &vector)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".