KiCad PCB EDA Suite
KIGFX::PAINTER Class Referenceabstract

Contains all the knowledge about how to draw graphical object onto any particular output device. More...

#include <painter.h>

Inheritance diagram for KIGFX::PAINTER:
KIGFX::DS_PAINTER KIGFX::GERBVIEW_PAINTER KIGFX::PCB_PAINTER KIGFX::SCH_PAINTER KIGFX::PCB_PRINT_PAINTER

Public Member Functions

 PAINTER (GAL *aGal)
 Initialize this object for painting on any of the polymorphic GRAPHICS_ABSTRACTION_LAYER* derivatives. More...
 
virtual ~PAINTER ()
 
void SetGAL (GAL *aGal)
 Changes Graphics Abstraction Layer used for drawing items for a new one. More...
 
virtual RENDER_SETTINGSGetSettings ()=0
 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)=0
 Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item. More...
 

Protected Attributes

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

Detailed Description

Contains all the knowledge about how to draw graphical object onto any particular output device.

This knowledge is held outside the individual graphical objects so that alternative output devices may be used, and so that the graphical objects themselves to not contain drawing routines. Drawing routines in the objects cause problems with usages of the objects as simple container objects in DLL/DSOs. PAINTER is an abstract layer because every module (pcbnew, eeschema, etc.) has to draw different kinds of objects.

Definition at line 57 of file painter.h.

Constructor & Destructor Documentation

◆ PAINTER()

PAINTER::PAINTER ( GAL aGal)

Initialize this object for painting on any of the polymorphic GRAPHICS_ABSTRACTION_LAYER* derivatives.

Parameters
aGalis a pointer to a polymorphic GAL device on which to draw (i.e. Cairo, OpenGL, wxDC). No ownership is given to this PAINTER of aGal.

Definition at line 32 of file painter.cpp.

32  :
33  m_gal( aGal )
34 {
35 }
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101

◆ ~PAINTER()

PAINTER::~PAINTER ( )
virtual

Definition at line 38 of file painter.cpp.

39 {
40 }

Member Function Documentation

◆ Draw()

virtual bool KIGFX::PAINTER::Draw ( const VIEW_ITEM aItem,
int  aLayer 
)
pure virtual

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.

Implemented in KIGFX::PCB_PAINTER, KIGFX::GERBVIEW_PAINTER, KIGFX::SCH_PAINTER, and KIGFX::DS_PAINTER.

Referenced by KIGFX::VIEW::draw(), KIGFX::VIEW::updateItemGeometry(), and KIGFX::VIEW_GROUP::ViewDraw().

◆ GetSettings()

virtual RENDER_SETTINGS* KIGFX::PAINTER::GetSettings ( )
pure virtual

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

Returns
Current rendering settings.

Implemented in KIGFX::PCB_PAINTER, KIGFX::GERBVIEW_PAINTER, KIGFX::SCH_PAINTER, and KIGFX::DS_PAINTER.

Referenced by DS_PROXY_VIEW_ITEM::buildDrawList(), DIALOG_NET_INSPECTOR::buildNetsList(), BOARD_INSPECTION_TOOL::ClearHighlight(), PL_EDITOR_FRAME::CommonSettingsChanged(), PCB_BASE_FRAME::CommonSettingsChanged(), PCB_GRID_HELPER::computeAnchors(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), BOARD_INSPECTION_TOOL::doHideNet(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), FOOTPRINT_PREVIEW_PANEL::GetBackgroundColor(), FOOTPRINT_PREVIEW_PANEL::GetForegroundColor(), ROUTER_PREVIEW_ITEM::getLayerColor(), SCH_BASE_FRAME::GetRenderSettings(), PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PNS_KICAD_IFACE::IsItemVisible(), PCB_BASE_FRAME::LoadSettings(), DIALOG_PAD_PROPERTIES::onChangePadMode(), ZONE_CREATE_HELPER::OnFirstPoint(), GERBER_LAYER_WIDGET::OnLayerColorChange(), APPEARANCE_CONTROLS::onNetclassColorChanged(), APPEARANCE_CONTROLS::onNetclassContextMenu(), DIALOG_NET_INSPECTOR::onSelChanged(), GERBVIEW_DRAW_PANEL_GAL::OnShow(), DIALOG_NET_INSPECTOR::onSortingChanged(), KIGFX::VIEW::UPDATE_COLOR_VISITOR::operator()(), PCB_GRID_HELPER::PCB_GRID_HELPER(), DIALOG_PAD_PROPERTIES::prepareCanvas(), PCB_GRID_HELPER::queryVisible(), NET_GRID_TABLE::Rebuild(), APPEARANCE_CONTROLS::rebuildNets(), DIALOG_PAD_PROPERTIES::redraw(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), GERBVIEW_SELECTION_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Selectable(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), BOARD_PRINTOUT::setupPainter(), PCBNEW_PRINTOUT::setupViewLayers(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_EESCHEMA_COLOR_SETTINGS::TransferDataFromWindow(), KIGFX::VIEW::UpdateAllLayersColor(), PCB_DRAW_PANEL_GAL::UpdateColors(), KIGFX::VIEW::updateItemColor(), NET_GRID_TABLE::updateNetColor(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), DS_PROXY_VIEW_ITEM::ViewDraw(), and EDIT_POINTS::ViewDraw().

◆ SetGAL()

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

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.

76  {
77  m_gal = aGal;
78  }
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
Definition: painter.h:101

References m_gal.

Member Data Documentation

◆ m_gal


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