KiCad PCB EDA Suite
KIGFX::VIEW::UPDATE_COLOR_VISITOR Struct Reference

Public Member Functions

 UPDATE_COLOR_VISITOR (int aLayer, PAINTER *aPainter, GAL *aGal)
 
bool operator() (VIEW_ITEM *aItem)
 

Public Attributes

int layer
 
PAINTERpainter
 
GALgal
 

Detailed Description

Definition at line 727 of file view.cpp.

Constructor & Destructor Documentation

◆ UPDATE_COLOR_VISITOR()

KIGFX::VIEW::UPDATE_COLOR_VISITOR::UPDATE_COLOR_VISITOR ( int  aLayer,
PAINTER aPainter,
GAL aGal 
)
inline

Definition at line 729 of file view.cpp.

729  :
730  layer( aLayer ),
731  painter( aPainter ),
732  gal( aGal )
733  {
734  }

Member Function Documentation

◆ operator()()

bool KIGFX::VIEW::UPDATE_COLOR_VISITOR::operator() ( VIEW_ITEM aItem)
inline

Definition at line 736 of file view.cpp.

737  {
738  // Obtain the color that should be used for coloring the item
739  const COLOR4D color = painter->GetSettings()->GetColor( aItem, layer );
740  int group = aItem->viewPrivData()->getGroup( layer );
741 
742  if( group >= 0 )
743  gal->ChangeGroupColor( group, color );
744 
745  return true;
746  }
int color
Definition: DXF_plotter.cpp:57
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor)
Change the color used to draw the group.
virtual COLOR4D GetColor(const VIEW_ITEM *aItem, int aLayer) const =0
Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using curr...
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References KIGFX::GAL::ChangeGroupColor(), color, gal, KIGFX::RENDER_SETTINGS::GetColor(), KIGFX::VIEW_ITEM_DATA::getGroup(), KIGFX::PAINTER::GetSettings(), group, layer, painter, and KIGFX::VIEW_ITEM::viewPrivData().

Member Data Documentation

◆ gal

GAL* KIGFX::VIEW::UPDATE_COLOR_VISITOR::gal

Definition at line 750 of file view.cpp.

Referenced by operator()().

◆ layer

int KIGFX::VIEW::UPDATE_COLOR_VISITOR::layer

Definition at line 748 of file view.cpp.

Referenced by operator()().

◆ painter

PAINTER* KIGFX::VIEW::UPDATE_COLOR_VISITOR::painter

Definition at line 749 of file view.cpp.

Referenced by operator()().


The documentation for this struct was generated from the following file: