KiCad PCB EDA Suite
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 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>
28 #include <view/wx_view_controls.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_base_frame.h>
39 #include <pcbnew_settings.h>
40 #include <ratsnest/ratsnest_data.h>
42 
43 #include <pgm_base.h>
45 #include <confirm.h>
46 #include <progress_reporter.h>
47 
49 #include <zoom_defines.h>
50 
51 #include <functional>
52 #include <memory>
53 #include <thread>
54 
55 using namespace std::placeholders;
56 
57 
59 {
64  Dwgs_User,
65  Cmts_User,
68 
78 
80 
87 
96 
127 
136 
138 };
139 
140 
141 PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
142  const wxPoint& aPosition, const wxSize& aSize,
143  KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
144  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
145 {
146  m_view = new KIGFX::PCB_VIEW( true );
147  m_view->SetGAL( m_gal );
148 
149  m_painter = std::make_unique<KIGFX::PCB_PAINTER>( m_gal );
150  m_view->SetPainter( m_painter.get() );
151 
152  // This fixes the zoom in and zoom out limits:
154 
157 
158  // View controls is the first in the event handler chain, so the Tool Framework operates
159  // on updated viewport data.
161 
162  // Load display options (such as filled/outline display of items).
163  // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
164  // which is not always the case (namely when it is used from a wxDialog like the pad editor)
165  if( !IsDialogPreview() )
166  {
167  KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( m_view );
168  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
169 
170  if( frame )
171  view->UpdateDisplayOptions( frame->GetDisplayOptions() );
172  }
173 }
174 
175 
177 {
178 }
179 
180 
182 {
183  m_view->Clear();
184 
185  auto zones = aBoard->Zones();
186  std::atomic<size_t> next( 0 );
187  std::atomic<size_t> count_done( 0 );
188  size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
189 
190  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
191  {
192  std::thread t = std::thread( [ &count_done, &next, &zones ]( )
193  {
194  for( size_t i = next.fetch_add( 1 ); i < zones.size(); i = next.fetch_add( 1 ) )
195  zones[i]->CacheTriangulation();
196 
197  count_done++;
198  } );
199 
200  t.detach();
201  }
202 
203  if( m_drawingSheet )
204  m_drawingSheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
205 
206  // Load drawings
207  for( BOARD_ITEM* drawing : aBoard->Drawings() )
208  m_view->Add( drawing );
209 
210  // Load tracks
211  for( PCB_TRACK* track : aBoard->Tracks() )
212  m_view->Add( track );
213 
214  // Load footprints and its additional elements
215  for( FOOTPRINT* footprint : aBoard->Footprints() )
216  m_view->Add( footprint );
217 
218  // DRC markers
219  for( PCB_MARKER* marker : aBoard->Markers() )
220  m_view->Add( marker );
221 
222  // Finalize the triangulation threads
223  while( count_done < parallelThreadCount )
224  {
225  if( aReporter )
226  aReporter->KeepRefreshing();
227 
228  std::this_thread::sleep_for( std::chrono::milliseconds( 30 ) );
229  }
230 
231  // Load zones
232  for( ZONE* zone : aBoard->Zones() )
233  m_view->Add( zone );
234 
235  // Ratsnest
236  m_ratsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aBoard->GetConnectivity() );
237  m_view->Add( m_ratsnest.get() );
238 }
239 
240 
242 {
243  m_drawingSheet.reset( aDrawingSheet );
244  m_view->Add( m_drawingSheet.get() );
245 }
246 
247 
249 {
250  COLOR_SETTINGS* cs = nullptr;
251 
252  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
253 
254  if( frame )
255  {
256  cs = frame->GetColorSettings();
257  }
258  else
259  {
260  PCBNEW_SETTINGS* app = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
261 
262  if( app )
263  cs = Pgm().GetSettingsManager().GetColorSettings( app->m_ColorTheme );
264  else
265  cs = Pgm().GetSettingsManager().GetColorSettings();
266  }
267 
268  wxCHECK_RET( cs, wxT( "null COLOR_SETTINGS" ) );
269 
270  auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
271  rs->LoadColors( cs );
272 
276 }
277 
278 
280 {
281  // Set display settings for high contrast mode
283 
284  SetTopLayer( aLayer );
285  rSettings->SetActiveLayer( aLayer );
286 
287  rSettings->ClearHighContrastLayers();
288  rSettings->SetLayerIsHighContrast( aLayer );
289 
290  if( IsCopperLayer( aLayer ) )
291  {
292  // Bring some other layers to the front in case of copper layers and make them colored
293  // fixme do not like the idea of storing the list of layers here,
294  // should be done in some other way I guess..
295  LAYER_NUM layers[] = {
298  ZONE_LAYER_FOR( aLayer ),
305  };
306 
307  for( unsigned int i : layers )
308  rSettings->SetLayerIsHighContrast( i );
309 
310  // Pads should be shown too
311  if( aLayer == B_Cu )
312  {
313  rSettings->SetLayerIsHighContrast( LAYER_PAD_BK );
314  rSettings->SetLayerIsHighContrast( LAYER_MOD_BK );
315  }
316  else if( aLayer == F_Cu )
317  {
318  rSettings->SetLayerIsHighContrast( LAYER_PAD_FR );
319  rSettings->SetLayerIsHighContrast( LAYER_MOD_FR );
320  }
321  }
322 
324 }
325 
326 
328 {
331  m_view->SetTopLayer( aLayer );
332 
333  // Layers that should always have on-top attribute enabled
334  const std::vector<LAYER_NUM> layers = {
343  };
344 
345  for( auto layer : layers )
346  m_view->SetTopLayer( layer );
347 
348  // Extra layers that are brought to the top if a F.* or B.* is selected
349  const std::vector<LAYER_NUM> frontLayers = {
352  };
353 
354  const std::vector<LAYER_NUM> backLayers = {
357  };
358 
359  const std::vector<LAYER_NUM>* extraLayers = nullptr;
360 
361  // Bring a few more extra layers to the top depending on the selected board side
362  if( IsFrontLayer( aLayer ) )
363  extraLayers = &frontLayers;
364  else if( IsBackLayer( aLayer ) )
365  extraLayers = &backLayers;
366 
367  if( extraLayers )
368  {
369  for( auto layer : *extraLayers )
370  {
371  m_view->SetTopLayer( layer );
372 
373  if( layer < PCB_LAYER_ID_COUNT )
374  m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
375  }
376 
377  // Move the active layer to the top of the stack but below all the overlay layers
378  if( !IsCopperLayer( aLayer ) )
379  {
381  m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ),
383 
384  // Fix up pad and via netnames to be below. This is hacky, we need a rethink
385  // of layer ordering...
390  }
391  }
392  else if( IsCopperLayer( aLayer ) )
393  {
394  // Display labels for copper layers on the top
395  m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
396  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
397  }
398  else
399  {
400  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
401  }
402 
403  m_view->EnableTopLayer( true );
405 }
406 
407 
409 {
410  // Load layer & elements visibility settings
411  for( LAYER_NUM i = 0; i < PCB_LAYER_ID_COUNT; ++i )
412  m_view->SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
413 
415  m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
416 
417  // Via layers controlled by dependencies
421 
422  // Pad layers controlled by dependencies
425 
426  // Always enable netname layers, as their visibility is controlled by layer dependencies
428  m_view->SetLayerVisible( i, true );
429 
430  for( LAYER_NUM i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
431  m_view->SetLayerVisible( i, true );
432 
433  // Enable some layers that are GAL specific
442 }
443 
444 
446  std::vector<MSG_PANEL_ITEM>& aList )
447 {
448  BOARD* board = static_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() )->GetBoard();
449  int padCount = 0;
450  int viaCount = 0;
451  int trackSegmentCount = 0;
452  std::set<int> netCodes;
453  int unconnected = board->GetConnectivity()->GetUnconnectedCount();
454 
455  for( PCB_TRACK* item : board->Tracks() )
456  {
457  if( item->Type() == PCB_VIA_T )
458  viaCount++;
459  else
460  trackSegmentCount++;
461 
462  if( item->GetNetCode() > 0 )
463  netCodes.insert( item->GetNetCode() );
464  }
465 
466  for( FOOTPRINT* footprint : board->Footprints() )
467  {
468  for( PAD* pad : footprint->Pads() )
469  {
470  padCount++;
471 
472  if( pad->GetNetCode() > 0 )
473  netCodes.insert( pad->GetNetCode() );
474  }
475  }
476 
477  aList.emplace_back( _( "Pads" ), wxString::Format( wxT( "%d" ), padCount ) );
478  aList.emplace_back( _( "Vias" ), wxString::Format( wxT( "%d" ), viaCount ) );
479  aList.emplace_back( _( "Track Segments" ), wxString::Format( wxT( "%d" ), trackSegmentCount ) );
480  aList.emplace_back( _( "Nets" ), wxString::Format( wxT( "%d" ), (int) netCodes.size() ) );
481  aList.emplace_back( _( "Unrouted" ), wxString::Format( wxT( "%d" ), unconnected ) );
482 }
483 
484 
486 {
487  PCB_BASE_FRAME* frame = nullptr;
488 
489  if( !IsDialogPreview() )
490  frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
491 
492  try
493  {
494  // Check if the current rendering back end can be properly initialized
495  m_view->UpdateItems();
496  }
497  catch( const std::runtime_error& e )
498  {
499  DisplayError( GetParent(), e.what() );
500 
501  // Use the fallback if we have one
502  if( GAL_FALLBACK != m_backend )
503  {
505 
506  if( frame )
507  frame->ActivateGalCanvas();
508  }
509  }
510 
511  if( frame )
512  {
513  SetTopLayer( frame->GetActiveLayer() );
514  KIGFX::PAINTER* painter = m_view->GetPainter();
515  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
516  settings->LoadDisplayOptions( frame->GetDisplayOptions(), frame->ShowPageLimits() );
517  }
518 }
519 
520 
522 {
523  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
524  {
525  LAYER_NUM layer = GAL_LAYER_ORDER[i];
526  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
527 
528  m_view->SetLayerOrder( layer, i );
529  }
530 }
531 
532 
534 {
535  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
537  m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
538  return rv;
539 }
540 
541 
543 {
544  if( m_ratsnest )
545  m_view->Update( m_ratsnest.get() );
546 }
547 
548 
550 {
552  return m_drawingSheet->ViewBBox();
553 
554  return BOX2I();
555 }
556 
557 
559 {
560  // caching makes no sense for Cairo and other software renderers
562 
563  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
564  m_view->SetLayerTarget( i, target );
565 
566  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
567  {
568  LAYER_NUM layer = GAL_LAYER_ORDER[i];
569  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
570 
571  // Set layer display dependencies & targets
572  if( IsCopperLayer( layer ) )
573  {
574  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
575  m_view->SetRequired( GetNetnameLayer( layer ), layer );
576  }
577  else if( IsNonCopperLayer( layer ) )
578  {
579  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
580  }
581  else if( IsNetnameLayer( layer ) )
582  {
583  m_view->SetLayerDisplayOnly( layer );
584  }
585  }
586 
589 
590  // Some more required layers settings
593 
594  // Holes can be independent of their host objects (cf: printing drill marks)
600 
601  // Via visibility
605 
606  // Pad visibility
610 
611  // Front footprints
614 
615  // Back footprints
618 
625 
634 
638 }
639 
640 
642 {
643  return static_cast<KIGFX::PCB_VIEW*>( m_view );
644 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:279
CITER next(CITER it)
Definition: ptree.cpp:126
void SetScaleLimits(double aMaximum, double aMinimum)
Set minimum and maximum values for scale.
Definition: view.h:304
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
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.
currently selected items overlay
Definition: layer_ids.h:226
smd pads, front layer
Definition: layer_ids.h:209
to draw micro vias
Definition: layer_ids.h:201
BOX2< VECTOR2I > BOX2I
Definition: box2.h:506
void setDefaultLayerDeps()
Currently used drawing-sheet.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
ZONES & Zones()
Definition: board.h:240
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:223
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Mark the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:390
void SetLayerOrder(int aLayer, int aRenderingOrder)
Set rendering order of a particular layer.
Definition: view.cpp:635
GAL_TYPE m_backend
Currently used GAL.
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:826
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
This file is part of the common library.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:237
An implementation of class VIEW_CONTROLS for wxWidgets library.
PCB cursor.
Definition: layer_ids.h:228
show footprints values (when texts are visible)
Definition: layer_ids.h:217
virtual bool SwitchBackend(GAL_TYPE aGalType)
Switch method of rendering graphics.
A progress reporter interface for use in multi-threaded environments.
void setDefaultLayerOrder()
< Reassign layer order to the initial settings.
MARKERS & Markers()
Definition: board.h:243
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:196
Class that computes missing connections on a PCB.
smd pads, back layer
Definition: layer_ids.h:210
Additional netnames layers (not associated with a PCB layer)
Definition: layer_ids.h:172
static constexpr GAL_TYPE GAL_FALLBACK
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:208
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:41
show footprints on back
Definition: layer_ids.h:216
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
Definition: view.cpp:893
#define ZONE_LAYER_FOR(copperLayer)
Macro for getting the zone layer for a given copper layer.
Definition: layer_ids.h:263
The base class for create windows for drawing purpose.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
const wxString & GetFileName() const
Definition: board.h:229
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
virtual void EnableTopLayer(bool aEnable)
Enable or disable display of the top layer.
Definition: view.cpp:853
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:222
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
WX_VIEW_CONTROLS class definition.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:711
const LAYER_NUM GAL_LAYER_ORDER[]
bool ShowPageLimits() const
Auxiliary rendering target (noncached)
Definition: definitions.h:49
This file contains miscellaneous commonly used macros and functions.
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:953
Classes used in Pcbnew, CvPcb and GerbView.
to draw usual through hole vias
Definition: layer_ids.h:203
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Called when the window is shown for the first time.
virtual COLOR_SETTINGS * GetColorSettings() const override
Helper to retrieve the current color settings.
virtual PCB_LAYER_ID GetActiveLayer() const
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Change the rendering target for a particular layer.
Definition: view.h:461
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Ratsnest view item.
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
Contains all the knowledge about how to draw graphical object onto any particular output device.
Definition: painter.h:57
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:204
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Definition: pcb_view.cpp:125
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:200
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:907
void Clear()
Remove all items from the view.
Definition: view.cpp:1100
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
shadows for drc markers
Definition: layer_ids.h:244
FOOTPRINTS & Footprints()
Definition: board.h:234
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:449
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
#define ZOOM_MAX_LIMIT_PCBNEW
Definition: zoom_defines.h:62
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:345
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)
show footprints on front
Definition: layer_ids.h:215
bool IsNonCopperLayer(LAYER_NUM aLayerId)
Test whether a layer is a non copper layer.
Definition: layer_ids.h:819
Virtual layers for stacking zones and tracks on a given copper layer.
Definition: layer_ids.h:253
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
#define _(s)
void SetLayerIsHighContrast(int aLayerId, bool aEnabled=true)
Set the specified layer as high-contrast.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:388
Handle a list of polygons defining a copper zone.
Definition: zone.h:56
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
Definition: view.cpp:1402
drawingsheet frame and titleblock
Definition: layer_ids.h:224
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:884
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
BOX2I GetDefaultViewBBox() const override
Return the bounding box of the view that should be used if model is not valid.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:808
void UpdateColors()
Update the color settings in the painter and GAL.
void ClearTopLayers()
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).
Definition: view.cpp:878
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:533
bool SwitchBackend(GAL_TYPE aGalType) override
Force refresh of the ratsnest visual representation.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
show footprints references (when texts are visible)
Definition: layer_ids.h:218
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
COLOR4D GetColor(int aLayer) const
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:473
see class PGM_BASE
multilayer pads, usually with holes
Definition: layer_ids.h:220
Main rendering target (cached)
Definition: definitions.h:48
to draw blind/buried vias
Definition: layer_ids.h:202
layer for drc markers which have been individually excluded
Definition: layer_ids.h:243
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
general purpose overlay
Definition: layer_ids.h:225
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
Definition: layer_ids.h:976
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:65
#define ZOOM_MIN_LIMIT_PCBNEW
Definition: zoom_defines.h:63
Definition: layer_ids.h:71
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition: view.cpp:643
EDA_DRAW_FRAME * GetParentEDAFrame() const
Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:242
void ClearHighContrastLayers()
Clear the list of active layers.
void SetPainter(PAINTER *aPainter)
Set the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:198
Color settings are a bit different than most of the settings objects in that there can be more than o...
to draw pad holes (plated)
Definition: layer_ids.h:221
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:36
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:320
virtual void SetTopLayer(int aLayer) override
SetTopLayer(), with some extra smarts for PCB.
void OnShow() override
Called when the window is shown for the first time.
Definition: pad.h:57
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:762
std::unique_ptr< RATSNEST_VIEW_ITEM > m_ratsnest
void SetActiveLayer(PCB_LAYER_ID aLayer)
void SetGAL(GAL *aGal)
Assign a rendering device for the VIEW.
Definition: view.cpp:493
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
DRAWINGS & Drawings()
Definition: board.h:237
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layer_ids.h:181
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
TRACKS & Tracks()
Definition: board.h:231
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:1570
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:405
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:184