KiCad PCB EDA Suite
|
Methods for drawing GerbView specific items. More...
#include <gerbview_painter.h>
Public Member Functions | |
GERBVIEW_PAINTER (GAL *aGal) | |
virtual GERBVIEW_RENDER_SETTINGS * | GetSettings () override |
Return a pointer to current settings that are going to be used when drawing items. | |
virtual bool | Draw (const VIEW_ITEM *aItem, int aLayer) override |
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item. | |
void | SetGAL (GAL *aGal) |
Changes Graphics Abstraction Layer used for drawing items for a new one. | |
Protected Member Functions | |
void | draw (GERBER_DRAW_ITEM *aVia, int aLayer) |
void | drawPolygon (GERBER_DRAW_ITEM *aParent, const SHAPE_POLY_SET &aPolygon, bool aFilled, bool aShift=false) |
Helper routine to draw a polygon. | |
void | drawFlashedShape (GERBER_DRAW_ITEM *aItem, bool aFilled) |
Helper to draw a flashed shape (aka spot) | |
void | drawApertureMacro (GERBER_DRAW_ITEM *aParent, bool aFilled) |
Helper to draw an aperture macro shape. | |
int | getLineThickness (int aActualThickness) const |
Get the thickness to draw for a line (e.g. | |
Protected Attributes | |
GERBVIEW_RENDER_SETTINGS | m_gerbviewSettings |
GAL * | m_gal |
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg. | |
Methods for drawing GerbView specific items.
Definition at line 124 of file gerbview_painter.h.
GERBVIEW_PAINTER::GERBVIEW_PAINTER | ( | GAL * | aGal | ) |
Definition at line 190 of file gerbview_painter.cpp.
|
overridevirtual |
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
aItem | is an item to be drawn. |
aLayer | tells which layer is currently rendered so that draw functions may know what to draw (eg. for pads there are separate layers for holes, because they have other dimensions then the pad itself. |
Implements KIGFX::PAINTER.
Definition at line 208 of file gerbview_painter.cpp.
References draw().
|
protected |
Definition at line 224 of file gerbview_painter.cpp.
References SHAPE_POLY_SET::AddOutline(), ANGLE_360, APT_RECT, KIGFX::GAL::BitmapText(), SHAPE_POLY_SET::CacheTriangulation(), color, GERBER_DRAW_ITEM::ConvertSegmentToPolygon(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoints(), VECTOR2< T >::Distance(), KIGFX::GAL::DrawArcSegment(), KIGFX::GAL::DrawCircle(), drawFlashedShape(), KIGFX::GAL::DrawLine(), KIGFX::GAL::DrawPolygon(), drawPolygon(), KIGFX::GAL::DrawPolyline(), KIGFX::GAL::DrawRectangle(), KIGFX::GAL::DrawSegment(), GBR_ARC, GBR_CIRCLE, GBR_POLYGON, GBR_SEGMENT, GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, gerbIUScale, GERBER_DRAW_ITEM::GetABPosition(), GERBER_DRAW_ITEM::GetBoundingBox(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), GERBER_DRAW_ITEM::GetDcodeDescr(), BOX2< Vec >::GetEnd(), GERBER_DRAW_ITEM::GetLayerPolarity(), BOX2< Vec >::GetOrigin(), GetSettings(), GERBER_DRAW_ITEM::GetTextD_CodePrms(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_V_ALIGN_CENTER, gvconfig(), EDA_ITEM::IsBrightened(), IsDCodeLayer(), KIGFX::GAL::IsOpenGlEngine(), SHAPE_POLY_SET::IsTriangulationUpToDate(), GERBER_DRAW_ITEM::m_AbsolutePolygon, D_CODE::m_ApertType, GERBVIEW_SETTINGS::m_Appearance, GERBER_DRAW_ITEM::m_ArcCentre, GERBER_DRAW_ITEM::m_DCode, GERBVIEW_SETTINGS::m_Display, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GBR_DISPLAY_OPTIONS::m_DisplayPolygonsFill, GERBER_DRAW_ITEM::m_End, KIGFX::PAINTER::m_gal, GERBER_DRAW_ITEM::m_GerberImageFile, m_gerbviewSettings, GERBER_FILE_IMAGE::m_ImageNegative, KIGFX::RENDER_SETTINGS::m_outlineWidth, GERBER_DRAW_ITEM::m_ShapeAsPolygon, GERBER_DRAW_ITEM::m_ShapeType, GERBER_DRAW_ITEM::m_Size, GERBER_DRAW_ITEM::m_Start, EDA_IU_SCALE::mmToIU(), SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SetClosed(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetFontBold(), KIGFX::GAL::SetFontItalic(), KIGFX::GAL::SetFontUnderlined(), KIGFX::GAL::SetGlyphSize(), KIGFX::GAL::SetHorizontalJustify(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetNegativeDrawMode(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextMirrored(), KIGFX::GAL::SetVerticalJustify(), GERBVIEW_SETTINGS::APPEARANCE::show_negative_objects, GERBER_DRAW_ITEM::ViewBBox(), and VECTOR2< T >::x.
Referenced by Draw().
|
protected |
Helper to draw an aperture macro shape.
Definition at line 598 of file gerbview_painter.cpp.
References SHAPE_POLY_SET::COutline(), KIGFX::GAL::DrawPolygon(), KIGFX::GAL::DrawPolyline(), APERTURE_MACRO::GetApertureMacroShape(), GERBER_DRAW_ITEM::GetDcodeDescr(), D_CODE::GetMacro(), gvconfig(), GERBER_DRAW_ITEM::m_AbsolutePolygon, KIGFX::PAINTER::m_gal, m_gerbviewSettings, KIGFX::RENDER_SETTINGS::m_outlineWidth, GERBER_DRAW_ITEM::m_Start, SHAPE_POLY_SET::OutlineCount(), and KIGFX::GAL::SetLineWidth().
Referenced by drawFlashedShape().
|
protected |
Helper to draw a flashed shape (aka spot)
Definition at line 482 of file gerbview_painter.cpp.
References APT_DEF_NO_HOLE, D_CODE::ConvertShapeToPolygon(), delta, drawApertureMacro(), KIGFX::GAL::DrawCircle(), drawPolygon(), KIGFX::GAL::DrawRectangle(), KIGFX::GAL::DrawSegment(), GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, GERBER_DRAW_ITEM::GetABPosition(), GERBER_DRAW_ITEM::GetDcodeDescr(), D_CODE::m_DrillShape, KIGFX::PAINTER::m_gal, m_gerbviewSettings, KIGFX::RENDER_SETTINGS::m_outlineWidth, D_CODE::m_Polygon, GERBER_DRAW_ITEM::m_ShapeType, D_CODE::m_Size, GERBER_DRAW_ITEM::m_Start, SHAPE_POLY_SET::OutlineCount(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by draw().
|
protected |
Helper routine to draw a polygon.
aParent | Pointer to the draw item for AB Position calculation. |
aPolygon | the polygon to draw. |
aFilled | If true, draw the polygon as filled, otherwise only outline. |
aShift | If true, draw the polygon relative to the parent item position. |
Definition at line 456 of file gerbview_painter.cpp.
References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoints(), KIGFX::GAL::DrawPolygon(), KIGFX::GAL::DrawPolyline(), GERBER_DRAW_ITEM::GetABPosition(), gvconfig(), KIGFX::PAINTER::m_gal, m_gerbviewSettings, KIGFX::RENDER_SETTINGS::m_outlineWidth, GERBER_DRAW_ITEM::m_Start, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), and KIGFX::GAL::SetLineWidth().
Referenced by draw(), and drawFlashedShape().
|
protected |
Get the thickness to draw for a line (e.g.
0 thickness lines get a minimum value).
aActualThickness | line own thickness. |
Definition at line 197 of file gerbview_painter.cpp.
References m_gerbviewSettings, and KIGFX::RENDER_SETTINGS::m_outlineWidth.
|
inlineoverridevirtual |
Return a pointer to current settings that are going to be used when drawing items.
Implements KIGFX::PAINTER.
Definition at line 130 of file gerbview_painter.h.
References m_gerbviewSettings.
Referenced by draw().
|
inlineinherited |
|
protectedinherited |
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
DrawLine, DrawCircle, etc.)
Definition at line 102 of file painter.h.
Referenced by ZONE_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), draw(), drawApertureMacro(), drawFlashedShape(), KIGFX::SCH_PAINTER::drawItemBoundingBox(), drawPolygon(), KIGFX::SCH_PAINTER::getShadowWidth(), KIGFX::PCB_PAINTER::renderNetNameForSegment(), and KIGFX::PCB_PAINTER::strokeText().
|
protected |
Definition at line 139 of file gerbview_painter.h.
Referenced by draw(), drawApertureMacro(), drawFlashedShape(), drawPolygon(), getLineThickness(), and GetSettings().