KiCad PCB EDA Suite
KIGFX::GERBVIEW_RENDER_SETTINGS Class Reference

GERBVIEW_RENDER_SETTINGS Stores GerbView specific render settings. More...

#include <gerbview_painter.h>

Inheritance diagram for KIGFX::GERBVIEW_RENDER_SETTINGS:
KIGFX::RENDER_SETTINGS

Public Member Functions

 GERBVIEW_RENDER_SETTINGS ()
 
void LoadColors (const COLOR_SETTINGS *aSettings) override
 
void LoadDisplayOptions (const GBR_DISPLAY_OPTIONS &aOptions)
 Function LoadDisplayOptions Loads settings related to display options. More...
 
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...
 
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...
 
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...
 
bool IsSpotFill () const
 
bool IsLineFill () const
 
bool IsPolygonFill () const
 
bool IsShowNegativeItems () const
 
bool IsShowCodes () const
 
bool IsDiffMode () 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)
 
virtual bool IsBackgroundDark () const
 
void SetOutlineWidth (float aWidth)
 Set line width used for drawing outlines. More...
 
wxDC * GetPrintDC ()
 
void SetPrintDC (wxDC *aDC)
 

Public Attributes

wxString m_componentHighlightString
 If set to anything but an empty string, will highlight items with matching component. More...
 
wxString m_netHighlightString
 If set to anything but an empty string, will highlight items with matching net. More...
 
wxString m_attributeHighlightString
 If set to anything but an empty string, will highlight items with matching attribute. More...
 

Protected Member Functions

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

Protected Attributes

bool m_spotFill
 Flag determining if spots should be drawn with fill. More...
 
bool m_lineFill
 Flag determining if lines should be drawn with fill. More...
 
bool m_polygonFill
 Flag determining if polygons should be drawn with fill. More...
 
bool m_showNegativeItems
 Flag determining if negative items should be drawn with a "ghost" color. More...
 
bool m_showCodes
 Flag determining if D-Codes should be drawn. More...
 
bool m_diffMode
 Flag determining if layers should be rendered in "diff" mode. 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 D-Codes and other strings. More...
 

Friends

class GERBVIEW_PAINTER
 

Detailed Description

GERBVIEW_RENDER_SETTINGS Stores GerbView specific render settings.

Definition at line 47 of file gerbview_painter.h.

Constructor & Destructor Documentation

◆ GERBVIEW_RENDER_SETTINGS()

GERBVIEW_RENDER_SETTINGS::GERBVIEW_RENDER_SETTINGS ( )

Definition at line 34 of file gerbview_painter.cpp.

35 {
37 
38  m_spotFill = true;
39  m_lineFill = true;
40  m_polygonFill = true;
41  m_showNegativeItems = false;
42  m_showCodes = false;
43  m_diffMode = true;
44 
48 
49  update();
50 }
bool m_showNegativeItems
Flag determining if negative items should be drawn with a "ghost" color.
bool m_lineFill
Flag determining if lines should be drawn with fill.
bool m_spotFill
Flag determining if spots should be drawn with fill.
bool m_showCodes
Flag determining if D-Codes should be drawn.
static const COLOR4D BLACK
Definition: color4d.h:376
wxString m_netHighlightString
If set to anything but an empty string, will highlight items with matching net.
wxString m_attributeHighlightString
If set to anything but an empty string, will highlight items with matching attribute.
virtual void update()
Function update Precalculates extra colors for layers (e.g.
wxString m_componentHighlightString
If set to anything but an empty string, will highlight items with matching component.
bool m_polygonFill
Flag determining if polygons should be drawn with fill.
bool m_diffMode
Flag determining if layers should be rendered in "diff" mode.

References KIGFX::COLOR4D::BLACK, m_attributeHighlightString, KIGFX::RENDER_SETTINGS::m_backgroundColor, m_componentHighlightString, m_diffMode, m_lineFill, m_netHighlightString, m_polygonFill, m_showCodes, m_showNegativeItems, m_spotFill, 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().

◆ 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::GERBVIEW_RENDER_SETTINGS::GetBackgroundColor ( )
inlineoverridevirtual

Function GetBackgroundColor Returns current background color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 89 of file gerbview_painter.h.

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

◆ GetColor()

const COLOR4D & GERBVIEW_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 105 of file gerbview_painter.cpp.

106 {
107  const EDA_ITEM* item = static_cast<const EDA_ITEM*>( aItem );
108  static const COLOR4D transparent = COLOR4D( 0, 0, 0, 0 );
109  const GERBER_DRAW_ITEM* gbrItem = nullptr;
110 
111  if( item && item->Type() == GERBER_DRAW_ITEM_T )
112  gbrItem = static_cast<const GERBER_DRAW_ITEM*>( item );
113 
114  // All DCODE layers stored under a single color setting
115  if( IsDCodeLayer( aLayer ) )
116  return m_layerColors[ LAYER_DCODES ];
117 
118  if( item && item->IsSelected() )
119  return m_layerColorsSel[aLayer];
120 
121  if( gbrItem && gbrItem->GetLayerPolarity() )
122  {
123  if( m_showNegativeItems )
125  else
126  return transparent;
127  }
128 
129  if( !m_netHighlightString.IsEmpty() && gbrItem &&
131  return m_layerColorsHi[aLayer];
132 
133  if( !m_componentHighlightString.IsEmpty() && gbrItem &&
135  return m_layerColorsHi[aLayer];
136 
137  if( !m_attributeHighlightString.IsEmpty() && gbrItem && gbrItem->GetDcodeDescr() &&
139  return m_layerColorsHi[aLayer];
140 
141  // Return grayish color for non-highlighted layers in the high contrast mode
142  if( m_hiContrastEnabled && m_activeLayers.count( aLayer ) == 0)
143  return m_hiContrastColor[aLayer];
144 
145  // Catch the case when highlight and high-contraste modes are enabled
146  // and we are drawing a not highlighted track
147  if( m_highlightEnabled )
148  return m_layerColorsDark[aLayer];
149 
150  // No special modificators enabled
151  return m_layerColors[aLayer];
152 }
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
bool m_showNegativeItems
Flag determining if negative items should be drawn with a "ghost" color.
bool IsDCodeLayer(int aLayer)
bool IsSelected() const
Definition: base_struct.h:203
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
COLOR4D m_layerColors[LAYER_ID_COUNT]
wxString m_Cmpref
the component reference parent of the data
COLOR4D m_hiContrastColor[LAYER_ID_COUNT]
std::set< unsigned int > m_activeLayers
Stores active layers number.
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
wxString m_netHighlightString
If set to anything but an empty string, will highlight items with matching net.
wxString m_attributeHighlightString
If set to anything but an empty string, will highlight items with matching attribute.
bool m_hiContrastEnabled
Parameters for display modes.
wxString m_Netname
for items associated to a net: the netname
wxString m_componentHighlightString
If set to anything but an empty string, will highlight items with matching component.
const GBR_NETLIST_METADATA & GetNetAttributes() const
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE
Definition: dcode.h:105
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
bool GetLayerPolarity() const
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References GERBER_DRAW_ITEM_T, GERBER_DRAW_ITEM::GetDcodeDescr(), GERBER_DRAW_ITEM::GetLayerPolarity(), GERBER_DRAW_ITEM::GetNetAttributes(), IsDCodeLayer(), EDA_ITEM::IsSelected(), LAYER_DCODES, LAYER_NEGATIVE_OBJECTS, KIGFX::RENDER_SETTINGS::m_activeLayers, D_CODE::m_AperFunction, m_attributeHighlightString, GBR_NETLIST_METADATA::m_Cmpref, m_componentHighlightString, KIGFX::RENDER_SETTINGS::m_hiContrastColor, KIGFX::RENDER_SETTINGS::m_hiContrastEnabled, KIGFX::RENDER_SETTINGS::m_highlightEnabled, KIGFX::RENDER_SETTINGS::m_layerColors, KIGFX::RENDER_SETTINGS::m_layerColorsDark, KIGFX::RENDER_SETTINGS::m_layerColorsHi, KIGFX::RENDER_SETTINGS::m_layerColorsSel, m_netHighlightString, GBR_NETLIST_METADATA::m_Netname, m_showNegativeItems, and EDA_ITEM::Type().

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

◆ GetCursorColor()

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

Function GetCursorColor Returns current cursor color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 98 of file gerbview_painter.h.

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

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

◆ GetDefaultPenWidth()

◆ GetGridColor()

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

Function GetGridColor Returns current grid color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 96 of file gerbview_painter.h.

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

◆ 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::GERBVIEW_RENDER_SETTINGS::GetLayerColor ( int  aLayer) const
inline

Function GetLayerColor Returns the color used to draw a layer.

Parameters
aLayeris the layer number.

Definition at line 71 of file gerbview_painter.h.

72  {
73  return m_layerColors[aLayer];
74  }
COLOR4D m_layerColors[LAYER_ID_COUNT]

References KIGFX::RENDER_SETTINGS::m_layerColors.

◆ GetPrintDC()

◆ GetShowPageLimits()

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

◆ 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()

virtual bool KIGFX::RENDER_SETTINGS::IsBackgroundDark ( ) const
inlinevirtualinherited

◆ IsDiffMode()

bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsDiffMode ( ) const
inline

Definition at line 125 of file gerbview_painter.h.

126  {
127  return m_diffMode;
128  }
bool m_diffMode
Flag determining if layers should be rendered in "diff" mode.

References m_diffMode.

◆ 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().

◆ IsLineFill()

bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsLineFill ( ) const
inline

Definition at line 105 of file gerbview_painter.h.

106  {
107  return m_lineFill;
108  }
bool m_lineFill
Flag determining if lines should be drawn with fill.

References m_lineFill.

◆ IsPolygonFill()

bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsPolygonFill ( ) const
inline

Definition at line 110 of file gerbview_painter.h.

111  {
112  return m_polygonFill;
113  }
bool m_polygonFill
Flag determining if polygons should be drawn with fill.

References m_polygonFill.

◆ IsShowCodes()

bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsShowCodes ( ) const
inline

Definition at line 120 of file gerbview_painter.h.

121  {
122  return m_showCodes;
123  }
bool m_showCodes
Flag determining if D-Codes should be drawn.

References m_showCodes.

◆ IsShowNegativeItems()

bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsShowNegativeItems ( ) const
inline

Definition at line 115 of file gerbview_painter.h.

116  {
117  return m_showNegativeItems;
118  }
bool m_showNegativeItems
Flag determining if negative items should be drawn with a "ghost" color.

References m_showNegativeItems.

◆ IsSpotFill()

bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsSpotFill ( ) const
inline

Definition at line 100 of file gerbview_painter.h.

101  {
102  return m_spotFill;
103  }
bool m_spotFill
Flag determining if spots should be drawn with fill.

References m_spotFill.

◆ LoadColors()

void GERBVIEW_RENDER_SETTINGS::LoadColors ( const COLOR_SETTINGS aSettings)
overridevirtual

Reimplemented from KIGFX::RENDER_SETTINGS.

Definition at line 53 of file gerbview_painter.cpp.

54 {
55  size_t palette_size = aSettings->m_Palette.size();
56  size_t palette_idx = 0;
57 
58  // Layers to draw gerber data read from gerber files:
59  for( int i = GERBVIEW_LAYER_ID_START;
61  {
62  COLOR4D baseColor = aSettings->GetColor( i );
63 
64  if( baseColor == COLOR4D::UNSPECIFIED )
65  baseColor = aSettings->m_Palette[ ( palette_idx++ ) % palette_size ];
66 
67  if( m_diffMode )
68  baseColor.a = 0.75;
69 
70  m_layerColors[i] = baseColor;
71  m_layerColorsHi[i] = baseColor.Brightened( 0.5 );
72  m_layerColorsSel[i] = baseColor.Brightened( 0.8 );
73  m_layerColorsDark[i] = baseColor.Darkened( 0.25 );
74  }
75 
76  // Draw layers specific to Gerbview:
77  // LAYER_DCODES, LAYER_NEGATIVE_OBJECTS, LAYER_GERBVIEW_GRID,
78  // LAYER_GERBVIEW_AXES, LAYER_GERBVIEW_BACKGROUND, LAYER_GERBVIEW_WORKSHEET,
79  for( int i = LAYER_DCODES; i < GERBVIEW_LAYER_ID_END; i++ )
80  m_layerColors[i] = aSettings->GetColor( i );
81 
82  for( int i = GAL_LAYER_ID_START; i < GAL_LAYER_ID_END; i++ )
83  m_layerColors[i] = aSettings->GetColor( i );
84 
85  update();
86 }
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
COLOR4D m_layerColors[LAYER_ID_COUNT]
Add new GAL layers here.
COLOR4D Darkened(double aFactor) const
Function Darkened Returns a color that is darker by a given factor, without modifying object.
Definition: color4d.h:275
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:372
COLOR4D Brightened(double aFactor) const
Function Brightened Returns a color that is brighter by a given factor, without modifying object.
Definition: color4d.h:259
double a
Alpha component.
Definition: color4d.h:369
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
#define GERBER_DRAWLAYERS_COUNT
virtual void update()
Function update Precalculates extra colors for layers (e.g.
std::vector< COLOR4D > m_Palette
m_Pallete stores a list of colors that are used, in order, when a list of colors needs to be generate...
COLOR4D GetColor(int aLayer) const
bool m_diffMode
Flag determining if layers should be rendered in "diff" mode.
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99

References KIGFX::COLOR4D::a, KIGFX::COLOR4D::Brightened(), KIGFX::COLOR4D::Darkened(), GAL_LAYER_ID_END, GAL_LAYER_ID_START, GERBER_DRAWLAYERS_COUNT, GERBVIEW_LAYER_ID_END, GERBVIEW_LAYER_ID_START, COLOR_SETTINGS::GetColor(), LAYER_DCODES, m_diffMode, KIGFX::RENDER_SETTINGS::m_layerColors, KIGFX::RENDER_SETTINGS::m_layerColorsDark, KIGFX::RENDER_SETTINGS::m_layerColorsHi, KIGFX::RENDER_SETTINGS::m_layerColorsSel, COLOR_SETTINGS::m_Palette, KIGFX::COLOR4D::UNSPECIFIED, and KIGFX::RENDER_SETTINGS::update().

Referenced by GERBVIEW_FRAME::applyDisplaySettingsToGAL().

◆ LoadDisplayOptions()

void GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions ( const GBR_DISPLAY_OPTIONS aOptions)

Function LoadDisplayOptions Loads settings related to display options.

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

Definition at line 89 of file gerbview_painter.cpp.

90 {
92  m_lineFill = aOptions.m_DisplayLinesFill;
95  m_showCodes = aOptions.m_DisplayDCodes;
96  m_diffMode = aOptions.m_DiffMode;
100 
101  update();
102 }
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
bool m_showNegativeItems
Flag determining if negative items should be drawn with a "ghost" color.
COLOR4D m_BgDrawColor
The background color.
bool m_lineFill
Flag determining if lines should be drawn with fill.
bool m_HighContrastMode
High contrast mode (dim un-highlighted objects)
bool m_DisplayNegativeObjects
Option to draw negative objects in a specific color.
bool m_spotFill
Flag determining if spots should be drawn with fill.
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
bool m_showCodes
Flag determining if D-Codes should be drawn.
bool m_DiffMode
Display layers in diff mode.
bool m_hiContrastEnabled
Parameters for display modes.
virtual void update()
Function update Precalculates extra colors for layers (e.g.
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
bool m_polygonFill
Flag determining if polygons should be drawn with fill.
bool m_DisplayDCodes
Option to show dcode values on items drawn with a dcode tool.
bool m_diffMode
Flag determining if layers should be rendered in "diff" mode.

References KIGFX::RENDER_SETTINGS::m_backgroundColor, GBR_DISPLAY_OPTIONS::m_BgDrawColor, GBR_DISPLAY_OPTIONS::m_DiffMode, m_diffMode, GBR_DISPLAY_OPTIONS::m_DisplayDCodes, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GBR_DISPLAY_OPTIONS::m_DisplayNegativeObjects, GBR_DISPLAY_OPTIONS::m_DisplayPageLimits, GBR_DISPLAY_OPTIONS::m_DisplayPolygonsFill, KIGFX::RENDER_SETTINGS::m_hiContrastEnabled, GBR_DISPLAY_OPTIONS::m_HighContrastMode, m_lineFill, m_polygonFill, m_showCodes, m_showNegativeItems, KIGFX::RENDER_SETTINGS::m_showPageLimits, m_spotFill, and KIGFX::RENDER_SETTINGS::update().

Referenced by GERBVIEW_FRAME::applyDisplaySettingsToGAL().

◆ 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::GERBVIEW_RENDER_SETTINGS::SetBackgroundColor ( const COLOR4D aColor)
inlineoverridevirtual

Sets the background color.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 91 of file gerbview_painter.h.

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

◆ SetDefaultPenWidth()

◆ 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::GERBVIEW_RENDER_SETTINGS::SetLayerColor ( int  aLayer,
const COLOR4D aColor 
)
inline

Function SetLayerColor Changes the color used to draw a layer.

Parameters
aLayeris the layer number.
aColoris the new color.

Definition at line 82 of file gerbview_painter.h.

83  {
84  m_layerColors[aLayer] = aColor;
85 
86  update(); // recompute other shades of the color
87  }
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().

◆ 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

◆ 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 GERBVIEW_RENDER_SETTINGS(), LoadColors(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), LoadDisplayOptions(), KIGFX::PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS(), SetLayerColor(), KIGFX::RENDER_SETTINGS::SetLayerColor(), and KIGFX::WS_RENDER_SETTINGS::WS_RENDER_SETTINGS().

Friends And Related Function Documentation

◆ GERBVIEW_PAINTER

friend class GERBVIEW_PAINTER
friend

Definition at line 50 of file gerbview_painter.h.

Member Data Documentation

◆ m_activeLayers

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

◆ m_attributeHighlightString

wxString KIGFX::GERBVIEW_RENDER_SETTINGS::m_attributeHighlightString

If set to anything but an empty string, will highlight items with matching attribute.

Definition at line 137 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), and GetColor().

◆ m_backgroundColor

◆ m_componentHighlightString

wxString KIGFX::GERBVIEW_RENDER_SETTINGS::m_componentHighlightString

If set to anything but an empty string, will highlight items with matching component.

Definition at line 131 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), and GetColor().

◆ m_defaultPenWidth

int KIGFX::RENDER_SETTINGS::m_defaultPenWidth
protectedinherited

◆ m_diffMode

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_diffMode
protected

Flag determining if layers should be rendered in "diff" mode.

Definition at line 156 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), IsDiffMode(), LoadColors(), 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_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_lineFill

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_lineFill
protected

Flag determining if lines should be drawn with fill.

Definition at line 144 of file gerbview_painter.h.

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), GERBVIEW_RENDER_SETTINGS(), IsLineFill(), and LoadDisplayOptions().

◆ m_netHighlightString

wxString KIGFX::GERBVIEW_RENDER_SETTINGS::m_netHighlightString

If set to anything but an empty string, will highlight items with matching net.

Definition at line 134 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), and GetColor().

◆ m_outlineWidth

◆ m_polygonFill

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_polygonFill
protected

◆ m_printDC

wxDC* KIGFX::RENDER_SETTINGS::m_printDC
protectedinherited

◆ m_selectFactor

float KIGFX::RENDER_SETTINGS::m_selectFactor
protectedinherited

◆ m_showCodes

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_showCodes
protected

Flag determining if D-Codes should be drawn.

Definition at line 153 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), IsShowCodes(), and LoadDisplayOptions().

◆ m_showNegativeItems

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_showNegativeItems
protected

Flag determining if negative items should be drawn with a "ghost" color.

Definition at line 150 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), GetColor(), IsShowNegativeItems(), and LoadDisplayOptions().

◆ m_showPageLimits

◆ m_spotFill

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_spotFill
protected

Flag determining if spots should be drawn with fill.

Definition at line 141 of file gerbview_painter.h.

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), GERBVIEW_RENDER_SETTINGS(), IsSpotFill(), and LoadDisplayOptions().

◆ m_worksheetLineWidth

float KIGFX::RENDER_SETTINGS::m_worksheetLineWidth
protectedinherited

◆ MAX_FONT_SIZE

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

Maximum font size for D-Codes and other strings.

Definition at line 159 of file gerbview_painter.h.


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