KiCad PCB EDA Suite
KIGFX::PCB_RENDER_SETTINGS Class Reference

PCB_RENDER_SETTINGS Stores PCB specific render settings. More...

#include <pcb_painter.h>

Inheritance diagram for KIGFX::PCB_RENDER_SETTINGS:
KIGFX::RENDER_SETTINGS

Public Types

enum  CLEARANCE_MODE {
  CL_NONE = 0x00, CL_PADS = 0x01, CL_VIAS = 0x02, CL_TRACKS = 0x04,
  CL_NEW = 0x08, CL_EDITED = 0x10, CL_EXISTING = 0x20
}
 

Flags to control clearance lines visibility

More...
 
enum  DISPLAY_ZONE_MODE { DZ_HIDE_FILLED = 0, DZ_SHOW_FILLED, DZ_SHOW_OUTLINED }
 

Determines how zones should be displayed

More...
 
enum  NET_COLOR_MODE { NET_COLOR_MODE::OFF, NET_COLOR_MODE::RATSNEST, NET_COLOR_MODE::ALL }
 

Determines how net color overrides should be applied

More...
 

Public Member Functions

 PCB_RENDER_SETTINGS ()
 
void LoadDisplayOptions (const PCB_DISPLAY_OPTIONS &aOptions, bool aShowPageLimits)
 Function LoadDisplayOptions Loads settings related to display options (high-contrast mode, full or outline modes for vias/pads/tracks and so on). More...
 
void LoadNetSettings (const NET_SETTINGS &aSettings, const NETINFO_LIST &aList, const std::set< int > &aHiddenNets)
 Loads net-specific render settings. More...
 
virtual void LoadColors (const COLOR_SETTINGS *aSettings) override
 
virtual const COLOR4DGetColor (const VIEW_ITEM *aItem, int aLayer) const override
 Function GetColor Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using currently used render settings. More...
 
void SetSketchMode (int aItemLayer, bool aEnabled)
 Function SetSketchMode Turns on/off sketch mode for given item layer. More...
 
bool GetSketchMode (int aItemLayer) const
 Function GetSketchMode Returns sketch mode setting for a given item layer. More...
 
void SetSketchModeGraphicItems (bool aEnabled)
 Turns on/off sketch mode for graphic items (DRAWSEGMENTs, texts). More...
 
void EnableZoneOutlines (bool aEnabled)
 Turns on/off drawing outline and hatched lines for zones. More...
 
bool IsBackgroundDark () const override
 
const COLOR4DGetBackgroundColor () override
 Function GetBackgroundColor Returns current background color settings. More...
 
void SetBackgroundColor (const COLOR4D &aColor) override
 Sets the background color. More...
 
const COLOR4DGetGridColor () override
 Function GetGridColor Returns current grid color settings. More...
 
const COLOR4DGetCursorColor () override
 Function GetCursorColor Returns current cursor color settings. More...
 
void SetContrastModeDisplay (HIGH_CONTRAST_MODE aMode)
 Switch the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN ) to control how the non active layers are shown. More...
 
HIGH_CONTRAST_MODE GetContrastModeDisplay ()
 return the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN ) More...
 
bool GetCurvedRatsnestLinesEnabled () const
 
bool GetGlobalRatsnestLinesEnabled () const
 
bool GetDrawIndividualViaLayers () const
 
void SetDrawIndividualViaLayers (bool aFlag)
 
NET_COLOR_MODE GetNetColorMode () const
 
void SetNetColorMode (NET_COLOR_MODE aMode)
 
std::map< wxString, KIGFX::COLOR4D > & GetNetclassColorMap ()
 
std::map< int, KIGFX::COLOR4D > & GetNetColorMap ()
 
std::set< int > & GetHiddenNets ()
 
const std::set< int > & GetHiddenNets () const
 
void SetActiveLayer (int aLayerId, bool aEnabled=true)
 Function SetActiveLayer Sets the specified layer as active - it means that it can be drawn in a specific mode (eg. More...
 
const std::set< unsigned int > GetActiveLayers () const
 Function GetActiveLayers() Returns the set of currently active layers. More...
 
void ClearActiveLayers ()
 Function ClearActiveLayers Clears the list of active layers. More...
 
bool IsActiveLayer (int aLayerId) const
 Function IsActiveLayer Returns information whether the queried layer is marked as active. More...
 
bool IsHighlightEnabled () const
 Function IsHighlightEnabled Returns current highlight setting. More...
 
const std::set< int > & GetHighlightNetCodes () const
 Function GetHighlightNetCode Returns netcode of currently highlighted net. More...
 
void SetHighlight (bool aEnabled, int aNetcode=-1, bool aMulti=false)
 Function SetHighlight Turns on/off highlighting - it may be done for the active layer or the specified net(s). More...
 
void SetHighContrast (bool aEnabled)
 Function SetHighContrast Turns on/off high contrast display mode. More...
 
bool GetHighContrast () const
 
float GetWorksheetLineWidth () const
 
int GetDefaultPenWidth () const
 
void SetDefaultPenWidth (int aWidth)
 
bool GetShowPageLimits () const
 
void SetShowPageLimits (bool aDraw)
 
const COLOR4DGetLayerColor (int aLayer) const
 Function GetLayerColor Returns the color used to draw a layer. More...
 
void SetLayerColor (int aLayer, const COLOR4D &aColor)
 Function SetLayerColor Changes the color used to draw a layer. More...
 
void SetOutlineWidth (float aWidth)
 Set line width used for drawing outlines. More...
 
wxDC * GetPrintDC ()
 
void SetPrintDC (wxDC *aDC)
 

Protected Member Functions

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

Protected Attributes

bool m_sketchMode [GAL_LAYER_ID_END]
 

Flag determining if items on a given layer should be drawn as an outline or a filled item

More...
 
bool m_sketchGraphics
 

Flag determining if graphic items should be outlined or stroked

More...
 
bool m_sketchText
 

Flag determining if text items should be outlined or stroked

More...
 
bool m_padNumbers
 

Flag determining if pad numbers should be visible

More...
 
bool m_netNamesOnPads
 

Flag determining if net names should be visible for pads

More...
 
bool m_netNamesOnTracks
 

Flag determining if net names should be visible for tracks

More...
 
bool m_netNamesOnVias
 

Flag determining if net names should be visible for vias

More...
 
bool m_zoneOutlines
 

Flag determining if zones should have outlines drawn

More...
 
bool m_curvedRatsnestlines = true
 

Flag determining if ratsnest lines should be drawn curved

More...
 
bool m_globalRatsnestlines = true
 

Flag determining if ratsnest lines are shown by default

More...
 
bool m_drawIndividualViaLayers = false
 
DISPLAY_ZONE_MODE m_displayZone
 

Option for different display modes for zones

More...
 
int m_clearance
 

Clearance visibility settings

More...
 
COLOR4D m_selectionCandidateColor
 

Color used for highlighting selection candidates

More...
 
NET_COLOR_MODE m_netColorMode
 

How to display nets and netclasses with color overrides

More...
 
std::map< wxString, KIGFX::COLOR4Dm_netclassColors
 

Overrides for specific netclass colors

More...
 
std::map< int, KIGFX::COLOR4Dm_netColors
 

Overrides for specific net colors, stored as netcodes for the ratsnest to access easily

More...
 
std::set< int > m_hiddenNets
 

Set of net codes that should not have their ratsnest displayed

More...
 
HIGH_CONTRAST_MODE m_contrastModeDisplay
 

How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )

More...
 
std::set< unsigned int > m_activeLayers
 Stores active layers number. More...
 
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_worksheetLineWidth
 
int m_defaultPenWidth
 
bool m_showPageLimits
 
wxDC * m_printDC
 

Static Protected Attributes

static const double MAX_FONT_SIZE = Millimeter2iu( 10.0 )
 

Maximum font size for netnames (and other dynamically shown strings)

More...
 

Friends

class PCB_PAINTER
 

Detailed Description

PCB_RENDER_SETTINGS Stores PCB specific render settings.

Definition at line 64 of file pcb_painter.h.

Member Enumeration Documentation

◆ CLEARANCE_MODE

Flags to control clearance lines visibility

Enumerator
CL_NONE 
CL_PADS 
CL_VIAS 
CL_TRACKS 
CL_NEW 
CL_EDITED 
CL_EXISTING 

Definition at line 70 of file pcb_painter.h.

◆ DISPLAY_ZONE_MODE

Determines how zones should be displayed

Enumerator
DZ_HIDE_FILLED 
DZ_SHOW_FILLED 
DZ_SHOW_OUTLINED 

Definition at line 86 of file pcb_painter.h.

◆ NET_COLOR_MODE

Determines how net color overrides should be applied

Enumerator
OFF 

Net (and netclass) colors are not shown.

RATSNEST 

Net/netclass colors are shown on ratsnest lines only.

ALL 

Net/netclass colors are shown on all net copper.

Definition at line 94 of file pcb_painter.h.

95  {
96  OFF,
97  RATSNEST,
98  ALL
99  };
Item needs to be redrawn.
Definition: view_item.h:63
#define OFF

Constructor & Destructor Documentation

◆ PCB_RENDER_SETTINGS()

PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS ( )

Definition at line 53 of file pcb_painter.cpp.

