KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::GERBVIEW_RENDER_SETTINGS Class Reference

Store 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
 
virtual COLOR4D GetColor (const VIEW_ITEM *aItem, int aLayer) const override
 Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using currently used render settings.
 
const COLOR4DGetLayerColor (int aLayer) const
 Return the color used to draw a layer.
 
void SetLayerColor (int aLayer, const COLOR4D &aColor)
 Change the color used to draw a layer.
 
const COLOR4DGetBackgroundColor () const override
 Return current background color settings.
 
void SetBackgroundColor (const COLOR4D &aColor) override
 Set the background color.
 
const COLOR4DGetGridColor () override
 Return current grid color settings.
 
const COLOR4DGetCursorColor () override
 Return current cursor color settings.
 
bool GetShowPageLimits () const override
 
void ClearHighlightSelections ()
 Clear all highlight selections (dcode, net, component, attribute selection)
 
void SetLayerIsHighContrast (int aLayerId, bool aEnabled=true)
 Set the specified layer as high-contrast.
 
bool GetLayerIsHighContrast (int aLayerId) const
 Return information whether the queried layer is marked as high-contrast.
 
const std::set< int > GetHighContrastLayers () const
 Returns the set of currently high-contrast layers.
 
PCB_LAYER_ID GetPrimaryHighContrastLayer () const
 Return the board layer which is in high-contrast mode.
 
PCB_LAYER_ID GetActiveLayer () const
 
void SetActiveLayer (PCB_LAYER_ID aLayer)
 
const wxString & GetLayerName () const
 
void SetLayerName (const wxString &aLayerName)
 
LSET GetPrintLayers () const
 
void SetPrintLayers (LSET aLayerSet)
 
void ClearHighContrastLayers ()
 Clear the list of active layers.
 
bool IsHighlightEnabled () const
 Return current highlight setting.
 
const std::set< int > & GetHighlightNetCodes () const
 Return the netcode of currently highlighted net.
 
void SetHighlight (bool aEnabled, int aNetcode=-1, bool aMulti=false)
 Turns on/off highlighting.
 
void SetHighlight (std::set< int > &aHighlight, bool aEnabled=true)
 Turns on highlighting and highlights multiple nets.
 
void SetHighContrast (bool aEnabled)
 Turns on/off high contrast display mode.
 
bool GetHighContrast () const
 
void SetDrawBoundingBoxes (bool aEnabled)
 
bool GetDrawBoundingBoxes () const
 
float GetDrawingSheetLineWidth () const
 
int GetDefaultPenWidth () const
 
void SetDefaultPenWidth (int aWidth)
 
int GetMinPenWidth () const
 
void SetMinPenWidth (int aWidth)
 
double GetDashLengthRatio () const
 
void SetDashLengthRatio (double aRatio)
 
double GetDashLength (int aLineWidth) const
 
double GetDotLength (int aLineWidth) const
 
double GetGapLengthRatio () const
 
void SetGapLengthRatio (double aRatio)
 
double GetGapLength (int aLineWidth) const
 
bool IsPrinting () const
 
void SetIsPrinting (bool isPrinting)
 
bool IsPrintBlackAndWhite () const
 
void SetPrintBlackAndWhite (bool aPrintBlackAndWhite)
 
bool PrintBlackAndWhiteReq () const
 
virtual bool IsBackgroundDark () const
 
void SetOutlineWidth (float aWidth)
 Set line width used for drawing outlines.
 
float GetOutlineWidth () const
 
void SetHighlightFactor (float aFactor)
 
void SetSelectFactor (float aFactor)
 
void SetDefaultFont (const wxString &aFont)
 
const wxString & GetDefaultFont () const
 
wxDC * GetPrintDC () const
 
void SetPrintDC (wxDC *aDC)
 

Public Attributes

wxString m_componentHighlightString
 If set to anything but an empty string, will highlight items with matching component.
 
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.
 
int m_dcodeHighlightValue
 If set to anything but >0 (in fact 10 the min dcode value), will highlight items with matching dcode.
 

Protected Member Functions

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

Protected Attributes

PCB_LAYER_ID m_activeLayer
 
