KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::PCB_PAINTER Class Reference

Contains methods for drawing PCB-specific items. More...

#include <pcb_painter.h>

Inheritance diagram for KIGFX::PCB_PAINTER:
KIGFX::PAINTER KIGFX::PCB_PRINT_PAINTER

Public Member Functions

 PCB_PAINTER (GAL *aGal, FRAME_T aFrameType)
 
virtual PCB_RENDER_SETTINGSGetSettings () override
 Return a pointer to current settings that are going to be used when drawing items. More...
 
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. More...
 
void SetGAL (GAL *aGal)
 Changes Graphics Abstraction Layer used for drawing items for a new one. More...
 

Protected Member Functions

PCB_VIEWERS_SETTINGS_BASEviewer_settings ()
 
void draw (const PCB_TRACK *aTrack, int aLayer)
 
void draw (const PCB_ARC *aArc, int aLayer)
 
void draw (const PCB_VIA *aVia, int aLayer)
 
void draw (const PAD *aPad, int aLayer)
 
void draw (const PCB_SHAPE *aSegment, int aLayer)
 
void draw (const PCB_BITMAP *aBitmap, int aLayer)
 
void draw (const PCB_TEXT *aText, int aLayer)
 
void draw (const PCB_TEXTBOX *aText, int aLayer)
 
void draw (const FOOTPRINT *aFootprint, int aLayer)
 
void draw (const PCB_GROUP *aGroup, int aLayer)
 
void draw (const ZONE *aZone, int aLayer)
 
void draw (const PCB_DIMENSION_BASE *aDimension, int aLayer)
 
void draw (const PCB_TARGET *aTarget)
 
void draw (const PCB_MARKER *aMarker, int aLayer)
 