54 {
55  m_backgroundColor = COLOR4D( 0.0, 0.0, 0.0, 1.0 );
56  m_padNumbers = true;
57  m_netNamesOnPads = true;
58  m_netNamesOnTracks = true;
59  m_netNamesOnVias = true;
60  m_zoneOutlines = true;
63  m_sketchGraphics = false;
64  m_sketchText = false;
65  m_selectionCandidateColor = COLOR4D( 0.0, 1.0, 0.0, 0.75 );
68 
69  // By default everything should be displayed as filled
70  for( unsigned int i = 0; i < arrayDim( m_sketchMode ); ++i )
71  {
72  m_sketchMode[i] = false;
73  }
74 
75  update();
76 }
bool m_sketchMode[GAL_LAYER_ID_END]
Flag determining if items on a given layer should be drawn as an outline or a filled item
Definition: pcb_painter.h:211
bool m_padNumbers
Flag determining if pad numbers should be visible
Definition: pcb_painter.h:220
DISPLAY_ZONE_MODE m_displayZone
Option for different display modes for zones
Definition: pcb_painter.h:246
COLOR4D m_selectionCandidateColor
Color used for highlighting selection candidates
Definition: pcb_painter.h:252
bool m_netNamesOnPads
Flag determining if net names should be visible for pads
Definition: pcb_painter.h:223
bool m_sketchGraphics
Flag determining if graphic items should be outlined or stroked
Definition: pcb_painter.h:214
NET_COLOR_MODE m_netColorMode
How to display nets and netclasses with color overrides
Definition: pcb_painter.h:255
Net/netclass colors are shown on ratsnest lines only.
virtual void update()
Function update Precalculates extra colors for layers (e.g.
bool m_sketchText
Flag determining if text items should be outlined or stroked
Definition: pcb_painter.h:217
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:160
bool m_netNamesOnTracks
Flag determining if net names should be visible for tracks
Definition: pcb_painter.h:226
int m_clearance
Clearance visibility settings
Definition: pcb_painter.h:249
HIGH_CONTRAST_MODE m_contrastModeDisplay
How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
Definition: pcb_painter.h:267
bool m_zoneOutlines
Flag determining if zones should have outlines drawn
Definition: pcb_painter.h:232
bool m_netNamesOnVias
Flag determining if net names should be visible for vias
Definition: pcb_painter.h:229
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References arrayDim(), CL_NONE, DZ_SHOW_FILLED, KIGFX::RENDER_SETTINGS::m_backgroundColor, m_clearance, m_contrastModeDisplay, m_displayZone, m_netColorMode, m_netNamesOnPads, m_netNamesOnTracks, m_netNamesOnVias, m_padNumbers, m_selectionCandidateColor, m_sketchGraphics, m_sketchMode, m_sketchText, m_zoneOutlines, NORMAL, RATSNEST, and KIGFX::RENDER_SETTINGS::update().

Member Function Documentation

◆ ClearActiveLayers()

void KIGFX::RENDER_SETTINGS::ClearActiveLayers ( )
inlineinherited

Function ClearActiveLayers Clears the list of active layers.

Definition at line 89 of file render_settings.h.

90  {
91  m_activeLayers.clear();
92  }
std::set< unsigned int > m_activeLayers
Stores active layers number.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

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

◆ EnableZoneOutlines()

void KIGFX::PCB_RENDER_SETTINGS::EnableZoneOutlines ( bool  aEnabled)
inline

Turns on/off drawing outline and hatched lines for zones.

Definition at line 160 of file pcb_painter.h.

161  {
162  m_zoneOutlines = aEnabled;
163  }
bool m_zoneOutlines
Flag determining if zones should have outlines drawn
Definition: pcb_painter.h:232

References m_zoneOutlines.

Referenced by KIGFX::PCB_PRINT_PAINTER::PCB_PRINT_PAINTER().

◆ GetActiveLayers()

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

Function GetActiveLayers() Returns the set of currently active layers.

Returns
The set of currently active layers.

Definition at line 80 of file render_settings.h.

81  {
82  return m_activeLayers;
83  }
std::set< unsigned int > m_activeLayers
Stores active layers number.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

Referenced by GRID_HELPER::computeAnchors(), PNS_KICAD_IFACE::IsItemVisible(), GRID_HELPER::queryVisible(), and SELECTION_TOOL::Selectable().

◆ GetBackgroundColor()

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

Function GetBackgroundColor Returns current background color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 172 of file pcb_painter.h.

172 { return m_layerColors[ LAYER_PCB_BACKGROUND ]; }
COLOR4D m_layerColors[LAYER_ID_COUNT]

References LAYER_PCB_BACKGROUND, and KIGFX::RENDER_SETTINGS::m_layerColors.

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

◆ GetColor()

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

Function GetColor 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 249 of file pcb_painter.cpp.

250 {
251  int netCode = -1;
252  const EDA_ITEM* item = dynamic_cast<const EDA_ITEM*>( aItem );
253  const BOARD_CONNECTED_ITEM* conItem = dynamic_cast<const BOARD_CONNECTED_ITEM*> ( aItem );
254 
255  // Make items invisible in "other layers hidden" contrast mode
256  if( m_contrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN && m_activeLayers.count( aLayer ) == 0 )
257  return COLOR4D::CLEAR;
258 
259  // Hide net names in "dimmed" contrast mode
261  && m_activeLayers.count( aLayer ) == 0 )
262  return COLOR4D::CLEAR;
263 
264  if( item )
265  {
266  // Selection disambiguation
267  if( item->IsBrightened() )
268  {
270  }
271 
272  // Don't let pads that *should* be NPTHs get lost
273  if( item->Type() == PCB_PAD_T && dyn_cast<const D_PAD*>( item )->PadShouldBeNPTH() )
274  aLayer = LAYER_MOD_TEXT_INVISIBLE;
275 
276  if( item->IsSelected() )
277  return m_layerColorsSel[aLayer];
278 
279  if( item->Type() == PCB_MARKER_T )
280  return m_layerColors[aLayer];
281 
282  // For vias, some layers depend on other layers in high contrast mode
283  if( m_hiContrastEnabled && item->Type() == PCB_VIA_T &&
284  ( aLayer == LAYER_VIAS_HOLES ||
285  aLayer == LAYER_VIA_THROUGH ||
286  aLayer == LAYER_VIA_MICROVIA ||
287  aLayer == LAYER_VIA_BBLIND ) )
288  {
289  const VIA* via = static_cast<const VIA*>( item );
290  const BOARD* pcb = static_cast<const BOARD*>( item->GetParent() );
291  bool viaActiveLayer = false;
292 
293  for( auto activeLayer : m_activeLayers )
294  {
295  auto lay_id = static_cast<PCB_LAYER_ID>( activeLayer );
296  viaActiveLayer |= via->IsOnLayer( lay_id ) && pcb->IsLayerVisible( lay_id );
297  }
298 
299  if( viaActiveLayer )
300  return m_layerColors[aLayer];
301  else
302  return m_hiContrastColor[aLayer];
303  }
304  }
305 
306  // Try to obtain the netcode for the item
307  if( conItem )
308  netCode = conItem->GetNetCode();
309 
310  // Single net highlight mode
311  if( m_highlightEnabled && m_highlightNetcodes.count( netCode ) )
312  return m_layerColorsHi[aLayer];
313 
314  // Return grayish color for non-highlighted layers in the dimmed high contrast mode
315  if( m_contrastModeDisplay == HIGH_CONTRAST_MODE::DIMMED && m_activeLayers.count( aLayer ) == 0 )
316  return m_hiContrastColor[aLayer];
317 
318  // Catch the case when highlight and high-contraste modes are enabled
319  // and we are drawing a not highlighted track
320  if( m_highlightEnabled )
321  return m_layerColorsDark[aLayer];
322 
323  // Apply net color overrides
324  if( conItem && m_netColorMode == NET_COLOR_MODE::ALL )
325  {
326  if( m_netColors.count( conItem->GetNetCode() ) )
327  return m_netColors.at( conItem->GetNetCode() );
328  else if( m_netclassColors.count( conItem->GetNetClassName() ) )
329  return m_netclassColors.at( conItem->GetNetClassName() );
330  }
331 
332  // No special modificators enabled
333  return m_layerColors[aLayer];
334 }
to draw blind/buried vias
int GetNetCode() const
Function GetNetCode.
bool IsSelected() const
Definition: base_struct.h:203
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
COLOR4D m_layerColors[LAYER_ID_COUNT]
to draw via holes (pad holes do not use this layer)
bool IsBrightened() const
Definition: base_struct.h:205
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
COLOR4D m_selectionCandidateColor
Color used for highlighting selection candidates
Definition: pcb_painter.h:252
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
wxString GetNetClassName() const
Function GetNetClassName returns a pointer to the netclass of the zone.
std::map< wxString, KIGFX::COLOR4D > m_netclassColors
Overrides for specific netclass colors
Definition: pcb_painter.h:258
COLOR4D m_hiContrastColor[LAYER_ID_COUNT]
NET_COLOR_MODE m_netColorMode
How to display nets and netclasses with color overrides
Definition: pcb_painter.h:255
std::set< unsigned int > m_activeLayers
Stores active layers number.
Non-active layers are shown normally (no high-contrast mode)
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
bool m_hiContrastEnabled
Parameters for display modes.
static const COLOR4D CLEAR
Definition: color4d.h:377
to draw usual through hole vias
EDA_ITEM * GetParent() const
Definition: base_struct.h:195
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
std::map< int, KIGFX::COLOR4D > m_netColors
Overrides for specific net colors, stored as netcodes for the ratsnest to access easily
Definition: pcb_painter.h:261
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:184
HIGH_CONTRAST_MODE m_contrastModeDisplay
How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
Definition: pcb_painter.h:267
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
Non-active layers are dimmed (old high-contrast mode)
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
std::set< int > m_highlightNetcodes
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
Net/netclass colors are shown on all net copper.
bool IsNetnameLayer(LAYER_NUM aLayer)
Function IsNetnameLayer tests whether a layer is a netname layer.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193

References ALL, KIGFX::COLOR4D::CLEAR, DIMMED, BOARD_CONNECTED_ITEM::GetNetClassName(), BOARD_CONNECTED_ITEM::GetNetCode(), EDA_ITEM::GetParent(), HIDDEN, EDA_ITEM::IsBrightened(), BOARD::IsLayerVisible(), IsNetnameLayer(), VIA::IsOnLayer(), EDA_ITEM::IsSelected(), LAYER_MOD_TEXT_INVISIBLE, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_VIAS_HOLES, KIGFX::RENDER_SETTINGS::m_activeLayers, m_contrastModeDisplay, KIGFX::RENDER_SETTINGS::m_hiContrastColor, KIGFX::RENDER_SETTINGS::m_hiContrastEnabled, KIGFX::RENDER_SETTINGS::m_highlightEnabled, KIGFX::RENDER_SETTINGS::m_highlightNetcodes, KIGFX::RENDER_SETTINGS::m_layerColors, KIGFX::RENDER_SETTINGS::m_layerColorsDark, KIGFX::RENDER_SETTINGS::m_layerColorsHi, KIGFX::RENDER_SETTINGS::m_layerColorsSel, m_netclassColors, m_netColorMode, m_netColors, m_selectionCandidateColor, NORMAL, PCB_MARKER_T, PCB_PAD_T, PCB_VIA_T, and EDA_ITEM::Type().

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

◆ GetContrastModeDisplay()

HIGH_CONTRAST_MODE KIGFX::PCB_RENDER_SETTINGS::GetContrastModeDisplay ( )
inline

