![]() |
KiCad PCB EDA Suite
|
Struct AM_PRIMITIVE holds an aperture macro primitive as given in Table 3 of http://gerbv.sourceforge.net/docs/rs274xrevd_e.pdf. More...
#include <am_primitive.h>
Public Member Functions | |
AM_PRIMITIVE (bool aGerbMetric, AM_PRIMITIVE_ID aId=AMP_UNKNOWN) | |
~AM_PRIMITIVE () | |
bool | IsAMPrimitiveExposureOn (const GERBER_DRAW_ITEM *aParent) const |
Function IsAMPrimitiveExposureOn. More... | |
int | GetShapeDim (const GERBER_DRAW_ITEM *aParent) |
GetShapeDim Calculate a value that can be used to evaluate the size of text when displaying the D-Code of an item due to the complexity of the shape of some primitives one cannot calculate the "size" of a shape (only a bounding box) but here, the "dimension" of the shape is the diameter of the primitive or for lines the width of the line. More... | |
void | DrawBasicShape (const GERBER_DRAW_ITEM *aParent, SHAPE_POLY_SET &aShapeBuffer, wxPoint aShapePos) |
Function drawBasicShape Draw (in fact generate the actual polygonal shape of) the primitive shape of an aperture macro instance. More... | |
Public Attributes | |
AM_PRIMITIVE_ID | primitive_id |
The primitive type. More... | |
AM_PARAMS | params |
A sequence of parameters used by. More... | |
bool | m_GerbMetric |
Private Member Functions | |
void | ConvertShapeToPolygon (const GERBER_DRAW_ITEM *aParent, std::vector< wxPoint > &aBuffer) |
Function ConvertShapeToPolygon convert a shape to an equivalent polygon. More... | |
Struct AM_PRIMITIVE holds an aperture macro primitive as given in Table 3 of http://gerbv.sourceforge.net/docs/rs274xrevd_e.pdf.
Definition at line 91 of file am_primitive.h.
|
inline |
Definition at line 99 of file am_primitive.h.
References m_GerbMetric, and primitive_id.
|
inline |
Definition at line 106 of file am_primitive.h.
|
private |
Function ConvertShapeToPolygon convert a shape to an equivalent polygon.
Function ConvertShapeToPolygon (virtual) convert a shape to an equivalent polygon.
Arcs and circles are approximated by segments Useful when a shape is not a graphic primitive (shape with hole, rotated shape ... ) and cannot be easily drawn.
Arcs and circles are approximated by segments Useful when a shape is not a graphic primitive (shape with hole, rotated shape ... ) and cannot be easily drawn. note for some schapes conbining circles and solid lines (rectangles), only rectangles are converted because circles are very easy to draw (no rotation problem) so convert them in polygons, and draw them as polygons is not a good idea.
Definition at line 450 of file am_primitive.cpp.
References AMP_CIRCLE, AMP_COMMENT, AMP_EOF, AMP_LINE2, AMP_LINE20, AMP_LINE_CENTER, AMP_LINE_LOWER_LEFT, AMP_MOIRE, AMP_OUTLINE, AMP_POLYGON, AMP_THERMAL, AMP_UNKNOWN, PNS::angle(), ArcTangente(), EuclideanNorm(), GERBER_DRAW_ITEM::GetDcodeDescr(), KiROUND(), m_GerbMetric, mapPt(), params, primitive_id, RAD2DECIDEG(), RotatePoint(), scaletoIU(), and seg_per_circle.
Referenced by DrawBasicShape().
void AM_PRIMITIVE::DrawBasicShape | ( | const GERBER_DRAW_ITEM * | aParent, |
SHAPE_POLY_SET & | aShapeBuffer, | ||
wxPoint | aShapePos | ||
) |
Function drawBasicShape Draw (in fact generate the actual polygonal shape of) the primitive shape of an aperture macro instance.
aParent | = the parent GERBER_DRAW_ITEM which is actually drawn |
aShapeBuffer | = a SHAPE_POLY_SET to put the shape converted to a polygon |
aShapePos | = the actual shape position |
Definition at line 95 of file am_primitive.cpp.
References AMP_CIRCLE, AMP_EOF, AMP_LINE2, AMP_LINE20, AMP_LINE_CENTER, AMP_LINE_LOWER_LEFT, AMP_MOIRE, AMP_OUTLINE, AMP_POLYGON, AMP_THERMAL, AMP_UNKNOWN, ConvertShapeToPolygon(), ERROR_INSIDE, GERBER_DRAW_ITEM::GetABPosition(), GERBER_DRAW_ITEM::GetDcodeDescr(), KiROUND(), m_GerbMetric, mapPt(), params, primitive_id, RotatePoint(), scaletoIU(), TO_POLY_SHAPE, TransformCircleToPolygon(), and TransformRingToPolygon().
int AM_PRIMITIVE::GetShapeDim | ( | const GERBER_DRAW_ITEM * | aParent | ) |
GetShapeDim Calculate a value that can be used to evaluate the size of text when displaying the D-Code of an item due to the complexity of the shape of some primitives one cannot calculate the "size" of a shape (only a bounding box) but here, the "dimension" of the shape is the diameter of the primitive or for lines the width of the line.
GetShapeDim Calculate a value that can be used to evaluate the size of text when displaying the D-Code of an item due to the complexity of the shape of some primitives one cannot calculate the "size" of a shape (only abounding box) but here, the "dimension" of the shape is the diameter of the primitive or for lines the width of the line.
aParent | = the parent GERBER_DRAW_ITEM which is actually drawn |
Definition at line 675 of file am_primitive.cpp.
References AMP_CIRCLE, AMP_COMMENT, AMP_EOF, AMP_LINE2, AMP_LINE20, AMP_LINE_CENTER, AMP_LINE_LOWER_LEFT, AMP_MOIRE, AMP_OUTLINE, AMP_POLYGON, AMP_THERMAL, AMP_UNKNOWN, GERBER_DRAW_ITEM::GetDcodeDescr(), m_GerbMetric, mapPt(), params, primitive_id, and scaletoIU().
bool AM_PRIMITIVE::IsAMPrimitiveExposureOn | ( | const GERBER_DRAW_ITEM * | aParent | ) | const |
Function IsAMPrimitiveExposureOn.
Definition at line 59 of file am_primitive.cpp.
References AMP_CIRCLE, AMP_EOF, AMP_LINE2, AMP_LINE20, AMP_LINE_CENTER, AMP_LINE_LOWER_LEFT, AMP_MOIRE, AMP_OUTLINE, AMP_POLYGON, AMP_THERMAL, AMP_UNKNOWN, GERBER_DRAW_ITEM::GetDcodeDescr(), params, and primitive_id.
bool AM_PRIMITIVE::m_GerbMetric |
Definition at line 97 of file am_primitive.h.
Referenced by AM_PRIMITIVE(), ConvertShapeToPolygon(), DrawBasicShape(), and GetShapeDim().
AM_PARAMS AM_PRIMITIVE::params |
A sequence of parameters used by.
Definition at line 95 of file am_primitive.h.
Referenced by ConvertShapeToPolygon(), DrawBasicShape(), GetShapeDim(), IsAMPrimitiveExposureOn(), and GERBER_FILE_IMAGE::ReadApertureMacro().
AM_PRIMITIVE_ID AM_PRIMITIVE::primitive_id |
The primitive type.
Definition at line 94 of file am_primitive.h.
Referenced by AM_PRIMITIVE(), ConvertShapeToPolygon(), DrawBasicShape(), GetShapeDim(), IsAMPrimitiveExposureOn(), and GERBER_FILE_IMAGE::ReadApertureMacro().