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

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

#include <pcb_painter.h>

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

Public Member Functions

 PCB_PAINTER (GAL *aGal, FRAME_T aFrameType)
 
virtual PCB_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.
 
virtual bool HasUniformColor (const VIEW_ITEM *aItem, int aLayer) const override
 Return false when drawing the item on the given layer emits more than one colour, so a cached group of it cannot be recoloured in place and must be repainted instead.
 

Protected Member Functions

PCB_VIEWERS_SETTINGS_BASE * viewer_settings ()
 
bool zoneOutlineOnly (const ZONE *aZone) const
 True when a zone's only visual is its outline, as for a rule area or outline-only display.
 
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_DRILL_MAP *aMap, int aLayer)
 
void draw (const PCB_SHAPE *aSegment, int aLayer)
 
void draw (const PCB_REFERENCE_IMAGE *aBitmap, int aLayer)
 
void draw (const PCB_FIELD *aField, int aLayer)
 
void draw (const PCB_TEXT *aText, int aLayer)
 
void draw (const PCB_TEXTBOX *aText, int aLayer)
 
void draw (const PCB_TABLE *aTable, 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_BARCODE *aBarcode, int aLayer)
 
void draw (const PCB_DIMENSION_BASE *aDimension, int aLayer)
 
void draw (const PCB_POINT *aPoint, int aLayer)
 
void draw (const PCB_TARGET *aTarget)
 
void draw (const PCB_MARKER *aMarker, int aLayer)
 
void draw (const PCB_BOARD_OUTLINE *aBoardOutline, int aLayer)
 
void draw (const PCB_GRID_ITEM *aGridItem, int aLayer)
 
void drawDrillSymbol (const BOARD_ITEM *aItem, int aLayer)
 
void drawDrillMarks (const PCB_DRILL_MAP *aMap, const std::vector< DRILL_SYMBOL_ENTRY > &aEntries, const COLOR4D &aColor, const KIFONT::METRICS &aFontMetrics)
 One hole's marks for one map.
 
void drawChartSymbols (const PCB_DRILL_CHART *aChart, int aLayer)
 