return the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )

Definition at line 190 of file pcb_painter.h.

190 { return m_contrastModeDisplay; }
HIGH_CONTRAST_MODE m_contrastModeDisplay
How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
Definition: pcb_painter.h:267

References m_contrastModeDisplay.

◆ GetCursorColor()

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

Function GetCursorColor Returns current cursor color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 181 of file pcb_painter.h.

181 { return m_layerColors[ LAYER_CURSOR ]; }
COLOR4D m_layerColors[LAYER_ID_COUNT]

References LAYER_CURSOR, and KIGFX::RENDER_SETTINGS::m_layerColors.

◆ GetCurvedRatsnestLinesEnabled()

bool KIGFX::PCB_RENDER_SETTINGS::GetCurvedRatsnestLinesEnabled ( ) const
inline

Definition at line 192 of file pcb_painter.h.

192 { return m_curvedRatsnestlines; }
bool m_curvedRatsnestlines
Flag determining if ratsnest lines should be drawn curved
Definition: pcb_painter.h:235

References m_curvedRatsnestlines.

◆ GetDefaultPenWidth()

◆ GetDrawIndividualViaLayers()

bool KIGFX::PCB_RENDER_SETTINGS::GetDrawIndividualViaLayers ( ) const
inline

Definition at line 196 of file pcb_painter.h.

References m_drawIndividualViaLayers.

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

◆ GetGlobalRatsnestLinesEnabled()

bool KIGFX::PCB_RENDER_SETTINGS::GetGlobalRatsnestLinesEnabled ( ) const
inline

Definition at line 194 of file pcb_painter.h.

194 { return m_globalRatsnestlines; }
bool m_globalRatsnestlines
Flag determining if ratsnest lines are shown by default
Definition: pcb_painter.h:238

References m_globalRatsnestlines.

◆ GetGridColor()

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

Function GetGridColor Returns current grid color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 179 of file pcb_painter.h.

References LAYER_GRID, and KIGFX::RENDER_SETTINGS::m_layerColors.

◆ GetHiddenNets() [1/2]

std::set<int>& KIGFX::PCB_RENDER_SETTINGS::GetHiddenNets ( )
inline

Definition at line 206 of file pcb_painter.h.

206 { return m_hiddenNets; }
std::set< int > m_hiddenNets
Set of net codes that should not have their ratsnest displayed
Definition: pcb_painter.h:264

References m_hiddenNets.

Referenced by PCB_INSPECTION_TOOL::doHideNet(), and PCB_EDIT_FRAME::SaveProjectSettings().

◆ GetHiddenNets() [2/2]

const std::set<int>& KIGFX::PCB_RENDER_SETTINGS::GetHiddenNets ( ) const
inline

Definition at line 207 of file pcb_painter.h.

207 { return m_hiddenNets; }
std::set< int > m_hiddenNets
Set of net codes that should not have their ratsnest displayed
Definition: pcb_painter.h:264

References m_hiddenNets.

◆ GetHighContrast()

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

◆ GetHighlightNetCodes()

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

Function GetHighlightNetCode Returns netcode of currently highlighted net.

Returns
Netcode of currently highlighted net.

Definition at line 119 of file render_settings.h.

120  {
121  return m_highlightNetcodes;
122  }
std::set< int > m_highlightNetcodes

References KIGFX::RENDER_SETTINGS::m_highlightNetcodes.

Referenced by PNS::TOOL_BASE::highlightNet().

◆ GetLayerColor()

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

Function GetLayerColor Returns the color used to draw a layer.

Parameters
aLayeris the layer number.

Definition at line 199 of file render_settings.h.

