KiCad PCB EDA Suite
painter.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
5  * Copyright (C) 2013 CERN
6  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  * @author Maciej Suminski <maciej.suminski@cern.ch>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #include <painter.h>
29 
30 using namespace KIGFX;
31 
33 {
34  // Set the default initial values
35  m_highlightFactor = 0.5;
36  m_selectFactor = 0.5;
37  m_layerOpacity = 0.8;
38  m_highlightEnabled = false;
39  m_hiContrastEnabled = false;
40  m_hiContrastFactor = 0.2;
41  m_highlightNetcode = -1;
42  m_outlineWidth = 1;
43  m_worksheetLineWidth = 100000;
44 }
45 
46 
48 {
49 }
50 
51 
53 {
56 
57  // Calculate darkened/highlighted variants of layer colors
58  for( int i = 0; i < LAYER_ID_COUNT; i++ )
59  {
63  }
64 }
65 
66 
68  m_gal( aGal ), m_brightenedColor( 0.0, 1.0, 0.0, 0.9 )
69 {
70 }
71 
72 
74 {
75 }
float m_worksheetLineWidth
Line width used when drawing worksheet.
Definition: painter.h:259
COLOR4D m_hiContrastColor
Color used for high contrast display mode.
Definition: painter.h:247
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
float m_outlineWidth
Line width used when drawing outlines.
Definition: painter.h:258
COLOR4D m_layerColorsHi[LAYER_ID_COUNT]
Colors for all layers (highlighted)
Definition: painter.h:237
COLOR4D m_layerColors[LAYER_ID_COUNT]
Colors for all layers (normal)
Definition: painter.h:234
PAINTER(GAL *aGal)
Definition: painter.cpp:67
virtual ~PAINTER()
Definition: painter.cpp:73
bool m_highlightEnabled
Highlight display mode on/off.
Definition: painter.h:250
float m_highlightFactor
Factor used for computing hightlight color.
Definition: painter.h:254
COLOR4D Brightened(double aFactor) const
Function Brightened Returns a color that is brighter by a given factor, without modifying object...
Definition: color4d.h:200
COLOR4D m_layerColorsDark[LAYER_ID_COUNT]
Colors for all layers (darkened)
Definition: painter.h:243
bool m_hiContrastEnabled
Parameters for display modes.
Definition: painter.h:246
virtual void update()
Function update Precalculates extra colors for layers (e.g.
Definition: painter.cpp:52
float m_layerOpacity
Determines opacity of all layers.
Definition: painter.h:257
#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:248
COLOR4D Darkened(double aFactor) const
Function Darkened Returns a color that is darker by a given factor, without modifying object...
Definition: color4d.h:216
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:251
virtual ~RENDER_SETTINGS()
Definition: painter.cpp:47
float m_selectFactor
Specifies how color of selected items is changed.
Definition: painter.h:256
COLOR4D m_layerColorsSel[LAYER_ID_COUNT]
Colors for all layers (selected)
Definition: painter.h:240
Class GAL is the abstract interface for drawing on a 2D-surface.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39