KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_render_settings.h
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) 2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef SCH_RENDER_SETTINGS_H
25#define SCH_RENDER_SETTINGS_H
26
27#include <gal/color4d.h>
28#include <render_settings.h>
29#include <transform.h>
30
31
32using KIGFX::COLOR4D;
33
34
36{
37public:
39
40 void LoadColors( const COLOR_SETTINGS* aSettings ) override;
41
42 virtual COLOR4D GetColor( const KIGFX::VIEW_ITEM* aItem, int aLayer ) const override
43 {
44 return m_layerColors[ aLayer ];
45 }
46
47 bool IsBackgroundDark() const override
48 {
50 }
51
52 const KIGFX::COLOR4D& GetBackgroundColor() const override
53 {
55 }
56
57 void SetBackgroundColor( const COLOR4D& aColor ) override
58 {
60 }
61
63 {
64 return (float) m_defaultPenWidth / 3.0F;
65 }
66
67 const COLOR4D& GetGridColor() override { return m_layerColors[ LAYER_SCHEMATIC_GRID ]; }
69
70 bool GetShowPageLimits() const override;
71
72 VECTOR2I TransformCoordinate( const VECTOR2I& aPoint ) const
73 {
74 return m_Transform.TransformCoordinate( aPoint );
75 }
76
77public:
79
80 int m_ShowUnit; // Show all units if 0
81 int m_ShowBodyStyle; // Show all body styles if 0
82
87 bool m_ShowPinNumbers; // Force showing of pin numbers (normally symbol-specific)
88 bool m_ShowPinNames; // Force showing of pin names (normally symbol-specific)
93
95
96 double m_LabelSizeRatio; // Proportion of font size to label box
97 double m_TextOffsetRatio; // Proportion of font size to offset text above/below
98 // wires, buses, etc.
100
102};
103
104
105#endif /* SCH_RENDER_SETTINGS_H */
Color settings are a bit different than most of the settings objects in that there can be more than o...
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
Definition: color4d.h:333
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
COLOR4D m_layerColors[LAYER_ID_COUNT]
An abstract base class for deriving all objects that can be added to a VIEW.
Definition: view_item.h:84
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
virtual COLOR4D GetColor(const KIGFX::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 curr...
bool IsBackgroundDark() const override
void SetBackgroundColor(const COLOR4D &aColor) override
Set the background color.
const COLOR4D & GetGridColor() override
Return current grid color settings.
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
float GetDanglingIndicatorThickness() const
void LoadColors(const COLOR_SETTINGS *aSettings) override
const COLOR4D & GetCursorColor() override
Return current cursor color settings.
bool GetShowPageLimits() const override
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:46
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:44
@ LAYER_SCHEMATIC_CURSOR
Definition: layer_ids.h:392
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:391
@ LAYER_SCHEMATIC_GRID
Definition: layer_ids.h:389