KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_draw_panel_gal.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) 2014-2017 CERN
5 * Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Maciej Suminski <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include "pcb_draw_panel_gal.h"
27#include <pcb_view.h>
29#include <pcb_painter.h>
32
33#include <board.h>
34#include <footprint.h>
35#include <pcb_track.h>
36#include <macros.h>
37#include <pcb_marker.h>
38#include <pcb_generator.h>
39#include <pcb_base_frame.h>
40#include <pcbnew_settings.h>
43
44#include <pgm_base.h>
46#include <confirm.h>
47#include <progress_reporter.h>
48
50#include <zoom_defines.h>
51
52#include <functional>
53#include <memory>
54#include <thread>
55
56using namespace std::placeholders;
57
58
59const int GAL_LAYER_ORDER[] =
60{
71
75
84
94
96
104
113
144
153
158
168
176
207
215
217};
218
219
220PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
221 const wxPoint& aPosition, const wxSize& aSize,
222 KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
223 EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
224{
225 m_view = new KIGFX::PCB_VIEW( true );
226 m_view->SetGAL( m_gal );
227
229
230 if( EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( aParentWindow ) )
231 frameType = frame->GetFrameType();
232
233 m_painter = std::make_unique<KIGFX::PCB_PAINTER>( m_gal, frameType );
234 m_view->SetPainter( m_painter.get() );
235
236 // This fixes the zoom in and zoom out limits:
238
241
242 // View controls is the first in the event handler chain, so the Tool Framework operates
243 // on updated viewport data.
245
246 // Load display options (such as filled/outline display of items).
247 // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
248 // which is not always the case (namely when it is used from a wxDialog like the pad editor)
249 if( !IsDialogPreview() )
250 {
251 KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( m_view );
252 PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
253
254 if( frame )
255 view->UpdateDisplayOptions( frame->GetDisplayOptions() );
256 }
257}
258
259
261{
262}
263
264
266{
267 m_view->Clear();
268
269 aBoard->CacheTriangulation( aReporter );
270
271 if( m_drawingSheet )
272 m_drawingSheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
273
274 // Load drawings
275 for( BOARD_ITEM* drawing : aBoard->Drawings() )
276 m_view->Add( drawing );
277
278 // Load tracks
279 for( PCB_TRACK* track : aBoard->Tracks() )
280 m_view->Add( track );
281
282 // Load footprints and its additional elements
283 for( FOOTPRINT* footprint : aBoard->Footprints() )
284 m_view->Add( footprint );
285
286 // DRC markers
287 for( PCB_MARKER* marker : aBoard->Markers() )
288 m_view->Add( marker );
289
290 // Load zones
291 for( ZONE* zone : aBoard->Zones() )
292 m_view->Add( zone );
293
294 for( PCB_GENERATOR* generator : aBoard->Generators() )
295 m_view->Add( generator );
296
297 // Ratsnest
298 if( !aBoard->IsFootprintHolder() )
299 {
300 m_ratsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aBoard->GetConnectivity() );
301 m_view->Add( m_ratsnest.get() );
302 }
303}
304
305
307{
308 m_drawingSheet.reset( aDrawingSheet );
309 m_view->Add( m_drawingSheet.get() );
310}
311
312
314{
315 COLOR_SETTINGS* cs = nullptr;
316
317 PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
318
319 if( frame )
320 {
321 cs = frame->GetColorSettings();
322 }
323 else
324 {
326
327 if( app )
329 else
331 }
332
333 wxCHECK_RET( cs, wxT( "null COLOR_SETTINGS" ) );
334
335 auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
336 rs->LoadColors( cs );
337
341}
342
343
345{
346 // Set display settings for high contrast mode
348
349 SetTopLayer( aLayer );
350 rSettings->SetActiveLayer( aLayer );
351
352 rSettings->ClearHighContrastLayers();
353 rSettings->SetLayerIsHighContrast( aLayer );
354
355 if( IsCopperLayer( aLayer ) )
356 {
357 // Bring some other layers to the front in case of copper layers and make them colored
358 // fixme do not like the idea of storing the list of layers here,
359 // should be done in some other way I guess..
360 int layers[] = {
364 ZONE_LAYER_FOR( aLayer ),
365 BITMAP_LAYER_FOR( aLayer ),
372 };
373
374 for( int i : layers )
375 rSettings->SetLayerIsHighContrast( i );
376
377 for( int i = LAYER_UI_START; i < LAYER_UI_END; ++i )
378 rSettings->SetLayerIsHighContrast( i );
379
380 // Pads should be shown too
381 if( aLayer == B_Cu )
382 {
385 }
386 else if( aLayer == F_Cu )
387 {
390 }
391 }
392
394}
395
396
398{
401 m_view->SetTopLayer( aLayer );
402
403 // Layers that should always have on-top attribute enabled
404 const std::vector<int> layers = {
413 };
414
415 for( auto layer : layers )
416 m_view->SetTopLayer( layer );
417
418 for( int i = LAYER_UI_START; i < LAYER_UI_END; i++ )
419 m_view->SetTopLayer( i );
420
421 // Extra layers that are brought to the top if a F.* or B.* is selected
422 const std::vector<int> frontLayers = {
425 };
426
427 const std::vector<int> backLayers = {
430 };
431
432 const std::vector<int>* extraLayers = nullptr;
433
434 // Bring a few more extra layers to the top depending on the selected board side
435 if( IsFrontLayer( aLayer ) )
436 extraLayers = &frontLayers;
437 else if( IsBackLayer( aLayer ) )
438 extraLayers = &backLayers;
439
440 if( extraLayers )
441 {
442 for( auto layer : *extraLayers )
443 {
444 m_view->SetTopLayer( layer );
445
446 if( layer < PCB_LAYER_ID_COUNT )
447 m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
448 }
449
450 // Move the active layer to the top of the stack but below all the overlay layers
451 if( !IsCopperLayer( aLayer ) )
452 {
456
457 // Fix up pad and via netnames to be below. This is hacky, we need a rethink
458 // of layer ordering...
463 }
464 }
465
466 if( IsCopperLayer( aLayer ) )
467 {
468 m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
469
470 // Display labels for copper layers on the top
471 m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
472 }
473
474 m_view->SetTopLayer( BITMAP_LAYER_FOR( aLayer ) );
475 m_view->EnableTopLayer( true );
477}
478
479
481{
482 // Load layer & elements visibility settings
483 for( int i = 0; i < PCB_LAYER_ID_COUNT; ++i )
484 m_view->SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
485
487 m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
488
489 // Via layers controlled by dependencies
493
494 // Pad layers controlled by dependencies
497
498 // Always enable netname layers, as their visibility is controlled by layer dependencies
499 for( int i = NETNAMES_LAYER_ID_START; i < NETNAMES_LAYER_ID_END; ++i )
500 m_view->SetLayerVisible( i, true );
501
502 for( int i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
503 m_view->SetLayerVisible( i, true );
504
505 for( int i = LAYER_BITMAP_START; i < LAYER_BITMAP_END; i++ )
506 m_view->SetLayerVisible( i, true );
507
508 for( int i = LAYER_UI_START; i < LAYER_UI_END; i++ )
509 m_view->SetLayerVisible( i, true );
510
511 // Enable some layers that are GAL specific
520}
521
522
524 std::vector<MSG_PANEL_ITEM>& aList )
525{
526 BOARD* board = static_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() )->GetBoard();
527 int padCount = 0;
528 int viaCount = 0;
529 int trackSegmentCount = 0;
530 std::set<int> netCodes;
531 int unconnected = (int) board->GetConnectivity()->GetUnconnectedCount( true );
532
533 for( PCB_TRACK* item : board->Tracks() )
534 {
535 if( item->Type() == PCB_VIA_T )
536 viaCount++;
537 else
538 trackSegmentCount++;
539
540 if( item->GetNetCode() > 0 )
541 netCodes.insert( item->GetNetCode() );
542 }
543
544 for( FOOTPRINT* footprint : board->Footprints() )
545 {
546 for( PAD* pad : footprint->Pads() )
547 {
548 padCount++;
549
550 if( pad->GetNetCode() > 0 )
551 netCodes.insert( pad->GetNetCode() );
552 }
553 }
554
555 aList.emplace_back( _( "Pads" ), wxString::Format( wxT( "%d" ), padCount ) );
556 aList.emplace_back( _( "Vias" ), wxString::Format( wxT( "%d" ), viaCount ) );
557 aList.emplace_back( _( "Track Segments" ), wxString::Format( wxT( "%d" ), trackSegmentCount ) );
558 aList.emplace_back( _( "Nets" ), wxString::Format( wxT( "%d" ), (int) netCodes.size() ) );
559 aList.emplace_back( _( "Unrouted" ), wxString::Format( wxT( "%d" ), unconnected ) );
560}
561
562
564{
565 PCB_BASE_FRAME* frame = nullptr;
566
567 if( !IsDialogPreview() )
568 frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
569
570 try
571 {
572 // Check if the current rendering back end can be properly initialized
574 }
575 catch( const std::runtime_error& e )
576 {
577 DisplayError( GetParent(), e.what() );
578
579 // Use the fallback if we have one
580 if( GAL_FALLBACK != m_backend )
581 {
583
584 if( frame )
585 frame->ActivateGalCanvas();
586 }
587 }
588
589 if( frame )
590 {
591 SetTopLayer( frame->GetActiveLayer() );
592
593 KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( m_view->GetPainter() );
594 KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
595
596 settings->LoadDisplayOptions( frame->GetDisplayOptions() );
598 }
599}
600
601
603{
604 for( int i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( int ); ++i )
605 {
606 int layer = GAL_LAYER_ORDER[i];
607 wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
608
609 // MW: Gross hack to make SetTopLayer bring the correct bitmap layer to
610 // the top of the other bitmaps, but still below all the other layers
611 if( layer >= LAYER_BITMAP_START && layer < LAYER_BITMAP_END )
613 else
614 m_view->SetLayerOrder( layer, i );
615 }
616}
617
618
620{
621 bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
623 m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
624 return rv;
625}
626
627
629{
630 if( m_ratsnest )
631 m_view->Update( m_ratsnest.get() );
632}
633
634
636{
638 return m_drawingSheet->ViewBBox();
639
640 return BOX2I();
641}
642
643
645{
646 // caching makes no sense for Cairo and other software renderers
648
649 for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
650 m_view->SetLayerTarget( i, target );
651
652 for( int i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( int ); ++i )
653 {
654 int layer = GAL_LAYER_ORDER[i];
655 wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
656
657 // Set layer display dependencies & targets
658 if( IsCopperLayer( layer ) )
659 {
660 m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
661 m_view->SetRequired( BITMAP_LAYER_FOR( layer ), layer );
663 m_view->SetRequired( GetNetnameLayer( layer ), layer );
664 }
665 else if( IsNonCopperLayer( layer ) )
666 {
667 m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
669 m_view->SetRequired( BITMAP_LAYER_FOR( layer ), layer );
670 }
671 else if( IsNetnameLayer( layer ) )
672 {
673 m_view->SetLayerDisplayOnly( layer );
674 }
675 }
676
679
681
684
685 // Some more required layers settings
688
689 // Holes can be independent of their host objects (cf: printing drill marks)
695
696 // Via visibility
700
701 // Pad visibility
705
706 // Front footprints
709
710 // Back footprints
713
720
729
733
734 for( int i = LAYER_UI_START; i < LAYER_UI_END; ++i )
735 {
738 }
739}
740
741
743{
744 return static_cast<KIGFX::PCB_VIEW*>( m_view );
745}
BOX2< VECTOR2I > BOX2I
Definition: box2.h:853
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:173
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:281
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition: board.h:311
const GENERATORS & Generators() const
Definition: board.h:328
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:746
const ZONES & Zones() const
Definition: board.h:326
const MARKERS & Markers() const
Definition: board.h:330
const FOOTPRINTS & Footprints() const
Definition: board.h:322
const TRACKS & Tracks() const
Definition: board.h:320
const wxString & GetFileName() const
Definition: board.h:318
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
Definition: board.cpp:686
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:459
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition: board.cpp:832
const DRAWINGS & Drawings() const
Definition: board.h:324
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
The base frame for deriving all KiCad main window classes.
The base class for create windows for drawing purpose.
static constexpr GAL_TYPE GAL_FALLBACK
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
@ GAL_TYPE_OPENGL
OpenGL implementation.
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
virtual bool SwitchBackend(GAL_TYPE aGalType)
Switch method of rendering graphics.
GAL_TYPE m_backend
Currently used GAL.
EDA_DRAW_FRAME * GetParentEDAFrame() const
Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:164
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
Definition: pcb_painter.h:169
PCB specific render settings.
Definition: pcb_painter.h:77
void LoadColors(const COLOR_SETTINGS *aSettings) override
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Load settings related to display options (high-contrast mode, full or outline modes for vias/pads/tra...
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Definition: pcb_view.cpp:103
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void ClearHighContrastLayers()
Clear the list of active layers.
void SetActiveLayer(PCB_LAYER_ID aLayer)
void SetLayerIsHighContrast(int aLayerId, bool aEnabled=true)
Set the specified layer as high-contrast.
static constexpr int TOP_LAYER_MODIFIER
Definition: view.h:732
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
Definition: view.cpp:897
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Mark the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:390
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Set a layer display-only (ie: to be rendered but not returned by hit test queries).
Definition: view.h:459
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition: view.cpp:646
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:315
virtual void EnableTopLayer(bool aEnable)
Enable or disable display of the top layer.
Definition: view.cpp:857
void SetPainter(PAINTER *aPainter)
Set the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:205
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:766
void SetGAL(GAL *aGal)
Assign a rendering device for the VIEW.
Definition: view.cpp:493
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Change the rendering target for a particular layer.
Definition: view.h:471
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1639
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:395
void Clear()
Remove all items from the view.
Definition: view.cpp:1124
void ClearTopLayers()
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).
Definition: view.cpp:882
static constexpr int VIEW_MAX_LAYERS
Rendering order modifier for layers that are marked as top layers.
Definition: view.h:729
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
Definition: view.cpp:1435
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
Definition: view.cpp:830
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:412
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:215
void SetScaleLimits(double aMaximum, double aMinimum)
Set minimum and maximum values for scale.
Definition: view.h:311
void SetLayerOrder(int aLayer, int aRenderingOrder)
Set rendering order of a particular layer.
Definition: view.cpp:638
An implementation of class VIEW_CONTROLS for wxWidgets library.
Definition: pad.h:59
DISPLAY_OPTIONS m_Display
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
void UpdateColors()
Update the color settings in the painter and GAL.
PCB_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
virtual void SetTopLayer(int aLayer) override
SetTopLayer(), with some extra smarts for PCB.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Called when the window is shown for the first time.
std::unique_ptr< RATSNEST_VIEW_ITEM > m_ratsnest
Ratsnest view item.
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void OnShow() override
Called when the window is shown for the first time.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
void setDefaultLayerOrder()
< Reassign layer order to the initial settings.
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Currently used drawing-sheet.
bool SwitchBackend(GAL_TYPE aGalType) override
Force refresh of the ratsnest visual representation.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
A progress reporter interface for use in multi-threaded environments.
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
Handle a list of polygons defining a copper zone.
Definition: zone.h:72
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:280
This file is part of the common library.
#define _(s)
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:33
@ FRAME_FOOTPRINT_PREVIEW
Definition: frame_type.h:48
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer)
Definition: layer_ids.h:167
@ LAYER_PAD_BK_NETNAMES
Definition: layer_ids.h:168
@ LAYER_PAD_NETNAMES
Definition: layer_ids.h:169
@ NETNAMES_LAYER_ID_START
Definition: layer_ids.h:159
@ NETNAMES_LAYER_ID_END
Definition: layer_ids.h:172
@ LAYER_VIA_NETNAMES
Definition: layer_ids.h:170
#define BITMAP_LAYER_FOR(boardLayer)
Macros for getting the extra layers for a given board layer.
Definition: layer_ids.h:275
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layer_ids.h:176
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:954
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:977
bool IsNonCopperLayer(int aLayerId)
Test whether a layer is a non copper layer.
Definition: layer_ids.h:891
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:1021
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:880
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:194
@ LAYER_GRID
Definition: layer_ids.h:209
@ GAL_LAYER_ID_START
Definition: layer_ids.h:195
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
Definition: layer_ids.h:243
@ LAYER_VIA_HOLEWALLS
Definition: layer_ids.h:238
@ LAYER_GRID_AXES
Definition: layer_ids.h:210
@ LAYER_CONFLICTS_SHADOW
shadow layer for items flagged conficting
Definition: layer_ids.h:245
@ LAYER_FOOTPRINTS_FR
show footprints on front
Definition: layer_ids.h:212
@ LAYER_ZONE_END
Definition: layer_ids.h:258
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:201
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:221
@ LAYER_FP_REFERENCES
show footprints references (when texts are visible)
Definition: layer_ids.h:215
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
Definition: layer_ids.h:240
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:234
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:239
@ LAYER_UI_START
Definition: layer_ids.h:265
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition: layer_ids.h:218
@ GAL_LAYER_ID_END
Definition: layer_ids.h:268
@ LAYER_GP_OVERLAY
general purpose overlay
Definition: layer_ids.h:222
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:225
@ LAYER_RATSNEST
Definition: layer_ids.h:208
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
Definition: layer_ids.h:257
@ LAYER_FP_TEXT
Definition: layer_ids.h:202
@ LAYER_FOOTPRINTS_BK
show footprints on back
Definition: layer_ids.h:213
@ LAYER_UI_END
Definition: layer_ids.h:266
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:205
@ LAYER_PADS_SMD_BK
smd pads, back layer
Definition: layer_ids.h:207
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:217
@ LAYER_PADS_SMD_FR
smd pads, front layer
Definition: layer_ids.h:206
@ LAYER_MARKER_SHADOWS
shadows for drc markers
Definition: layer_ids.h:241
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:219
@ LAYER_FP_VALUES
show footprints values (when texts are visible)
Definition: layer_ids.h:214
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:198
@ LAYER_SELECT_OVERLAY
currently selected items overlay
Definition: layer_ids.h:223
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:200
@ LAYER_BITMAP_END
Definition: layer_ids.h:262
@ LAYER_BITMAP_START
Virtual layers for background images per board layer.
Definition: layer_ids.h:261
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:220
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:197
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:199
@ LAYER_PAD_HOLEWALLS
Definition: layer_ids.h:237
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
Definition: layer_ids.h:1044
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ In22_Cu
Definition: layer_ids.h:86
@ In11_Cu
Definition: layer_ids.h:75
@ In29_Cu
Definition: layer_ids.h:93
@ In30_Cu
Definition: layer_ids.h:94
@ User_8
Definition: layer_ids.h:130
@ F_CrtYd
Definition: layer_ids.h:117
@ In17_Cu
Definition: layer_ids.h:81
@ B_Adhes
Definition: layer_ids.h:97
@ Edge_Cuts
Definition: layer_ids.h:113
@ Dwgs_User
Definition: layer_ids.h:109
@ F_Paste
Definition: layer_ids.h:101
@ In9_Cu
Definition: layer_ids.h:73
@ Cmts_User
Definition: layer_ids.h:110
@ User_6
Definition: layer_ids.h:128
@ User_7
Definition: layer_ids.h:129
@ In19_Cu
Definition: layer_ids.h:83
@ In7_Cu
Definition: layer_ids.h:71
@ In28_Cu
Definition: layer_ids.h:92
@ In26_Cu
Definition: layer_ids.h:90
@ F_Adhes
Definition: layer_ids.h:98
@ B_Mask
Definition: layer_ids.h:106
@ B_Cu
Definition: layer_ids.h:95
@ User_5
Definition: layer_ids.h:127
@ Eco1_User
Definition: layer_ids.h:111
@ F_Mask
Definition: layer_ids.h:107
@ In21_Cu
Definition: layer_ids.h:85
@ In23_Cu
Definition: layer_ids.h:87
@ B_Paste
Definition: layer_ids.h:100
@ In15_Cu
Definition: layer_ids.h:79
@ In2_Cu
Definition: layer_ids.h:66
@ User_9
Definition: layer_ids.h:131
@ F_Fab
Definition: layer_ids.h:120
@ In10_Cu
Definition: layer_ids.h:74
@ Margin
Definition: layer_ids.h:114
@ F_SilkS
Definition: layer_ids.h:104
@ In4_Cu
Definition: layer_ids.h:68
@ B_CrtYd
Definition: layer_ids.h:116
@ Eco2_User
Definition: layer_ids.h:112
@ In16_Cu
Definition: layer_ids.h:80
@ In24_Cu
Definition: layer_ids.h:88
@ In1_Cu
Definition: layer_ids.h:65
@ User_3
Definition: layer_ids.h:125
@ User_1
Definition: layer_ids.h:123
@ B_SilkS
Definition: layer_ids.h:103
@ In13_Cu
Definition: layer_ids.h:77
@ User_4
Definition: layer_ids.h:126
@ In8_Cu
Definition: layer_ids.h:72
@ In14_Cu
Definition: layer_ids.h:78
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
@ User_2
Definition: layer_ids.h:124
@ In12_Cu
Definition: layer_ids.h:76
@ In27_Cu
Definition: layer_ids.h:91
@ In6_Cu
Definition: layer_ids.h:70
@ In5_Cu
Definition: layer_ids.h:69
@ In3_Cu
Definition: layer_ids.h:67
@ In20_Cu
Definition: layer_ids.h:84
@ F_Cu
Definition: layer_ids.h:64
@ In18_Cu
Definition: layer_ids.h:82
@ In25_Cu
Definition: layer_ids.h:89
@ B_Fab
Definition: layer_ids.h:119
#define ZONE_LAYER_FOR(boardLayer)
Definition: layer_ids.h:276
This file contains miscellaneous commonly used macros and functions.
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
Definition: definitions.h:49
@ TARGET_CACHED
Main rendering target (cached)
Definition: definitions.h:48
@ TARGET_OVERLAY
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
const int GAL_LAYER_ORDER[]
BOARD * GetBoard()
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1059
see class PGM_BASE
Class that computes missing connections on a PCB.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:391
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
WX_VIEW_CONTROLS class definition.
#define ZOOM_MAX_LIMIT_PCBNEW
Definition: zoom_defines.h:65
#define ZOOM_MIN_LIMIT_PCBNEW
Definition: zoom_defines.h:66