KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_render_settings.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) 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#include <pgm_base.h>
25#include <kiface_base.h>
26#include <advanced_config.h>
28#include <eeschema_settings.h>
29#include <default_values.h>
30#include <sch_render_settings.h>
31
32
34 m_IsSymbolEditor( false ),
35 m_ShowUnit( 0 ),
36 m_ShowBodyStyle( 0 ),
37 m_ShowPinsElectricalType( true ),
38 m_ShowHiddenPins( true ),
39 m_ShowHiddenFields( true ),
40 m_ShowVisibleFields( true ),
41 m_ShowPinNumbers( false ),
42 m_ShowPinNames( false ),
43 m_ShowPinAltIcons( false ),
44 m_ShowDisabled( false ),
45 m_ShowGraphicsDisabled( false ),
46 m_ShowConnectionPoints( false ),
47 m_OverrideItemColors( false ),
48 m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ),
49 m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ),
50 m_PinSymbolSize( DEFAULT_TEXT_SIZE * schIUScale.IU_PER_MILS / 2 ),
51 m_Transform()
52{
54 SetDashLengthRatio( 12 ); // From ISO 128-2
55 SetGapLengthRatio( 3 ); // From ISO 128-2
56
58}
59
60
62{
63 for( int layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; layer ++)
64 m_layerColors[ layer ] = aSettings->GetColor( layer );
65
66 for( int layer = GAL_LAYER_ID_START; layer < GAL_LAYER_ID_END; layer ++)
67 m_layerColors[ layer ] = aSettings->GetColor( layer );
68
70
72
74}
75
76
78{
79 EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
80 return cfg && cfg->m_Appearance.show_page_limits && !IsPrinting();
81}
82
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:110
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition: box2.h:990
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Color settings are a bit different than most of the settings objects in that there can be more than o...
bool GetOverrideSchItemColors() const
COLOR4D GetColor(int aLayer) const
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
void SetDefaultPenWidth(int aWidth)
void SetGapLengthRatio(double aRatio)
void SetDashLengthRatio(double aRatio)
std::map< int, COLOR4D > m_layerColors
void LoadColors(const COLOR_SETTINGS *aSettings) override
bool GetShowPageLimits() const override
#define DEFAULT_LABEL_SIZE_RATIO
The offset of the pin name string from the end of the pin in mils.
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
#define DEFAULT_TEXT_OFFSET_RATIO
Ratio of the font height to space around global labels.
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
@ GAL_LAYER_ID_START
Definition: layer_ids.h:192
@ GAL_LAYER_ID_END
Definition: layer_ids.h:268
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:223
@ SCH_LAYER_ID_END
Definition: layer_ids.h:406
@ SCH_LAYER_ID_START
Definition: layer_ids.h:354
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:391
@ LAYER_SCHEMATIC_AUX_ITEMS
Definition: layer_ids.h:401
see class PGM_BASE
#define IU_PER_MILS
Definition: plotter.cpp:129
const double IU_PER_MM
Definition: base_units.h:76
const double IU_PER_MILS
Definition: base_units.h:77