int getLineThickness (int aActualThickness) const
 Get the thickness to draw for a line (e.g. More...
 
virtual int getDrillShape (const PAD *aPad) const
 Return drill shape of a pad. More...
 
virtual SHAPE_SEGMENT getPadHoleShape (const PAD *aPad) const
 Return hole shape for a pad (internal units). More...
 
virtual int getViaDrillSize (const PCB_VIA *aVia) const
 Return drill diameter for a via (internal units). More...
 
void strokeText (const wxString &aText, const VECTOR2I &aPosition, const TEXT_ATTRIBUTES &aAttrs)
 

Protected Attributes

PCB_RENDER_SETTINGS m_pcbSettings
 
FRAME_T m_frameType
 
int m_maxError
 
int m_holePlatingThickness
 
int m_lockedShadowMargin
 
GALm_gal
 Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg. More...
 

Detailed Description

Contains methods for drawing PCB-specific items.

Definition at line 155 of file pcb_painter.h.

Constructor & Destructor Documentation

◆ PCB_PAINTER()

PCB_PAINTER::PCB_PAINTER ( GAL aGal,
FRAME_T  aFrameType 
)

Definition at line 452 of file pcb_painter.cpp.

Member Function Documentation

◆ draw() [1/14]

◆ draw() [2/14]

void PCB_PAINTER::draw ( const PAD aPad,
int  aLayer 
)
protected

Definition at line 1068 of file pcb_painter.cpp.

References SEG::A, ANGLE_90, ANGLE_HORIZONTAL, SHAPE_POLY_SET::Append(), EDA_ANGLE::AsRadians(), SEG::B, B_Mask, B_Paste, KIGFX::GAL::BitmapText(), BOX2< Vec >::Centre(), SHAPE_POLY_SET::CHAMFER_ALL_CORNERS, color, SHAPE_SIMPLE::CPoint(), SHAPE_POLY_SET::Deflate(), KIGFX::GAL::DrawCircle(), KIGFX::GAL::DrawPolygon(), KIGFX::GAL::DrawRectangle(), KIGFX::GAL::DrawSegment(), BOARD_ITEM::Duplicate(), ENTERED, ERROR_INSIDE, F_Mask, F_Paste, PAD::FlashLayer(), KIGFX::RENDER_SETTINGS::GetActiveLayer(), PAD::GetAttribute(), BOARD_ITEM::GetBoard(), EDA_SHAPE::GetBotRight(), PAD::GetBoundingBox(), SHAPE_CIRCLE::GetCenter(), PCB_SHAPE::GetCenter(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PAD::GetDrillSize(), PAD::GetEffectiveHoleShape(), PAD::GetEffectiveShape(), BOARD::GetEnabledLayers(), EDA_ITEM::GetFlags(), SHAPE_RECT::GetHeight(), KIGFX::RENDER_SETTINGS::GetLayerColor(), PAD::GetNumber(), PAD::GetOwnClearance(), getPadHoleShape(), BOARD_ITEM::GetParentFootprint(), SHAPE_RECT::GetPosition(), PAD::GetPosition(), PAD::GetPrimitives(), KIGFX::RENDER_SETTINGS::GetPrintLayers(), SHAPE_CIRCLE::GetRadius(), SHAPE_SEGMENT::GetSeg(), SHAPE_SIMPLE::GetSegment(), SHAPE_SIMPLE::GetSegmentCount(), PAD::GetShape(), SHAPE_RECT::GetSize(), BOX2< Vec >::GetSize(), PAD::GetSize(), PAD::GetSolderMaskExpansion(), PAD::GetSolderPasteMargin(), EDA_SHAPE::GetTopLeft(), BOARD_CONNECTED_ITEM::GetUnescapedShortNetname(), BOARD::GetVisibleLayers(), SHAPE_RECT::GetWidth(), SHAPE_SEGMENT::GetWidth(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_V_ALIGN_CENTER, FOOTPRINT::GraphicalItems(), EDA_SHAPE::IsAnnotationProxy(), IsCopperLayer(), PAD::IsFreePad(), IsNetnameLayer(), PAD::IsNoConnectPad(), KIGFX::RENDER_SETTINGS::IsPrinting(), EDA_ITEM::IsSelected(), KiROUND(), LAYER_NON_PLATEDHOLES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PAD_HOLEWALLS, LAYER_PAD_PLATEDHOLES, LAYER_PADS_TH, PCBNEW_SETTINGS::m_Display, PCB_VIEWERS_SETTINGS_BASE::VIEWERS_DISPLAY_OPTIONS::m_DisplayPadFill, KIGFX::PCB_RENDER_SETTINGS::m_ForcePadSketchModeOn, KIGFX::PAINTER::m_gal, m_holePlatingThickness, KIGFX::RENDER_SETTINGS::m_isPrinting, m_maxError, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_NetNames, KIGFX::RENDER_SETTINGS::m_outlineWidth, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_PadClearance, m_pcbSettings, PCB_VIEWERS_SETTINGS_BASE::m_ViewersDisplay, KIGFX::PCB_RENDER_SETTINGS::MAX_FONT_SIZE, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::Outline(), PCB_SHAPE_T, pcbconfig(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_SIMPLE::PointCount(), PrintableCharCount(), KIGFX::GAL::ResetTextAttributes(), KIGFX::GAL::Restore(), KIGFX::GAL::Rotate(), KIGFX::GAL::Save(), 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::SetStrokeColor(), KIGFX::GAL::SetTextMirrored(), KIGFX::GAL::SetVerticalJustify(), SH_CIRCLE, SH_RECT, SH_SEGMENT, SH_SIMPLE, ToLAYER_ID(), PAD::TransformShapeToPolygon(), KIGFX::GAL::Translate(), UnescapeString(), SHAPE_SIMPLE::Vertices(), viewer_settings(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ draw() [3/14]

◆ draw() [4/14]

◆ draw() [5/14]

◆ draw() [6/14]

◆ draw() [7/14]

◆ draw() [8/14]

◆ draw() [9/14]

◆ draw() [10/14]

void PCB_PAINTER::draw ( const PCB_TEXT aText,
int  aLayer 
)
protected

◆ draw() [11/14]

◆ draw() [12/14]

void PCB_PAINTER::draw ( const PCB_TRACK aTrack,
int  aLayer 
)
protected

Definition at line 650 of file pcb_painter.cpp.

References SEG::A, ANGLE_HORIZONTAL, ANGLE_VERTICAL, SEG::B, KIGFX::GAL::BitmapText(), ClipLine(), color, BOX2< Vec >::Contains(), KIGFX::GAL::DrawSegment(), KIGFX::RENDER_SETTINGS::GetActiveLayer(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), PCB_TRACK::GetEnd(), BOX2< Vec >::GetHeight(), PCB_TRACK::GetLength(), BOARD_CONNECTED_ITEM::GetNetCode(), BOX2< Vec >::GetOrigin(), BOARD_CONNECTED_ITEM::GetOwnClearance(), KIGFX::GAL::GetScreenPixelSize(), KIGFX::GAL::GetScreenWorldMatrix(), BOX2< Vec >::GetSize(), PCB_TRACK::GetStart(), BOARD_CONNECTED_ITEM::GetUnescapedShortNetname(), BOX2< Vec >::GetWidth(), PCB_TRACK::GetWidth(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_V_ALIGN_CENTER, IsCopperLayer(), IsNetnameLayer(), LAYER_LOCKED_ITEM_SHADOW, SEG::Length(), PCBNEW_SETTINGS::m_Display, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayPcbTrackFill, KIGFX::PAINTER::m_gal, KIGFX::RENDER_SETTINGS::m_isPrinting, m_lockedShadowMargin, KIGFX::RENDER_SETTINGS::m_outlineWidth, m_pcbSettings, BOX2< Vec >::Normalize(), EDA_ANGLE::Normalize90(), pcbconfig(), BOX2< Vec >::SetEnd(), 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(), BOX2< Vec >::SetOrigin(), KIGFX::GAL::SetStrokeColor(), KIGFX::GAL::SetTextMirrored(), KIGFX::GAL::SetVerticalJustify(), SHOW_WITH_VIA_ALWAYS, NETINFO_LIST::UNCONNECTED, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by draw(), and Draw().

◆ draw() [13/14]

void PCB_PAINTER::draw ( const PCB_VIA aVia,
int  aLayer 
)
protected

Definition at line 851 of file pcb_painter.cpp.

References ANGLE_HORIZONTAL, KIGFX::GAL::BitmapText(), PCB_VIA::BottomLayer(), KIGFX::COLOR4D::CLEAR, color, DEGREES_T, draw(), KIGFX::GAL::DrawArc(), KIGFX::GAL::DrawCircle(), PCB_VIA::FlashLayer(), KIGFX::RENDER_SETTINGS::GetActiveLayer(), BOARD_ITEM::GetBoard(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), BOARD::GetCopperLayerCount(), BOARD::GetEnabledLayers(), BOARD_CONNECTED_ITEM::GetNetname(), BOARD_CONNECTED_ITEM::GetOwnClearance(), KIGFX::RENDER_SETTINGS::GetPrintLayers(), PCB_TRACK::GetStart(), BOARD_CONNECTED_ITEM::GetUnescapedShortNetname(), getViaDrillSize(), PCB_VIA::GetViaType(), BOARD::GetVisibleLayers(), PCB_TRACK::GetWidth(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_V_ALIGN_CENTER, IsNetnameLayer(), KIGFX::RENDER_SETTINGS::IsPrinting(), EDA_ITEM::IsSelected(), LAYER_LOCKED_ITEM_SHADOW, LAYER_VIA_BBLIND, LAYER_VIA_HOLES, LAYER_VIA_HOLEWALLS, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, PCB_VIA::LayerPair(), PCBNEW_SETTINGS::m_Display, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayViaFill, KIGFX::PAINTER::m_gal, m_holePlatingThickness, KIGFX::RENDER_SETTINGS::m_isPrinting, m_lockedShadowMargin, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_NetNames, KIGFX::RENDER_SETTINGS::m_outlineWidth, m_pcbSettings, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_TrackClearance, KIGFX::PCB_RENDER_SETTINGS::MAX_FONT_SIZE, pcbconfig(), PrintableCharCount(), KIGFX::GAL::ResetTextAttributes(), KIGFX::GAL::Restore(), KIGFX::GAL::Save(), 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::SetStrokeColor(), KIGFX::GAL::SetTextMirrored(), KIGFX::GAL::SetVerticalJustify(), SHOW_WITH_VIA_ALWAYS, PCB_VIA::TopLayer(), KIGFX::GAL::Translate(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Draw()

bool PCB_PAINTER::Draw ( const VIEW_ITEM aItem,
int  aLayer 
)
overridevirtual

◆ draw() [14/14]

◆ getDrillShape()

int PCB_PAINTER::getDrillShape ( const PAD aPad) const
protectedvirtual

Return drill shape of a pad.

Reimplemented in KIGFX::PCB_PRINT_PAINTER.

Definition at line 474 of file pcb_painter.cpp.

References PAD::GetDrillShape().

Referenced by KIGFX::PCB_PRINT_PAINTER::getDrillShape().

◆ getLineThickness()

int PCB_PAINTER::getLineThickness ( int  aActualThickness) const
protected

Get the thickness to draw for a line (e.g.

0 thickness lines get a minimum value).

Parameters
aActualThicknessline own thickness
Returns
the thickness to draw

Definition at line 462 of file pcb_painter.cpp.

References KIGFX::RENDER_SETTINGS::m_outlineWidth, and m_pcbSettings.

Referenced by draw().

◆ getPadHoleShape()

SHAPE_SEGMENT PCB_PAINTER::getPadHoleShape ( const PAD aPad) const
protectedvirtual

Return hole shape for a pad (internal units).

Reimplemented in KIGFX::PCB_PRINT_PAINTER.

Definition at line 480 of file pcb_painter.cpp.

References PAD::GetEffectiveHoleShape().

Referenced by draw(), and KIGFX::PCB_PRINT_PAINTER::getPadHoleShape().

◆ GetSettings()

virtual PCB_RENDER_SETTINGS * KIGFX::PCB_PAINTER::GetSettings ( )
inlineoverridevirtual

Return a pointer to current settings that are going to be used when drawing items.

Returns
Current rendering settings.

Implements KIGFX::PAINTER.

Definition at line 161 of file pcb_painter.h.

References m_pcbSettings.

Referenced by PCB_BASE_FRAME::ActivateGalCanvas(), PCB_EDIT_FRAME::CommonSettingsChanged(), PCBNEW_PRINTOUT::setupPainter(), PAD::ViewGetLOD(), PCB_SHAPE::ViewGetLOD(), PCB_TEXT::ViewGetLOD(), PCB_TEXTBOX::ViewGetLOD(), PCB_TRACK::ViewGetLOD(), and PCB_VIA::ViewGetLOD().

◆ getViaDrillSize()

int PCB_PAINTER::getViaDrillSize ( const PCB_VIA aVia) const
protectedvirtual

Return drill diameter for a via (internal units).

Reimplemented in KIGFX::PCB_PRINT_PAINTER.

Definition at line 487 of file pcb_painter.cpp.

References PCB_VIA::GetDrillValue().

Referenced by draw(), and KIGFX::PCB_PRINT_PAINTER::getViaDrillSize().

◆ SetGAL()

void KIGFX::PAINTER::SetGAL ( GAL aGal)
inlineinherited

Changes Graphics Abstraction Layer used for drawing items for a new one.

Parameters
aGalis the new GAL instance.

Definition at line 75 of file painter.h.

References KIGFX::PAINTER::m_gal.

◆ strokeText()

◆ viewer_settings()

Member Data Documentation

◆ m_frameType

FRAME_T KIGFX::PCB_PAINTER::m_frameType
protected

Definition at line 216 of file pcb_painter.h.

Referenced by draw(), and viewer_settings().

◆ m_gal

GAL* KIGFX::PAINTER::m_gal
protectedinherited

Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.

DrawLine, DrawCircle, etc.)

Definition at line 101 of file painter.h.

Referenced by KIGFX::SCH_PAINTER::draw(), draw(), Draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), KIGFX::SCH_PAINTER::getShadowWidth(), KIGFX::PAINTER::SetGAL(), and strokeText().

◆ m_holePlatingThickness

int KIGFX::PCB_PAINTER::m_holePlatingThickness
protected

Definition at line 219 of file pcb_painter.h.

Referenced by draw(), and Draw().

◆ m_lockedShadowMargin

int KIGFX::PCB_PAINTER::m_lockedShadowMargin
protected

Definition at line 220 of file pcb_painter.h.

Referenced by draw(), and Draw().

◆ m_maxError

int KIGFX::PCB_PAINTER::m_maxError
protected

Definition at line 218 of file pcb_painter.h.

Referenced by draw(), and Draw().

◆ m_pcbSettings

PCB_RENDER_SETTINGS KIGFX::PCB_PAINTER::m_pcbSettings
protected

Definition at line 215 of file pcb_painter.h.

Referenced by draw(), Draw(), getLineThickness(), and GetSettings().


The documentation for this class was generated from the following files: