KiCad PCB EDA Suite
KIGFX::DS_RENDER_SETTINGS Class Reference

Store page-layout-specific render settings. More...

#include <ds_painter.h>

Inheritance diagram for KIGFX::DS_RENDER_SETTINGS:
KIGFX::RENDER_SETTINGS

Public Member Functions

 DS_RENDER_SETTINGS ()
 
void LoadColors (const COLOR_SETTINGS *aSettings) override
 
virtual COLOR4D GetColor (const VIEW_ITEM *aItem, int aLayer) const override
 Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using currently used render settings. More...
 
bool IsBackgroundDark () const override
 
const COLOR4DGetBackgroundColor () override
 Return current background color settings. More...
 
void SetBackgroundColor (const COLOR4D &aColor) override
 Set the background color. More...
 
void SetNormalColor (const COLOR4D &aColor)
 
void SetSelectedColor (const COLOR4D &aColor)
 
void SetBrightenedColor (const COLOR4D &aColor)
 
void SetPageBorderColor (const COLOR4D &aColor)
 
const COLOR4DGetGridColor () override
 Return current grid color settings. More...
 
const COLOR4DGetCursorColor () override
 Return current cursor color settings. More...
 
void SetLayerIsHighContrast (int aLayerId, bool aEnabled=true)
 Set the specified layer as high-contrast. More...
 
bool GetLayerIsHighContrast (int aLayerId) const
 Return information whether the queried layer is marked as high-contrast. More...
 
const std::set< unsigned int > GetHighContrastLayers () const
 Returns the set of currently high-contrast layers. More...
 
PCB_LAYER_ID GetPrimaryHighContrastLayer () const
 Return the board layer which is in high-contrast mode. More...
 
PCB_LAYER_ID GetActiveLayer () const
 
void SetActiveLayer (PCB_LAYER_ID aLayer)
 
void ClearHighContrastLayers ()
 Clear the list of active layers. More...
 
bool IsHighlightEnabled () const
 Return current highlight setting. More...
 
const std::set< int > & GetHighlightNetCodes () const
 Return the netcode of currently highlighted net. More...
 
void SetHighlight (bool aEnabled, int aNetcode=-1, bool aMulti=false)
 Turns on/off highlighting. More...
 
void SetHighlight (std::set< int > &aHighlight, bool aEnabled=true)
 Turns on highlighting and highlights multiple nets. More...
 
void SetHighContrast (bool aEnabled)
 Turns on/off high contrast display mode. More...
 
bool GetHighContrast () const
 
float GetDrawingSheetLineWidth () const
 
int GetDefaultPenWidth () const
 
void SetDefaultPenWidth (int aWidth)
 
int GetMinPenWidth () const
 
void SetMinPenWidth (int aWidth)
 
bool GetShowPageLimits () const
 
void SetShowPageLimits (bool aDraw)
 
bool IsPrinting () const
 
void SetIsPrinting (bool isPrinting)
 
const COLOR4DGetLayerColor (int aLayer) const
 Return the color used to draw a layer. More...
 
void SetLayerColor (int aLayer, const COLOR4D &aColor)
 Change the color used to draw a layer. More...
 
void SetOutlineWidth (float aWidth)
 Set line width used for drawing outlines. More...
 
void SetHighlightFactor (float aFactor)
 
void SetSelectFactor (float aFactor)
 
void SetHighContrastFactor (float aFactor)
 
wxDC * GetPrintDC () const
 
void SetPrintDC (wxDC *aDC)
 

Protected Member Functions

virtual void update ()
 Precalculates extra colors for layers (e.g. More...
 

Protected Attributes

PCB_LAYER_ID m_activeLayer
 
std::set< unsigned int > m_highContrastLayers
 
COLOR4D m_layerColors [LAYER_ID_COUNT]
 
COLOR4D m_layerColorsHi [LAYER_ID_COUNT]
 
COLOR4D m_layerColorsSel [LAYER_ID_COUNT]
 
COLOR4D m_hiContrastColor [LAYER_ID_COUNT]
 
COLOR4D m_layerColorsDark [LAYER_ID_COUNT]
 
COLOR4D m_backgroundColor
 
bool m_hiContrastEnabled
 Parameters for display modes. More...
 
float m_hiContrastFactor
 
bool m_highlightEnabled
 
std::set< int > m_highlightNetcodes
 
float m_highlightFactor
 
float m_selectFactor
 
float m_outlineWidth
 
float m_drawingSheetLineWidth
 
int m_defaultPenWidth
 
int m_minPenWidth
 
bool m_showPageLimits
 
bool m_isPrinting
 
wxDC * m_printDC
 

Private Attributes

COLOR4D m_normalColor
 
COLOR4D m_selectedColor
 
COLOR4D m_brightenedColor
 
COLOR4D m_gridColor
 
COLOR4D m_cursorColor
 
COLOR4D m_pageBorderColor
 

Friends

class DS_PAINTER
 

Detailed Description

Store page-layout-specific render settings.

Definition at line 46 of file ds_painter.h.

Constructor & Destructor Documentation

◆ DS_RENDER_SETTINGS()

DS_RENDER_SETTINGS::DS_RENDER_SETTINGS ( )

Definition at line 45 of file ds_painter.cpp.

46 {
47  m_backgroundColor = COLOR4D( 1.0, 1.0, 1.0, 1.0 );
50  m_brightenedColor = COLOR4D( 0.0, 1.0, 0.0, 0.9 );
51  m_pageBorderColor = COLOR4D( 0.4, 0.4, 0.4, 1.0 );
52 
53  update();
54 }
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
Definition: color4d.h:262
virtual void update()
Precalculates extra colors for layers (e.g.
Definition: color4d.h:59
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References KIGFX::COLOR4D::Brightened(), KIGFX::RENDER_SETTINGS::m_backgroundColor, m_brightenedColor, m_normalColor, m_pageBorderColor, m_selectedColor, RED, and KIGFX::RENDER_SETTINGS::update().

Member Function Documentation

◆ ClearHighContrastLayers()

void KIGFX::RENDER_SETTINGS::ClearHighContrastLayers ( )
inlineinherited

Clear the list of active layers.

Definition at line 118 of file render_settings.h.

119  {
120  m_highContrastLayers.clear();
121  }
std::set< unsigned int > m_highContrastLayers

References KIGFX::RENDER_SETTINGS::m_highContrastLayers.

Referenced by GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), and EDA_DRAW_PANEL_GAL::SetHighContrastLayer().

◆ GetActiveLayer()

PCB_LAYER_ID KIGFX::RENDER_SETTINGS::GetActiveLayer ( ) const
inlineinherited

Definition at line 112 of file render_settings.h.

112 { return m_activeLayer; }

References KIGFX::RENDER_SETTINGS::m_activeLayer.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ GetBackgroundColor()

const COLOR4D& KIGFX::DS_RENDER_SETTINGS::GetBackgroundColor ( )
inlineoverridevirtual

Return current background color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 64 of file ds_painter.h.

64 { return m_backgroundColor; }

References KIGFX::RENDER_SETTINGS::m_backgroundColor.

◆ GetColor()

COLOR4D DS_RENDER_SETTINGS::GetColor ( const VIEW_ITEM aItem,
int  aLayer 
) const
overridevirtual

Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using currently used render settings.

Parameters
aItemis the VIEW_ITEM.
aLayeris the layer.
Returns
The color.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 71 of file ds_painter.cpp.

72 {
73  const EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );
74 
75  if( item )
76  {
77  // Selection disambiguation
78  if( item->IsBrightened() )
79  return m_brightenedColor;
80 
81  if( item->IsSelected() )
82  return m_selectedColor;
83  }
84 
85  return m_normalColor;
86 }
bool IsSelected() const
Definition: eda_item.h:123
bool IsBrightened() const
Definition: eda_item.h:126
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100

References EDA_ITEM::IsBrightened(), EDA_ITEM::IsSelected(), m_brightenedColor, m_normalColor, and m_selectedColor.

◆ GetCursorColor()

const COLOR4D& KIGFX::DS_RENDER_SETTINGS::GetCursorColor ( )
inlineoverridevirtual

Return current cursor color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 78 of file ds_painter.h.

79  {
81  return m_cursorColor;
82  }
Definition: color4d.h:44
bool IsBackgroundDark() const override
Definition: ds_painter.h:58
Definition: color4d.h:48

References BLACK, IsBackgroundDark(), m_cursorColor, and WHITE.

◆ GetDefaultPenWidth()

◆ GetDrawingSheetLineWidth()

float KIGFX::RENDER_SETTINGS::GetDrawingSheetLineWidth ( ) const
inlineinherited

◆ GetGridColor()

const COLOR4D& KIGFX::DS_RENDER_SETTINGS::GetGridColor ( )
inlineoverridevirtual

Return current grid color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 72 of file ds_painter.h.

73  {
75  return m_gridColor;
76  }
bool IsBackgroundDark() const override
Definition: ds_painter.h:58

References DARKGRAY, IsBackgroundDark(), LIGHTGRAY, and m_gridColor.

◆ GetHighContrast()

bool KIGFX::RENDER_SETTINGS::GetHighContrast ( ) const
inlineinherited

◆ GetHighContrastLayers()

const std::set<unsigned int> KIGFX::RENDER_SETTINGS::GetHighContrastLayers ( ) const
inlineinherited

Returns the set of currently high-contrast layers.

Definition at line 90 of file render_settings.h.

91  {
92  return m_highContrastLayers;
93  }
std::set< unsigned int > m_highContrastLayers

References KIGFX::RENDER_SETTINGS::m_highContrastLayers.

Referenced by PCB_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::queryVisible(), and PCB_SELECTION_TOOL::Selectable().

◆ GetHighlightNetCodes()

const std::set<int>& KIGFX::RENDER_SETTINGS::GetHighlightNetCodes ( ) const
inlineinherited

Return the netcode of currently highlighted net.

Returns
Netcode of currently highlighted net.

Definition at line 138 of file render_settings.h.

139  {
140  return m_highlightNetcodes;
141  }
std::set< int > m_highlightNetcodes

References KIGFX::RENDER_SETTINGS::m_highlightNetcodes.

Referenced by PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), and PCB_EDIT_FRAME::setupUIConditions().

◆ GetLayerColor()

const COLOR4D& KIGFX::RENDER_SETTINGS::GetLayerColor ( int  aLayer) const
inlineinherited

Return the color used to draw a layer.

Parameters
aLayeris the layer number.

Definition at line 237 of file render_settings.h.

238  {
239  return m_layerColors[aLayer];
240  }
COLOR4D m_layerColors[LAYER_ID_COUNT]

References KIGFX::RENDER_SETTINGS::m_layerColors.

Referenced by DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLine(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight(), BOARD_PRINTOUT::DrawPage(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), KIGFX::SCH_PAINTER::getRenderColor(), PCB_GRID_HELPER::PCB_GRID_HELPER(), LIB_RECTANGLE::Plot(), LIB_CIRCLE::Plot(), LIB_ARC::Plot(), LIB_BEZIER::Plot(), LIB_POLYLINE::Plot(), LIB_TEXT::Plot(), SCH_NO_CONNECT::Plot(), SCH_BITMAP::Plot(), LIB_FIELD::Plot(), SCH_FIELD::Plot(), SCH_TEXT::Plot(), LIB_SYMBOL::Plot(), SCH_SHEET::Plot(), LIB_SYMBOL::PlotLibFields(), DIALOG_PLOT_SCHEMATIC::plotOneSheetDxf(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), LIB_PIN::PlotPinTexts(), LIB_PIN::PlotSymbol(), SCH_JUNCTION::Print(), SCH_NO_CONNECT::Print(), SCH_BUS_ENTRY_BASE::Print(), LIB_CIRCLE::print(), LIB_BEZIER::print(), LIB_RECTANGLE::print(), LIB_POLYLINE::print(), LIB_ARC::print(), LIB_TEXT::print(), LIB_PIN::print(), SCH_FIELD::Print(), SCH_LINE::Print(), SCH_TEXT::Print(), LIB_FIELD::print(), SCH_SHEET::Print(), SCH_GLOBALLABEL::Print(), SCH_HIERLABEL::Print(), LIB_PIN::printPinElectricalTypeName(), LIB_PIN::printPinSymbol(), LIB_PIN::printPinTexts(), DS_DRAW_ITEM_LINE::PrintWsItem(), DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem(), DS_DRAW_ITEM_RECT::PrintWsItem(), DS_DRAW_ITEM_TEXT::PrintWsItem(), PCBNEW_PRINTOUT::setupViewLayers(), DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), DS_PROXY_VIEW_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), and FP_TEXT::ViewGetLOD().

◆ GetLayerIsHighContrast()

bool KIGFX::RENDER_SETTINGS::GetLayerIsHighContrast ( int  aLayerId) const
inlineinherited

Return information whether the queried layer is marked as high-contrast.

Returns
True if the queried layer is marked as active.

Definition at line 82 of file render_settings.h.

83  {
84  return ( m_highContrastLayers.count( aLayerId ) > 0 );
85  }
std::set< unsigned int > m_highContrastLayers

References KIGFX::RENDER_SETTINGS::m_highContrastLayers.

◆ GetMinPenWidth()

◆ GetPrimaryHighContrastLayer()

PCB_LAYER_ID KIGFX::RENDER_SETTINGS::GetPrimaryHighContrastLayer ( ) const
inlineinherited

Return the board layer which is in high-contrast mode.

There should only be one board layer which is high-contrast at any given time, although there might be many high-contrast synthetic (GAL) layers.

Definition at line 101 of file render_settings.h.

102  {
103  for( int layer : m_highContrastLayers )
104  {
105  if( layer >= PCBNEW_LAYER_ID_START && layer < PCB_LAYER_ID_COUNT )
106  return (PCB_LAYER_ID) layer;
107  }
108 
109  return UNDEFINED_LAYER;
110  }
std::set< unsigned int > m_highContrastLayers
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:64

References KIGFX::RENDER_SETTINGS::m_highContrastLayers, PCB_LAYER_ID_COUNT, PCBNEW_LAYER_ID_START, and UNDEFINED_LAYER.

Referenced by KIGFX::PCB_RENDER_SETTINGS::GetColor(), and PNS_KICAD_IFACE::IsItemVisible().

◆ GetPrintDC()

◆ GetShowPageLimits()

bool KIGFX::RENDER_SETTINGS::GetShowPageLimits ( ) const
inlineinherited

◆ IsBackgroundDark()

bool KIGFX::DS_RENDER_SETTINGS::IsBackgroundDark ( ) const
inlineoverridevirtual

Reimplemented from KIGFX::RENDER_SETTINGS.

Definition at line 58 of file ds_painter.h.

59  {
60  auto luma = m_backgroundColor.GetBrightness();
61  return luma < 0.5;
62  }
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
Definition: color4d.h:327

References KIGFX::COLOR4D::GetBrightness(), and KIGFX::RENDER_SETTINGS::m_backgroundColor.

Referenced by GetCursorColor(), and GetGridColor().

◆ IsHighlightEnabled()

bool KIGFX::RENDER_SETTINGS::IsHighlightEnabled ( ) const
inlineinherited

Return current highlight setting.

Returns
True if highlight is enabled, false otherwise.

Definition at line 128 of file render_settings.h.

129  {
130  return m_highlightEnabled;
131  }

References KIGFX::RENDER_SETTINGS::m_highlightEnabled.

Referenced by PCB_EDIT_FRAME::ExecuteRemoteCommand(), and PNS::TOOL_BASE::highlightNet().

