KiCad PCB EDA Suite
Loading...
Searching...
No Matches
appearance_controls_3D.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) 2023 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
22
23#include <bitmaps.h>
24#include <confirm.h>
25#include <pgm_base.h>
26#include <dpi_scaling_common.h>
27#include <eda_list_dialog.h>
28#include <pcb_display_options.h>
29#include <eda_3d_viewer_frame.h>
30#include <pcbnew_settings.h>
31#include <project.h>
32#include <board.h>
33#include <tool/tool_manager.h>
34#include <tools/pcb_actions.h>
40#include <wx/bmpbuttn.h>
41#include <wx/sizer.h>
42#include <wx/textdlg.h>
43#include <wx/checkbox.h>
44
45#include <../3d_rendering/opengl/render_3d_opengl.h>
46
48#define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D
49
52
53 // text id tooltip
54 RR( _HKI( "Board Body" ), LAYER_3D_BOARD, _HKI( "Show board body" ) ),
55 RR( wxS( "F.Cu" ), LAYER_3D_COPPER_TOP, _HKI( "Show front copper / surface finish color" ) ),
56 RR( wxS( "B.Cu" ), LAYER_3D_COPPER_BOTTOM, _HKI( "Show back copper / surface finish color" ) ),
57 RR( _HKI( "Adhesive" ), LAYER_3D_ADHESIVE, _HKI( "Show adhesive" ) ),
58 RR( _HKI( "Solder Paste" ), LAYER_3D_SOLDERPASTE, _HKI( "Show solder paste" ) ),
59 RR( wxS( "F.Silkscreen" ), LAYER_3D_SILKSCREEN_TOP, _HKI( "Show front silkscreen" ) ),
60 RR( wxS( "B.Silkscreen" ), LAYER_3D_SILKSCREEN_BOTTOM, _HKI( "Show back silkscreen" ) ),
61 RR( wxS( "F.Mask" ), LAYER_3D_SOLDERMASK_TOP, _HKI( "Show front solder mask" ) ),
62 RR( wxS( "B.Mask" ), LAYER_3D_SOLDERMASK_BOTTOM, _HKI( "Show back solder mask" ) ),
63 RR( wxS( "User.Drawings" ), LAYER_3D_USER_DRAWINGS, _HKI( "Show user drawings layer" ) ),
64 RR( wxS( "User.Comments" ), LAYER_3D_USER_COMMENTS, _HKI( "Show user comments layer" ) ),
65 RR( wxS( "User.Eco1" ), LAYER_3D_USER_ECO1, _HKI( "Show user ECO1 layer" ) ),
66 RR( wxS( "User.Eco2" ), LAYER_3D_USER_ECO2, _HKI( "Show user ECO2 layer" ) ),
67 RR( wxS( "User.1" ), LAYER_3D_USER_1, _HKI( "Show user defined layer 1" ) ),
68 RR( wxS( "User.2" ), LAYER_3D_USER_2, _HKI( "Show user defined layer 2" ) ),
69 RR( wxS( "User.3" ), LAYER_3D_USER_3, _HKI( "Show user defined layer 3" ) ),
70 RR( wxS( "User.4" ), LAYER_3D_USER_4, _HKI( "Show user defined layer 4" ) ),
71 RR( wxS( "User.5" ), LAYER_3D_USER_5, _HKI( "Show user defined layer 5" ) ),
72 RR( wxS( "User.6" ), LAYER_3D_USER_6, _HKI( "Show user defined layer 6" ) ),
73 RR( wxS( "User.7" ), LAYER_3D_USER_7, _HKI( "Show user defined layer 7" ) ),
74 RR( wxS( "User.8" ), LAYER_3D_USER_8, _HKI( "Show user defined layer 8" ) ),
75 RR( wxS( "User.9" ), LAYER_3D_USER_9, _HKI( "Show user defined layer 9" ) ),
76 RR( wxS( "User.10" ), LAYER_3D_USER_10, _HKI( "Show user defined layer 10" ) ),
77 RR( wxS( "User.11" ), LAYER_3D_USER_11, _HKI( "Show user defined layer 11" ) ),
78 RR( wxS( "User.12" ), LAYER_3D_USER_12, _HKI( "Show user defined layer 12" ) ),
79 RR( wxS( "User.13" ), LAYER_3D_USER_13, _HKI( "Show user defined layer 13" ) ),
80 RR( wxS( "User.14" ), LAYER_3D_USER_14, _HKI( "Show user defined layer 14" ) ),
81 RR( wxS( "User.15" ), LAYER_3D_USER_15, _HKI( "Show user defined layer 15" ) ),
82 RR( wxS( "User.16" ), LAYER_3D_USER_16, _HKI( "Show user defined layer 16" ) ),
83 RR( wxS( "User.17" ), LAYER_3D_USER_17, _HKI( "Show user defined layer 17" ) ),
84 RR( wxS( "User.18" ), LAYER_3D_USER_18, _HKI( "Show user defined layer 18" ) ),
85 RR( wxS( "User.19" ), LAYER_3D_USER_19, _HKI( "Show user defined layer 19" ) ),
86 RR( wxS( "User.20" ), LAYER_3D_USER_20, _HKI( "Show user defined layer 20" ) ),
87 RR( wxS( "User.21" ), LAYER_3D_USER_21, _HKI( "Show user defined layer 21" ) ),
88 RR( wxS( "User.22" ), LAYER_3D_USER_22, _HKI( "Show user defined layer 22" ) ),
89 RR( wxS( "User.23" ), LAYER_3D_USER_23, _HKI( "Show user defined layer 23" ) ),
90 RR( wxS( "User.24" ), LAYER_3D_USER_24, _HKI( "Show user defined layer 24" ) ),
91 RR( wxS( "User.25" ), LAYER_3D_USER_25, _HKI( "Show user defined layer 25" ) ),
92 RR( wxS( "User.26" ), LAYER_3D_USER_26, _HKI( "Show user defined layer 26" ) ),
93 RR( wxS( "User.27" ), LAYER_3D_USER_27, _HKI( "Show user defined layer 27" ) ),
94 RR( wxS( "User.28" ), LAYER_3D_USER_28, _HKI( "Show user defined layer 28" ) ),
95 RR( wxS( "User.29" ), LAYER_3D_USER_29, _HKI( "Show user defined layer 29" ) ),
96 RR( wxS( "User.30" ), LAYER_3D_USER_30, _HKI( "Show user defined layer 30" ) ),
97 RR( wxS( "User.31" ), LAYER_3D_USER_31, _HKI( "Show user defined layer 31" ) ),
98 RR( wxS( "User.32" ), LAYER_3D_USER_32, _HKI( "Show user defined layer 32" ) ),
99 RR( wxS( "User.33" ), LAYER_3D_USER_33, _HKI( "Show user defined layer 33" ) ),
100 RR( wxS( "User.34" ), LAYER_3D_USER_34, _HKI( "Show user defined layer 34" ) ),
101 RR( wxS( "User.35" ), LAYER_3D_USER_35, _HKI( "Show user defined layer 35" ) ),
102 RR( wxS( "User.36" ), LAYER_3D_USER_36, _HKI( "Show user defined layer 36" ) ),
103 RR( wxS( "User.37" ), LAYER_3D_USER_37, _HKI( "Show user defined layer 37" ) ),
104 RR( wxS( "User.38" ), LAYER_3D_USER_38, _HKI( "Show user defined layer 38" ) ),
105 RR( wxS( "User.39" ), LAYER_3D_USER_39, _HKI( "Show user defined layer 39" ) ),
106 RR( wxS( "User.40" ), LAYER_3D_USER_40, _HKI( "Show user defined layer 40" ) ),
107 RR( wxS( "User.41" ), LAYER_3D_USER_41, _HKI( "Show user defined layer 41" ) ),
108 RR( wxS( "User.42" ), LAYER_3D_USER_42, _HKI( "Show user defined layer 42" ) ),
109 RR( wxS( "User.43" ), LAYER_3D_USER_43, _HKI( "Show user defined layer 43" ) ),
110 RR( wxS( "User.44" ), LAYER_3D_USER_44, _HKI( "Show user defined layer 44" ) ),
111 RR( wxS( "User.45" ), LAYER_3D_USER_45, _HKI( "Show user defined layer 45" ) ),
112 RR(),
113 RR( _HKI( "Through-hole Models" ), LAYER_3D_TH_MODELS, EDA_3D_ACTIONS::showTHT ),
117 RR( _HKI( "Models marked DNP" ), LAYER_3D_MODELS_MARKED_DNP, EDA_3D_ACTIONS::showDNP ),
118 RR( _HKI( "Model Bounding Boxes" ), LAYER_3D_BOUNDING_BOXES, EDA_3D_ACTIONS::showBBoxes ),
119 RR(),
120 RR( _HKI( "Values" ), LAYER_FP_VALUES, _HKI( "Show footprint values" ) ),
121 RR( _HKI( "References" ), LAYER_FP_REFERENCES, _HKI( "Show footprint references" ) ),
122 RR( _HKI( "Footprint Text" ), LAYER_FP_TEXT, _HKI( "Show all footprint text" ) ),
123 RR( _HKI( "Off-board Silkscreen" ), LAYER_3D_OFF_BOARD_SILK, _HKI( "Do not clip silk layers to board outline" ) ),
124 RR(),
126 RR( _HKI( "Background Start" ), LAYER_3D_BACKGROUND_TOP, _HKI( "Background gradient start color" ) ),
127 RR( _HKI( "Background End" ), LAYER_3D_BACKGROUND_BOTTOM, _HKI( "Background gradient end color" ) ),
128};
129
130// The list of IDs that can have colors coming from the board stackup, and cannot be
131// modified if use colors from stackup is activated
132static std::vector<int> inStackupColors{ LAYER_3D_BOARD,
137 };
138
141 m_frame( aParent ),
142 m_focusOwner( aFocusOwner ),
143 m_lastSelectedViewport( nullptr )
144{
145 DPI_SCALING_COMMON dpi( nullptr, m_frame );
146
147 int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
148 m_pointSize = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ).GetPointSize();
149
150 m_layerPanelColour = m_panelLayers->GetBackgroundColour().ChangeLightness( 110 );
151 SetBorders( true, false, false, false );
152
153 m_layersOuterSizer = new wxBoxSizer( wxVERTICAL );
155 m_windowLayers->SetScrollRate( 0, 5 );
156 m_windowLayers->Bind( wxEVT_SET_FOCUS, &APPEARANCE_CONTROLS_3D::OnSetFocus, this );
157
158 m_envOuterSizer = new wxBoxSizer( wxVERTICAL );
159
160 wxFont infoFont = KIUI::GetInfoFont( this );
161 m_panelLayers->SetFont( infoFont );
162 m_windowLayers->SetFont( infoFont );
163 m_presetsLabel->SetFont( infoFont );
164 m_viewportsLabel->SetFont( infoFont );
165
166 // Create display options
167 m_cbUseBoardStackupColors = new wxCheckBox( m_panelLayers, wxID_ANY,
168 _( "Use board stackup colors" ) );
169 m_cbUseBoardStackupColors->SetFont( infoFont );
170
171 m_cbUseBoardStackupColors->Bind( wxEVT_CHECKBOX,
172 [this]( wxCommandEvent& aEvent )
173 {
175 cfg->m_UseStackupColors = aEvent.IsChecked();
176
178 m_frame->NewDisplay( true );
179 } );
180
181 m_cbUseBoardEditorCopperColors = new wxCheckBox( m_panelLayers, wxID_ANY,
182 _( "Use PCB editor copper colors" ) );
183 m_cbUseBoardEditorCopperColors->SetFont( infoFont );
184 m_cbUseBoardEditorCopperColors->SetToolTip( _( "Use the board editor layer colors for copper "
185 "layers (realtime renderer only)" ) );
186
187 m_cbUseBoardEditorCopperColors->Bind( wxEVT_CHECKBOX,
188 [this]( wxCommandEvent& aEvent )
189 {
191 cfg->m_Render.use_board_editor_copper_colors = aEvent.IsChecked();
192
194 m_frame->NewDisplay( true );
195 } );
196
197 m_panelLayersSizer->Add( m_cbUseBoardStackupColors, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5 );
199 wxEXPAND | wxALL, 5 );
200
201 m_cbLayerPresets->SetToolTip( wxString::Format( _( "Save and restore color and visibility combinations.\n"
202 "Use %s+Tab to activate selector.\n"
203 "Successive Tabs while holding %s down will cycle through "
204 "presets in the popup." ),
207
208 m_cbViewports->SetToolTip( wxString::Format( _( "Save and restore camera position and zoom.\n"
209 "Use %s+Tab to activate selector.\n"
210 "Successive Tabs while holding %s down will cycle through "
211 "viewports in the popup." ),
214
215 if( screenHeight <= 900 && m_pointSize >= FromDIP( KIUI::c_IndicatorSizeDIP ) )
216 m_pointSize = m_pointSize * 8 / 10;
217
219
221 KiBitmapBundle( BITMAPS::visibility ), KiBitmapBundle( BITMAPS::visibility_off ) );
222
223 m_frame->Bind( EDA_LANG_CHANGED, &APPEARANCE_CONTROLS_3D::OnLanguageChanged, this );
224}
225
226
228{
229 m_frame->Unbind( EDA_LANG_CHANGED, &APPEARANCE_CONTROLS_3D::OnLanguageChanged, this );
230}
231
232
234{
235 DPI_SCALING_COMMON dpi( nullptr, m_frame );
236 wxSize size( 220 * dpi.GetScaleFactor(), 480 * dpi.GetScaleFactor() );
237 return size;
238}
239
240
241void APPEARANCE_CONTROLS_3D::OnSetFocus( wxFocusEvent& aEvent )
242{
243#ifdef __WXMSW__
244 // In wxMSW, buttons won't process events unless they have focus, so we'll let it take the
245 // focus and give it back to the parent in the button event handler.
246 if( wxBitmapButton* btn = dynamic_cast<wxBitmapButton*>( aEvent.GetEventObject() ) )
247 {
248 wxCommandEvent evt( wxEVT_BUTTON );
249 wxPostEvent( btn, evt );
250 }
251#endif
252
253 passOnFocus();
254 aEvent.Skip();
255}
256
257
258void APPEARANCE_CONTROLS_3D::OnSize( wxSizeEvent& aEvent )
259{
260 aEvent.Skip();
261}
262
263
265{
266 Freeze();
267
269 m_cbUseBoardStackupColors->SetLabel( _( "Use board stackup colors" ) );
272
273 Thaw();
274 Refresh();
275}
276
277
278void APPEARANCE_CONTROLS_3D::OnLanguageChanged( wxCommandEvent& aEvent )
279{
281
282 aEvent.Skip();
283}
284
285
287{
288 // This is essentially a list of hacks because DarkMode isn't yet implemented inside
289 // wxWidgets.
290 //
291 // The individual wxPanels, COLOR_SWATCHes and GRID_CELL_COLOR_RENDERERs should really be
292 // overriding some virtual method or responding to some wxWidgets event so that the parent
293 // doesn't have to know what it contains. But, that's not where we are, so... :shrug:
294
295 m_layerPanelColour = m_panelLayers->GetBackgroundColour().ChangeLightness( 110 );
296
297 m_windowLayers->SetBackgroundColour( m_layerPanelColour );
298
299 for( wxSizerItem* child : m_layersOuterSizer->GetChildren() )
300 {
301 if( child && child->GetWindow() )
302 child->GetWindow()->SetBackgroundColour( m_layerPanelColour );
303 }
304}
305
306
308{
310
312
313 const wxString& currentPreset = m_frame->GetAdapter().m_Cfg->m_CurrentPreset;
314
315 if( currentPreset == FOLLOW_PCB || currentPreset == FOLLOW_PLOT_SETTINGS )
316 updateLayerPresetWidget( currentPreset );
317 else
319}
320
321
322void APPEARANCE_CONTROLS_3D::ApplyLayerPreset( const wxString& aPresetName )
323{
324 doApplyLayerPreset( aPresetName );
325
326 // Move to front of MRU list
327 if( m_presetMRU.Index( aPresetName ) != wxNOT_FOUND )
328 m_presetMRU.Remove( aPresetName );
329
330 m_presetMRU.Insert( aPresetName, 0 );
331
332 updateLayerPresetWidget( aPresetName );
333}
334
335
336std::vector<VIEWPORT3D> APPEARANCE_CONTROLS_3D::GetUserViewports() const
337{
338 std::vector<VIEWPORT3D> ret;
339
340 for( const auto& [name, viewport] : m_viewports )
341 ret.emplace_back( viewport );
342
343 return ret;
344}
345
346
347void APPEARANCE_CONTROLS_3D::SetUserViewports( std::vector<VIEWPORT3D>& aViewportList )
348{
349 m_viewports.clear();
350
351 for( const VIEWPORT3D& viewport : aViewportList )
352 {
353 if( m_viewports.count( viewport.name ) )
354 continue;
355
356 m_viewports[viewport.name] = viewport;
357
358 m_viewportMRU.Add( viewport.name );
359 }
360
362
363 // Now is as good a time as any to initialize the layer presets as well.
365
366 m_presetMRU.Add( FOLLOW_PCB );
368
369 for( const LAYER_PRESET_3D& preset : m_frame->GetAdapter().m_Cfg->m_LayerPresets )
370 m_presetMRU.Add( preset.name );
371}
372
373
374void APPEARANCE_CONTROLS_3D::ApplyViewport( const wxString& aViewportName )
375{
376 int idx = m_cbViewports->FindString( aViewportName );
377
378 if( idx >= 0 && idx < (int)m_cbViewports->GetCount() - 3 /* separator */ )
379 {
380 m_cbViewports->SetSelection( idx );
381 m_lastSelectedViewport = static_cast<VIEWPORT3D*>( m_cbViewports->GetClientData( idx ) );
382 }
383 else
384 {
385 m_cbViewports->SetSelection( m_cbViewports->GetCount() - 3 ); // separator
386 m_lastSelectedViewport = nullptr;
387 }
388
391}
392
393
394void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisible )
395{
396 std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
397 const std::map<int, COLOR4D>& colors = m_frame->GetAdapter().GetLayerColors();
398 bool killFollow = false;
399 bool doFastRefresh = false; // true to just refresh the display
400
401 // Special-case controls
402 switch( aLayer )
403 {
404 case LAYER_FP_TEXT:
405 // Because Footprint Text is a meta-control that also can disable values/references,
406 // drag them along here so that the user is less likely to be confused.
407 if( !isVisible )
408 {
409 visibleLayers.set( LAYER_FP_REFERENCES, false );
410 visibleLayers.set( LAYER_FP_VALUES, false );
411 }
412
413 visibleLayers.set( LAYER_FP_TEXT, isVisible );
414 killFollow = true;
415 break;
416
418 case LAYER_FP_VALUES:
419 // In case that user changes Footprint Value/References when the Footprint Text
420 // meta-control is disabled, we should put it back on.
421 if( isVisible )
422 visibleLayers.set( LAYER_FP_TEXT, true );
423
424 visibleLayers.set( aLayer, isVisible );
425 killFollow = true;
426 break;
427
428 case LAYER_3D_BOARD:
441 visibleLayers.set( aLayer, isVisible );
442 killFollow = true;
443 break;
444
450 doFastRefresh = true;
451 visibleLayers.set( aLayer, isVisible );
452 break;
453
454 default:
455 visibleLayers.set( aLayer, isVisible );
456
457 if( aLayer >= LAYER_3D_USER_1 && aLayer <= LAYER_3D_USER_45 )
458 killFollow = true;
459
460 break;
461 }
462
463 m_frame->GetAdapter().SetVisibleLayers( visibleLayers );
464 m_frame->GetAdapter().SetLayerColors( colors );
465
466 const wxString& currentPreset = m_frame->GetAdapter().m_Cfg->m_CurrentPreset;
467
468 if( ( currentPreset != FOLLOW_PCB && currentPreset != FOLLOW_PLOT_SETTINGS ) || killFollow )
470
472
473 if( doFastRefresh && m_frame->GetAdapter().m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL )
474 {
475 RENDER_3D_OPENGL* renderer = static_cast<RENDER_3D_OPENGL*>( m_frame->GetCanvas()->GetCurrentRender() );
476 renderer->Load3dModelsIfNeeded();
478 }
479 else
480 {
481 m_frame->NewDisplay( true );
482 }
483}
484
485
487{
488 std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
489 std::map<int, COLOR4D> colors = m_frame->GetAdapter().GetLayerColors();
490
491 m_frame->GetAdapter().SetVisibleLayers( visibleLayers );
492
493 int layer = aSwatch->GetId();
494 COLOR4D newColor = aSwatch->GetSwatchColor();
495
496 colors[ layer ] = newColor;
497
498 // The internals of the 3D viewer only supports a single color for copper, which must
499 // be applied to all copper layers.
500 COLOR_SWATCH* otherSwatch = nullptr;
501
502 if( layer == LAYER_3D_COPPER_TOP )
503 {
504 colors[ LAYER_3D_COPPER_BOTTOM ] = newColor;
505 otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_BOTTOM]->m_Ctl_color;
506 }
507 else if( layer == LAYER_3D_COPPER_BOTTOM )
508 {
509 colors[ LAYER_3D_COPPER_TOP ] = newColor;
510 otherSwatch = m_layerSettingsMap[LAYER_3D_COPPER_TOP]->m_Ctl_color;
511 }
512
513 if( otherSwatch )
514 {
515 // Don't send an event, because that will cause an event loop
516 otherSwatch->SetSwatchColor( newColor, false );
517 }
518
519
520 m_frame->GetAdapter().SetLayerColors( colors );
521
522 const wxString& currentPreset = m_frame->GetAdapter().m_Cfg->m_CurrentPreset;
523
524 if( currentPreset == FOLLOW_PCB || currentPreset == FOLLOW_PLOT_SETTINGS )
525 updateLayerPresetWidget( currentPreset );
526 else
528
529 m_frame->NewDisplay( true );
530}
531
532
534{
535 int swatchWidth = m_windowLayers->ConvertDialogToPixels( wxSize( 8, 0 ) ).x;
536
537 std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
538 std::map<int, COLOR4D> colors = m_frame->GetAdapter().GetLayerColors();
539 std::map<int, COLOR4D> defaultColors = m_frame->GetAdapter().GetDefaultColors();
540 LSET enabled = m_frame->GetBoard()->GetEnabledLayers();
541
542 m_layerSettings.clear();
543 m_layersOuterSizer->Clear( true );
544 m_layersOuterSizer->AddSpacer( 5 );
545
546 m_envOuterSizer->Clear( true );
547
548 auto appendLayer =
549 [&]( const std::unique_ptr<APPEARANCE_SETTING_3D>& aSetting )
550 {
551 wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL );
552 int layer = aSetting->m_Id;
553
554 aSetting->m_Visible = visibleLayers.test( layer );
555
556 if( colors.count( layer ) )
557 {
558 COLOR_SWATCH* swatch = new COLOR_SWATCH( m_windowLayers, colors[ layer ], layer,
559 COLOR4D::WHITE, defaultColors[ layer ],
560 SWATCH_SMALL );
561 swatch->SetToolTip( _( "Left double click or middle click to change color" ) );
562
563 swatch->SetReadOnlyCallback(
564 [this]()
565 {
566 WX_INFOBAR* infobar = m_frame->GetInfoBar();
567
568 infobar->RemoveAllButtons();
569 infobar->AddCloseButton();
570
571 infobar->ShowMessageFor( _( "Uncheck 'Use board stackup colors' to "
572 "allow color editing." ),
573 10000, wxICON_INFORMATION );
574 } );
575
576 sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL, 0 );
577 aSetting->m_Ctl_color = swatch;
578
579 swatch->Bind( COLOR_SWATCH_CHANGED,
580 [this]( wxCommandEvent& event )
581 {
582 auto swatch = static_cast<COLOR_SWATCH*>( event.GetEventObject() );
583 onColorSwatchChanged( swatch );
584
585 passOnFocus();
586 } );
587 }
588 else
589 {
590 sizer->AddSpacer( swatchWidth );
591 }
592
593 sizer->AddSpacer( 5 );
594
595 wxString layerName = aSetting->GetLabel();
596 PCB_LAYER_ID boardLayer = Map3DLayerToPCBLayer( layer );
597
598 if( boardLayer != UNDEFINED_LAYER )
599 layerName = m_frame->GetBoard()->GetLayerName( boardLayer );
600
601 wxStaticText* label = new wxStaticText( m_windowLayers, layer, layerName );
602 label->Wrap( -1 );
603 label->SetToolTip( aSetting->GetTooltip() );
604
605 if( layer == LAYER_3D_BACKGROUND_TOP || layer == LAYER_3D_BACKGROUND_BOTTOM )
606 {
607 sizer->AddSpacer( swatchWidth );
608 }
609 else
610 {
611 BITMAP_TOGGLE* btn_visible = new BITMAP_TOGGLE( m_windowLayers, layer,
612 KiBitmapBundle( BITMAPS::visibility ),
613 KiBitmapBundle( BITMAPS::visibility_off ),
614 aSetting->m_Visible );
615
616 btn_visible->Bind( TOGGLE_CHANGED,
617 [this]( wxCommandEvent& aEvent )
618 {
619 int id = static_cast<wxWindow*>( aEvent.GetEventObject() )->GetId();
620 bool isVisible = aEvent.GetInt();
621 OnLayerVisibilityChanged( id, isVisible );
622
623 passOnFocus();
624 } );
625
626 wxString tip;
627 tip.Printf( _( "Show or hide %s" ), aSetting->GetLabel().Lower() );
628 btn_visible->SetToolTip( tip );
629
630 aSetting->m_Ctl_visibility = btn_visible;
631 sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL, 0 );
632 }
633
634 sizer->AddSpacer( 5 );
635 sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL, 0 );
636
637 m_layersOuterSizer->Add( sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, 5 );
638 m_layersOuterSizer->AddSpacer( 2 );
639 };
640
641 for( const APPEARANCE_SETTING_3D& s_setting : s_layerSettings )
642 {
643 m_layerSettings.emplace_back( std::make_unique<APPEARANCE_SETTING_3D>( s_setting ) );
644 std::unique_ptr<APPEARANCE_SETTING_3D>& setting = m_layerSettings.back();
645
646 if( setting->m_Spacer )
647 {
648 m_layersOuterSizer->AddSpacer( m_pointSize );
649 }
650 else if( setting->m_Id >= LAYER_3D_USER_1 && setting->m_Id <= LAYER_3D_USER_45 )
651 {
652 if( enabled.test( Map3DLayerToPCBLayer( setting->m_Id ) ) )
653 appendLayer( setting );
654 }
655 else
656 {
657 appendLayer( setting );
658 }
659
660 m_layerSettingsMap[setting->m_Id] = setting.get();
661 }
662
663 m_sizerOuter->Layout();
664}
665
666
668{
670 std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
671 std::map<int, COLOR4D> colors = m_frame->GetAdapter().GetLayerColors();
672
673 for( std::unique_ptr<APPEARANCE_SETTING_3D>& setting : m_layerSettings )
674 {
675 if( setting->m_Spacer )
676 continue;
677
678 if( setting->m_Ctl_visibility )
679 setting->m_Ctl_visibility->SetValue( visibleLayers.test( setting->m_Id ) );
680
681 if( setting->m_Ctl_color )
682 {
683 setting->m_Ctl_color->SetSwatchColor( colors[ setting->m_Id ], false );
684
685 // if cfg->m_UseStackupColors is set, board colors cannot be modified locally, but
686 // other colors can be
687 if( alg::contains( inStackupColors, setting->m_Id ) && cfg )
688 setting->m_Ctl_color->SetReadOnly( cfg->m_UseStackupColors );
689 }
690 }
691
692 if( cfg )
693 {
696 }
697}
698
699
701{
702 m_presetsLabel->SetLabel( wxString::Format( _( "Presets (%s+Tab):" ),
704
705 m_cbLayerPresets->Clear();
706
707 // Build the layers preset list.
708
709 m_cbLayerPresets->Append( _( "Follow PCB Editor" ) );
710 m_cbLayerPresets->Append( _( "Follow PCB Plot Settings" ) );
711
712 for( const LAYER_PRESET_3D& preset : m_frame->GetAdapter().m_Cfg->m_LayerPresets )
713 m_cbLayerPresets->Append( preset.name );
714
715 m_cbLayerPresets->Append( wxT( "---" ) );
716 m_cbLayerPresets->Append( _( "Save preset..." ) );
717 m_cbLayerPresets->Append( _( "Delete preset..." ) );
718
720}
721
722
724{
725 m_frame->GetAdapter().m_Cfg->m_CurrentPreset = wxEmptyString;
726
727 std::vector<LAYER_PRESET_3D>& presets = m_frame->GetAdapter().m_Cfg->m_LayerPresets;
728 std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
729 std::map<int, COLOR4D> colors = m_frame->GetAdapter().GetLayerColors();
730
731 auto it = std::find_if(
732 presets.begin(), presets.end(),
733 [&]( const LAYER_PRESET_3D& aPreset )
734 {
735 if( aPreset.name.Lower() == _( "legacy colors" ) && m_cbUseBoardStackupColors->GetValue() )
736 return false;
737
738 for( int layer = LAYER_3D_BOARD; layer < LAYER_3D_END; ++layer )
739 {
740 if( aPreset.layers.test( layer ) != visibleLayers.test( layer ) )
741 return false;
742 }
743
744 for( int layer : { LAYER_FP_REFERENCES, LAYER_FP_VALUES, LAYER_FP_TEXT } )
745 {
746 if( aPreset.layers.test( layer ) != visibleLayers.test( layer ) )
747 return false;
748 }
749
750 for( int layer = LAYER_3D_START + 1; layer < LAYER_3D_END; ++layer )
751 {
752 auto it1 = aPreset.colors.find( layer );
753 auto it2 = colors.find( layer );
754
755 if( it1 != aPreset.colors.end() && it2 != colors.end() && *it1 != *it2 )
756 return false;
757 }
758
759 return true;
760 } );
761
762 if( it != presets.end() )
763 {
764 m_frame->GetAdapter().m_Cfg->m_CurrentPreset = it->name;
765 m_cbLayerPresets->SetStringSelection( it->name );
766 }
767 else
768 {
769 m_cbLayerPresets->SetSelection( m_cbLayerPresets->GetCount() - 3 ); // separator
770 }
771}
772
773
775{
776 if( aName == FOLLOW_PCB )
777 m_cbLayerPresets->SetSelection( 0 );
778 else if( aName == FOLLOW_PLOT_SETTINGS )
779 m_cbLayerPresets->SetSelection( 1 );
780 else if( !m_cbLayerPresets->SetStringSelection( aName ) )
781 m_cbLayerPresets->SetSelection( m_cbLayerPresets->GetCount() - 3 ); // separator
782}
783
784
786{
788 int count = m_cbLayerPresets->GetCount();
789 int index = m_cbLayerPresets->GetSelection();
790 wxString name;
791
792 auto resetSelection =
793 [&]()
794 {
796 };
797
798 if( index == 0 )
799 {
801 }
802 else if( index == 1 )
803 {
805 }
806 else if( index == count - 3 )
807 {
808 // Separator: reject the selection
809 resetSelection();
810 return;
811 }
812 else if( index == count - 2 )
813 {
814 wxTextEntryDialog dlg( wxGetTopLevelParent( this ), _( "Layer preset name:" ),
815 _( "Save Layer Preset" ) );
816
817 if( dlg.ShowModal() != wxID_OK )
818 {
819 resetSelection();
820 return;
821 }
822
823 std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
824 std::map<int, COLOR4D> colors = m_frame->GetAdapter().GetLayerColors();
825
826 name = dlg.GetValue();
827
828 if( LAYER_PRESET_3D* preset = cfg->FindPreset( name ) )
829 {
830 if( !IsOK( wxGetTopLevelParent( this ), _( "Overwrite existing preset?" ) ) )
831 {
832 resetSelection();
833 return;
834 }
835
836 preset->layers = visibleLayers;
837 preset->colors = colors;
838 m_cbLayerPresets->SetSelection( m_cbLayerPresets->FindString( name ) );
839 }
840 else
841 {
842 cfg->m_LayerPresets.emplace_back( name, visibleLayers, colors );
843 m_cbLayerPresets->SetSelection( m_cbLayerPresets->Insert( name, index - 1 ) );
844 }
845
846 cfg->m_CurrentPreset = name;
847 m_presetMRU.Insert( name, 0 );
848
849 return;
850 }
851 else if( index == count - 1 )
852 {
853 wxArrayString headers;
854 std::vector<wxArrayString> items;
855
856 headers.Add( _( "Presets" ) );
857
858 for( LAYER_PRESET_3D& preset : cfg->m_LayerPresets )
859 {
860 wxArrayString item;
861 item.Add( preset.name );
862 items.emplace_back( item );
863 }
864
865 EDA_LIST_DIALOG dlg( m_frame, _( "Delete Preset" ), headers, items );
866 dlg.SetListLabel( _( "Select preset:" ) );
867
868 if( dlg.ShowModal() == wxID_OK )
869 {
870 name = dlg.GetTextSelection();
871
872 if( m_cbLayerPresets->FindString( name ) != wxNOT_FOUND )
873 m_cbLayerPresets->Delete( m_cbLayerPresets->FindString( name ) );
874
876 [name]( const LAYER_PRESET_3D& preset )
877 {
878 return preset.name == name;
879 } );
880
881 if( cfg->m_CurrentPreset == name )
882 cfg->m_CurrentPreset = wxEmptyString;
883
884 if( m_presetMRU.Index( name ) >= 0 )
885 m_presetMRU.Remove( name );
886 }
887
888 resetSelection();
889 return;
890 }
891 else
892 {
893 doApplyLayerPreset( m_cbLayerPresets->GetStringSelection() );
894 }
895
896 // Move to front of MRU list
897 if( m_presetMRU.Index( name ) != wxNOT_FOUND )
898 m_presetMRU.Remove( name );
899
900 m_presetMRU.Insert( name, 0 );
901
902 passOnFocus();
903}
904
905
906void APPEARANCE_CONTROLS_3D::doApplyLayerPreset( const wxString& aPresetName )
907{
908 BOARD_ADAPTER& adapter = m_frame->GetAdapter();
909
910 if( aPresetName == FOLLOW_PCB || aPresetName == FOLLOW_PLOT_SETTINGS )
911 {
912 adapter.m_Cfg->m_CurrentPreset = aPresetName;
913 adapter.SetVisibleLayers( adapter.GetVisibleLayers() );
914 }
915 else if( LAYER_PRESET_3D* preset = adapter.m_Cfg->FindPreset( aPresetName ) )
916 {
917 adapter.m_Cfg->m_CurrentPreset = aPresetName;
918 adapter.SetVisibleLayers( preset->layers );
919 adapter.SetLayerColors( preset->colors );
920
921 if( preset->name.Lower() == _( "legacy colors" ) )
922 adapter.m_Cfg->m_UseStackupColors = false;
923 }
924 else
925 {
926 return;
927 }
928
930 m_frame->NewDisplay( true );
931}
932
933
935{
936 m_viewportsLabel->SetLabel( wxString::Format( _( "Viewports (%s+Tab):" ),
938
939 m_cbViewports->Clear();
940
941 for( std::pair<const wxString, VIEWPORT3D>& pair : m_viewports )
942 m_cbViewports->Append( pair.first, static_cast<void*>( &pair.second ) );
943
944 m_cbViewports->Append( wxT( "---" ) );
945 m_cbViewports->Append( _( "Save viewport..." ) );
946 m_cbViewports->Append( _( "Delete viewport..." ) );
947
948 m_cbViewports->SetSelection( m_cbViewports->GetCount() - 3 );
949 m_lastSelectedViewport = nullptr;
950}
951
952
953void APPEARANCE_CONTROLS_3D::onViewportChanged( wxCommandEvent& aEvent )
954{
955 int count = m_cbViewports->GetCount();
956 int index = m_cbViewports->GetSelection();
957
958 if( index >= 0 && index < count - 3 )
959 {
960 VIEWPORT3D* viewport = static_cast<VIEWPORT3D*>( m_cbViewports->GetClientData( index ) );
961
962 wxCHECK( viewport, /* void */ );
963
964 doApplyViewport( *viewport );
965
966 if( !viewport->name.IsEmpty() )
967 {
968 m_viewportMRU.Remove( viewport->name );
969 m_viewportMRU.Insert( viewport->name, 0 );
970 }
971 }
972 else if( index == count - 2 )
973 {
974 // Save current state to new preset
975 wxString name;
976
977 wxTextEntryDialog dlg( wxGetTopLevelParent( this ), _( "Viewport name:" ),
978 _( "Save Viewport" ), name );
979
980 if( dlg.ShowModal() != wxID_OK )
981 {
983 m_cbViewports->SetStringSelection( m_lastSelectedViewport->name );
984 else
985 m_cbViewports->SetSelection( m_cbViewports->GetCount() - 3 );
986
987 return;
988 }
989
990 name = dlg.GetValue();
991 bool exists = m_viewports.count( name );
992
993 if( !exists )
994 {
996
997 index = m_cbViewports->Insert( name, index-1, static_cast<void*>( &m_viewports[name] ) );
998 }
999 else
1000 {
1002 index = m_cbViewports->FindString( name );
1003 m_viewportMRU.Remove( name );
1004 }
1005
1006 m_cbViewports->SetSelection( index );
1007 m_viewportMRU.Insert( name, 0 );
1008
1009 return;
1010 }
1011 else if( index == count - 1 )
1012 {
1013 // Delete an existing viewport
1014 wxArrayString headers;
1015 std::vector<wxArrayString> items;
1016
1017 headers.Add( _( "Viewports" ) );
1018
1019 for( std::pair<const wxString, VIEWPORT3D>& pair : m_viewports )
1020 {
1021 wxArrayString item;
1022 item.Add( pair.first );
1023 items.emplace_back( item );
1024 }
1025
1026 EDA_LIST_DIALOG dlg( m_frame, _( "Delete Viewport" ), headers, items );
1027 dlg.SetListLabel( _( "Select viewport:" ) );
1028
1029 if( dlg.ShowModal() == wxID_OK )
1030 {
1031 wxString viewportName = dlg.GetTextSelection();
1032 int idx = m_cbViewports->FindString( viewportName );
1033
1034 if( idx != wxNOT_FOUND )
1035 {
1036 m_viewports.erase( viewportName );
1037 m_cbViewports->Delete( idx );
1038 m_viewportMRU.Remove( viewportName );
1039 }
1040 }
1041
1043 m_cbViewports->SetStringSelection( m_lastSelectedViewport->name );
1044 else
1045 m_cbViewports->SetSelection( m_cbViewports->GetCount() - 3 );
1046
1047 return;
1048 }
1049
1050 passOnFocus();
1051}
1052
1053
1054void APPEARANCE_CONTROLS_3D::onUpdateViewportsCb( wxUpdateUIEvent& aEvent )
1055{
1056 int count = m_cbViewports->GetCount();
1057 int index = m_cbViewports->GetSelection();
1058
1059 if( index >= 0 && index < count - 3 )
1060 {
1061 VIEWPORT3D* viewport = static_cast<VIEWPORT3D*>( m_cbViewports->GetClientData( index ) );
1062
1063 wxCHECK( viewport, /* void */ );
1064
1065 if( m_frame->GetCurrentCamera().GetViewMatrix() != viewport->matrix )
1066 m_cbViewports->SetSelection( -1 );
1067 }
1068}
1069
1070
1072{
1074
1075 if( m_frame->GetAdapter().m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL )
1077 else
1079}
1080
1081
1083{
1084 m_focusOwner->SetFocus();
1085}
1086
1087
const char * name
Definition: DXF_plotter.cpp:62
static std::vector< int > inStackupColors
#define RR
Render Row abbreviation to reduce source width.
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition: bitmap.cpp:110
Container for an appearance setting (can control a layer class, object type, etc.)
Class APPEARANCE_CONTROLS_3D_BASE.
void OnLanguageChanged(wxCommandEvent &aEvent)
GRID_BITMAP_TOGGLE_RENDERER * m_toggleGridRenderer
void onLayerPresetChanged(wxCommandEvent &aEvent) override
void updateLayerPresetWidget(const wxString &aName)
std::vector< VIEWPORT3D > GetUserViewports() const
Return a list of viewports created by the user.
void ApplyViewport(const wxString &aPresetName)
void onColorSwatchChanged(COLOR_SWATCH *aSwatch)
APPEARANCE_CONTROLS_3D(EDA_3D_VIEWER_FRAME *aParent, wxWindow *aFocusOwner)
std::vector< std::unique_ptr< APPEARANCE_SETTING_3D > > m_layerSettings
std::map< int, APPEARANCE_SETTING_3D * > m_layerSettingsMap
static const APPEARANCE_SETTING_3D s_layerSettings[]
Template for object appearance settings.
void doApplyLayerPreset(const wxString &aPresetName)
EDA_3D_VIEWER_FRAME * m_frame
void onUpdateViewportsCb(wxUpdateUIEvent &aEvent) override
void OnSetFocus(wxFocusEvent &aEvent) override
void OnLayerVisibilityChanged(int aLayer, bool isVisible)
void OnSize(wxSizeEvent &aEvent) override
void doApplyViewport(const VIEWPORT3D &aViewport)
std::map< wxString, VIEWPORT3D > m_viewports
wxCheckBox * m_cbUseBoardEditorCopperColors
void ApplyLayerPreset(const wxString &aPresetName)
void onViewportChanged(wxCommandEvent &aEvent) override
void SetUserViewports(std::vector< VIEWPORT3D > &aPresetList)
Update the current viewports from those saved in the project file.
A checkbox control except with custom bitmaps for the checked and unchecked states.
Definition: bitmap_toggle.h:45
Helper class to handle information needed to display 3D board.
Definition: board_adapter.h:73
void SetVisibleLayers(const std::bitset< LAYER_3D_END > &aLayers)
std::map< int, COLOR4D > GetLayerColors() const
Build a color list which is used to store colors layers.
std::bitset< LAYER_3D_END > GetVisibleLayers() const
void SetLayerColors(const std::map< int, COLOR4D > &aColors)
EDA_3D_VIEWER_SETTINGS * m_Cfg
std::map< int, COLOR4D > GetDefaultColors() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:679
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:906
const glm::mat4 & GetViewMatrix() const
Definition: camera.cpp:510
void SetViewMatrix(glm::mat4 aViewMatrix)
Set the affine matrix to be applied to a transformation camera.
Definition: camera.cpp:516
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:57
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SetReadOnlyCallback(std::function< void()> aCallback)
Register a handler for when the user tries to interact with a read-only swatch.
Definition: color_swatch.h:126
int ShowModal() override
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
double GetScaleFactor() const override
Get the DPI scale from all known sources in order:
static TOOL_ACTION showNavigator
static TOOL_ACTION showNotInPosFile
static TOOL_ACTION showTHT
static TOOL_ACTION showDNP
static TOOL_ACTION showSMD
static TOOL_ACTION showVirtual
static TOOL_ACTION showBBoxes
RENDER_3D_BASE * GetCurrentRender() const
void RenderRaytracingRequest()
Request to render the current view in Raytracing mode.
void Request_refresh(bool aRedrawImmediately=true)
Schedule a refresh update of the canvas.
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
EDA_3D_CANVAS * GetCanvas()
BOARD_ADAPTER & GetAdapter()
LAYER_PRESET_3D * FindPreset(const wxString &aName)
std::vector< LAYER_PRESET_3D > m_LayerPresets
WX_INFOBAR * GetInfoBar()
A dialog which shows:
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
void SetListLabel(const wxString &aLabel)
A toggle button renderer for a wxGrid, similar to BITMAP_TOGGLE.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:37
Object to render the board using openGL.
void Load3dModelsIfNeeded()
Load footprint models if they are not already loaded, i.e.
A modified version of the wxInfoBar class that allows us to:
Definition: wx_infobar.h:76
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
Definition: wx_infobar.cpp:371
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
Definition: wx_infobar.cpp:142
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
Definition: wx_infobar.cpp:361
void SetBorders(bool aLeft, bool aRight, bool aTop, bool aBottom)
Definition: wx_panel.h:39
@ SWATCH_SMALL
Definition: color_swatch.h:40
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:251
This file is part of the common library.
#define _HKI(x)
#define _(s)
Declaration of the eda_3d_viewer class.
#define FOLLOW_PLOT_SETTINGS
#define FOLLOW_PCB
#define VIEWPORT_SWITCH_KEY
#define PRESET_SWITCH_KEY
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
PCB_LAYER_ID Map3DLayerToPCBLayer(int aLayer)
Definition: layer_id.cpp:266
@ LAYER_3D_USER_1
Definition: layer_ids.h:555
@ LAYER_3D_SOLDERMASK_TOP
Definition: layer_ids.h:548
@ LAYER_3D_USER_8
Definition: layer_ids.h:562
@ LAYER_3D_USER_22
Definition: layer_ids.h:576
@ LAYER_3D_USER_44
Definition: layer_ids.h:598
@ LAYER_3D_USER_23
Definition: layer_ids.h:577
@ LAYER_3D_NAVIGATOR
Definition: layer_ids.h:605
@ LAYER_3D_USER_28
Definition: layer_ids.h:582
@ LAYER_3D_BOUNDING_BOXES
Definition: layer_ids.h:606
@ LAYER_3D_START
Definition: layer_ids.h:538
@ LAYER_3D_USER_32
Definition: layer_ids.h:586
@ LAYER_3D_USER_19
Definition: layer_ids.h:573
@ LAYER_3D_USER_25
Definition: layer_ids.h:579
@ LAYER_3D_ADHESIVE
Definition: layer_ids.h:550
@ LAYER_3D_USER_3
Definition: layer_ids.h:557
@ LAYER_3D_USER_21
Definition: layer_ids.h:575
@ LAYER_3D_USER_26
Definition: layer_ids.h:580
@ LAYER_3D_SMD_MODELS
Definition: layer_ids.h:601
@ LAYER_3D_USER_24
Definition: layer_ids.h:578
@ LAYER_3D_USER_43
Definition: layer_ids.h:597
@ LAYER_3D_BACKGROUND_TOP
Definition: layer_ids.h:541
@ LAYER_3D_USER_COMMENTS
Definition: layer_ids.h:551
@ LAYER_3D_SOLDERMASK_BOTTOM
Definition: layer_ids.h:547
@ LAYER_3D_USER_11
Definition: layer_ids.h:565
@ LAYER_3D_USER_41
Definition: layer_ids.h:595
@ LAYER_3D_USER_17
Definition: layer_ids.h:571
@ LAYER_3D_BOARD
Definition: layer_ids.h:542
@ LAYER_3D_USER_ECO1
Definition: layer_ids.h:553
@ LAYER_3D_USER_20
Definition: layer_ids.h:574
@ LAYER_3D_USER_31
Definition: layer_ids.h:585
@ LAYER_3D_USER_ECO2
Definition: layer_ids.h:554
@ LAYER_3D_TH_MODELS
Definition: layer_ids.h:600
@ LAYER_3D_USER_15
Definition: layer_ids.h:569
@ LAYER_3D_USER_38
Definition: layer_ids.h:592
@ LAYER_3D_USER_13
Definition: layer_ids.h:567
@ LAYER_3D_USER_33
Definition: layer_ids.h:587
@ LAYER_3D_USER_35
Definition: layer_ids.h:589
@ LAYER_3D_USER_29
Definition: layer_ids.h:583
@ LAYER_3D_USER_40
Definition: layer_ids.h:594
@ LAYER_3D_SILKSCREEN_TOP
Definition: layer_ids.h:546
@ LAYER_3D_VIRTUAL_MODELS
Definition: layer_ids.h:602
@ LAYER_3D_MODELS_MARKED_DNP
Definition: layer_ids.h:604
@ LAYER_3D_USER_7
Definition: layer_ids.h:561
@ LAYER_3D_COPPER_TOP
Definition: layer_ids.h:543
@ LAYER_3D_USER_12
Definition: layer_ids.h:566
@ LAYER_3D_SOLDERPASTE
Definition: layer_ids.h:549
@ LAYER_3D_USER_30
Definition: layer_ids.h:584
@ LAYER_3D_USER_36
Definition: layer_ids.h:590
@ LAYER_3D_USER_2
Definition: layer_ids.h:556
@ LAYER_3D_USER_18
Definition: layer_ids.h:572
@ LAYER_3D_OFF_BOARD_SILK
Definition: layer_ids.h:607
@ LAYER_3D_USER_14
Definition: layer_ids.h:568
@ LAYER_3D_USER_5
Definition: layer_ids.h:559
@ LAYER_3D_USER_37
Definition: layer_ids.h:591
@ LAYER_3D_USER_10
Definition: layer_ids.h:564
@ LAYER_3D_MODELS_NOT_IN_POS
Definition: layer_ids.h:603
@ LAYER_3D_USER_42
Definition: layer_ids.h:596
@ LAYER_3D_USER_45
Definition: layer_ids.h:599
@ LAYER_3D_USER_6
Definition: layer_ids.h:560
@ LAYER_3D_USER_4
Definition: layer_ids.h:558
@ LAYER_3D_USER_27
Definition: layer_ids.h:581
@ LAYER_3D_USER_DRAWINGS
Definition: layer_ids.h:552
@ LAYER_3D_COPPER_BOTTOM
Definition: layer_ids.h:544
@ LAYER_3D_USER_39
Definition: layer_ids.h:593
@ LAYER_3D_USER_9
Definition: layer_ids.h:563
@ LAYER_3D_BACKGROUND_BOTTOM
Definition: layer_ids.h:540
@ LAYER_3D_USER_16
Definition: layer_ids.h:570
@ LAYER_3D_SILKSCREEN_BOTTOM
Definition: layer_ids.h:545
@ LAYER_3D_USER_34
Definition: layer_ids.h:588
@ LAYER_3D_END
Definition: layer_ids.h:609
@ LAYER_FP_REFERENCES
Show footprints references (when texts are visible).
Definition: layer_ids.h:265
@ LAYER_FP_TEXT
Definition: layer_ids.h:239
@ LAYER_FP_VALUES
Show footprints values (when texts are visible).
Definition: layer_ids.h:262
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:156
const int c_IndicatorSizeDIP
Definition: ui_common.h:52
void delete_if(_Container &__c, _Function &&__f)
Deletes all values from __c for which __f returns true.
Definition: kicad_algo.h:174
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:100
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
see class PGM_BASE
wxString name
A name for this layer set.