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 The 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, see <https://www.gnu.org/licenses/>.
20 */
21
22#include "pcb_draw_panel_gal.h"
23
25#include <pcb_view.h>
27#include <pcb_painter.h>
30
31#include <board.h>
32#include <footprint.h>
33#include <pad.h>
34#include <pcb_track.h>
35#include <macros.h>
36#include <pcb_generator.h>
37#include <pcb_marker.h>
38#include <pcb_point.h>
39#include <pcb_grid_item.h>
40#include <pcb_base_frame.h>
41#include <pcbnew_settings.h>
44#include <pcb_board_outline.h>
45
46#include <pgm_base.h>
48#include <confirm.h>
49#include <progress_reporter.h>
50#include <string_utils.h>
51
53#include <zoom_defines.h>
54
55#include <functional>
56#include <memory>
57#include <thread>
58#include <fmt/format.h>
59
60using namespace std::placeholders;
61
62
63const int GAL_LAYER_ORDER[] = {
66
68
70
72
78
109
111
113
115
120
123 // POINT_LAYER_FOR( F_Cu ),
127
188
193
195
198
211
214
223
226
228
230};
231
232
233PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
234 const wxPoint& aPosition, const wxSize& aSize,
235 KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
236 EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
237{
238 m_view = new KIGFX::PCB_VIEW();
239 m_view->SetGAL( m_gal );
240
242
243 if( EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( aParentWindow ) )
244 frameType = frame->GetFrameType();
245
246 m_painter = std::make_unique<KIGFX::PCB_PAINTER>( m_gal, frameType );
247 m_view->SetPainter( m_painter.get() );
248
249 // This fixes the zoom in and zoom out limits:
251
254
255 // View controls is the first in the event handler chain, so the Tool Framework operates
256 // on updated viewport data.
258
259 // Load display options (such as filled/outline display of items).
260 // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
261 // which is not always the case (namely when it is used from a wxDialog like the pad editor)
262 if( !IsDialogPreview() )
263 {
264 KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( m_view );
265 PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
266
267 if( frame )
268 view->UpdateDisplayOptions( frame->GetDisplayOptions() );
269 }
270}
271
272
276
277
279{
280 m_view->Clear();
281
282 aBoard->CacheTriangulation( aReporter );
283
284 if( m_drawingSheet )
285 m_drawingSheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
286
287 // Collect all board items, expanding footprints into their children (pads, fields,
288 // graphics, zones) which are individually registered in the VIEW for rendering and
289 // selection. Then bulk-load all items in a single pass for efficient R-tree construction.
290 std::vector<KIGFX::VIEW_ITEM*> viewItems;
291
292 for( BOARD_ITEM* item : aBoard->GetItemSet() )
293 {
294 // Geometry-free items (constraints) are never rendered; VIEW::Add would stamp their
295 // view data on an empty layer set and risk a later "already in a different view" assert.
296 if( item->Type() == PCB_CONSTRAINT_T )
297 continue;
298
299 viewItems.push_back( item );
300
301 if( item->Type() == PCB_FOOTPRINT_T )
302 {
303 static_cast<FOOTPRINT*>( item )->RunOnChildren(
304 [&viewItems]( BOARD_ITEM* child )
305 {
306 if( child->Type() != PCB_CONSTRAINT_T )
307 viewItems.push_back( child );
308 },
310 }
311 }
312
313 m_view->AddBatch( viewItems );
314
315 aBoard->UpdateBoardOutline();
316 m_view->Add( aBoard->BoardOutline() );
317
318 // Ratsnest
319 if( !aBoard->IsFootprintHolder() )
320 addRatsnest( aBoard->GetConnectivity() );
321}
322
323
324void PCB_DRAW_PANEL_GAL::addRatsnest( std::shared_ptr<CONNECTIVITY_DATA> aConnectivity )
325{
326 // A retained scene caches the board's lines, so the lines of moving items, which change every
327 // frame, get their own overlay item
328 if( m_gal->HasRetainedScene() )
329 {
330 m_ratsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aConnectivity, RATSNEST_VIEW_ITEM::PART::BOARD );
331 m_localRatsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aConnectivity, RATSNEST_VIEW_ITEM::PART::LOCAL );
332 m_view->Add( m_localRatsnest.get() );
333 }
334 else
335 {
336 m_ratsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aConnectivity );
337 m_localRatsnest.reset();
338 }
339
340 m_view->Add( m_ratsnest.get() );
341}
342
343
345{
346 // Nothing else updates the cached board lines when a move starts or ends, a highlight changes
347 // or a display option changes
348 if( m_localRatsnest && m_ratsnest->BoardInputsChanged( m_view ) )
349 m_view->Update( m_ratsnest.get() );
350}
351
352
354{
355 m_drawingSheet.reset( aDrawingSheet );
356 m_view->Add( m_drawingSheet.get() );
357}
358
359
361{
363 PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
364
365 if( frame )
366 cs = frame->GetColorSettings();
367 else if( PCBNEW_SETTINGS* cfg = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ) )
368 cs = ::GetColorSettings( cfg->m_ColorTheme );
369
370 wxCHECK_RET( cs, wxT( "null COLOR_SETTINGS" ) );
371
372 auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
373 rs->LoadColors( cs );
374
375 m_gal->SetGridColor( cs->GetColor( LAYER_GRID ) );
376 m_gal->SetAxesColor( cs->GetColor( LAYER_GRID_AXES ) );
377 m_gal->SetCursorColor( cs->GetColor( LAYER_CURSOR ) );
378}
379
380
382{
383 std::vector<KIGFX::GRID_SOURCE> sources;
384
385 BOARD* board = nullptr;
386
387 if( PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() ) )
388 board = frame->GetBoard();
389
390 // The "Grid Items" object visibility toggle hides the rendered grid
391 // content; the items themselves (selection decorations, snap) follow
392 // the same flag at their own sites.
393 if( !board || !board->IsElementVisible( LAYER_SUBGRIDS ) )
394 {
395 m_gal->SetGridSources( std::move( sources ) );
396 return;
397 }
398
399 // Grid content color comes from the "Grid Items" entry of the color
400 // theme, falling back to the global grid color.
401 COLOR4D gridItemColor = m_gal->GetGridColor();
402
403 if( PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() ) )
404 {
405 if( COLOR_SETTINGS* cs = frame->GetColorSettings() )
406 gridItemColor = cs->GetColor( LAYER_SUBGRIDS );
407 }
408
409 for( BOARD_ITEM* item : board->Drawings() )
410 {
411 if( item->Type() != PCB_GRID_ITEM_T )
412 continue;
413
414 PCB_GRID_ITEM* grid = static_cast<PCB_GRID_ITEM*>( item );
415
416 // Priority 0 is the background grid's; a grid item must never sink behind it.
417 wxASSERT( grid->GetAssignedPriority() > 0 );
418
420 static_cast<GRID_GEOMETRY&>( src ) = grid->AsGridGeometry();
421
422 // Pitch is a loop step in the renderer; the spacing setters keep it positive.
423 wxASSERT( src.pitch.x > 0.0 && src.pitch.y > 0.0 );
424
425 src.tick = grid->GetTickInterval();
426 src.highlighted = grid->IsSelected();
427 src.snapCursor = grid->Affects().cursor && !grid->IsSelected();
428 src.color = gridItemColor;
429 src.style = m_gal->GetGridStyle(); // inherit display style
430
431 sources.push_back( src );
432 }
433
434 m_gal->SetGridSources( std::move( sources ) );
435}
436
437
442
443
448
449
450void PCB_DRAW_PANEL_GAL::applyHighContrastLayer( PCB_LAYER_ID aLayer, bool aOnlyLayerChanged )
451{
452 // Set display settings for high contrast mode
453 KIGFX::RENDER_SETTINGS* rSettings = m_view->GetPainter()->GetSettings();
454
455 SetTopLayer( aLayer );
456 rSettings->SetActiveLayer( aLayer );
457
458 rSettings->ClearHighContrastLayers();
459 rSettings->SetLayerIsHighContrast( aLayer );
460
461 if( IsCopperLayer( aLayer ) )
462 {
463 // Bring some other layers to the front in case of copper layers and make them colored
464 // fixme do not like the idea of storing the list of layers here,
465 // should be done in some other way I guess..
466 int layers[] = {
468 GetNetnameLayer( aLayer ),
471 PAD_COPPER_LAYER_FOR( aLayer ),
472 VIA_COPPER_LAYER_FOR( aLayer ),
473 ZONE_LAYER_FOR( aLayer ),
474 BITMAP_LAYER_FOR( aLayer ),
475 POINT_LAYER_FOR( aLayer ),
486 };
487
488 for( int i : layers )
489 rSettings->SetLayerIsHighContrast( i );
490
491 for( int i = LAYER_UI_START; i < LAYER_UI_END; ++i )
492 rSettings->SetLayerIsHighContrast( i );
493
494 // Pads should be shown too
495 if( aLayer == B_Cu )
496 {
498 }
499 else if( aLayer == F_Cu )
500 {
502 }
503 }
504
505 // High contrast hides and shows items as well as recolouring them
506 const bool contrast = rSettings->GetHighContrast();
507 auto* pcbSettings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( rSettings );
508 const bool hidden = contrast && pcbSettings->m_ContrastModeDisplay == HIGH_CONTRAST_MODE::HIDDEN;
509
510 // Layers the canvas fades keep their item colours, unless high contrast hides inactive layers
511 // now or did at the last switch
512 if( aOnlyLayerChanged && pcbSettings->HasCanvasFadedLayers() && !hidden && !m_highContrastHidden )
513 {
514 m_view->UpdateLayersColor( contrast || m_highContrastShown,
515 [pcbSettings]( int aViewLayer )
516 {
517 return !pcbSettings->IsCanvasFadedLayer( aViewLayer );
518 } );
519 }
520 else if( contrast || m_highContrastShown )
521 {
522 m_view->UpdateAllLayersColorAndVisibility();
523 }
524 else
525 {
526 m_view->UpdateAllLayersColor();
527 }
528
529 m_highContrastShown = contrast;
530 m_highContrastHidden = hidden;
531}
532
533
535{
536 m_view->ClearTopLayers();
538 m_view->SetTopLayer( aLayer );
539
540 // Layers that should always have on-top attribute enabled
541 const std::vector<int> layers = {
550 };
551
552 for( auto layer : layers )
553 m_view->SetTopLayer( layer );
554
555 for( int i = LAYER_UI_START; i < LAYER_UI_END; i++ )
556 m_view->SetTopLayer( i );
557
558 // Extra layers that are brought to the top if a F.* or B.* is selected
559 const std::vector<int> frontLayers = {
562 };
563
564 const std::vector<int> backLayers = {
567 };
568
569 const std::vector<int>* extraLayers = nullptr;
570
571 // Bring a few more extra layers to the top depending on the selected board side
572 if( IsFrontLayer( aLayer ) )
573 extraLayers = &frontLayers;
574 else if( IsBackLayer( aLayer ) )
575 extraLayers = &backLayers;
576
577 if( extraLayers )
578 {
579 for( auto layer : *extraLayers )
580 {
581 m_view->SetTopLayer( layer );
582
583 if( layer < PCB_LAYER_ID_COUNT )
584 {
585 m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
586 m_view->SetTopLayer( PAD_COPPER_LAYER_FOR( layer ) );
587 m_view->SetTopLayer( VIA_COPPER_LAYER_FOR( layer ) );
588 m_view->SetTopLayer( CLEARANCE_LAYER_FOR( layer ) );
589 m_view->SetTopLayer( POINT_LAYER_FOR( layer ) );
590 }
591 }
592
593 // Move the active layer to the top of the stack but below all the overlay layers
594 if( !IsCopperLayer( aLayer ) )
595 {
596 m_view->SetLayerOrder( aLayer, m_view->GetLayerOrder( LAYER_MARKER_SHADOWS ) + 1 );
597 m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ),
598 m_view->GetLayerOrder( LAYER_MARKER_SHADOWS ) + 2 );
599 m_view->SetLayerOrder( POINT_LAYER_FOR( aLayer ),
600 m_view->GetLayerOrder( LAYER_MARKER_SHADOWS ) + 3 );
601
602 // Fix up pad and via netnames to be below. This is hacky, we need a rethink
603 // of layer ordering...
604 m_view->SetLayerOrder( LAYER_PAD_NETNAMES,
605 m_view->GetLayerOrder( LAYER_MARKER_SHADOWS ) + 4 );
606 m_view->SetLayerOrder( LAYER_VIA_NETNAMES,
607 m_view->GetLayerOrder( LAYER_MARKER_SHADOWS ) + 5 );
608 }
609 }
610
611 if( IsCopperLayer( aLayer ) )
612 {
613 m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
614 m_view->SetTopLayer( PAD_COPPER_LAYER_FOR( aLayer ) );
615 m_view->SetTopLayer( VIA_COPPER_LAYER_FOR( aLayer ) );
616 m_view->SetTopLayer( CLEARANCE_LAYER_FOR( aLayer ) );
617
618 // Display labels for copper layers on the top
619 m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
620 }
621
622 m_view->SetTopLayer( POINT_LAYER_FOR( aLayer ) );
623 m_view->SetTopLayer( BITMAP_LAYER_FOR( aLayer ) );
624 m_view->EnableTopLayer( true );
625 m_view->UpdateAllLayersOrder();
626}
627
628
630{
631 PCB_LAYER_ID activeLayer = UNDEFINED_LAYER;
632 PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
633
634 // A preview canvas edits no layer, so it shows no clearance outlines
635 if( frame && frame->GetCanvas() == this )
636 activeLayer = frame->GetActiveLayer();
637
638 SyncLayersVisibility( *m_view, aBoard, activeLayer );
639}
640
641
643{
644 // Load layer & elements visibility settings
645 for( int i = 0; i < PCB_LAYER_ID_COUNT; ++i )
646 aView.SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
647
649 aView.SetLayerVisible( i, aBoard->IsElementVisible( i ) );
650
651 // Via layers controlled by dependencies
652 aView.SetLayerVisible( LAYER_VIA_MICROVIA, true );
653 aView.SetLayerVisible( LAYER_VIA_BLIND, true );
654 aView.SetLayerVisible( LAYER_VIA_BURIED, true );
655 aView.SetLayerVisible( LAYER_VIA_THROUGH, true );
656
657 // Always enable netname layers, as their visibility is controlled by layer dependencies
658 for( int i = NETNAMES_LAYER_ID_START; i < NETNAMES_LAYER_ID_END; ++i )
659 aView.SetLayerVisible( i, true );
660
661 for( int i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
662 aView.SetLayerVisible( i, true );
663
664 for( int i = LAYER_PAD_COPPER_START; i < LAYER_PAD_COPPER_END; i++ )
665 aView.SetLayerVisible( i, true );
666
667 for( int i = LAYER_VIA_COPPER_START; i < LAYER_VIA_COPPER_END; i++ )
668 aView.SetLayerVisible( i, true );
669
670 // Holes draw their drill map symbols here. Whether anything appears is governed by the
671 // documentation layer these depend on, not by this flag
672 for( int i = LAYER_DRILL_SYMBOL_START; i < LAYER_DRILL_SYMBOL_END; i++ )
673 aView.SetLayerVisible( i, true );
674
675 // Clearance outlines show for the copper layer being edited alone. Every caller that applies a
676 // board's visibility has to leave that one on, or a canvas switch or a layer preset drops the
677 // outlines until the active layer next changes.
678 for( int i = LAYER_CLEARANCE_START; i < LAYER_CLEARANCE_END; i++ )
679 aView.SetLayerVisible( i, false );
680
681 if( IsCopperLayer( aActiveLayer ) )
682 aView.SetLayerVisible( CLEARANCE_LAYER_FOR( aActiveLayer ), true );
683
684 for( int i = LAYER_POINT_START; i < LAYER_POINT_END; i++ )
685 aView.SetLayerVisible( i, true );
686
687 for( int i = LAYER_BITMAP_START; i < LAYER_BITMAP_END; i++ )
688 aView.SetLayerVisible( i, true );
689
690 for( int i = LAYER_UI_START; i < LAYER_UI_END; i++ )
691 aView.SetLayerVisible( i, true );
692
693 // Enable some layers that are GAL specific
697 aView.SetLayerVisible( LAYER_VIA_HOLES, true );
699 aView.SetLayerVisible( LAYER_GP_OVERLAY, true );
701 aView.SetLayerVisible( LAYER_RATSNEST, true );
704}
705
706
708 std::vector<MSG_PANEL_ITEM>& aList )
709{
710 BOARD* board = static_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() )->GetBoard();
711 int padCount = 0;
712 int viaCount = 0;
713 int trackSegmentCount = 0;
714 std::set<int> netCodes;
715 int unconnected = (int) board->GetConnectivity()->GetUnconnectedCount( true );
716
717 for( PCB_TRACK* item : board->Tracks() )
718 {
719 if( item->Type() == PCB_VIA_T )
720 viaCount++;
721 else
722 trackSegmentCount++;
723
724 if( item->GetNetCode() > 0 )
725 netCodes.insert( item->GetNetCode() );
726 }
727
728 for( FOOTPRINT* footprint : board->Footprints() )
729 {
730 for( PAD* pad : footprint->Pads() )
731 {
732 padCount++;
733
734 if( pad->GetNetCode() > 0 )
735 netCodes.insert( pad->GetNetCode() );
736 }
737 }
738
739 aList.emplace_back( _( "Pads" ), fmt::format( "{}", padCount ) );
740 aList.emplace_back( _( "Vias" ), fmt::format( "{}", viaCount ) );
741 aList.emplace_back( _( "Track Segments" ), fmt::format( "{}", trackSegmentCount ) );
742 aList.emplace_back( _( "Nets" ), fmt::format( "{}", (int) netCodes.size() ) );
743 aList.emplace_back( _( "Unrouted" ), fmt::format( "{}", unconnected ) );
744}
745
746
748{
749 PCB_BASE_FRAME* frame = nullptr;
750
751 if( !IsDialogPreview() )
752 frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
753
755
756 if( frame )
757 {
758 SetTopLayer( frame->GetActiveLayer() );
759
760 KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( m_view->GetPainter() );
761 KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
762
763 settings->LoadDisplayOptions( frame->GetDisplayOptions() );
765 }
766}
767
768
770{
771 for( int i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( int ); ++i )
772 {
773 int layer = GAL_LAYER_ORDER[i];
774 wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
775
776 // MW: Gross hack to make SetTopLayer bring the correct bitmap layer to
777 // the top of the other bitmaps, but still below all the other layers
778 if( layer >= LAYER_BITMAP_START && layer < LAYER_BITMAP_END )
779 aView->SetLayerOrder( layer, i - KIGFX::VIEW::TOP_LAYER_MODIFIER, false );
780 else
781 aView->SetLayerOrder( layer, i, false );
782 }
783
784 // Drill symbol layers are not listed in the table above. Each one draws with the
785 // documentation layer whose map owns it
786 for( int i = 0; i < PCB_LAYER_ID_COUNT; ++i )
787 {
788 const PCB_LAYER_ID boardLayer = static_cast<PCB_LAYER_ID>( i );
789
790 aView->SetLayerOrder( DRILL_SYMBOL_LAYER_FOR( boardLayer ),
791 aView->GetLayerOrder( boardLayer ), false );
792 }
793
794 aView->SortOrderedLayers();
795}
796
797
802
803
805{
806 bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
808 m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
809
810 // Whether the ratsnest is split depends on the canvas
811 if( m_ratsnest && ( m_localRatsnest != nullptr ) != m_gal->HasRetainedScene() )
812 {
813 std::shared_ptr<CONNECTIVITY_DATA> connectivity = m_ratsnest->GetConnectivity();
814
815 m_view->Remove( m_ratsnest.get() );
816
817 if( m_localRatsnest )
818 m_view->Remove( m_localRatsnest.get() );
819
820 addRatsnest( connectivity );
821 }
822
823 return rv;
824}
825
826
828{
829 if( m_ratsnest )
830 m_view->Update( m_ratsnest.get() );
831
832 if( m_localRatsnest )
833 m_view->Update( m_localRatsnest.get() );
834}
835
836
838{
839 if( m_drawingSheet && m_view->IsLayerVisible( LAYER_DRAWINGSHEET ) )
840 return m_drawingSheet->ViewBBox();
841
842 return BOX2I();
843}
844
845
847{
848 // Cairo keeps cached groups in screen coordinates, so caching makes no sense for it
850
851 // Anything not cached is composited above the whole retained scene, which would put reference
852 // images over the zones
853 const KIGFX::RENDER_TARGET bitmapTarget = ( m_gal && m_gal->HasRetainedScene() ) ? KIGFX::TARGET_CACHED
855
856 for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
857 m_view->SetLayerTarget( i, target );
858
859 // A map's offset changes while its hole owners do not. Rebuilding every drilled pad and
860 // via on each mouse event makes dragging scale with the board's hole count.
861 for( int i = LAYER_DRILL_SYMBOL_START; i < LAYER_DRILL_SYMBOL_END; ++i )
862 m_view->SetLayerTarget( i, KIGFX::TARGET_NONCACHED );
863
864 for( int i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( int ); ++i )
865 {
866 int layer = GAL_LAYER_ORDER[i];
867 wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
868
869 // Set layer display dependencies & targets
870 if( IsCopperLayer( layer ) )
871 {
872 m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
873 m_view->SetRequired( PAD_COPPER_LAYER_FOR( layer ), layer );
874 m_view->SetRequired( VIA_COPPER_LAYER_FOR( layer ), layer );
875 m_view->SetRequired( CLEARANCE_LAYER_FOR( layer ), layer );
876 m_view->SetRequired( POINT_LAYER_FOR( layer ), layer );
877
878 m_view->SetRequired( BITMAP_LAYER_FOR( layer ), layer );
879 m_view->SetLayerTarget( BITMAP_LAYER_FOR( layer ), bitmapTarget );
880 m_view->SetRequired( GetNetnameLayer( layer ), layer );
881 m_view->SetRequired( DRILL_SYMBOL_LAYER_FOR( layer ), layer );
882 }
883 else if( IsNonCopperLayer( layer ) )
884 {
885 m_view->SetRequired( POINT_LAYER_FOR( layer ), layer );
886 m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
887 m_view->SetLayerTarget( BITMAP_LAYER_FOR( layer ), bitmapTarget );
888 m_view->SetRequired( BITMAP_LAYER_FOR( layer ), layer );
889 m_view->SetRequired( DRILL_SYMBOL_LAYER_FOR( layer ), layer );
890 }
891 else if( IsNetnameLayer( layer ) )
892 {
893 m_view->SetLayerDisplayOnly( layer );
894 }
895 }
896
897 m_view->SetLayerTarget( LAYER_ANCHOR, KIGFX::TARGET_NONCACHED );
898 m_view->SetLayerDisplayOnly( LAYER_ANCHOR );
899
900 // Use TARGET_OVERLAY for LAYER_CONFLICTS_SHADOW, it is for items
901 // that may change while the view stays the same.
903
904 // Constraint shadow drawn under item like locked-item shadow
905 // kept on cached target not overlay and re-cached on set change
906 m_view->SetLayerDisplayOnly( LAYER_LOCKED_ITEM_SHADOW );
907 m_view->SetLayerDisplayOnly( LAYER_CONFLICTS_SHADOW );
908 m_view->SetLayerDisplayOnly( LAYER_CONSTRAINT_SHADOW );
909 m_view->SetLayerDisplayOnly( LAYER_BOARD_OUTLINE_AREA );
910
911 // Some more required layers settings
912 m_view->SetRequired( LAYER_PAD_NETNAMES, LAYER_PADS );
913
914 // Holes can be independent of their host objects (cf: printing drill marks)
915 m_view->SetRequired( LAYER_VIA_HOLES, LAYER_VIAS );
916 m_view->SetRequired( LAYER_VIA_HOLEWALLS, LAYER_VIAS );
917 m_view->SetRequired( LAYER_PAD_PLATEDHOLES, LAYER_PADS );
918 m_view->SetRequired( LAYER_PAD_HOLEWALLS, LAYER_PADS );
919 m_view->SetRequired( LAYER_NON_PLATEDHOLES, LAYER_PADS );
920
921 // Via visibility
922 m_view->SetRequired( LAYER_VIA_MICROVIA, LAYER_VIAS );
923 m_view->SetRequired( LAYER_VIA_BLIND, LAYER_VIAS );
924 m_view->SetRequired( LAYER_VIA_BURIED, LAYER_VIAS );
925 m_view->SetRequired( LAYER_VIA_THROUGH, LAYER_VIAS );
926 m_view->SetRequired( LAYER_VIA_NETNAMES, LAYER_VIAS );
927
929 m_view->SetLayerDisplayOnly( LAYER_SELECT_OVERLAY ) ;
931 m_view->SetLayerDisplayOnly( LAYER_GP_OVERLAY ) ;
932 // Non-cached so the clearance halo lands behind copper on every backend
934 m_view->SetLayerDisplayOnly( LAYER_ROUTER_PREVIEW_SHADOW );
936 m_view->SetLayerDisplayOnly( LAYER_ROUTER_PREVIEW_COLLISION );
937
938 // A retained scene caches the board's ratsnest, see addRatsnest()
939 const bool cachedRatsnest = m_gal && m_gal->HasRetainedScene();
940
941 m_view->SetLayerTarget( LAYER_RATSNEST, cachedRatsnest ? KIGFX::TARGET_CACHED : KIGFX::TARGET_OVERLAY );
942 m_view->SetLayerDisplayOnly( LAYER_RATSNEST );
943
944 if( cachedRatsnest )
945 {
947
948 // Blended as on the legacy overlay
949 m_gal->SetSceneLayerOverlayAlpha( LAYER_RATSNEST );
950 }
951
952 m_view->SetLayerTarget( LAYER_DRC_ERROR, KIGFX::TARGET_OVERLAY );
957 m_view->SetLayerDisplayOnly( LAYER_MARKER_SHADOWS );
958
959 // A retained scene keeps the sheet with the board rather than redrawing it on every pan
960 m_view->SetLayerTarget( LAYER_DRAWINGSHEET, ( m_gal && m_gal->HasRetainedScene() ) ? KIGFX::TARGET_CACHED
962 m_view->SetLayerDisplayOnly( LAYER_DRAWINGSHEET ) ; // drawing sheet can't be selected
963 m_view->SetLayerDisplayOnly( LAYER_GRID ); // grid can't be selected
964
965 for( int i = LAYER_UI_START; i < LAYER_UI_END; ++i )
966 {
967 m_view->SetLayerTarget( i, KIGFX::TARGET_OVERLAY );
968 m_view->SetLayerDisplayOnly( i );
969 }
970
972}
973
974
976{
977 auto* settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
978 std::bitset<MAX_LAYERS_FOR_VIEW> layers;
979
980 if( m_gal && m_gal->HasRetainedScene() )
981 {
982 for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
983 {
984 for( int viewLayer : { layer, static_cast<int>( ZONE_LAYER_FOR( layer ) ),
985 static_cast<int>( PAD_COPPER_LAYER_FOR( layer ) ),
986 static_cast<int>( VIA_COPPER_LAYER_FOR( layer ) ),
987 static_cast<int>( CLEARANCE_LAYER_FOR( layer ) ) } )
988 {
989 if( m_view->IsCached( viewLayer ) )
990 layers.set( viewLayer );
991 }
992 }
993 }
994
995 settings->SetCanvasFadedLayers( layers );
996}
997
998
1000{
1001 return static_cast<KIGFX::PCB_VIEW*>( m_view );
1002}
@ HIDDEN
Inactive layers are hidden.
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:85
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
bool IsFootprintHolder() const
Find out if the board is being used to hold a single footprint for editing/viewing.
Definition board.h:441
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition board.cpp:1241
PCB_BOARD_OUTLINE * BoardOutline()
Definition board.h:487
void UpdateBoardOutline()
Definition board.cpp:4299
const FOOTPRINTS & Footprints() const
Definition board.h:465
const BOARD_ITEM_SET GetItemSet()
Collect every owned item (tracks, zones, generators, footprints, drawings, markers,...
Definition board.cpp:4214
const TRACKS & Tracks() const
Definition board.h:463
const wxString & GetFileName() const
Definition board.h:454
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:1180
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition board.h:758
void CacheTriangulation(PROGRESS_REPORTER *aReporter=nullptr, const std::vector< ZONE * > &aZones={})
Definition board.cpp:1357
const DRAWINGS & Drawings() const
Definition board.h:467
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
unsigned int GetUnconnectedCount(bool aVisibleOnly) const
The base frame for deriving all KiCad main window classes.
The base class for create windows for drawing purpose.
virtual void OnShow()
Called when the window is shown for the first time.
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.
EDA_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
Create a drawing panel that is contained inside aParentWindow.
static bool IsAccelerated(GAL_TYPE aCanvasType)
True for a canvas drawn on the GPU, which keeps cached layers between frames.
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.
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
Contains methods for drawing PCB-specific items.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
Definition pcb_painter.h:94
void LoadColors(const COLOR_SETTINGS *aSettings) override
void SetCanvasFadedLayers(const std::bitset< MAX_LAYERS_FOR_VIEW > &aLayers)
Let the canvas fade these VIEW layers as a whole for high contrast, see GAL::SetSceneLayerDim().
HIGH_CONTRAST_MODE m_ContrastModeDisplay
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:145
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.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:68
static constexpr int TOP_LAYER_MODIFIER
Rendering order modifier for layers that are marked as top layers.
Definition view.h:902
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition view.cpp:1040
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition view.h:431
void SetLayerOrder(int aLayer, int aRenderingOrder, bool aAutoSort=true)
Set rendering order of a particular layer.
Definition view.cpp:1031
static constexpr int VIEW_MAX_LAYERS
Maximum number of layers that may be shown.
Definition view.h:899
void SortOrderedLayers()
Sorts m_orderedLayers after layer rendering order has changed.
Definition view.cpp:1979
An implementation of class VIEW_CONTROLS for wxWidgets library.
Definition pad.h:61
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
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual PCB_LAYER_ID GetActiveLayer() const
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
void ChangeHighContrastLayer(PCB_LAYER_ID aLayer)
Follow an active layer change when nothing else that colours items has changed.
void UpdateColors()
Update the color settings in the painter and GAL.
void updateCanvasFadedLayers()
Let a retained scene apply the high contrast dim of cached layers whose dim does not depend on the it...
std::unique_ptr< RATSNEST_VIEW_ITEM > m_localRatsnest
Moving items' part, when split off.
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
Move the selected layer to the top, so it is displayed above all others.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
std::unique_ptr< RATSNEST_VIEW_ITEM > m_ratsnest
Ratsnest view item.
void applyHighContrastLayer(PCB_LAYER_ID aLayer, bool aOnlyLayerChanged)
Make aLayer the high contrast layer.
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Set or update drawing-sheet used by the draw panel.
void setDefaultLayerDeps()
Set rendering targets & dependencies for layers.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the KIGFX::VIEW instance used in the panel.
void beforeRedraw() override
Hook for subclasses to update view items whose inputs nothing else tracks.
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.
bool m_highContrastShown
High contrast was on at the last recolour, so the next one may bring items back.
void setDefaultLayerOrder()
Reassign layer order to the initial settings.
PCB_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_MODERN)
bool m_highContrastHidden
High contrast hid inactive layers at the last recolour, which the canvas cannot fade away.
virtual void SetHighContrastLayer(int aLayer) override
Take care of display settings for the given layer to be displayed in high contrast mode.
void addRatsnest(std::shared_ptr< CONNECTIVITY_DATA > aConnectivity)
Add the ratsnest items the current canvas needs.
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Currently used drawing-sheet.
bool SwitchBackend(GAL_TYPE aGalType) override
Switch method of rendering graphics.
void RedrawRatsnest()
Force refresh of the ratsnest visual representation.
void prepareGridSources() override
Push a GRID_SOURCE for every PCB_GRIDITEM on the board to the GAL.
A progress reporter interface for use in multi-threaded environments.
static constexpr int LOCAL_LAYER
The local part is drawn on a UI layer, which every canvas keeps on its overlay.
This file is part of the common library.
#define _(s)
@ NO_RECURSE
Definition eda_item.h:52
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition frame_type.h:29
@ FRAME_FOOTPRINT_PREVIEW
Definition frame_type.h:44
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition idf_helpers.h:37
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer).
Definition layer_ids.h:196
@ LAYER_PAD_BK_NETNAMES
Definition layer_ids.h:197
@ LAYER_PAD_NETNAMES
Definition layer_ids.h:198
@ NETNAMES_LAYER_ID_START
Definition layer_ids.h:190
@ NETNAMES_LAYER_ID_END
Definition layer_ids.h:201
@ LAYER_VIA_NETNAMES
Definition layer_ids.h:199
#define BITMAP_LAYER_FOR(boardLayer)
Macros for getting the extra layers for a given board layer.
Definition layer_ids.h:392
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition layer_ids.h:205
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition layer_ids.h:844
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition layer_ids.h:867
#define POINT_LAYER_FOR(boardLayer)
Definition layer_ids.h:400
bool IsNonCopperLayer(int aLayerId)
Test whether a layer is a non copper layer.
Definition layer_ids.h:774
int GetNetnameLayer(int aLayer)
Return a netname layer corresponding to the given layer.
Definition layer_ids.h:918
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
Definition layer_ids.h:741
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition layer_ids.h:224
@ LAYER_GRID
Definition layer_ids.h:250
@ LAYER_DRILL_SYMBOL_START
Drill symbols, one channel per board layer.
Definition layer_ids.h:382
@ LAYER_POINTS
PCB reference/manual snap points visibility.
Definition layer_ids.h:317
@ GAL_LAYER_ID_START
Definition layer_ids.h:225
@ LAYER_LOCKED_ITEM_SHADOW
Shadow layer for locked items.
Definition layer_ids.h:303
@ LAYER_PAD_COPPER_START
Virtual layers for pad copper on a given copper layer.
Definition layer_ids.h:355
@ LAYER_VIA_HOLEWALLS
Definition layer_ids.h:294
@ LAYER_CLEARANCE_END
Definition layer_ids.h:364
@ LAYER_GRID_AXES
Definition layer_ids.h:251
@ LAYER_CONFLICTS_SHADOW
Shadow layer for items flagged conflicting.
Definition layer_ids.h:306
@ LAYER_FOOTPRINTS_FR
Show footprints on front.
Definition layer_ids.h:255
@ LAYER_ZONE_END
Definition layer_ids.h:352
@ LAYER_NON_PLATEDHOLES
Draw usual through hole vias.
Definition layer_ids.h:235
@ LAYER_VIA_STITCHING
Outline of via stitching generators.
Definition layer_ids.h:326
@ LAYER_DRAWINGSHEET
Sheet frame and title block.
Definition layer_ids.h:274
@ LAYER_FP_REFERENCES
Show footprints references (when texts are visible).
Definition layer_ids.h:262
@ LAYER_BOARD_OUTLINE_AREA
PCB board outline.
Definition layer_ids.h:314
@ LAYER_DRC_EXCLUSION
Layer for DRC markers which have been individually excluded.
Definition layer_ids.h:300
@ LAYER_POINT_END
Definition layer_ids.h:372
@ LAYER_DRC_HIGHLIGHTED
Color for highlighted DRC markers.
Definition layer_ids.h:337
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored).
Definition layer_ids.h:288
@ LAYER_DRC_WARNING
Layer for DRC markers with RPT_SEVERITY_WARNING.
Definition layer_ids.h:297
@ LAYER_UI_START
Definition layer_ids.h:375
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
Definition layer_ids.h:267
@ GAL_LAYER_ID_END
Definition layer_ids.h:385
@ LAYER_GP_OVERLAY
General purpose overlay.
Definition layer_ids.h:275
@ LAYER_VIA_COPPER_START
Virtual layers for via copper on a given copper layer.
Definition layer_ids.h:359
@ LAYER_CONSTRAINT_SHADOW
Shadow layer for items bound to a constraint.
Definition layer_ids.h:320
@ LAYER_ROUTER_PREVIEW_COLLISION
Router preview collision marker, drawn above all board items.
Definition layer_ids.h:348
@ LAYER_CURSOR
PCB cursor.
Definition layer_ids.h:278
@ LAYER_RATSNEST
Definition layer_ids.h:249
@ LAYER_CLEARANCE_START
Virtual layers for pad/via/track clearance outlines for a given copper layer.
Definition layer_ids.h:363
@ LAYER_ROUTER_PREVIEW_SHADOW
Router preview clearance shadow, drawn behind board copper.
Definition layer_ids.h:345
@ LAYER_DRILL_SYMBOL_END
Definition layer_ids.h:383
@ LAYER_PAD_COPPER_END
Definition layer_ids.h:356
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
Definition layer_ids.h:351
@ LAYER_FP_TEXT
Definition layer_ids.h:236
@ LAYER_FOOTPRINTS_BK
Show footprints on back.
Definition layer_ids.h:256
@ LAYER_UI_END
Definition layer_ids.h:376
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
Definition layer_ids.h:244
@ LAYER_VIA_BURIED
Draw blind vias.
Definition layer_ids.h:231
@ LAYER_VIA_COPPER_END
Definition layer_ids.h:360
@ LAYER_MARKER_SHADOWS
Shadows for DRC markers.
Definition layer_ids.h:301
@ LAYER_VIA_HOLES
Draw via holes (pad holes do not use this layer).
Definition layer_ids.h:270
@ LAYER_VIA_BLIND
Draw micro vias.
Definition layer_ids.h:230
@ LAYER_FP_VALUES
Show footprints values (when texts are visible).
Definition layer_ids.h:259
@ LAYER_POINT_START
Virtual layers for points per board layer.
Definition layer_ids.h:371
@ LAYER_VIA_MICROVIA
Definition layer_ids.h:229
@ LAYER_SELECT_OVERLAY
Selected items overlay.
Definition layer_ids.h:276
@ LAYER_VIA_THROUGH
Draw buried vias.
Definition layer_ids.h:232
@ LAYER_SUBGRIDS
Routing/placement subgrids (PCB_GRID_ITEM) visibility and color.
Definition layer_ids.h:323
@ LAYER_BITMAP_END
Definition layer_ids.h:368
@ LAYER_BITMAP_START
Virtual layers for background images per board layer.
Definition layer_ids.h:367
@ LAYER_DRC_ERROR
Layer for DRC markers with RPT_SEVERITY_ERROR.
Definition layer_ids.h:273
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
Definition layer_ids.h:228
@ LAYER_PAD_HOLEWALLS
Definition layer_ids.h:293
#define CLEARANCE_LAYER_FOR(boardLayer)
Definition layer_ids.h:396
#define DRILL_SYMBOL_LAYER_FOR(boardLayer)
Definition layer_ids.h:397
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
Definition layer_ids.h:933
#define VIA_COPPER_LAYER_FOR(boardLayer)
Definition layer_ids.h:395
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ User_16
Definition layer_ids.h:135
@ In22_Cu
Definition layer_ids.h:83
@ In11_Cu
Definition layer_ids.h:72
@ User_29
Definition layer_ids.h:148
@ In29_Cu
Definition layer_ids.h:90
@ In30_Cu
Definition layer_ids.h:91
@ User_40
Definition layer_ids.h:159
@ User_15
Definition layer_ids.h:134
@ User_8
Definition layer_ids.h:127
@ F_CrtYd
Definition layer_ids.h:112
@ User_11
Definition layer_ids.h:130
@ User_25
Definition layer_ids.h:144
@ In17_Cu
Definition layer_ids.h:78
@ User_34
Definition layer_ids.h:153
@ User_45
Definition layer_ids.h:164
@ B_Adhes
Definition layer_ids.h:99
@ User_36
Definition layer_ids.h:155
@ Edge_Cuts
Definition layer_ids.h:108
@ Dwgs_User
Definition layer_ids.h:103
@ F_Paste
Definition layer_ids.h:100
@ In9_Cu
Definition layer_ids.h:70
@ Cmts_User
Definition layer_ids.h:104
@ User_6
Definition layer_ids.h:125
@ User_7
Definition layer_ids.h:126
@ In19_Cu
Definition layer_ids.h:80
@ User_19
Definition layer_ids.h:138
@ User_23
Definition layer_ids.h:142
@ In7_Cu
Definition layer_ids.h:68
@ In28_Cu
Definition layer_ids.h:89
@ In26_Cu
Definition layer_ids.h:87
@ F_Adhes
Definition layer_ids.h:98
@ User_41
Definition layer_ids.h:160
@ B_Mask
Definition layer_ids.h:94
@ B_Cu
Definition layer_ids.h:61
@ User_14
Definition layer_ids.h:133
@ User_39
Definition layer_ids.h:158
@ User_5
Definition layer_ids.h:124
@ User_20
Definition layer_ids.h:139
@ Eco1_User
Definition layer_ids.h:105
@ F_Mask
Definition layer_ids.h:93
@ In21_Cu
Definition layer_ids.h:82
@ User_42
Definition layer_ids.h:161
@ User_43
Definition layer_ids.h:162
@ In23_Cu
Definition layer_ids.h:84
@ B_Paste
Definition layer_ids.h:101
@ In15_Cu
Definition layer_ids.h:76
@ In2_Cu
Definition layer_ids.h:63
@ User_10
Definition layer_ids.h:129
@ User_9
Definition layer_ids.h:128
@ User_27
Definition layer_ids.h:146
@ User_28
Definition layer_ids.h:147
@ F_Fab
Definition layer_ids.h:115
@ In10_Cu
Definition layer_ids.h:71
@ Margin
Definition layer_ids.h:109
@ F_SilkS
Definition layer_ids.h:96
@ In4_Cu
Definition layer_ids.h:65
@ B_CrtYd
Definition layer_ids.h:111
@ UNDEFINED_LAYER
Definition layer_ids.h:57
@ Eco2_User
Definition layer_ids.h:106
@ In16_Cu
Definition layer_ids.h:77
@ In24_Cu
Definition layer_ids.h:85
@ In1_Cu
Definition layer_ids.h:62
@ User_35
Definition layer_ids.h:154
@ User_31
Definition layer_ids.h:150
@ User_3
Definition layer_ids.h:122
@ User_1
Definition layer_ids.h:120
@ User_12
Definition layer_ids.h:131
@ B_SilkS
Definition layer_ids.h:97
@ User_30
Definition layer_ids.h:149
@ User_37
Definition layer_ids.h:156
@ User_22
Definition layer_ids.h:141
@ User_38
Definition layer_ids.h:157
@ In13_Cu
Definition layer_ids.h:74
@ User_4
Definition layer_ids.h:123
@ In8_Cu
Definition layer_ids.h:69
@ User_21
Definition layer_ids.h:140
@ In14_Cu
Definition layer_ids.h:75
@ User_24
Definition layer_ids.h:143
@ PCB_LAYER_ID_COUNT
Definition layer_ids.h:167
@ User_13
Definition layer_ids.h:132
@ User_2
Definition layer_ids.h:121
@ In12_Cu
Definition layer_ids.h:73
@ User_17
Definition layer_ids.h:136
@ In27_Cu
Definition layer_ids.h:88
@ In6_Cu
Definition layer_ids.h:67
@ In5_Cu
Definition layer_ids.h:66
@ User_33
Definition layer_ids.h:152
@ User_26
Definition layer_ids.h:145
@ In3_Cu
Definition layer_ids.h:64
@ User_32
Definition layer_ids.h:151
@ In20_Cu
Definition layer_ids.h:81
@ User_18
Definition layer_ids.h:137
@ User_44
Definition layer_ids.h:163
@ F_Cu
Definition layer_ids.h:60
@ In18_Cu
Definition layer_ids.h:79
@ In25_Cu
Definition layer_ids.h:86
@ B_Fab
Definition layer_ids.h:114
#define ZONE_LAYER_FOR(boardLayer)
Definition layer_ids.h:393
#define PAD_COPPER_LAYER_FOR(boardLayer)
Definition layer_ids.h:394
This file contains miscellaneous commonly used macros and functions.
RENDER_TARGET
RENDER_TARGET: Possible rendering targets.
Definition definitions.h:32
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
Definition definitions.h:34
@ TARGET_CACHED
Main rendering target (cached)
Definition definitions.h:33
@ TARGET_OVERLAY
Items that may change while the view stays the same (noncached)
Definition definitions.h:35
const int GAL_LAYER_ORDER[]
void ApplyPcbGalLayerOrder(KIGFX::VIEW *aView)
Apply pcbnew's canonical GAL layer order (copper and zones below silk, fab and courtyard) to any view...
void ApplyPcbGalLayerOrder(KIGFX::VIEW *aView)
Apply pcbnew's canonical GAL layer order (copper and zones below silk, fab and courtyard) to any view...
see class PGM_BASE
Class that computes missing connections on a PCB.
#define DEFAULT_THEME
COLOR_SETTINGS * GetColorSettings(const wxString &aName)
T * GetAppSettings(const char *aFilename)
Geometry of a regular grid (cartesian or polar) and the math operations for snapping and coverage tes...
VECTOR2D pitch
Cartesian: (dx, dy); polar: (dr, dPhi rad).
Render-time projection of a grid: GRID_GEOMETRY (kind/origin/pitch/orientation/extent) plus rendering...
bool snapCursor
Participate in the cursor snap (GAL::GetGridPoint).
unsigned tick
Major-tick interval (0 = inherit default).
bool highlighted
Render with edit-mode emphasis (selected grid).
@ PCB_CONSTRAINT_T
a geometric constraint between board items
Definition typeinfo.h:237
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:89
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:78
@ PCB_GRID_ITEM_T
a subgrid placed on a board
Definition typeinfo.h:238
WX_VIEW_CONTROLS class definition.
#define ZOOM_MAX_LIMIT_PCBNEW
#define ZOOM_MIN_LIMIT_PCBNEW