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 710 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 712 of file view.cpp.

712 :
713 layer( aLayer ),
714 painter( aPainter ),
715 gal( aGal )
716 {
717 }

Member Function Documentation

◆ operator()()

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

Definition at line 719 of file view.cpp.

720 {
721 // Obtain the color that should be used for coloring the item
722 const COLOR4D color = painter->GetSettings()->GetColor( aItem, layer );
723 int group = aItem->viewPrivData()->getGroup( layer );
724
725 if( group >= 0 )
726 gal->ChangeGroupColor( group, color );
727
728 return true;
729 }
int color
Definition: DXF_plotter.cpp:57
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor)
Change the color used to draw the group.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
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...

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 733 of file view.cpp.

Referenced by operator()().

◆ layer

int KIGFX::VIEW::UPDATE_COLOR_VISITOR::layer

Definition at line 731 of file view.cpp.

Referenced by operator()().

◆ painter

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

Definition at line 732 of file view.cpp.

Referenced by operator()().


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