KiCad PCB EDA Suite
|
Contains all the knowledge about how to draw graphical object onto any particular output device. More...
#include <painter.h>
Public Member Functions | |
PAINTER (GAL *aGal) | |
Initialize this object for painting on any of the polymorphic GRAPHICS_ABSTRACTION_LAYER* derivatives. | |
virtual | ~PAINTER () |
void | SetGAL (GAL *aGal) |
Changes Graphics Abstraction Layer used for drawing items for a new one. | |
virtual RENDER_SETTINGS * | GetSettings ()=0 |
Return a pointer to current settings that are going to be used when drawing items. | |
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. | |
Protected Attributes | |
GAL * | m_gal |
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg. | |
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.
PAINTER::PAINTER | ( | GAL * | aGal | ) |
Initialize this object for painting on any of the polymorphic GRAPHICS_ABSTRACTION_LAYER* derivatives.
aGal | is 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.
|
virtual |
Definition at line 38 of file painter.cpp.
|
pure virtual |
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. |
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().
|
pure virtual |
Return a pointer to current settings that are going to be used when drawing items.
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(), BOARD_INSPECTION_TOOL::ClearHighlight(), SCH_BASE_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), PCB_GRID_HELPER::computeAnchors(), DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), 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(), PAD_TOOL::EnumeratePads(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PCB_SELECTION_TOOL::FilterCollectorForFootprints(), FOOTPRINT_PREVIEW_PANEL::GetBackgroundColor(), FOOTPRINT_PREVIEW_PANEL::GetForegroundColor(), ROUTER_PREVIEW_ITEM::getLayerColor(), GRID_HELPER::GRID_HELPER(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), PNS::TOOL_BASE::highlightNets(), PCB_NET_INSPECTOR_PANEL::highlightSelectedNets(), ROUTER_TOOL::Init(), DRAWING_TOOL::Init(), PCB_SELECTION_TOOL::Init(), PNS_KICAD_IFACE::IsItemVisible(), PCB_EDIT_FRAME::LoadProjectSettings(), PCB_BASE_FRAME::LoadSettings(), DIALOG_PAD_PROPERTIES::onChangePadMode(), PCB_NET_INSPECTOR_PANEL::onClearHighlighting(), ZONE_CREATE_HELPER::OnFirstPoint(), GERBER_LAYER_WIDGET::OnLayerColorChange(), APPEARANCE_CONTROLS::onNetclassContextMenu(), PCB_NET_INSPECTOR_PANEL::OnNetsListContextMenu(), KIGFX::VIEW::UPDATE_COLOR_VISITOR::operator()(), PCB_GRID_HELPER::PCB_GRID_HELPER(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), DIALOG_PAD_PROPERTIES::prepareCanvas(), PCB_SELECTION_TOOL::pruneObscuredSelectionCandidates(), PCB_GRID_HELPER::queryVisible(), NET_GRID_TABLE::Rebuild(), 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(), 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(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), and KIGFX::ANCHOR_DEBUG::ViewDraw().
|
inline |
|
protected |
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(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), KIGFX::SCH_PAINTER::drawItemBoundingBox(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), KIGFX::SCH_PAINTER::getShadowWidth(), KIGFX::PCB_PAINTER::renderNetNameForSegment(), and KIGFX::PCB_PAINTER::strokeText().