KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 ZONE_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 58 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.

◆ ~PAINTER()

PAINTER::~PAINTER ( )
virtual

Definition at line 38 of file painter.cpp.

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 ZONE_PAINTER, KIGFX::SCH_PAINTER, KIGFX::DS_PAINTER, KIGFX::GERBVIEW_PAINTER, and KIGFX::PCB_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::SCH_PAINTER, KIGFX::GERBVIEW_PAINTER, KIGFX::DS_PAINTER, and KIGFX::PCB_PAINTER.

Referenced by EDITOR_CONDITIONS::bboxesFunc(), DS_PROXY_VIEW_ITEM::buildDrawList(), DIALOG_NET_INSPECTOR::buildNetsList(), BOARD_INSPECTION_TOOL::ClearHighlight(), SCH_BASE_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), PCB_GRID_HELPER::computeAnchors(), SYMBOL_DIFF_WIDGET::DisplayDiff(), SYMBOL_PREVIEW_WIDGET::DisplayPart(), PNS_KICAD_IFACE::DisplayRatline(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), BOARD_INSPECTION_TOOL::doHideRatsnestNet(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), FOOTPRINT_PREVIEW_PANEL::GetBackgroundColor(), FOOTPRINT_PREVIEW_PANEL::GetForegroundColor(), ROUTER_PREVIEW_ITEM::getLayerColor(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PNS::TOOL_BASE::highlightNets(), ROUTER_TOOL::Init(), DRAWING_TOOL::Init(), PCB_SELECTION_TOOL::Init(), PNS_KICAD_IFACE::IsItemVisible(), PANEL_SETUP_NETCLASSES::loadNetclasses(), PCB_EDIT_FRAME::LoadProjectSettings(), 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(), DIALOG_NET_INSPECTOR::onSortingChanged(), KIGFX::VIEW::UPDATE_COLOR_VISITOR::operator()(), PCB_GRID_HELPER::PCB_GRID_HELPER(), DIALOG_PAD_PROPERTIES::prepareCanvas(), PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates(), PCB_GRID_HELPER::queryVisible(), NET_GRID_TABLE::Rebuild(), APPEARANCE_CONTROLS::rebuildNets(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), EE_SELECTION_TOOL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), PCB_SELECTION_TOOL::Reset(), PCB_EDIT_FRAME::SaveProjectLocalSettings(), PCB_EDIT_FRAME::saveProjectSettings(), PCB_SELECTION_TOOL::Selectable(), NETS_SEARCH_HANDLER::SelectItems(), RATSNEST_SEARCH_HANDLER::SelectItems(), PCB_BASE_FRAME::SetBoard(), EDA_DRAW_PANEL_GAL::SetHighContrastLayer(), GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), BOARD_PRINTOUT::setupPainter(), PCB_EDIT_FRAME::setupUIConditions(), PCBNEW_PRINTOUT::setupViewLayers(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), COMMON_TOOLS::ToggleBoundingBoxes(), PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), KIGFX::VIEW::UpdateAllLayersColor(), PCB_DRAW_PANEL_GAL::UpdateColors(), KIGFX::VIEW::updateItemColor(), NET_GRID_TABLE::updateNetColor(), PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview(), PANEL_PCBNEW_COLOR_SETTINGS::updatePreview(), DS_PROXY_VIEW_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and KIGFX::PREVIEW::SELECTION_AREA::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 76 of file painter.h.

Member Data Documentation

◆ m_gal


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