![]() |
KiCad PCB EDA Suite
|
Struct APERTURE_MACRO helps support the "aperture macro" defined within standard RS274X. More...
#include <am_primitive.h>
Public Member Functions | |
double | GetLocalParam (const D_CODE *aDcode, unsigned aParamId) const |
function GetLocalParam Usually, parameters are defined inside the aperture primitive using immediate mode or defered mode. More... | |
SHAPE_POLY_SET * | GetApertureMacroShape (const GERBER_DRAW_ITEM *aParent, wxPoint aShapePos) |
Function GetApertureMacroShape Calculate the primitive shape for flashed items. More... | |
void | DrawApertureMacroShape (GERBER_DRAW_ITEM *aParent, EDA_RECT *aClipBox, wxDC *aDC, COLOR4D aColor, wxPoint aShapePos, bool aFilledShape) |
Function DrawApertureMacroShape Draw the primitive shape for flashed items. More... | |
int | GetShapeDim (GERBER_DRAW_ITEM *aParent) |
Function 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 a shape using many primitives one cannot calculate the "size" of a shape (only abounding box) but most of aperture macro are using one or few primitives and the "dimension" of the shape is the diameter of the primitive (or the max diameter of primitives) More... | |
EDA_RECT | GetBoundingBox () const |
Returns the bounding box of the shape. More... | |
Public Attributes | |
wxString | name |
The name of the aperture macro. More... | |
AM_PRIMITIVES | primitives |
A sequence of AM_PRIMITIVEs. More... | |
AM_PARAMS | m_localparamStack |
SHAPE_POLY_SET | m_shape |
The shape of the item, calculated by GetApertureMacroShape. More... | |
EDA_RECT | m_boundingBox |
The bounding box of the item, calculated by GetApertureMacroShape. More... | |
Struct APERTURE_MACRO helps support the "aperture macro" defined within standard RS274X.
Definition at line 163 of file am_primitive.h.
void APERTURE_MACRO::DrawApertureMacroShape | ( | GERBER_DRAW_ITEM * | aParent, |
EDA_RECT * | aClipBox, | ||
wxDC * | aDC, | ||
COLOR4D | aColor, | ||
wxPoint | aShapePos, | ||
bool | aFilledShape | ||
) |
Function DrawApertureMacroShape Draw the primitive shape for flashed items.
When an item is flashed, this is the shape of the item
aParent | = the parent GERBER_DRAW_ITEM which is actually drawn |
aClipBox | = DC clip box (NULL is no clip) |
aDC | = device context |
aColor | = the color of shape |
aShapePos | = the actual shape position |
aFilledShape | = true to draw in filled mode, false to draw in skecth mode |
Definition at line 825 of file am_primitive.cpp.
References GetApertureMacroShape(), GRClosedPoly(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::Point(), and SHAPE_LINE_CHAIN::PointCount().
Referenced by D_CODE::DrawFlashedShape().
SHAPE_POLY_SET * APERTURE_MACRO::GetApertureMacroShape | ( | const GERBER_DRAW_ITEM * | aParent, |
wxPoint | aShapePos | ||
) |
Function GetApertureMacroShape Calculate the primitive shape for flashed items.
When an item is flashed, this is the shape of the item
aParent | = the parent GERBER_DRAW_ITEM which is actually drawn |
Definition at line 776 of file am_primitive.cpp.
References AMP_COMMENT, SHAPE_POLY_SET::BBox(), SHAPE_POLY_SET::BooleanSubtract(), SHAPE_POLY_SET::Fracture(), GERBER_DRAW_ITEM::GetABPosition(), EDA_RECT::Inflate(), m_boundingBox, m_shape, EDA_RECT::Move(), SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_FAST, primitives, and SHAPE_POLY_SET::RemoveAllContours().
Referenced by KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), DrawApertureMacroShape(), fillFlashedGBRITEM(), GERBER_DRAW_ITEM::GetBoundingBox(), and GERBER_DRAW_ITEM::HitTest().
|
inline |
Returns the bounding box of the shape.
Definition at line 231 of file am_primitive.h.
References m_boundingBox.
Referenced by GERBER_DRAW_ITEM::GetBoundingBox(), and GERBER_DRAW_ITEM::ViewGetLOD().
double APERTURE_MACRO::GetLocalParam | ( | const D_CODE * | aDcode, |
unsigned | aParamId | ||
) | const |
function GetLocalParam Usually, parameters are defined inside the aperture primitive using immediate mode or defered mode.
in defered mode the value is defined in a DCODE that want to use the aperture macro. But some parameters are defined outside the aperture primitive and are local to the aperture macro
aDcode | = the D_CODE that uses this apertur macro and define defered parameters |
aParamId | = the param id (defined by $3 or $5 ..) to evaluate |
in defered mode the value is defined in a DCODE that want to use the aperture macro. But some parameters are defined outside the aperture primitive and are local to the aperture macro
aParamId | = the param id (defined by $3 or $5 ..) to evaluate |
Definition at line 879 of file am_primitive.cpp.
References AM_PARAM::GetValue(), and m_localparamStack.
Referenced by AM_PARAM::GetValue().
int APERTURE_MACRO::GetShapeDim | ( | GERBER_DRAW_ITEM * | aParent | ) |
Function 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 a shape using many primitives one cannot calculate the "size" of a shape (only abounding box) but most of aperture macro are using one or few primitives and the "dimension" of the shape is the diameter of the primitive (or the max diameter of primitives)
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 a shape using many primitives one cannot calculate the "size" of a shape (only abounding box) but most of aperture macro are using one or few primitives and the "dimension" of the shape is the diameter of the primitive (or the max diameter of primitives)
aParent | = the parent GERBER_DRAW_ITEM which is actually drawn |
Definition at line 854 of file am_primitive.cpp.
References primitives.
Referenced by D_CODE::GetShapeDim().
EDA_RECT APERTURE_MACRO::m_boundingBox |
The bounding box of the item, calculated by GetApertureMacroShape.
Definition at line 177 of file am_primitive.h.
Referenced by GetApertureMacroShape(), and GetBoundingBox().
AM_PARAMS APERTURE_MACRO::m_localparamStack |
Definition at line 174 of file am_primitive.h.
Referenced by GetLocalParam(), and GERBER_FILE_IMAGE::ReadApertureMacro().
SHAPE_POLY_SET APERTURE_MACRO::m_shape |
The shape of the item, calculated by GetApertureMacroShape.
Definition at line 176 of file am_primitive.h.
Referenced by GetApertureMacroShape().
wxString APERTURE_MACRO::name |
The name of the aperture macro.
Definition at line 165 of file am_primitive.h.
Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand(), APERTURE_MACRO_less_than::operator()(), GERBER_FILE_IMAGE::ReadApertureMacro(), and GERBER_DRAW_ITEM::ShowGBRShape().
AM_PRIMITIVES APERTURE_MACRO::primitives |
A sequence of AM_PRIMITIVEs.
Definition at line 166 of file am_primitive.h.
Referenced by GetApertureMacroShape(), GetShapeDim(), and GERBER_FILE_IMAGE::ReadApertureMacro().