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

715 :
716 layer( aLayer ),
717 painter( aPainter ),
718 gal( aGal )
719 {
720 }

Member Function Documentation

◆ operator()()

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

Definition at line 722 of file view.cpp.

723 {
724 // Obtain the color that should be used for coloring the item
725 const COLOR4D color = painter->GetSettings()->GetColor( aItem, layer );
726 int group = aItem->viewPrivData()->getGroup( layer );
727
728 if( group >= 0 )
729 gal->ChangeGroupColor( group, color );
730
731 return true;
732 }
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 736 of file view.cpp.

Referenced by operator()().

◆ layer

int KIGFX::VIEW::UPDATE_COLOR_VISITOR::layer

Definition at line 734 of file view.cpp.

Referenced by operator()().

◆ painter

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

Definition at line 735 of file view.cpp.

Referenced by operator()().


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