◆ IsPrinting()

bool KIGFX::RENDER_SETTINGS::IsPrinting ( ) const
inlineinherited

Definition at line 209 of file render_settings.h.

209 { return m_isPrinting; }

References KIGFX::RENDER_SETTINGS::m_isPrinting.

◆ LoadColors()

void DS_RENDER_SETTINGS::LoadColors ( const COLOR_SETTINGS aSettings)
overridevirtual

Reimplemented from KIGFX::RENDER_SETTINGS.

Definition at line 57 of file ds_painter.cpp.

58 {
59  for( int layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; layer ++)
60  m_layerColors[ layer ] = aSettings->GetColor( layer );
61 
62  for( int layer = GAL_LAYER_ID_START; layer < GAL_LAYER_ID_END; layer ++)
63  m_layerColors[ layer ] = aSettings->GetColor( layer );
64 
68 }
COLOR4D m_layerColors[LAYER_ID_COUNT]
COLOR4D GetColor(int aLayer) const

References GAL_LAYER_ID_END, GAL_LAYER_ID_START, COLOR_SETTINGS::GetColor(), LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_DRAWINGSHEET, LAYER_SCHEMATIC_GRID, KIGFX::RENDER_SETTINGS::m_backgroundColor, KIGFX::RENDER_SETTINGS::m_layerColors, m_normalColor, m_pageBorderColor, SCH_LAYER_ID_END, and SCH_LAYER_ID_START.

Referenced by DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().

◆ SetActiveLayer()

void KIGFX::RENDER_SETTINGS::SetActiveLayer ( PCB_LAYER_ID  aLayer)
inlineinherited

Definition at line 113 of file render_settings.h.

113 { m_activeLayer = aLayer; }

References KIGFX::RENDER_SETTINGS::m_activeLayer.

Referenced by PCB_DRAW_PANEL_GAL::SetHighContrastLayer().

◆ SetBackgroundColor()

void KIGFX::DS_RENDER_SETTINGS::SetBackgroundColor ( const COLOR4D aColor)
inlineoverridevirtual

Set the background color.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 65 of file ds_painter.h.

65 { m_backgroundColor = aColor; }

References KIGFX::RENDER_SETTINGS::m_backgroundColor.

◆ SetBrightenedColor()

void KIGFX::DS_RENDER_SETTINGS::SetBrightenedColor ( const COLOR4D aColor)
inline

Definition at line 69 of file ds_painter.h.

69 { m_brightenedColor = aColor; }

References m_brightenedColor.

◆ SetDefaultPenWidth()

◆ SetHighContrast()

void KIGFX::RENDER_SETTINGS::SetHighContrast ( bool  aEnabled)
inlineinherited

Turns on/off high contrast display mode.

Definition at line 185 of file render_settings.h.

185 { m_hiContrastEnabled = aEnabled; }
bool m_hiContrastEnabled
Parameters for display modes.

References KIGFX::RENDER_SETTINGS::m_hiContrastEnabled.

Referenced by DIALOG_PAD_PROPERTIES::onChangePadMode().

◆ SetHighContrastFactor()

void KIGFX::RENDER_SETTINGS::SetHighContrastFactor ( float  aFactor)
inlineinherited

Definition at line 272 of file render_settings.h.

272 { m_hiContrastFactor = aFactor; }

References KIGFX::RENDER_SETTINGS::m_hiContrastFactor.

Referenced by PCB_BASE_FRAME::LoadSettings().

◆ SetHighlight() [1/2]

void KIGFX::RENDER_SETTINGS::SetHighlight ( bool  aEnabled,
int  aNetcode = -1,
bool  aMulti = false 
)
inlineinherited

Turns on/off highlighting.

It may be done for the active layer or the specified net(s)..

Parameters
aEnabledtells if highlighting should be enabled.
aNetcodeis optional and if specified, turns on highlighting only for the net with number given as the parameter.

Definition at line 152 of file render_settings.h.

153  {
154  m_highlightEnabled = aEnabled;
155 
156  if( aEnabled )
157  {
158  if( !aMulti )
159  m_highlightNetcodes.clear();
160 
161  m_highlightNetcodes.insert( aNetcode );
162  }
163  else
164  m_highlightNetcodes.clear();
165  }
std::set< int > m_highlightNetcodes

References KIGFX::RENDER_SETTINGS::m_highlightEnabled, and KIGFX::RENDER_SETTINGS::m_highlightNetcodes.

Referenced by DIALOG_NET_INSPECTOR::buildNetsList(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PNS::TOOL_BASE::highlightNet(), APPEARANCE_CONTROLS::onNetclassContextMenu(), DIALOG_NET_INSPECTOR::onSelChanged(), DIALOG_NET_INSPECTOR::onSortingChanged(), GERBVIEW_SELECTION_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), and PCB_SELECTION_TOOL::Reset().

◆ SetHighlight() [2/2]

void KIGFX::RENDER_SETTINGS::SetHighlight ( std::set< int > &  aHighlight,
bool  aEnabled = true 
)
inlineinherited

Turns on highlighting and highlights multiple nets.

Parameters
aHighlightis a set of netcodes to highlight
aEnabledtells if highlighting should be enabled.

Definition at line 172 of file render_settings.h.

173  {
174  m_highlightEnabled = aEnabled;
175 
176  if( aEnabled )
177  m_highlightNetcodes = aHighlight;
178  else
179  m_highlightNetcodes.clear();
180  }
std::set< int > m_highlightNetcodes

References KIGFX::RENDER_SETTINGS::m_highlightEnabled, and KIGFX::RENDER_SETTINGS::m_highlightNetcodes.

◆ SetHighlightFactor()

void KIGFX::RENDER_SETTINGS::SetHighlightFactor ( float  aFactor)
inlineinherited

Definition at line 270 of file render_settings.h.

270 { m_highlightFactor = aFactor; }

References KIGFX::RENDER_SETTINGS::m_highlightFactor.

Referenced by PCB_BASE_FRAME::LoadSettings().

◆ SetIsPrinting()

void KIGFX::RENDER_SETTINGS::SetIsPrinting ( bool  isPrinting)
inlineinherited

Definition at line 210 of file render_settings.h.

210 { m_isPrinting = isPrinting; }

References KIGFX::RENDER_SETTINGS::m_isPrinting.

Referenced by BOARD_PRINTOUT::DrawPage().

◆ SetLayerColor()

void KIGFX::RENDER_SETTINGS::SetLayerColor ( int  aLayer,
const COLOR4D aColor 
)
inlineinherited

Change the color used to draw a layer.

Parameters
aLayeris the layer number.
aColoris the new color.

Definition at line 248 of file render_settings.h.

249  {
250  m_layerColors[aLayer] = aColor;
251 
252  update(); // recompute other shades of the color
253  }
COLOR4D m_layerColors[LAYER_ID_COUNT]
virtual void update()
Precalculates extra colors for layers (e.g.

References KIGFX::RENDER_SETTINGS::m_layerColors, and KIGFX::RENDER_SETTINGS::update().

Referenced by SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), BOARD_PRINTOUT::DrawPage(), PLEDITOR_PRINTOUT::PrintPage(), DIALOG_PAD_PROPERTIES::redraw(), PCBNEW_PRINTOUT::setupPainter(), PCBNEW_PRINTOUT::setupViewLayers(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().

◆ SetLayerIsHighContrast()

void KIGFX::RENDER_SETTINGS::SetLayerIsHighContrast ( int  aLayerId,
bool  aEnabled = true 
)
inlineinherited

Set the specified layer as high-contrast.

Parameters
aLayerIdis a layer number that should be displayed in a specific mode.
aEnabledis the new layer state ( true = active or false = not active).

Definition at line 69 of file render_settings.h.

70  {
71  if( aEnabled )
72  m_highContrastLayers.insert( aLayerId );
73  else
74  m_highContrastLayers.erase( aLayerId );
75  }
std::set< unsigned int > m_highContrastLayers

References KIGFX::RENDER_SETTINGS::m_highContrastLayers.

Referenced by GERBVIEW_DRAW_PANEL_GAL::SetHighContrastLayer(), PCB_DRAW_PANEL_GAL::SetHighContrastLayer(), and EDA_DRAW_PANEL_GAL::SetHighContrastLayer().

◆ SetMinPenWidth()

void KIGFX::RENDER_SETTINGS::SetMinPenWidth ( int  aWidth)
inlineinherited

Definition at line 204 of file render_settings.h.

204 { m_minPenWidth = aWidth; }

References KIGFX::RENDER_SETTINGS::m_minPenWidth.

◆ SetNormalColor()

void KIGFX::DS_RENDER_SETTINGS::SetNormalColor ( const COLOR4D aColor)
inline

Definition at line 67 of file ds_painter.h.

67 { m_normalColor = aColor; }

References m_normalColor.

◆ SetOutlineWidth()

void KIGFX::RENDER_SETTINGS::SetOutlineWidth ( float  aWidth)
inlineinherited

Set line width used for drawing outlines.

Parameters
aWidthis the new width.

Definition at line 265 of file render_settings.h.

266  {
267  m_outlineWidth = aWidth;
268  }

References KIGFX::RENDER_SETTINGS::m_outlineWidth.

◆ SetPageBorderColor()

void KIGFX::DS_RENDER_SETTINGS::SetPageBorderColor ( const COLOR4D aColor)
inline

Definition at line 70 of file ds_painter.h.

70 { m_pageBorderColor = aColor; }

References m_pageBorderColor.

◆ SetPrintDC()

◆ SetSelectedColor()

void KIGFX::DS_RENDER_SETTINGS::SetSelectedColor ( const COLOR4D aColor)
inline

Definition at line 68 of file ds_painter.h.

68 { m_selectedColor = aColor; }

References m_selectedColor.

◆ SetSelectFactor()

void KIGFX::RENDER_SETTINGS::SetSelectFactor ( float  aFactor)
inlineinherited

Definition at line 271 of file render_settings.h.

271 { m_selectFactor = aFactor; }

References KIGFX::RENDER_SETTINGS::m_selectFactor.

Referenced by PCB_BASE_FRAME::LoadSettings().

◆ SetShowPageLimits()

void KIGFX::RENDER_SETTINGS::SetShowPageLimits ( bool  aDraw)
inlineinherited

◆ update()

void RENDER_SETTINGS::update ( )
protectedvirtualinherited

Precalculates extra colors for layers (e.g.

highlighted, darkened and any needed version of base colors).

Definition at line 54 of file render_settings.cpp.

55 {
56  // Calculate darkened/highlighted variants of layer colors
57  for( int i = 0; i < LAYER_ID_COUNT; i++ )
58  {
64  }
65 }
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
COLOR4D m_layerColors[LAYER_ID_COUNT]
COLOR4D Darkened(double aFactor) const
Return a color that is darker by a given factor, without modifying object.
Definition: color4d.h:276
COLOR4D m_hiContrastColor[LAYER_ID_COUNT]
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
Definition: color4d.h:262
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
PCB background color.
Definition: layer_ids.h:215
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition: color4d.h:289
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
Definition: layer_ids.h:422
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]

References KIGFX::COLOR4D::Brightened(), KIGFX::COLOR4D::Darkened(), LAYER_ID_COUNT, LAYER_PCB_BACKGROUND, KIGFX::RENDER_SETTINGS::m_hiContrastColor, KIGFX::RENDER_SETTINGS::m_hiContrastFactor, KIGFX::RENDER_SETTINGS::m_highlightFactor, KIGFX::RENDER_SETTINGS::m_layerColors, KIGFX::RENDER_SETTINGS::m_layerColorsDark, KIGFX::RENDER_SETTINGS::m_layerColorsHi, KIGFX::RENDER_SETTINGS::m_layerColorsSel, KIGFX::RENDER_SETTINGS::m_selectFactor, and KIGFX::COLOR4D::Mix().

Referenced by DS_RENDER_SETTINGS(), KIGFX::GERBVIEW_RENDER_SETTINGS::GERBVIEW_RENDER_SETTINGS(), KIGFX::GERBVIEW_RENDER_SETTINGS::LoadColors(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), KIGFX::GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions(), KIGFX::PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS(), KIGFX::GERBVIEW_RENDER_SETTINGS::SetLayerColor(), and KIGFX::RENDER_SETTINGS::SetLayerColor().

Friends And Related Function Documentation

◆ DS_PAINTER

friend class DS_PAINTER
friend

Definition at line 49 of file ds_painter.h.

Member Data Documentation

◆ m_activeLayer

PCB_LAYER_ID KIGFX::RENDER_SETTINGS::m_activeLayer
protectedinherited

◆ m_backgroundColor

◆ m_brightenedColor

COLOR4D KIGFX::DS_RENDER_SETTINGS::m_brightenedColor
private

Definition at line 87 of file ds_painter.h.

Referenced by DS_RENDER_SETTINGS(), GetColor(), and SetBrightenedColor().

◆ m_cursorColor

COLOR4D KIGFX::DS_RENDER_SETTINGS::m_cursorColor
private

Definition at line 90 of file ds_painter.h.

Referenced by GetCursorColor().

◆ m_defaultPenWidth

◆ m_drawingSheetLineWidth

float KIGFX::RENDER_SETTINGS::m_drawingSheetLineWidth
protectedinherited

◆ m_gridColor

COLOR4D KIGFX::DS_RENDER_SETTINGS::m_gridColor
private

Definition at line 89 of file ds_painter.h.

Referenced by GetGridColor().

◆ m_hiContrastColor

COLOR4D KIGFX::RENDER_SETTINGS::m_hiContrastColor[LAYER_ID_COUNT]
protectedinherited

◆ m_hiContrastEnabled

◆ m_hiContrastFactor

float KIGFX::RENDER_SETTINGS::m_hiContrastFactor
protectedinherited

◆ m_highContrastLayers

◆ m_highlightEnabled

◆ m_highlightFactor

float KIGFX::RENDER_SETTINGS::m_highlightFactor
protectedinherited

◆ m_highlightNetcodes

std::set<int> KIGFX::RENDER_SETTINGS::m_highlightNetcodes
protectedinherited

◆ m_isPrinting

bool KIGFX::RENDER_SETTINGS::m_isPrinting
protectedinherited

◆ m_layerColors

◆ m_layerColorsDark

◆ m_layerColorsHi

◆ m_layerColorsSel

◆ m_minPenWidth

◆ m_normalColor

COLOR4D KIGFX::DS_RENDER_SETTINGS::m_normalColor
private

Definition at line 85 of file ds_painter.h.

Referenced by DS_RENDER_SETTINGS(), GetColor(), LoadColors(), and SetNormalColor().

◆ m_outlineWidth

◆ m_pageBorderColor

COLOR4D KIGFX::DS_RENDER_SETTINGS::m_pageBorderColor
private

Definition at line 91 of file ds_painter.h.

Referenced by DS_RENDER_SETTINGS(), LoadColors(), and SetPageBorderColor().

◆ m_printDC

wxDC* KIGFX::RENDER_SETTINGS::m_printDC
protectedinherited

◆ m_selectedColor

COLOR4D KIGFX::DS_RENDER_SETTINGS::m_selectedColor
private

Definition at line 86 of file ds_painter.h.

Referenced by DS_RENDER_SETTINGS(), GetColor(), and SetSelectedColor().

◆ m_selectFactor

float KIGFX::RENDER_SETTINGS::m_selectFactor
protectedinherited

◆ m_showPageLimits


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