int getLineThickness (int aActualThickness) const
 Get the thickness to draw for a line (e.g.
 
virtual PAD_DRILL_SHAPE getDrillShape (const PAD *aPad) const
 Return drill shape of a pad.
 
virtual SHAPE_SEGMENT getPadHoleShape (const PAD *aPad) const
 Return hole shape for a pad (internal units).
 
virtual int getViaDrillSize (const PCB_VIA *aVia) const
 Return drill diameter for a via (internal units).
 
void strokeText (const wxString &aText, const VECTOR2I &aPosition, const TEXT_ATTRIBUTES &aAttrs, const KIFONT::METRICS &aFontMetrics)
 
void renderNetNameForSegment (const SHAPE_SEGMENT &aSeg, const COLOR4D &aColor, const wxString &aNetName) const
 
void drawBackdrillIndicator (const BOARD_ITEM *aItem, const VECTOR2D &aCenter, int aBackdrillSize, PCB_LAYER_ID aMustCutLayer, int aOffset)
 Draw backdrill indicator (two semi-circles) at the given center point.
 
void drawPostMachiningIndicator (const BOARD_ITEM *aItem, const VECTOR2D &aCenter, PCB_LAYER_ID aLayer)
 Draw post-machining indicator (dashed circle) at the given center point.
 

Protected Attributes

PCB_RENDER_SETTINGS m_pcbSettings
 
FRAME_T m_frameType
 
int m_maxError
 
int m_holePlatingThickness
 
int m_lockedShadowMargin
 

Detailed Description

Contains methods for drawing PCB-specific items.

Definition at line 256 of file pcb_painter.h.

Constructor & Destructor Documentation

◆ PCB_PAINTER()

PCB_PAINTER::PCB_PAINTER ( GAL * aGal,
FRAME_T aFrameType )

Definition at line 736 of file pcb_painter.cpp.

Member Function Documentation

◆ Draw()

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

Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.

Parameters
aItemis an item to be drawn.
aLayertells 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 777 of file pcb_painter.cpp.

◆ draw() [1/21]

void PCB_PAINTER::draw ( const FOOTPRINT * aFootprint,
int aLayer )
protected

Definition at line 3579 of file pcb_painter.cpp.

◆ draw() [2/21]

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

Definition at line 1948 of file pcb_painter.cpp.

◆ draw() [3/21]

void PCB_PAINTER::draw ( const PCB_ARC * aArc,
int aLayer )
protected

Definition at line 1131 of file pcb_painter.cpp.

◆ draw() [4/21]

void PCB_PAINTER::draw ( const PCB_BARCODE * aBarcode,
int aLayer )
protected

Definition at line 3856 of file pcb_painter.cpp.

◆ draw() [5/21]

void PCB_PAINTER::draw ( const PCB_BOARD_OUTLINE * aBoardOutline,
int aLayer )
protected

Definition at line 4252 of file pcb_painter.cpp.

◆ draw() [6/21]

void PCB_PAINTER::draw ( const PCB_DIMENSION_BASE * aDimension,
int aLayer )
protected

Definition at line 3877 of file pcb_painter.cpp.

◆ draw() [7/21]

void PCB_PAINTER::draw ( const PCB_DRILL_MAP * aMap,
int aLayer )
protected

Definition at line 1732 of file pcb_painter.cpp.

◆ draw() [8/21]

void PCB_PAINTER::draw ( const PCB_FIELD * aField,
int aLayer )
protected

Definition at line 3262 of file pcb_painter.cpp.

◆ draw() [9/21]

void PCB_PAINTER::draw ( const PCB_GRID_ITEM * aGridItem,
int aLayer )
protected

Definition at line 3993 of file pcb_painter.cpp.

◆ draw() [10/21]

void PCB_PAINTER::draw ( const PCB_GROUP * aGroup,
int aLayer )
protected

Definition at line 3649 of file pcb_painter.cpp.

◆ draw() [11/21]

void PCB_PAINTER::draw ( const PCB_MARKER * aMarker,
int aLayer )
protected

Definition at line 4155 of file pcb_painter.cpp.

◆ draw() [12/21]

void PCB_PAINTER::draw ( const PCB_POINT * aPoint,
int aLayer )
protected

Definition at line 4108 of file pcb_painter.cpp.

◆ draw() [13/21]

void PCB_PAINTER::draw ( const PCB_REFERENCE_IMAGE * aBitmap,
int aLayer )
protected

Definition at line 3210 of file pcb_painter.cpp.

◆ draw() [14/21]

void PCB_PAINTER::draw ( const PCB_SHAPE * aSegment,
int aLayer )
protected

Definition at line 2666 of file pcb_painter.cpp.

◆ draw() [15/21]

void PCB_PAINTER::draw ( const PCB_TABLE * aTable,
int aLayer )
protected

Definition at line 3516 of file pcb_painter.cpp.

◆ draw() [16/21]

void PCB_PAINTER::draw ( const PCB_TARGET * aTarget)
protected

Definition at line 4072 of file pcb_painter.cpp.

◆ draw() [17/21]

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

Definition at line 3269 of file pcb_painter.cpp.

◆ draw() [18/21]

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

Definition at line 3377 of file pcb_painter.cpp.

◆ draw() [19/21]

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

Definition at line 975 of file pcb_painter.cpp.

◆ draw() [20/21]

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

Definition at line 1375 of file pcb_painter.cpp.

◆ draw() [21/21]

void PCB_PAINTER::draw ( const ZONE * aZone,
int aLayer )
protected

Definition at line 3726 of file pcb_painter.cpp.

◆ drawBackdrillIndicator()

void PCB_PAINTER::drawBackdrillIndicator ( const BOARD_ITEM * aItem,
const VECTOR2D & aCenter,
int aBackdrillSize,
PCB_LAYER_ID aMustCutLayer,
int aOffset )
protected

Draw backdrill indicator (two semi-circles) at the given center point.

Parameters
aItemthe board item (for color lookup)
aCentercenter point of the indicator
aBackdrillSizediameter of the backdrill
aMustCutLayerlayer the backdrill must cut
aOffsetdash offset (so that top and bottom backdrills at the same radius will alternate colors)

Definition at line 4279 of file pcb_painter.cpp.

◆ drawChartSymbols()

void PCB_PAINTER::drawChartSymbols ( const PCB_DRILL_CHART * aChart,
int aLayer )
protected

Definition at line 1670 of file pcb_painter.cpp.

◆ drawDrillMarks()

void PCB_PAINTER::drawDrillMarks ( const PCB_DRILL_MAP * aMap,
const std::vector< DRILL_SYMBOL_ENTRY > & aEntries,
const COLOR4D & aColor,
const KIFONT::METRICS & aFontMetrics )
protected

One hole's marks for one map.

Shared so that the map can draw them itself while it is being dragged, when the holes' own view bounds still describe where the marks were.

Definition at line 1830 of file pcb_painter.cpp.

◆ drawDrillSymbol()

void PCB_PAINTER::drawDrillSymbol ( const BOARD_ITEM * aItem,
int aLayer )
protected

Definition at line 1791 of file pcb_painter.cpp.

◆ drawPostMachiningIndicator()

void PCB_PAINTER::drawPostMachiningIndicator ( const BOARD_ITEM * aItem,
const VECTOR2D & aCenter,
PCB_LAYER_ID aLayer )
protected

Draw post-machining indicator (dashed circle) at the given center point.

Parameters
aItemthe board item (for color lookup)
aCentercenter point of the indicator
aLayerlayer to use for color

Definition at line 4307 of file pcb_painter.cpp.

◆ getDrillShape()

PAD_DRILL_SHAPE PCB_PAINTER::getDrillShape ( const PAD * aPad) const
protectedvirtual

Return drill shape of a pad.

Definition at line 758 of file pcb_painter.cpp.

◆ 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 746 of file pcb_painter.cpp.

◆ getPadHoleShape()

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

Return hole shape for a pad (internal units).

Definition at line 764 of file pcb_painter.cpp.

◆ 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 261 of file pcb_painter.h.

◆ getViaDrillSize()

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

Return drill diameter for a via (internal units).

Definition at line 771 of file pcb_painter.cpp.

◆ HasUniformColor()

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

Return false when drawing the item on the given layer emits more than one colour, so a cached group of it cannot be recoloured in place and must be repainted instead.

Reimplemented from KIGFX::PAINTER.

Definition at line 1316 of file pcb_painter.cpp.

◆ renderNetNameForSegment()

void PCB_PAINTER::renderNetNameForSegment ( const SHAPE_SEGMENT & aSeg,
const COLOR4D & aColor,
const wxString & aNetName ) const
protected

Definition at line 1060 of file pcb_painter.cpp.

◆ strokeText()

void PCB_PAINTER::strokeText ( const wxString & aText,
const VECTOR2I & aPosition,
const TEXT_ATTRIBUTES & aAttrs,
const KIFONT::METRICS & aFontMetrics )
protected

Definition at line 3179 of file pcb_painter.cpp.

◆ viewer_settings()

PCB_VIEWERS_SETTINGS_BASE * PCB_PAINTER::viewer_settings ( )
protected

Definition at line 95 of file pcb_painter.cpp.

◆ zoneOutlineOnly()

bool PCB_PAINTER::zoneOutlineOnly ( const ZONE * aZone) const
protected

True when a zone's only visual is its outline, as for a rule area or outline-only display.

Definition at line 1368 of file pcb_painter.cpp.

Member Data Documentation

◆ m_frameType

FRAME_T KIGFX::PCB_PAINTER::m_frameType
protected

Definition at line 364 of file pcb_painter.h.

◆ m_holePlatingThickness

int KIGFX::PCB_PAINTER::m_holePlatingThickness
protected

Definition at line 367 of file pcb_painter.h.

◆ m_lockedShadowMargin

int KIGFX::PCB_PAINTER::m_lockedShadowMargin
protected

Definition at line 368 of file pcb_painter.h.

◆ m_maxError

int KIGFX::PCB_PAINTER::m_maxError
protected

Definition at line 366 of file pcb_painter.h.

◆ m_pcbSettings

PCB_RENDER_SETTINGS KIGFX::PCB_PAINTER::m_pcbSettings
protected

Definition at line 363 of file pcb_painter.h.


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