200  {
201  return m_layerColors[aLayer];
202  }
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::DrawArcWithAngleHighlight(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawCircle(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLine(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineWithAngleHighlight(), KIGFX::SCH_PAINTER::getRenderColor(), LIB_CIRCLE::Plot(), LIB_RECTANGLE::Plot(), LIB_BEZIER::Plot(), LIB_TEXT::Plot(), LIB_ARC::Plot(), LIB_POLYLINE::Plot(), SCH_NO_CONNECT::Plot(), SCH_BITMAP::Plot(), LIB_FIELD::Plot(), SCH_FIELD::Plot(), LIB_PART::Plot(), SCH_TEXT::Plot(), SCH_SHEET::Plot(), LIB_PART::PlotLibFields(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), LIB_PIN::PlotPinTexts(), LIB_PIN::PlotSymbol(), LIB_POLYLINE::print(), LIB_RECTANGLE::print(), LIB_TEXT::print(), LIB_ARC::print(), SCH_JUNCTION::Print(), LIB_FIELD::print(), SCH_NO_CONNECT::Print(), SCH_BUS_ENTRY_BASE::Print(), LIB_BEZIER::print(), LIB_CIRCLE::print(), SCH_FIELD::Print(), SCH_LINE::Print(), SCH_TEXT::Print(), SCH_GLOBALLABEL::Print(), SCH_HIERLABEL::Print(), LIB_PIN::printPinElectricalTypeName(), LIB_PIN::printPinSymbol(), LIB_PIN::printPinTexts(), WS_DRAW_ITEM_LINE::PrintWsItem(), WS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem(), WS_DRAW_ITEM_RECT::PrintWsItem(), WS_DRAW_ITEM_TEXT::PrintWsItem(), KIGFX::WS_PROXY_VIEW_ITEM::ViewDraw(), and EDIT_POINTS::ViewDraw().

◆ GetNetclassColorMap()

std::map<wxString, KIGFX::COLOR4D>& KIGFX::PCB_RENDER_SETTINGS::GetNetclassColorMap ( )
inline

Definition at line 202 of file pcb_painter.h.

202 { return m_netclassColors; }
std::map< wxString, KIGFX::COLOR4D > m_netclassColors
Overrides for specific netclass colors
Definition: pcb_painter.h:258

References m_netclassColors.

◆ GetNetColorMap()

std::map<int, KIGFX::COLOR4D>& KIGFX::PCB_RENDER_SETTINGS::GetNetColorMap ( )
inline

Definition at line 204 of file pcb_painter.h.

204 { return m_netColors; }
std::map< int, KIGFX::COLOR4D > m_netColors
Overrides for specific net colors, stored as netcodes for the ratsnest to access easily
Definition: pcb_painter.h:261

References m_netColors.

◆ GetNetColorMode()

NET_COLOR_MODE KIGFX::PCB_RENDER_SETTINGS::GetNetColorMode ( ) const
inline

Definition at line 199 of file pcb_painter.h.

199 { return m_netColorMode; }
NET_COLOR_MODE m_netColorMode
How to display nets and netclasses with color overrides
Definition: pcb_painter.h:255

References m_netColorMode.

◆ GetPrintDC()

◆ GetShowPageLimits()

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

◆ GetSketchMode()

bool KIGFX::PCB_RENDER_SETTINGS::GetSketchMode ( int  aItemLayer) const
inline

Function GetSketchMode Returns sketch mode setting for a given item layer.

Parameters
aItemLayeris the item layer that is changed.

Definition at line 142 of file pcb_painter.h.

143  {
144  return m_sketchMode[aItemLayer];
145  }
bool m_sketchMode[GAL_LAYER_ID_END]
Flag determining if items on a given layer should be drawn as an outline or a filled item
Definition: pcb_painter.h:211

References m_sketchMode.

◆ GetWorksheetLineWidth()

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

◆ IsActiveLayer()

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

Function IsActiveLayer Returns information whether the queried layer is marked as active.

Returns
True if the queried layer is marked as active.

Definition at line 99 of file render_settings.h.

100  {
101  return ( m_activeLayers.count( aLayerId ) > 0 );
102  }
std::set< unsigned int > m_activeLayers
Stores active layers number.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

◆ IsBackgroundDark()

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

Reimplemented from KIGFX::RENDER_SETTINGS.

Definition at line 165 of file pcb_painter.h.

166  {
168 
169  return luma < 0.5;
170  }
double GetBrightness() const
Function GetBrightness Returns the brightness value of the color ranged from 0.0 to 1....
Definition: color4d.h:329
COLOR4D m_layerColors[LAYER_ID_COUNT]

References KIGFX::COLOR4D::GetBrightness(), LAYER_PCB_BACKGROUND, and KIGFX::RENDER_SETTINGS::m_layerColors.

◆ IsHighlightEnabled()

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

Function IsHighlightEnabled Returns current highlight setting.

Returns
True if highlight is enabled, false otherwise.

Definition at line 109 of file render_settings.h.

110  {
111  return m_highlightEnabled;
112  }

References KIGFX::RENDER_SETTINGS::m_highlightEnabled.

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

◆ LoadColors()

void PCB_RENDER_SETTINGS::LoadColors ( const COLOR_SETTINGS aSettings)
overridevirtual

Reimplemented from KIGFX::RENDER_SETTINGS.

Definition at line 79 of file pcb_painter.cpp.

80 {
82 
83  // Init board layers colors:
84  for( int i = 0; i < PCB_LAYER_ID_COUNT; i++ )
85  {
86  m_layerColors[i] = aSettings->GetColor( i );
87 
88  // Guard: if the alpah channel is too small, the layer is not visible.
89  // clamp it to 0.2
90  if( m_layerColors[i].a < 0.2 )
91  m_layerColors[i].a = 0.2;
92  }
93 
94  // Init specific graphic layers colors:
95  for( int i = GAL_LAYER_ID_START; i < GAL_LAYER_ID_END; i++ )
96  m_layerColors[i] = aSettings->GetColor( i );
97 
98  // Default colors for specific layers (not really board layers).
99  m_layerColors[LAYER_VIAS_HOLES] = COLOR4D( 0.5, 0.4, 0.0, 0.8 );
101  m_layerColors[LAYER_VIAS_NETNAMES] = COLOR4D( 0.2, 0.2, 0.2, 0.9 );
102  m_layerColors[LAYER_PADS_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
103  m_layerColors[LAYER_PAD_FR_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
104  m_layerColors[LAYER_PAD_BK_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
105 
106  // LAYER_PADS_TH, LAYER_NON_PLATEDHOLES, LAYER_ANCHOR ,LAYER_RATSNEST,
107  // LAYER_VIA_THROUGH, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA
108  // are initialized from aSettings
109 
110  // These colors are not actually used. Set just in case...
113 
114  // Netnames for copper layers
115  for( LSEQ cu = LSET::AllCuMask().CuStack(); cu; ++cu )
116  {
117  const COLOR4D lightLabel( 0.8, 0.8, 0.8, 0.7 );
118  const COLOR4D darkLabel = lightLabel.Inverted();
119  PCB_LAYER_ID layer = *cu;
120 
121  if( m_layerColors[layer].GetBrightness() > 0.5 )
122  m_layerColors[GetNetnameLayer( layer )] = darkLabel;
123  else
124  m_layerColors[GetNetnameLayer( layer )] = lightLabel;
125  }
126 
127  update();
128 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:714
COLOR4D Inverted() const
Function Inverted Returns an inverted color, alpha remains the same.
Definition: color4d.h:319
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
COLOR4D m_layerColors[LAYER_ID_COUNT]
to draw via holes (pad holes do not use this layer)
Add new GAL layers here.
PCB_LAYER_ID
A quick note on layer IDs:
double a
Alpha component.
Definition: color4d.h:369
virtual void update()
Function update Precalculates extra colors for layers (e.g.
void SetBackgroundColor(const COLOR4D &aColor) override
Sets the background color.
Definition: pcb_painter.h:174
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
COLOR4D GetColor(int aLayer) const
Additional netnames layers (not associated with a PCB layer)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References KIGFX::COLOR4D::a, LSET::AllCuMask(), B_SilkS, F_SilkS, GAL_LAYER_ID_END, GAL_LAYER_ID_START, COLOR_SETTINGS::GetColor(), GetNetnameLayer(), KIGFX::COLOR4D::Inverted(), LAYER_MOD_TEXT_BK, LAYER_MOD_TEXT_FR, LAYER_PAD_BK_NETNAMES, LAYER_PAD_FR_NETNAMES, LAYER_PADS_NETNAMES, LAYER_PADS_PLATEDHOLES, LAYER_PCB_BACKGROUND, LAYER_VIAS_HOLES, LAYER_VIAS_NETNAMES, KIGFX::RENDER_SETTINGS::m_layerColors, PCB_LAYER_ID_COUNT, SetBackgroundColor(), and KIGFX::RENDER_SETTINGS::update().

Referenced by StartPlotBoard().

◆ LoadDisplayOptions()

void PCB_RENDER_SETTINGS::LoadDisplayOptions ( const PCB_DISPLAY_OPTIONS aOptions,
bool  aShowPageLimits 
)

Function LoadDisplayOptions Loads settings related to display options (high-contrast mode, full or outline modes for vias/pads/tracks and so on).

Parameters
aOptionsare settings that you want to use for displaying items.

Definition at line 131 of file pcb_painter.cpp.

133 {
136  m_padNumbers = aOptions.m_DisplayPadNum;
138  m_sketchText = !aOptions.m_DisplayTextFill;
141 
142  // Whether to draw tracks, vias & pads filled or as outlines
148 
149  // Net names display settings
150  switch( aOptions.m_DisplayNetNamesMode )
151  {
152  case 0:
153  m_netNamesOnPads = false;
154  m_netNamesOnTracks = false;
155  m_netNamesOnVias = false;
156  break;
157 
158  case 1:
159  m_netNamesOnPads = true;
160  m_netNamesOnTracks = false;
161  m_netNamesOnVias = true; // Follow pads or tracks? For now we chose pads....
162  break;
163 
164  case 2:
165  m_netNamesOnPads = false;
166  m_netNamesOnTracks = true;
167  m_netNamesOnVias = false; // Follow pads or tracks? For now we chose pads....
168  break;
169 
170  case 3:
171  m_netNamesOnPads = true;
172  m_netNamesOnTracks = true;
173  m_netNamesOnVias = true;
174  break;
175  }
176 
177  // Zone display settings
178  switch( aOptions.m_DisplayZonesMode )
179  {
180  case 0:
182  break;
183 
184  case 1:
186  break;
187 
188  case 2:
190  break;
191  }
192 
193  // Clearance settings
194  switch( aOptions.m_ShowTrackClearanceMode )
195  {
198  break;
199 
202  break;
203 
206  break;
207 
210  break;
211 
214  break;
215  }
216 
217  if( aOptions.m_DisplayPadIsol )
218  m_clearance |= CL_PADS;
219 
221 
222  m_showPageLimits = aShowPageLimits;
223 }
to draw blind/buried vias
multilayer pads, usually with holes
bool m_sketchMode[GAL_LAYER_ID_END]
Flag determining if items on a given layer should be drawn as an outline or a filled item
Definition: pcb_painter.h:211
bool m_padNumbers
Flag determining if pad numbers should be visible
Definition: pcb_painter.h:220
DISPLAY_ZONE_MODE m_displayZone
Option for different display modes for zones
Definition: pcb_painter.h:246
bool m_netNamesOnPads
Flag determining if net names should be visible for pads
Definition: pcb_painter.h:223
bool m_sketchGraphics
Flag determining if graphic items should be outlined or stroked
Definition: pcb_painter.h:214
TRACE_CLEARANCE_DISPLAY_MODE_T m_ShowTrackClearanceMode
How trace clearances are displayed.
bool m_hiContrastEnabled
Parameters for display modes.
to draw usual through hole vias
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
bool m_curvedRatsnestlines
Flag determining if ratsnest lines should be drawn curved
Definition: pcb_painter.h:235
bool m_sketchText
Flag determining if text items should be outlined or stroked
Definition: pcb_painter.h:217
bool m_netNamesOnTracks
Flag determining if net names should be visible for tracks
Definition: pcb_painter.h:226
int m_clearance
Clearance visibility settings
Definition: pcb_painter.h:249
HIGH_CONTRAST_MODE m_contrastModeDisplay
How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
Definition: pcb_painter.h:267
bool m_netNamesOnVias
Flag determining if net names should be visible for vias
Definition: pcb_painter.h:229
bool m_globalRatsnestlines
Flag determining if ratsnest lines are shown by default
Definition: pcb_painter.h:238

References CL_EDITED, CL_EXISTING, CL_NEW, CL_NONE, CL_PADS, CL_TRACKS, CL_VIAS, PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE, DZ_HIDE_FILLED, DZ_SHOW_FILLED, DZ_SHOW_OUTLINED, LAYER_PADS_TH, LAYER_TRACKS, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, m_clearance, PCB_DISPLAY_OPTIONS::m_ContrastModeDisplay, m_contrastModeDisplay, m_curvedRatsnestlines, PCB_DISPLAY_OPTIONS::m_DisplayGraphicsFill, PCB_DISPLAY_OPTIONS::m_DisplayNetNamesMode, PCB_DISPLAY_OPTIONS::m_DisplayPadFill, PCB_DISPLAY_OPTIONS::m_DisplayPadIsol, PCB_DISPLAY_OPTIONS::m_DisplayPadNum, PCB_DISPLAY_OPTIONS::m_DisplayPcbTrackFill, PCB_DISPLAY_OPTIONS::m_DisplayRatsnestLinesCurved, PCB_DISPLAY_OPTIONS::m_DisplayTextFill, PCB_DISPLAY_OPTIONS::m_DisplayViaFill, m_displayZone, PCB_DISPLAY_OPTIONS::m_DisplayZonesMode, m_globalRatsnestlines, KIGFX::RENDER_SETTINGS::m_hiContrastEnabled, m_netNamesOnPads, m_netNamesOnTracks, m_netNamesOnVias, m_padNumbers, PCB_DISPLAY_OPTIONS::m_ShowGlobalRatsnest, KIGFX::RENDER_SETTINGS::m_showPageLimits, PCB_DISPLAY_OPTIONS::m_ShowTrackClearanceMode, m_sketchGraphics, m_sketchMode, m_sketchText, NORMAL, PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS, PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS, PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS, and PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS.

◆ LoadNetSettings()

void PCB_RENDER_SETTINGS::LoadNetSettings ( const NET_SETTINGS aSettings,
const NETINFO_LIST aList,
const std::set< int > &  aHiddenNets 
)

Loads net-specific render settings.

Parameters
aSettingsis the NET_SETTINGS for the current proejct
aListis the list of nets on the board
aHiddenNetsis a list of nets to hide from the ratsnest

Definition at line 226 of file pcb_painter.cpp.

228 {
229  m_netColors.clear();
230 
231  for( const auto& pair : aSettings.m_PcbNetColors )
232  {
233  if( NETINFO_ITEM* net = aList.GetNetItem( pair.first ) )
234  m_netColors[net->GetNet()] = pair.second;
235  }
236 
237  m_netclassColors.clear();
238 
239  for( const auto& pair : aSettings.m_NetClasses )
240  {
241  if( pair.second->GetPcbColor() != COLOR4D::UNSPECIFIED )
242  m_netclassColors[pair.first] = pair.second->GetPcbColor();
243  }
244 
245  m_hiddenNets = aHiddenNets;
246 }
std::map< wxString, KIGFX::COLOR4D > m_PcbNetColors
A map of fully-qualified net names to colors used in the board context.
Definition: net_settings.h:51
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:372
std::map< wxString, KIGFX::COLOR4D > m_netclassColors
Overrides for specific netclass colors
Definition: pcb_painter.h:258
NETCLASSES m_NetClasses
Definition: net_settings.h:39
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
std::map< int, KIGFX::COLOR4D > m_netColors
Overrides for specific net colors, stored as netcodes for the ratsnest to access easily
Definition: pcb_painter.h:261
NETINFO_ITEM * GetNetItem(int aNetCode) const
Function GetItem.
std::set< int > m_hiddenNets
Set of net codes that should not have their ratsnest displayed
Definition: pcb_painter.h:264

References NETINFO_LIST::GetNetItem(), m_hiddenNets, m_netclassColors, NET_SETTINGS::m_NetClasses, m_netColors, NET_SETTINGS::m_PcbNetColors, and KIGFX::COLOR4D::UNSPECIFIED.

Referenced by PCB_EDIT_FRAME::LoadProjectSettings().

◆ SetActiveLayer()

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

Function SetActiveLayer Sets the specified layer as active - it means that it can be drawn in a specific mode (eg.

highlighted, so it differs from other layers).

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 67 of file render_settings.h.

68  {
69  if( aEnabled )
70  m_activeLayers.insert( aLayerId );
71  else
72  m_activeLayers.erase( aLayerId );
73  }
std::set< unsigned int > m_activeLayers
Stores active layers number.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

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

◆ SetBackgroundColor()

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

Sets the background color.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 174 of file pcb_painter.h.

175  {
177  }
COLOR4D m_layerColors[LAYER_ID_COUNT]

References LAYER_PCB_BACKGROUND, and KIGFX::RENDER_SETTINGS::m_layerColors.

Referenced by LoadColors().

◆ SetContrastModeDisplay()

void KIGFX::PCB_RENDER_SETTINGS::SetContrastModeDisplay ( HIGH_CONTRAST_MODE  aMode)
inline

Switch the contrast mode setting (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN ) to control how the non active layers are shown.

Definition at line 186 of file pcb_painter.h.

186 { m_contrastModeDisplay = aMode; }
HIGH_CONTRAST_MODE m_contrastModeDisplay
How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )
Definition: pcb_painter.h:267

References m_contrastModeDisplay.

◆ SetDefaultPenWidth()

◆ SetDrawIndividualViaLayers()

void KIGFX::PCB_RENDER_SETTINGS::SetDrawIndividualViaLayers ( bool  aFlag)
inline

Definition at line 197 of file pcb_painter.h.

References m_drawIndividualViaLayers.

Referenced by PCBNEW_PRINTOUT::setupPainter().

◆ SetHighContrast()

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

Function SetHighContrast Turns on/off high contrast display mode.

Definition at line 150 of file render_settings.h.

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

References KIGFX::RENDER_SETTINGS::m_hiContrastEnabled.

◆ SetHighlight()

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

Function SetHighlight 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 higlighting only for the net with number given as the parameter.

Definition at line 131 of file render_settings.h.

132  {
133  m_highlightEnabled = aEnabled;
134 
135  if( aEnabled )
136  {
137  if( !aMulti )
138  m_highlightNetcodes.clear();
139 
140  m_highlightNetcodes.insert( aNetcode );
141  }
142  else
143  m_highlightNetcodes.clear();
144  }
std::set< int > m_highlightNetcodes

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

Referenced by PCB_EDIT_FRAME::ExecuteRemoteCommand(), PNS::TOOL_BASE::highlightNet(), DIALOG_SELECT_NET_FROM_LIST::highlightNetOnBoard(), GERBVIEW_SELECTION_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), and SELECTION_TOOL::Reset().

◆ SetLayerColor()

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

Function SetLayerColor Changes the color used to draw a layer.

Parameters
aLayeris the layer number.
aColoris the new color.

Definition at line 210 of file render_settings.h.

211  {
212  m_layerColors[aLayer] = aColor;
213 
214  update(); // recompute other shades of the color
215  }
COLOR4D m_layerColors[LAYER_ID_COUNT]
virtual void update()
Function update Precalculates extra colors for layers (e.g.

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

Referenced by PLEDITOR_PRINTOUT::PrintPage(), DIALOG_PAD_PROPERTIES::redraw(), PCBNEW_PRINTOUT::setupPainter(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

◆ SetNetColorMode()

void KIGFX::PCB_RENDER_SETTINGS::SetNetColorMode ( NET_COLOR_MODE  aMode)
inline

Definition at line 200 of file pcb_painter.h.

200 { m_netColorMode = aMode; }
NET_COLOR_MODE m_netColorMode
How to display nets and netclasses with color overrides
Definition: pcb_painter.h:255

References m_netColorMode.

◆ SetOutlineWidth()

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

Set line width used for drawing outlines.

Parameters
aWidthis the new width.

Definition at line 227 of file render_settings.h.

228  {
229  m_outlineWidth = aWidth;
230  }

References KIGFX::RENDER_SETTINGS::m_outlineWidth.

◆ SetPrintDC()

◆ SetShowPageLimits()

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

◆ SetSketchMode()

void KIGFX::PCB_RENDER_SETTINGS::SetSketchMode ( int  aItemLayer,
bool  aEnabled 
)
inline

Function SetSketchMode Turns on/off sketch mode for given item layer.

Parameters
aItemLayeris the item layer that is changed.
aEnableddecides if it is drawn in sketch mode (true for sketched mode, false for filled mode).

Definition at line 132 of file pcb_painter.h.

133  {
134  m_sketchMode[aItemLayer] = aEnabled;
135  }
bool m_sketchMode[GAL_LAYER_ID_END]
Flag determining if items on a given layer should be drawn as an outline or a filled item
Definition: pcb_painter.h:211

References m_sketchMode.

Referenced by DIALOG_PAD_PROPERTIES::onChangePadMode().

◆ SetSketchModeGraphicItems()

void KIGFX::PCB_RENDER_SETTINGS::SetSketchModeGraphicItems ( bool  aEnabled)
inline

Turns on/off sketch mode for graphic items (DRAWSEGMENTs, texts).

Parameters
aEnableddecides if it is drawn in sketch mode (true for sketched mode, false for filled mode).

Definition at line 152 of file pcb_painter.h.

153  {
154  m_sketchGraphics = aEnabled;
155  }
bool m_sketchGraphics
Flag determining if graphic items should be outlined or stroked
Definition: pcb_painter.h:214

References m_sketchGraphics.

Referenced by DIALOG_PAD_PROPERTIES::onChangePadMode().

◆ update()

void RENDER_SETTINGS::update ( )
protectedvirtualinherited

Function update Precalculates extra colors for layers (e.g.

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

Definition at line 51 of file render_settings.cpp.

52 {
53  // Calculate darkened/highlighted variants of layer colors
54  for( int i = 0; i < LAYER_ID_COUNT; i++ )
55  {
61  }
62 }
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
COLOR4D m_layerColors[LAYER_ID_COUNT]
COLOR4D Darkened(double aFactor) const
Function Darkened Returns a color that is darker by a given factor, without modifying object.
Definition: color4d.h:275
COLOR4D m_hiContrastColor[LAYER_ID_COUNT]
COLOR4D Brightened(double aFactor) const
Function Brightened Returns a color that is brighter by a given factor, without modifying object.
Definition: color4d.h:259
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Function Mix Returns a color that is mixed with the input by a factor.
Definition: color4d.h:291
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 KIGFX::GERBVIEW_RENDER_SETTINGS::GERBVIEW_RENDER_SETTINGS(), KIGFX::GERBVIEW_RENDER_SETTINGS::LoadColors(), LoadColors(), KIGFX::GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions(), PCB_RENDER_SETTINGS(), KIGFX::GERBVIEW_RENDER_SETTINGS::SetLayerColor(), KIGFX::RENDER_SETTINGS::SetLayerColor(), and KIGFX::WS_RENDER_SETTINGS::WS_RENDER_SETTINGS().

Friends And Related Function Documentation

◆ PCB_PAINTER

friend class PCB_PAINTER
friend

Definition at line 67 of file pcb_painter.h.

Member Data Documentation

◆ m_activeLayers

std::set<unsigned int> KIGFX::RENDER_SETTINGS::m_activeLayers
protectedinherited

◆ m_backgroundColor

◆ m_clearance

int KIGFX::PCB_RENDER_SETTINGS::m_clearance
protected

Clearance visibility settings

Definition at line 249 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), and PCB_RENDER_SETTINGS().

◆ m_contrastModeDisplay

HIGH_CONTRAST_MODE KIGFX::PCB_RENDER_SETTINGS::m_contrastModeDisplay
protected

How to display inactive layers (HIGH_CONTRAST_MODE:NORMAL, DIMMED or HIDDEN )

Definition at line 267 of file pcb_painter.h.

Referenced by GetColor(), GetContrastModeDisplay(), LoadDisplayOptions(), PCB_RENDER_SETTINGS(), and SetContrastModeDisplay().

◆ m_curvedRatsnestlines

bool KIGFX::PCB_RENDER_SETTINGS::m_curvedRatsnestlines = true
protected

Flag determining if ratsnest lines should be drawn curved

Definition at line 235 of file pcb_painter.h.

Referenced by GetCurvedRatsnestLinesEnabled(), and LoadDisplayOptions().

◆ m_defaultPenWidth

int KIGFX::RENDER_SETTINGS::m_defaultPenWidth
protectedinherited

◆ m_displayZone

DISPLAY_ZONE_MODE KIGFX::PCB_RENDER_SETTINGS::m_displayZone
protected

Option for different display modes for zones

Definition at line 246 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), and PCB_RENDER_SETTINGS().

◆ m_drawIndividualViaLayers

bool KIGFX::PCB_RENDER_SETTINGS::m_drawIndividualViaLayers = false
protected

Definition at line 240 of file pcb_painter.h.

Referenced by GetDrawIndividualViaLayers(), and SetDrawIndividualViaLayers().

◆ m_globalRatsnestlines

bool KIGFX::PCB_RENDER_SETTINGS::m_globalRatsnestlines = true
protected

Flag determining if ratsnest lines are shown by default

Definition at line 238 of file pcb_painter.h.

Referenced by GetGlobalRatsnestLinesEnabled(), and LoadDisplayOptions().

◆ m_hiContrastColor

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

◆ m_hiContrastEnabled

◆ m_hiContrastFactor

float KIGFX::RENDER_SETTINGS::m_hiContrastFactor
protectedinherited

◆ m_hiddenNets

std::set<int> KIGFX::PCB_RENDER_SETTINGS::m_hiddenNets
protected

Set of net codes that should not have their ratsnest displayed

Definition at line 264 of file pcb_painter.h.

Referenced by GetHiddenNets(), and LoadNetSettings().

◆ m_highlightEnabled

◆ m_highlightFactor

float KIGFX::RENDER_SETTINGS::m_highlightFactor
protectedinherited

◆ m_highlightNetcodes

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

◆ m_layerColors

◆ m_layerColorsDark

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

◆ m_layerColorsHi

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

◆ m_layerColorsSel

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

◆ m_netclassColors

std::map<wxString, KIGFX::COLOR4D> KIGFX::PCB_RENDER_SETTINGS::m_netclassColors
protected

Overrides for specific netclass colors

Definition at line 258 of file pcb_painter.h.

Referenced by GetColor(), GetNetclassColorMap(), and LoadNetSettings().

◆ m_netColorMode

NET_COLOR_MODE KIGFX::PCB_RENDER_SETTINGS::m_netColorMode
protected

How to display nets and netclasses with color overrides

Definition at line 255 of file pcb_painter.h.

Referenced by GetColor(), GetNetColorMode(), PCB_RENDER_SETTINGS(), and SetNetColorMode().

◆ m_netColors

std::map<int, KIGFX::COLOR4D> KIGFX::PCB_RENDER_SETTINGS::m_netColors
protected

Overrides for specific net colors, stored as netcodes for the ratsnest to access easily

Definition at line 261 of file pcb_painter.h.

Referenced by GetColor(), GetNetColorMap(), and LoadNetSettings().

◆ m_netNamesOnPads

bool KIGFX::PCB_RENDER_SETTINGS::m_netNamesOnPads
protected

Flag determining if net names should be visible for pads

Definition at line 223 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), and PCB_RENDER_SETTINGS().

◆ m_netNamesOnTracks

bool KIGFX::PCB_RENDER_SETTINGS::m_netNamesOnTracks
protected

Flag determining if net names should be visible for tracks

Definition at line 226 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), and PCB_RENDER_SETTINGS().

◆ m_netNamesOnVias

bool KIGFX::PCB_RENDER_SETTINGS::m_netNamesOnVias
protected

Flag determining if net names should be visible for vias

Definition at line 229 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), and PCB_RENDER_SETTINGS().

◆ m_outlineWidth

◆ m_padNumbers

bool KIGFX::PCB_RENDER_SETTINGS::m_padNumbers
protected

Flag determining if pad numbers should be visible

Definition at line 220 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), and PCB_RENDER_SETTINGS().

◆ m_printDC

wxDC* KIGFX::RENDER_SETTINGS::m_printDC
protectedinherited

◆ m_selectFactor

float KIGFX::RENDER_SETTINGS::m_selectFactor
protectedinherited

◆ m_selectionCandidateColor

COLOR4D KIGFX::PCB_RENDER_SETTINGS::m_selectionCandidateColor
protected

Color used for highlighting selection candidates

Definition at line 252 of file pcb_painter.h.

Referenced by GetColor(), and PCB_RENDER_SETTINGS().

◆ m_showPageLimits

◆ m_sketchGraphics

bool KIGFX::PCB_RENDER_SETTINGS::m_sketchGraphics
protected

Flag determining if graphic items should be outlined or stroked

Definition at line 214 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), PCB_RENDER_SETTINGS(), and SetSketchModeGraphicItems().

◆ m_sketchMode

bool KIGFX::PCB_RENDER_SETTINGS::m_sketchMode[GAL_LAYER_ID_END]
protected

Flag determining if items on a given layer should be drawn as an outline or a filled item

Definition at line 211 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), GetSketchMode(), LoadDisplayOptions(), PCB_RENDER_SETTINGS(), and SetSketchMode().

◆ m_sketchText

bool KIGFX::PCB_RENDER_SETTINGS::m_sketchText
protected

Flag determining if text items should be outlined or stroked

Definition at line 217 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), LoadDisplayOptions(), and PCB_RENDER_SETTINGS().

◆ m_worksheetLineWidth

float KIGFX::RENDER_SETTINGS::m_worksheetLineWidth
protectedinherited

◆ m_zoneOutlines

bool KIGFX::PCB_RENDER_SETTINGS::m_zoneOutlines
protected

Flag determining if zones should have outlines drawn

Definition at line 232 of file pcb_painter.h.

Referenced by KIGFX::PCB_PAINTER::draw(), EnableZoneOutlines(), and PCB_RENDER_SETTINGS().

◆ MAX_FONT_SIZE

const double PCB_RENDER_SETTINGS::MAX_FONT_SIZE = Millimeter2iu( 10.0 )
staticprotected

Maximum font size for netnames (and other dynamically shown strings)

Definition at line 243 of file pcb_painter.h.

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


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