KiCad PCB EDA Suite
KIGFX::PAINTER Class Referenceabstract

Class PAINTER 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::PCB_PAINTER

Public Member Functions

 PAINTER (GAL *aGal)
 
virtual ~PAINTER ()
 
void SetGAL (GAL *aGal)
 Function SetGAL Changes Graphics Abstraction Layer used for drawing items for a new one. More...
 
virtual void ApplySettings (const RENDER_SETTINGS *aSettings)=0
 Function ApplySettings Loads colors and display modes settings that are going to be used when drawing items. More...
 
virtual RENDER_SETTINGSGetSettings ()=0
 Function GetSettings Returns pointer to current settings that are going to be used when drawing items. More...
 
virtual bool Draw (const VIEW_ITEM *aItem, int aLayer)=0
 Function Draw Takes an instance of VIEW_ITEM and passes it to a function that know 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...
 
COLOR4D m_brightenedColor
 Color of brightened item frame. More...
 

Detailed Description

Class PAINTER 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 278 of file painter.h.

Constructor & Destructor Documentation

PAINTER::PAINTER ( GAL aGal)

Definition at line 67 of file painter.cpp.

67  :
68  m_gal( aGal ), m_brightenedColor( 0.0, 1.0, 0.0, 0.9 )
69 {
70 }
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg...
Definition: painter.h:330
COLOR4D m_brightenedColor
Color of brightened item frame.
Definition: painter.h:333
PAINTER::~PAINTER ( )
virtual

Definition at line 73 of file painter.cpp.

74 {
75 }

Member Function Documentation

virtual void KIGFX::PAINTER::ApplySettings ( const RENDER_SETTINGS aSettings)
pure virtual

Function ApplySettings Loads colors and display modes settings that are going to be used when drawing items.

Parameters
aSettingsare settings to be applied.

Implemented in KIGFX::PCB_PAINTER.

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

Function Draw Takes an instance of VIEW_ITEM and passes it to a function that know 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.

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

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

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

Parameters
aGalis the new GAL instance.

Definition at line 298 of file painter.h.

References m_gal.

Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().

299  {
300  m_gal = aGal;
301  }
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg...
Definition: painter.h:330

Member Data Documentation

COLOR4D KIGFX::PAINTER::m_brightenedColor
protected

Color of brightened item frame.

Definition at line 333 of file painter.h.

GAL* KIGFX::PAINTER::m_gal
protected

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

DrawLine, DrawCircle, etc.)

Definition at line 330 of file painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), and SetGAL().


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