KiCad PCB EDA Suite
KIGFX::GERBVIEW_RENDER_SETTINGS Class Reference

Class 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 ImportLegacyColors (const COLORS_DESIGN_SETTINGS *aSettings) override
 Function ImportLegacyColors Loads a list of color settings for layers. More...
 
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...
 
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 ()
 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...
 
int GetHighlightNetCode () const
 Function GetHighlightNetCode Returns netcode of currently highlighted net. More...
 
void SetHighlight (bool aEnabled, int aNetcode=-1)
 Function SetHighlight Turns on/off highlighting - it may be done for the active layer or the specified net. More...
 
void SetHighContrast (bool aEnabled)
 Function SetHighContrast Turns on/off high contrast display mode. More...
 
bool GetHighContrast () const
 Function GetHighContrast Returns information about high contrast display mode. More...
 
float GetWorksheetLineWidth () const
 
bool GetShowPageLimits () const
 
void SetShowPageLimits (bool aDraw)
 
const COLOR4DGetBackgroundColor () const
 Function GetBackgroundColor Returns current background color settings. More...
 
void SetBackgroundColor (const COLOR4D &aColor)
 Function SetBackgroundColor Sets new color for background. More...
 

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]
 

Colors for all layers (normal)

More...
 
COLOR4D m_layerColorsHi [LAYER_ID_COUNT]
 

Colors for all layers (highlighted)

More...
 
COLOR4D m_layerColorsSel [LAYER_ID_COUNT]
 

Colors for all layers (selected)

More...
 
COLOR4D m_layerColorsDark [LAYER_ID_COUNT]
 

Colors for all layers (darkened)

More...
 
bool m_hiContrastEnabled
 Parameters for display modes. More...
 
COLOR4D m_hiContrastColor
 Color used for high contrast display mode. More...
 
float m_hiContrastFactor
 Factor used for computing high contrast color. More...
 
bool m_highlightEnabled
 Highlight display mode on/off. More...
 
int m_highlightNetcode
 Net number that is displayed in highlight -1 means that there is no specific net, and whole active layer is highlighted. More...
 
float m_highlightFactor
 Factor used for computing hightlight color. More...
 
float m_selectFactor
 Specifies how color of selected items is changed. More...
 
float m_layerOpacity
 Determines opacity of all layers. More...
 
float m_outlineWidth
 Line width used when drawing outlines. More...
 
float m_worksheetLineWidth
 Line width used when drawing worksheet. More...
 
bool m_showPageLimits
 
COLOR4D m_backgroundColor
 The background color. More...
 

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

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

Definition at line 34 of file gerbview_painter.cpp.

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

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.
static const COLOR4D BLACK
Definition: color4d.h:301
bool m_spotFill
Flag determining if spots should be drawn with fill.
bool m_showCodes
Flag determining if D-Codes should be drawn.
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.
Definition: painter.cpp:53
wxString m_componentHighlightString
If set to anything but an empty string, will highlight items with matching component.
COLOR4D m_backgroundColor
The background color.
Definition: painter.h:274
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.

Member Function Documentation

void KIGFX::RENDER_SETTINGS::ClearActiveLayers ( )
inlineinherited

Function ClearActiveLayers Clears the list of active layers.

Definition at line 98 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

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

99  {
100  m_activeLayers.clear();
101  }
std::set< unsigned int > m_activeLayers
Stores active layers number.
Definition: painter.h:242
const std::set<unsigned int> KIGFX::RENDER_SETTINGS::GetActiveLayers ( )
inlineinherited

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

Returns
The set of currently active layers.

Definition at line 89 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

90  {
91  return m_activeLayers;
92  }
std::set< unsigned int > m_activeLayers
Stores active layers number.
Definition: painter.h:242
const COLOR4D& KIGFX::RENDER_SETTINGS::GetBackgroundColor ( ) const
inlineinherited

Function GetBackgroundColor Returns current background color settings.

Returns
Background color.

Definition at line 196 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_backgroundColor.

Referenced by KIGFX::PCB_PAINTER::draw(), and EDA_DRAW_PANEL_GAL::onPaint().

197  {
198  return m_backgroundColor;
199  }
COLOR4D m_backgroundColor
The background color.
Definition: painter.h:274
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 100 of file gerbview_painter.cpp.

References 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, and m_showNegativeItems.

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

101 {
102  const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
103  static const COLOR4D transparent = COLOR4D( 0, 0, 0, 0 );
104 
105  // All DCODE layers stored under a single color setting
106  if( IsDCodeLayer( aLayer ) )
107  return m_layerColors[ LAYER_DCODES ];
108 
109  if( item )
110  {
111  if( item->IsSelected() )
112  return m_layerColorsSel[aLayer];
113 
114  if( item->GetLayerPolarity() )
115  {
116  if( m_showNegativeItems )
118  else
119  return transparent;
120  }
121  }
122 
123  if( !m_netHighlightString.IsEmpty() && item &&
125  return m_layerColorsHi[aLayer];
126 
127  if( !m_componentHighlightString.IsEmpty() && item &&
129  return m_layerColorsHi[aLayer];
130 
131  if( !m_attributeHighlightString.IsEmpty() && item && item->GetDcodeDescr() &&
133  return m_layerColorsHi[aLayer];
134 
135  // Return grayish color for non-highlighted layers in the high contrast mode
136  if( m_hiContrastEnabled && m_activeLayers.count( aLayer ) == 0)
137  return m_hiContrastColor;
138 
139  // Catch the case when highlight and high-contraste modes are enabled
140  // and we are drawing a not highlighted track
141  if( m_highlightEnabled )
142  return m_layerColorsDark[aLayer];
143 
144  // No special modificators enabled
145  return m_layerColors[aLayer];
146 }
COLOR4D m_hiContrastColor
Color used for high contrast display mode.
Definition: painter.h:258
bool m_showNegativeItems
Flag determining if negative items should be drawn with a "ghost" color.
bool IsDCodeLayer(int aLayer)
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
Colors for all layers (highlighted)
Definition: painter.h:248
COLOR4D m_layerColors[LAYER_ID_COUNT]
Colors for all layers (normal)
Definition: painter.h:245
bool IsSelected() const
Definition: base_struct.h:221
wxString m_Cmpref
the component reference parent of the data
bool m_highlightEnabled
Highlight display mode on/off.
Definition: painter.h:261
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
std::set< unsigned int > m_activeLayers
Stores active layers number.
Definition: painter.h:242
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
Colors for all layers (darkened)
Definition: painter.h:254
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 GetLayerPolarity() const
bool m_hiContrastEnabled
Parameters for display modes.
Definition: painter.h:257
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.
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE ...
Definition: dcode.h:105
const GBR_NETLIST_METADATA & GetNetAttributes() const
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
Colors for all layers (selected)
Definition: painter.h:251
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
bool KIGFX::RENDER_SETTINGS::GetHighContrast ( ) const
inlineinherited

Function GetHighContrast Returns information about high contrast display mode.

Returns
True if the high contrast mode is on, false otherwise.

Definition at line 161 of file painter.h.

References KIGFX::RENDER_SETTINGS::GetColor(), and KIGFX::RENDER_SETTINGS::m_hiContrastEnabled.

Referenced by SELECTION_TOOL::selectable().

162  {
163  return m_hiContrastEnabled;
164  }
bool m_hiContrastEnabled
Parameters for display modes.
Definition: painter.h:257
int KIGFX::RENDER_SETTINGS::GetHighlightNetCode ( ) const
inlineinherited

Function GetHighlightNetCode Returns netcode of currently highlighted net.

Returns
Netcode of currently highlighted net.

Definition at line 128 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_highlightNetcode.

129  {
130  return m_highlightNetcode;
131  }
int m_highlightNetcode
Net number that is displayed in highlight -1 means that there is no specific net, and whole active la...
Definition: painter.h:262
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 72 of file gerbview_painter.h.

References KIGFX::RENDER_SETTINGS::m_layerColors.

73  {
74  return m_layerColors[aLayer];
75  }
COLOR4D m_layerColors[LAYER_ID_COUNT]
Colors for all layers (normal)
Definition: painter.h:245
bool KIGFX::RENDER_SETTINGS::GetShowPageLimits ( ) const
inlineinherited

Definition at line 181 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_showPageLimits.

182  {
183  return m_showPageLimits;
184  }
float KIGFX::RENDER_SETTINGS::GetWorksheetLineWidth ( ) const
inlineinherited

Definition at line 176 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_worksheetLineWidth.

177  {
178  return m_worksheetLineWidth;
179  }
float m_worksheetLineWidth
Line width used when drawing worksheet.
Definition: painter.h:270
void GERBVIEW_RENDER_SETTINGS::ImportLegacyColors ( const COLORS_DESIGN_SETTINGS aSettings)
overridevirtual

Function ImportLegacyColors Loads a list of color settings for layers.

Parameters
aSettingsis a list of color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 53 of file gerbview_painter.cpp.

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, COLORS_DESIGN_SETTINGS::GetItemColor(), COLORS_DESIGN_SETTINGS::GetLayerColor(), i, LAYER_DCODES, LAYER_PCB_BACKGROUND, m_diffMode, KIGFX::RENDER_SETTINGS::m_layerColors, KIGFX::RENDER_SETTINGS::m_layerColorsDark, KIGFX::RENDER_SETTINGS::m_layerColorsHi, KIGFX::RENDER_SETTINGS::m_layerColorsSel, KIGFX::RENDER_SETTINGS::SetBackgroundColor(), and KIGFX::RENDER_SETTINGS::update().

Referenced by GERBVIEW_FRAME::applyDisplaySettingsToGAL(), and GERBVIEW_DRAW_PANEL_GAL::UseColorScheme().

54 {
55  for( int i = GERBVIEW_LAYER_ID_START;
57  {
58  COLOR4D baseColor = aSettings->GetLayerColor( i );
59 
60  if( m_diffMode )
61  baseColor.a = 0.75;
62 
63  m_layerColors[i] = baseColor;
64  m_layerColorsHi[i] = baseColor.Brightened( 0.5 );
65  m_layerColorsSel[i] = baseColor.Brightened( 0.8 );
66  m_layerColorsDark[i] = baseColor.Darkened( 0.25 );
67  }
68 
69  for( int i = LAYER_DCODES; i < GERBVIEW_LAYER_ID_END; i++ )
70  m_layerColors[i] = aSettings->GetLayerColor( i );
71 
72  for( int i = GAL_LAYER_ID_START; i < GAL_LAYER_ID_END; i++ )
73  m_layerColors[i] = aSettings->GetLayerColor( i );
74 
76 
77  update();
78 }
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
Colors for all layers (highlighted)
Definition: painter.h:248
COLOR4D m_layerColors[LAYER_ID_COUNT]
Colors for all layers (normal)
Definition: painter.h:245
Add new GAL layers here.
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
COLOR4D Brightened(double aFactor) const
Function Brightened Returns a color that is brighter by a given factor, without modifying object...
Definition: color4d.h:205
double a
Alpha component.
Definition: color4d.h:294
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
Colors for all layers (darkened)
Definition: painter.h:254
#define GERBER_DRAWLAYERS_COUNT
virtual void update()
Function update Precalculates extra colors for layers (e.g.
Definition: painter.cpp:53
size_t i
Definition: json11.cpp:597
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
COLOR4D Darkened(double aFactor) const
Function Darkened Returns a color that is darker by a given factor, without modifying object...
Definition: color4d.h:221
void SetBackgroundColor(const COLOR4D &aColor)
Function SetBackgroundColor Sets new color for background.
Definition: painter.h:206
bool m_diffMode
Flag determining if layers should be rendered in "diff" mode.
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
Colors for all layers (selected)
Definition: painter.h:251
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
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 108 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

109  {
110  return ( m_activeLayers.count( aLayerId ) > 0 );
111  }
std::set< unsigned int > m_activeLayers
Stores active layers number.
Definition: painter.h:242
bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsDiffMode ( ) const
inline

Definition at line 115 of file gerbview_painter.h.

References m_diffMode.

116  {
117  return m_diffMode;
118  }
bool m_diffMode
Flag determining if layers should be rendered in "diff" mode.
bool KIGFX::RENDER_SETTINGS::IsHighlightEnabled ( ) const
inlineinherited

Function IsHighlightEnabled Returns current highlight setting.

Returns
True if highlight is enabled, false otherwise.

Definition at line 118 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_highlightEnabled.

119  {
120  return m_highlightEnabled;
121  }
bool m_highlightEnabled
Highlight display mode on/off.
Definition: painter.h:261
bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsLineFill ( ) const
inline

Definition at line 95 of file gerbview_painter.h.

References m_lineFill.

96  {
97  return m_lineFill;
98  }
bool m_lineFill
Flag determining if lines should be drawn with fill.
bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsPolygonFill ( ) const
inline

Definition at line 100 of file gerbview_painter.h.

References m_polygonFill.

101  {
102  return m_polygonFill;
103  }
bool m_polygonFill
Flag determining if polygons should be drawn with fill.
bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsShowCodes ( ) const
inline

Definition at line 110 of file gerbview_painter.h.

References m_showCodes.

111  {
112  return m_showCodes;
113  }
bool m_showCodes
Flag determining if D-Codes should be drawn.
bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsShowNegativeItems ( ) const
inline

Definition at line 105 of file gerbview_painter.h.

References m_showNegativeItems.

106  {
107  return m_showNegativeItems;
108  }
bool m_showNegativeItems
Flag determining if negative items should be drawn with a "ghost" color.
bool KIGFX::GERBVIEW_RENDER_SETTINGS::IsSpotFill ( ) const
inline

Definition at line 90 of file gerbview_painter.h.

References m_spotFill.

91  {
92  return m_spotFill;
93  }
bool m_spotFill
Flag determining if spots should be drawn with fill.
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 81 of file gerbview_painter.cpp.

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(), and PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow().

82 {
83  if( aOptions == NULL )
84  return;
85 
87  m_lineFill = aOptions->m_DisplayLinesFill;
90  m_showCodes = aOptions->m_DisplayDCodes;
91  m_diffMode = aOptions->m_DiffMode;
94  m_backgroundColor = aOptions->m_BgDrawColor;
95 
96  update();
97 }
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.
Definition: painter.h:257
virtual void update()
Function update Precalculates extra colors for layers (e.g.
Definition: painter.cpp:53
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
COLOR4D m_backgroundColor
The background color.
Definition: painter.h:274
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.
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 76 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_activeLayers.

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

77  {
78  if( aEnabled )
79  m_activeLayers.insert( aLayerId );
80  else
81  m_activeLayers.erase( aLayerId );
82  }
std::set< unsigned int > m_activeLayers
Stores active layers number.
Definition: painter.h:242
void KIGFX::RENDER_SETTINGS::SetBackgroundColor ( const COLOR4D aColor)
inlineinherited

Function SetBackgroundColor Sets new color for background.

Parameters
aColoris the new background color.

Definition at line 206 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_backgroundColor.

Referenced by ImportLegacyColors(), and KIGFX::PCB_RENDER_SETTINGS::ImportLegacyColors().

207  {
208  m_backgroundColor = aColor;
209  }
COLOR4D m_backgroundColor
The background color.
Definition: painter.h:274
void KIGFX::RENDER_SETTINGS::SetHighContrast ( bool  aEnabled)
inlineinherited

Function SetHighContrast Turns on/off high contrast display mode.

Parameters
aEnableddetermines if high contrast display mode should be enabled or not.

Definition at line 151 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_hiContrastEnabled.

152  {
153  m_hiContrastEnabled = aEnabled;
154  }
bool m_hiContrastEnabled
Parameters for display modes.
Definition: painter.h:257
void KIGFX::RENDER_SETTINGS::SetHighlight ( bool  aEnabled,
int  aNetcode = -1 
)
inlineinherited

Function SetHighlight Turns on/off highlighting - it may be done for the active layer or the specified net.

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 140 of file painter.h.

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

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

141  {
142  m_highlightEnabled = aEnabled;
143  m_highlightNetcode = aEnabled ? aNetcode : -1;
144  }
bool m_highlightEnabled
Highlight display mode on/off.
Definition: painter.h:261
int m_highlightNetcode
Net number that is displayed in highlight -1 means that there is no specific net, and whole active la...
Definition: painter.h:262
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 83 of file gerbview_painter.h.

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

84  {
85  m_layerColors[aLayer] = aColor;
86 
87  update(); // recompute other shades of the color
88  }
COLOR4D m_layerColors[LAYER_ID_COUNT]
Colors for all layers (normal)
Definition: painter.h:245
virtual void update()
Function update Precalculates extra colors for layers (e.g.
Definition: painter.cpp:53
void KIGFX::RENDER_SETTINGS::SetShowPageLimits ( bool  aDraw)
inlineinherited

Definition at line 186 of file painter.h.

References KIGFX::RENDER_SETTINGS::m_showPageLimits.

187  {
188  m_showPageLimits = aDraw;
189  }
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 53 of file painter.cpp.

References KIGFX::COLOR4D::Brightened(), KIGFX::COLOR4D::Darkened(), i, LAYER_ID_COUNT, 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_layerOpacity, and KIGFX::RENDER_SETTINGS::m_selectFactor.

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

54 {
57 
58  // Calculate darkened/highlighted variants of layer colors
59  for( int i = 0; i < LAYER_ID_COUNT; i++ )
60  {
64  }
65 }
COLOR4D m_hiContrastColor
Color used for high contrast display mode.
Definition: painter.h:258
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
Colors for all layers (highlighted)
Definition: painter.h:248
COLOR4D m_layerColors[LAYER_ID_COUNT]
Colors for all layers (normal)
Definition: painter.h:245
float m_highlightFactor
Factor used for computing hightlight color.
Definition: painter.h:265
COLOR4D Brightened(double aFactor) const
Function Brightened Returns a color that is brighter by a given factor, without modifying object...
Definition: color4d.h:205
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
Colors for all layers (darkened)
Definition: painter.h:254
float m_layerOpacity
Determines opacity of all layers.
Definition: painter.h:268
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
float m_hiContrastFactor
Factor used for computing high contrast color.
Definition: painter.h:259
size_t i
Definition: json11.cpp:597
COLOR4D Darkened(double aFactor) const
Function Darkened Returns a color that is darker by a given factor, without modifying object...
Definition: color4d.h:221
float m_selectFactor
Specifies how color of selected items is changed.
Definition: painter.h:267
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
Colors for all layers (selected)
Definition: painter.h:251
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

Friends And Related Function Documentation

friend class GERBVIEW_PAINTER
friend

Definition at line 50 of file gerbview_painter.h.

Member Data Documentation

std::set<unsigned int> KIGFX::RENDER_SETTINGS::m_activeLayers
protectedinherited
wxString KIGFX::GERBVIEW_RENDER_SETTINGS::m_attributeHighlightString

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

Definition at line 127 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), and GetColor().

COLOR4D KIGFX::RENDER_SETTINGS::m_backgroundColor
protectedinherited
wxString KIGFX::GERBVIEW_RENDER_SETTINGS::m_componentHighlightString

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

Definition at line 121 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), and GetColor().

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_diffMode
protected

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

Definition at line 146 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), ImportLegacyColors(), IsDiffMode(), and LoadDisplayOptions().

COLOR4D KIGFX::RENDER_SETTINGS::m_hiContrastColor
protectedinherited

Color used for high contrast display mode.

Definition at line 258 of file painter.h.

Referenced by GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and KIGFX::RENDER_SETTINGS::update().

bool KIGFX::RENDER_SETTINGS::m_hiContrastEnabled
protectedinherited
float KIGFX::RENDER_SETTINGS::m_hiContrastFactor
protectedinherited

Factor used for computing high contrast color.

Definition at line 259 of file painter.h.

Referenced by KIGFX::RENDER_SETTINGS::RENDER_SETTINGS(), and KIGFX::RENDER_SETTINGS::update().

bool KIGFX::RENDER_SETTINGS::m_highlightEnabled
protectedinherited
float KIGFX::RENDER_SETTINGS::m_highlightFactor
protectedinherited

Factor used for computing hightlight color.

Definition at line 265 of file painter.h.

Referenced by KIGFX::RENDER_SETTINGS::RENDER_SETTINGS(), and KIGFX::RENDER_SETTINGS::update().

int KIGFX::RENDER_SETTINGS::m_highlightNetcode
protectedinherited

Net number that is displayed in highlight -1 means that there is no specific net, and whole active layer is highlighted.

Definition at line 262 of file painter.h.

Referenced by KIGFX::PCB_RENDER_SETTINGS::GetColor(), KIGFX::RENDER_SETTINGS::GetHighlightNetCode(), KIGFX::RENDER_SETTINGS::RENDER_SETTINGS(), and KIGFX::RENDER_SETTINGS::SetHighlight().

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

Colors for all layers (darkened)

Definition at line 254 of file painter.h.

Referenced by GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), ImportLegacyColors(), and KIGFX::RENDER_SETTINGS::update().

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

Colors for all layers (highlighted)

Definition at line 248 of file painter.h.

Referenced by GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), ImportLegacyColors(), and KIGFX::RENDER_SETTINGS::update().

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

Colors for all layers (selected)

Definition at line 251 of file painter.h.

Referenced by GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), ImportLegacyColors(), and KIGFX::RENDER_SETTINGS::update().

float KIGFX::RENDER_SETTINGS::m_layerOpacity
protectedinherited

Determines opacity of all layers.

Definition at line 268 of file painter.h.

Referenced by KIGFX::RENDER_SETTINGS::RENDER_SETTINGS(), and KIGFX::RENDER_SETTINGS::update().

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_lineFill
protected

Flag determining if lines should be drawn with fill.

Definition at line 134 of file gerbview_painter.h.

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

wxString KIGFX::GERBVIEW_RENDER_SETTINGS::m_netHighlightString

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

Definition at line 124 of file gerbview_painter.h.

Referenced by GERBVIEW_RENDER_SETTINGS(), and GetColor().

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_polygonFill
protected
float KIGFX::RENDER_SETTINGS::m_selectFactor
protectedinherited

Specifies how color of selected items is changed.

Definition at line 267 of file painter.h.

Referenced by KIGFX::RENDER_SETTINGS::RENDER_SETTINGS(), and KIGFX::RENDER_SETTINGS::update().

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_showCodes
protected

Flag determining if D-Codes should be drawn.

Definition at line 143 of file gerbview_painter.h.

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

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_showNegativeItems
protected

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

Definition at line 140 of file gerbview_painter.h.

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

bool KIGFX::GERBVIEW_RENDER_SETTINGS::m_spotFill
protected

Flag determining if spots should be drawn with fill.

Definition at line 131 of file gerbview_painter.h.

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

float KIGFX::RENDER_SETTINGS::m_worksheetLineWidth
protectedinherited

Line width used when drawing worksheet.

Definition at line 270 of file painter.h.

Referenced by KIGFX::RENDER_SETTINGS::GetWorksheetLineWidth(), and KIGFX::RENDER_SETTINGS::RENDER_SETTINGS().

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

Maximum font size for D-Codes and other strings.

Definition at line 149 of file gerbview_painter.h.

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


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