KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_3D_colors.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) 2021 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 "panel_3D_colors.h"
27#include <pgm_base.h>
28
29
31 PANEL_3D_COLORS_BASE( aParent )
32{
35
40
45
48
51
54}
55
56
58{
59 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
60
65 m_solderMaskTop->SetBackgroundColour( *wxWHITE );
66 m_solderMaskBottom->SetBackgroundColour( *wxWHITE );
69 m_boardBody->SetBackgroundColour( *wxWHITE );
70
80
81 if( colors->GetUseBoardStackupColors() )
82 m_boardStackupRB->SetValue( true );
83 else
84 m_specificColorsRB->SetValue( true );
85
86 return true;
87}
88
89
91{
92 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
93
103
104 colors->SetUseBoardStackupColors( m_boardStackupRB->GetValue() );
105
106 Pgm().GetSettingsManager().SaveColorSettings( colors, "3d_viewer" );
107
108 return true;
109}
110
111
113{
114 COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
115
125
126 m_boardStackupRB->SetValue( true );
127}
static CUSTOM_COLORS_LIST g_PasteColors
static CUSTOM_COLORS_LIST g_FinishColors
static KIGFX::COLOR4D g_DefaultBoardBody
static KIGFX::COLOR4D g_DefaultSolderMask
static CUSTOM_COLORS_LIST g_SilkscreenColors
static CUSTOM_COLORS_LIST g_MaskColors
static KIGFX::COLOR4D g_DefaultBackgroundTop
static KIGFX::COLOR4D g_DefaultSurfaceFinish
static KIGFX::COLOR4D g_DefaultSolderPaste
static CUSTOM_COLORS_LIST g_BoardColors
static KIGFX::COLOR4D g_DefaultSilkscreen
static KIGFX::COLOR4D g_DefaultBackgroundBot
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
void SetUseBoardStackupColors(bool aFlag)
COLOR4D GetColor(int aLayer) const
COLOR4D GetDefaultColor(int aLayer)
bool GetUseBoardStackupColors() const
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
void SetSupportsOpacity(bool aSupportsOpacity)
Definition: color_swatch.h:122
KIGFX::COLOR4D GetSwatchColor() const
void SetUserColors(CUSTOM_COLORS_LIST *aUserColors)
Fetch a reference to the user colors list.
Definition: color_swatch.h:95
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
Class PANEL_3D_COLORS_BASE.
COLOR_SWATCH * m_silkscreenBottom
COLOR_SWATCH * m_silkscreenTop
COLOR_SWATCH * m_backgroundTop
wxRadioButton * m_specificColorsRB
COLOR_SWATCH * m_solderMaskTop
wxRadioButton * m_boardStackupRB
COLOR_SWATCH * m_surfaceFinish
COLOR_SWATCH * m_backgroundBottom
COLOR_SWATCH * m_solderPaste
COLOR_SWATCH * m_solderMaskBottom
bool TransferDataToWindow() override
PANEL_3D_COLORS(wxWindow *aParent)
void ResetPanel() override
Reset the contents of this panel.
bool TransferDataFromWindow() override
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:448
@ LAYER_3D_COPPER
Definition: layer_ids.h:444
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:442
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:447
@ LAYER_3D_BOARD
Definition: layer_ids.h:443
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:446
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:449
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:441
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:445
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:115