wxString m_layerName
 
std::set< int > m_highContrastLayers
 
std::map< int, COLOR4Dm_layerColors
 
std::map< int, COLOR4Dm_layerColorsHi
 
std::map< int, COLOR4Dm_layerColorsSel
 
std::map< int, COLOR4Dm_hiContrastColor
 
std::map< int, COLOR4Dm_layerColorsDark
 
COLOR4D m_backgroundColor
 
bool m_hiContrastEnabled
 Parameters for display modes.
 
float m_hiContrastFactor
 
bool m_highlightEnabled
 
std::set< int > m_highlightNetcodes
 
float m_highlightFactor
 
bool m_drawBoundingBoxes
 
float m_selectFactor
 
float m_outlineWidth
 
float m_drawingSheetLineWidth
 
int m_defaultPenWidth
 
int m_minPenWidth
 
double m_dashLengthRatio
 
double m_gapLengthRatio
 
wxString m_defaultFont
 
bool m_isPrinting
 
bool m_printBlackAndWite
 
LSET m_printLayers
 
wxDC * m_printDC
 

Static Protected Attributes

static const double MAX_FONT_SIZE = gerbIUScale.mmToIU( 10.0 )
 Maximum font size for D-Codes and other strings.
 

Friends

class GERBVIEW_PAINTER
 

Detailed Description

Store GerbView specific render settings.

Definition at line 46 of file gerbview_painter.h.

Constructor & Destructor Documentation

◆ GERBVIEW_RENDER_SETTINGS()

Member Function Documentation

◆ ClearHighContrastLayers()

void KIGFX::RENDER_SETTINGS::ClearHighContrastLayers ( )
inlineinherited

◆ ClearHighlightSelections()

void GERBVIEW_RENDER_SETTINGS::ClearHighlightSelections ( )

Clear all highlight selections (dcode, net, component, attribute selection)

Definition at line 91 of file gerbview_painter.cpp.

References m_attributeHighlightString, m_componentHighlightString, m_dcodeHighlightValue, and m_netHighlightString.

Referenced by GERBVIEW_CONTROL::ClearAllLayers().

◆ GetActiveLayer()

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

◆ GetBackgroundColor()

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

Return current background color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 82 of file gerbview_painter.h.

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

◆ GetColor()

◆ GetCursorColor()

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

Return current cursor color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 95 of file gerbview_painter.h.

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

◆ GetDashLength()

double RENDER_SETTINGS::GetDashLength ( int  aLineWidth) const
inherited

◆ GetDashLengthRatio()

double KIGFX::RENDER_SETTINGS::GetDashLengthRatio ( ) const
inlineinherited

Definition at line 216 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_dashLengthRatio.

◆ GetDefaultFont()

◆ GetDefaultPenWidth()

◆ GetDotLength()

double RENDER_SETTINGS::GetDotLength ( int  aLineWidth) const
inherited

Definition at line 73 of file render_settings.cpp.

References correction.

Referenced by PLOTTER::GetDotMarkLenIU(), and STROKE_PARAMS::Stroke().

◆ GetDrawBoundingBoxes()

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

◆ GetDrawingSheetLineWidth()

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

◆ GetGapLength()

double RENDER_SETTINGS::GetGapLength ( int  aLineWidth) const
inherited

◆ GetGapLengthRatio()

double KIGFX::RENDER_SETTINGS::GetGapLengthRatio ( ) const
inlineinherited

Definition at line 221 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_gapLengthRatio.

◆ GetGridColor()

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

Return current grid color settings.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 93 of file gerbview_painter.h.

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

◆ GetHighContrast()

◆ GetHighContrastLayers()

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

◆ GetHighlightNetCodes()

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

◆ GetLayerColor()

const COLOR4D & KIGFX::GERBVIEW_RENDER_SETTINGS::GetLayerColor ( int  aLayer) const
inline

Return the color used to draw a layer.

Parameters
aLayeris the layer number.

Definition at line 63 of file gerbview_painter.h.

References KIGFX::RENDER_SETTINGS::m_layerColors, and KIGFX::COLOR4D::WHITE.

◆ GetLayerIsHighContrast()

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

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

Returns
True if the queried layer is marked as active.

Definition at line 83 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_highContrastLayers.

Referenced by PCB_REFERENCE_IMAGE::ViewGetLOD().

◆ GetLayerName()

const wxString & KIGFX::RENDER_SETTINGS::GetLayerName ( ) const
inlineinherited

◆ GetMinPenWidth()

◆ GetOutlineWidth()

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

Definition at line 299 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_outlineWidth.

◆ GetPrimaryHighContrastLayer()

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

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

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

Definition at line 102 of file render_settings.h.

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

Referenced by KIGFX::PCB_RENDER_SETTINGS::GetColor(), BOARD_INSPECTION_TOOL::highlightNet(), PNS_KICAD_IFACE::IsItemVisible(), PAD::ViewGetLOD(), PCB_SHAPE::ViewGetLOD(), PCB_TEXT::ViewGetLOD(), PCB_TEXTBOX::ViewGetLOD(), PCB_TRACK::ViewGetLOD(), and PCB_VIA::ViewGetLOD().

◆ GetPrintDC()

◆ GetPrintLayers()

LSET KIGFX::RENDER_SETTINGS::GetPrintLayers ( ) const
inlineinherited

Definition at line 119 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_printLayers.

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

◆ GetShowPageLimits()

bool GERBVIEW_RENDER_SETTINGS::GetShowPageLimits ( ) const
overridevirtual

◆ IsBackgroundDark()

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

◆ IsHighlightEnabled()

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

Return current highlight setting.

Returns
True if highlight is enabled, false otherwise.

Definition at line 135 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_highlightEnabled.

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

◆ IsPrintBlackAndWhite()

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

Definition at line 230 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_printBlackAndWite.

◆ IsPrinting()

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

◆ LoadColors()

◆ PrintBlackAndWhiteReq()

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

◆ SetActiveLayer()

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

◆ SetBackgroundColor()

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

Set the background color.

Implements KIGFX::RENDER_SETTINGS.

Definition at line 88 of file gerbview_painter.h.

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

◆ SetDashLengthRatio()

◆ SetDefaultFont()

◆ SetDefaultPenWidth()

◆ SetDrawBoundingBoxes()

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

◆ SetGapLengthRatio()

◆ SetHighContrast()

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

Turns on/off high contrast display mode.

Definition at line 192 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_hiContrastEnabled.

Referenced by GERBVIEW_FRAME::ApplyDisplaySettingsToGAL().

◆ SetHighlight() [1/2]

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

◆ SetHighlight() [2/2]

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

Turns on highlighting and highlights multiple nets.

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

Definition at line 179 of file render_settings.h.

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

◆ SetHighlightFactor()

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

◆ SetIsPrinting()

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

◆ SetLayerColor()

void KIGFX::GERBVIEW_RENDER_SETTINGS::SetLayerColor ( int  aLayer,
const COLOR4D aColor 
)
inline

Change the color used to draw a layer.

Parameters
aLayeris the layer number.
aColoris the new color.

Definition at line 75 of file gerbview_painter.h.

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

◆ SetLayerIsHighContrast()

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

Set the specified layer as high-contrast.

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

Definition at line 70 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_highContrastLayers.

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

◆ SetLayerName()

void KIGFX::RENDER_SETTINGS::SetLayerName ( const wxString &  aLayerName)
inlineinherited

Definition at line 117 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_layerName.

Referenced by BOARD_PRINTOUT::DrawPage(), and StartPlotBoard().

◆ SetMinPenWidth()

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

◆ SetOutlineWidth()

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

Set line width used for drawing outlines.

Parameters
aWidthis the new width.

Definition at line 298 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_outlineWidth.

◆ SetPrintBlackAndWhite()

void KIGFX::RENDER_SETTINGS::SetPrintBlackAndWhite ( bool  aPrintBlackAndWhite)
inlineinherited

Definition at line 231 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_printBlackAndWite.

Referenced by SCH_PRINTOUT::PrintPage().

◆ SetPrintDC()

◆ SetPrintLayers()

void KIGFX::RENDER_SETTINGS::SetPrintLayers ( LSET  aLayerSet)
inlineinherited

Definition at line 120 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_printLayers.

Referenced by BOARD_PRINTOUT::DrawPage().

◆ SetSelectFactor()

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

Definition at line 302 of file render_settings.h.

References KIGFX::RENDER_SETTINGS::m_selectFactor.

Referenced by PCB_BASE_FRAME::LoadSettings().

◆ update()

Friends And Related Function Documentation

◆ GERBVIEW_PAINTER

friend class GERBVIEW_PAINTER
friend

Definition at line 49 of file gerbview_painter.h.

Member Data Documentation

◆ m_activeLayer

PCB_LAYER_ID KIGFX::RENDER_SETTINGS::m_activeLayer
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 109 of file gerbview_painter.h.

Referenced by ClearHighlightSelections(), 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 103 of file gerbview_painter.h.

Referenced by ClearHighlightSelections(), GERBVIEW_RENDER_SETTINGS(), and GetColor().

◆ m_dashLengthRatio

double KIGFX::RENDER_SETTINGS::m_dashLengthRatio
protectedinherited

◆ m_dcodeHighlightValue

int KIGFX::GERBVIEW_RENDER_SETTINGS::m_dcodeHighlightValue

If set to anything but >0 (in fact 10 the min dcode value), will highlight items with matching dcode.

Definition at line 113 of file gerbview_painter.h.

Referenced by ClearHighlightSelections(), GERBVIEW_RENDER_SETTINGS(), and GetColor().

◆ m_defaultFont

wxString KIGFX::RENDER_SETTINGS::m_defaultFont
protectedinherited

◆ m_defaultPenWidth

◆ m_drawBoundingBoxes

bool KIGFX::RENDER_SETTINGS::m_drawBoundingBoxes
protectedinherited

◆ m_drawingSheetLineWidth

float KIGFX::RENDER_SETTINGS::m_drawingSheetLineWidth
protectedinherited

◆ m_gapLengthRatio

double KIGFX::RENDER_SETTINGS::m_gapLengthRatio
protectedinherited

◆ m_hiContrastColor

std::map<int, COLOR4D> KIGFX::RENDER_SETTINGS::m_hiContrastColor
protectedinherited

Definition at line 325 of file render_settings.h.

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

◆ m_hiContrastEnabled

◆ m_hiContrastFactor

float KIGFX::RENDER_SETTINGS::m_hiContrastFactor
protectedinherited

◆ m_highContrastLayers

◆ m_highlightEnabled

◆ m_highlightFactor

float KIGFX::RENDER_SETTINGS::m_highlightFactor
protectedinherited

◆ m_highlightNetcodes

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

◆ m_isPrinting

◆ m_layerColors

◆ m_layerColorsDark

std::map<int, COLOR4D> KIGFX::RENDER_SETTINGS::m_layerColorsDark
protectedinherited

◆ m_layerColorsHi

std::map<int, COLOR4D> KIGFX::RENDER_SETTINGS::m_layerColorsHi
protectedinherited

◆ m_layerColorsSel

std::map<int, COLOR4D> KIGFX::RENDER_SETTINGS::m_layerColorsSel
protectedinherited

◆ m_layerName

wxString KIGFX::RENDER_SETTINGS::m_layerName
protectedinherited

◆ m_minPenWidth

◆ 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 106 of file gerbview_painter.h.

Referenced by ClearHighlightSelections(), GERBVIEW_RENDER_SETTINGS(), and GetColor().

◆ m_outlineWidth

◆ m_printBlackAndWite

◆ m_printDC

wxDC* KIGFX::RENDER_SETTINGS::m_printDC
protectedinherited

◆ m_printLayers

LSET KIGFX::RENDER_SETTINGS::m_printLayers
protectedinherited

◆ m_selectFactor

float KIGFX::RENDER_SETTINGS::m_selectFactor
protectedinherited

◆ MAX_FONT_SIZE

const double GERBVIEW_RENDER_SETTINGS::MAX_FONT_SIZE = gerbIUScale.mmToIU( 10.0 )
staticprotected

Maximum font size for D-Codes and other strings.

Definition at line 117 of file gerbview_painter.h.


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