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  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include "pcb_draw_panel_gal.h"
26 #include <pcb_view.h>
27 #include <view/wx_view_controls.h>
28 #include <pcb_painter.h>
31 
32 #include <class_board.h>
33 #include <class_module.h>
34 #include <class_track.h>
35 #include <class_marker_pcb.h>
36 #include <pcb_base_frame.h>
37 #include <pcbnew_settings.h>
38 #include <ratsnest/ratsnest_data.h>
40 
41 #include <pgm_base.h>
43 #include <confirm.h>
44 
46 
47 #include <functional>
48 #include <memory>
49 #include <thread>
50 using namespace std::placeholders;
51 
53 {
59 
65 
68 
73 
82 
113 
122 
125 };
126 
127 
128 PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
129  const wxPoint& aPosition, const wxSize& aSize,
130  KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
131  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
132 {
133  m_view = new KIGFX::PCB_VIEW( true );
134  m_view->SetGAL( m_gal );
135 
136  m_painter = std::make_unique<KIGFX::PCB_PAINTER>( m_gal );
137  m_view->SetPainter( m_painter.get() );
138 
141 
142  // View controls is the first in the event handler chain, so the Tool Framework operates
143  // on updated viewport data.
145 
146  // Load display options (such as filled/outline display of items).
147  // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
148  // which is not always the case (namely when it is used from a wxDialog like the pad editor)
149  if( !IsDialogPreview() )
150  {
151  KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( m_view );
152  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
153 
154  if( frame )
155  view->UpdateDisplayOptions( frame->GetDisplayOptions() );
156  }
157 }
158 
159 
161 {
162 }
163 
164 
166 {
167 
168  m_view->Clear();
169 
170  auto zones = aBoard->Zones();
171  std::atomic<size_t> next( 0 );
172  std::atomic<size_t> count_done( 0 );
173  size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
174 
175  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
176  {
177  std::thread t = std::thread( [ &count_done, &next, &zones ]( )
178  {
179  for( size_t i = next.fetch_add( 1 ); i < zones.size(); i = next.fetch_add( 1 ) )
180  zones[i]->CacheTriangulation();
181 
182  count_done++;
183  } );
184 
185  t.detach();
186  }
187 
188  if( m_worksheet )
189  m_worksheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
190 
191  // Load drawings
192  for( auto drawing : const_cast<BOARD*>(aBoard)->Drawings() )
193  m_view->Add( drawing );
194 
195  // Load tracks
196  for( auto track : aBoard->Tracks() )
197  m_view->Add( track );
198 
199  // Load footprints and its additional elements
200  for( auto module : aBoard->Modules() )
201  m_view->Add( module );
202 
203  // DRC markers
204  for( auto marker : aBoard->Markers() )
205  m_view->Add( marker );
206 
207  // Finalize the triangulation threads
208  while( count_done < parallelThreadCount )
209  std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
210 
211  // Load zones
212  for( auto zone : aBoard->Zones() )
213  m_view->Add( zone );
214 
215  // Ratsnest
216  m_ratsnest = std::make_unique<KIGFX::RATSNEST_VIEWITEM>( aBoard->GetConnectivity() );
217  m_view->Add( m_ratsnest.get() );
218 }
219 
220 
222 {
223  m_worksheet.reset( aWorksheet );
224  m_view->Add( m_worksheet.get() );
225 }
226 
227 
229 {
230  COLOR_SETTINGS* cs = nullptr;
231 
232  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
233 
234  if( frame )
235  {
236  cs = frame->GetColorSettings();
237  }
238  else
239  {
240  PCBNEW_SETTINGS* app = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
241 
242  if( app )
243  cs = Pgm().GetSettingsManager().GetColorSettings( app->m_ColorTheme );
244  else
245  cs = Pgm().GetSettingsManager().GetColorSettings();
246  }
247 
248  wxCHECK_RET( cs, "null COLOR_SETTINGS" );
249 
250  auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
251  rs->LoadColors( cs );
252 
256 }
257 
258 
260 {
261  // Set display settings for high contrast mode
263 
264  SetTopLayer( aLayer );
265  rSettings->SetActiveLayer( aLayer );
266 
267  rSettings->ClearHighContrastLayers();
268  rSettings->SetLayerIsHighContrast( aLayer );
269 
270  if( IsCopperLayer( aLayer ) )
271  {
272  // Bring some other layers to the front in case of copper layers and make them colored
273  // fixme do not like the idea of storing the list of layers here,
274  // should be done in some other way I guess..
275  LAYER_NUM layers[] = {
276  GetNetnameLayer( aLayer ),
277  ZONE_LAYER_FOR( aLayer ),
283  };
284 
285  for( unsigned int i : layers )
286  rSettings->SetLayerIsHighContrast( i );
287 
288  // Pads should be shown too
289  if( aLayer == B_Cu )
290  {
291  rSettings->SetLayerIsHighContrast( LAYER_PAD_BK );
292  rSettings->SetLayerIsHighContrast( LAYER_MOD_BK );
294  }
295  else if( aLayer == F_Cu )
296  {
297  rSettings->SetLayerIsHighContrast( LAYER_PAD_FR );
298  rSettings->SetLayerIsHighContrast( LAYER_MOD_FR );
300  }
301  }
302 
304 }
305 
306 
308 {
311  m_view->SetTopLayer( aLayer );
312 
313  // Layers that should always have on-top attribute enabled
314  const std::vector<LAYER_NUM> layers = {
319  };
320 
321  for( auto layer : layers )
322  m_view->SetTopLayer( layer );
323 
324  // Extra layers that are brought to the top if a F.* or B.* is selected
325  const std::vector<LAYER_NUM> frontLayers = {
328  };
329 
330  const std::vector<LAYER_NUM> backLayers = {
333  };
334 
335  const std::vector<LAYER_NUM>* extraLayers = NULL;
336 
337  // Bring a few more extra layers to the top depending on the selected board side
338  if( IsFrontLayer( aLayer ) )
339  extraLayers = &frontLayers;
340  else if( IsBackLayer( aLayer ) )
341  extraLayers = &backLayers;
342 
343  if( extraLayers )
344  {
345  for( auto layer : *extraLayers )
346  {
347  m_view->SetTopLayer( layer );
348 
349  if( layer < PCB_LAYER_ID_COUNT )
350  m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
351  }
352 
353  // Move the active layer to the top
354  if( !IsCopperLayer( aLayer ) )
355  {
357  m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ),
359  }
360  }
361  else if( IsCopperLayer( aLayer ) )
362  {
363  // Display labels for copper layers on the top
364  m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
365  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
366  }
367  else
368  {
369  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
370  }
371 
372  m_view->EnableTopLayer( true );
374 }
375 
376 
378 {
379  // Load layer & elements visibility settings
380  for( LAYER_NUM i = 0; i < PCB_LAYER_ID_COUNT; ++i )
381  m_view->SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
382 
384  m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
385 
386  // Via layers controlled by dependencies
390 
391  // Pad layers controlled by dependencies
395 
396  // Always enable netname layers, as their visibility is controlled by layer dependencies
398  m_view->SetLayerVisible( i, true );
399 
400  for( LAYER_NUM i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
401  m_view->SetLayerVisible( i, true );
402 
403  // Enable some layers that are GAL specific
410 }
411 
412 
414  std::vector<MSG_PANEL_ITEM>& aList )
415 {
416  BOARD* board = static_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() )->GetBoard();
417  wxString txt;
418  int viasCount = 0;
419  int trackSegmentsCount = 0;
420 
421  for( TRACK* item : board->Tracks() )
422  {
423  if( item->Type() == PCB_VIA_T )
424  viasCount++;
425  else
426  trackSegmentsCount++;
427  }
428 
429  txt.Printf( wxT( "%d" ), board->GetPadCount() );
430  aList.emplace_back( _( "Pads" ), txt, DARKGREEN );
431 
432  txt.Printf( wxT( "%d" ), viasCount );
433  aList.emplace_back( _( "Vias" ), txt, DARKGREEN );
434 
435  txt.Printf( wxT( "%d" ), trackSegmentsCount );
436  aList.emplace_back( _( "Track Segments" ), txt, DARKGREEN );
437 
438  txt.Printf( wxT( "%d" ), board->GetNodesCount() );
439  aList.emplace_back( _( "Nodes" ), txt, DARKCYAN );
440 
441  txt.Printf( wxT( "%d" ), board->GetNetCount() - 1 /* don't include "No Net" in count */ );
442  aList.emplace_back( _( "Nets" ), txt, RED );
443 
444  txt.Printf( wxT( "%d" ), board->GetConnectivity()->GetUnconnectedCount() );
445  aList.emplace_back( _( "Unrouted" ), txt, BLUE );
446 }
447 
448 
450 {
451  PCB_BASE_FRAME* frame = nullptr;
452 
453  if( !IsDialogPreview() )
454  frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
455 
456  try
457  {
458  // Check if the current rendering backend can be properly initialized
459  m_view->UpdateItems();
460  }
461  catch( const std::runtime_error& e )
462  {
463  DisplayError( GetParent(), e.what() );
464 
465  // Use the fallback if we have one
466  if( GAL_FALLBACK != m_backend )
467  {
469 
470  if( frame )
471  frame->ActivateGalCanvas();
472  }
473  }
474 
475  if( frame )
476  {
477  SetTopLayer( frame->GetActiveLayer() );
478  KIGFX::PAINTER* painter = m_view->GetPainter();
479  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
480  settings->LoadDisplayOptions( frame->GetDisplayOptions(), frame->ShowPageLimits() );
481  }
482 }
483 
484 
486 {
487  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
488  {
489  LAYER_NUM layer = GAL_LAYER_ORDER[i];
490  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
491 
492  m_view->SetLayerOrder( layer, i );
493  }
494 }
495 
496 
498 {
499  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
501  m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
502  return rv;
503 }
504 
505 
507 {
508  if( m_ratsnest )
509  m_view->Update( m_ratsnest.get() );
510 }
511 
512 
514 {
516  return m_worksheet->ViewBBox();
517 
518  return BOX2I();
519 }
520 
521 
523 {
524  // caching makes no sense for Cairo and other software renderers
526 
527  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
528  m_view->SetLayerTarget( i, target );
529 
530  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
531  {
532  LAYER_NUM layer = GAL_LAYER_ORDER[i];
533  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
534 
535  // Set layer display dependencies & targets
536  if( IsCopperLayer( layer ) )
537  {
538  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
539  m_view->SetRequired( GetNetnameLayer( layer ), layer );
540  }
541  else if( IsNonCopperLayer( layer ) )
542  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
543  else if( IsNetnameLayer( layer ) )
544  m_view->SetLayerDisplayOnly( layer );
545  }
546 
549 
550  // Some more required layers settings
553 
554  // Holes can be independent of their host objects (cf: printing drill marks)
558 
559  // Via visibility
563 
564  // Pad visibility
568 
569  // Front footprints
573 
574  // Back footprints
578 
585 
594 
598 }
599 
600 
602 {
603  return static_cast<KIGFX::PCB_VIEW*>( m_view );
604 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:240
CITER next(CITER it)
Definition: ptree.cpp:126
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
Virtual layers for stacking zones and tracks on a given copper layer.
to draw blind/buried vias
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
void setDefaultLayerDeps()
Sets rendering targets & dependencies for layers.
Class that draws missing connections on a PCB.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Function SetRequired() Marks the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:397
void SetLayerOrder(int aLayer, int aRenderingOrder)
Function SetLayerOrder() Sets rendering order of a particular layer.
Definition: view.cpp:645
GAL_TYPE m_backend
Currently used GAL.
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Function SetTopLayer() Sets given layer to be displayed on the top or sets back the default order of ...
Definition: view.cpp:838
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
multilayer pads, usually with holes
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
This file is part of the common library.
#define ZONE_LAYER_FOR(copperLayer)
Macro for getting the zone layer for a given copper layer.
WX_VIEW_CONTROLS is a specific implementation of class VIEW_CONTROLS for wxWidgets library.
virtual bool SwitchBackend(GAL_TYPE aGalType)
Function SwitchBackend Switches method of rendering graphics.
handle color for not plated holes (holes, not pads)
anchor of items having an anchor point (texts, footprints)
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
void setDefaultLayerOrder()
Reassigns layer order to the initial settings.
virtual COLOR_SETTINGS * GetColorSettings() override
Helper to retrieve the current color settings.
MARKERS & Markers()
Definition: class_board.h:293
Class that computes missing connections on a PCB.
static constexpr GAL_TYPE GAL_FALLBACK
show footprints on back
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
to draw via holes (pad holes do not use this layer)
show footprints values (when texts are visibles)
void UpdateAllLayersOrder()
Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers.
Definition: view.cpp:905
Add new GAL layers here.
The base class for create windows for drawing purpose.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:102
const wxString & GetFileName() const
Definition: class_board.h:279
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions Display options control the way tracks, vias, outlines and other things ar...
virtual void EnableTopLayer(bool aEnable)
Function EnableTopLayer() Enables or disables display of the top layer.
Definition: view.cpp:865
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:201
WX_VIEW_CONTROLS class definition.
void RedrawRatsnest()
Forces refresh of the ratsnest visual representation
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:694
const LAYER_NUM GAL_LAYER_ORDER[]
A single base class (TRACK) represents both tracks and vias, with subclasses for curved tracks (ARC) ...
bool IsNonCopperLayer(LAYER_NUM aLayerId)
Test whether a layer is a non copper layer.
bool ShowPageLimits() const
Auxiliary rendering target (noncached)
Definition: definitions.h:49
Classes used in Pcbnew, CvPcb and GerbView.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
show footprints on front
std::unique_ptr< KIGFX::RATSNEST_VIEWITEM > m_ratsnest
Ratsnest view item
virtual PCB_LAYER_ID GetActiveLayer() const
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:95
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Function SetLayerTarget() Changes the rendering target for a particular layer.
Definition: view.h:420
unsigned GetNodesCount(int aNet=-1) const
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
Markers used to show a drc problem on boards.
PCB_LAYER_ID
A quick note on layer IDs:
PAINTER contains all the knowledge about how to draw graphical object onto any particular output devi...
Definition: painter.h:57
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Definition: pcb_view.cpp:117
virtual void ActivateGalCanvas() override
#define NULL
unsigned GetNetCount() const
Definition: class_board.h:755
MODULES & Modules()
Definition: class_board.h:284
void DisplayBoard(BOARD *aBoard)
Function DisplayBoard adds all items from the current board to the VIEW, so they can be displayed by ...
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1089
unsigned GetPadCount() const
std::unique_ptr< KIGFX::WS_PROXY_VIEW_ITEM > m_worksheet
Currently used worksheet
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:408
Meta control for all pads opacity/visibility (color ignored)
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
to draw usual through hole vias
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: class_board.h:381
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)
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
void SetLayerIsHighContrast(int aLayerId, bool aEnabled=true)
Function SetLayerIsHighContrast Sets the specified layer as high-contrast.
void SetLayerVisible(int aLayer, bool aVisible=true)
Function SetLayerVisible() Controls the visibility of a particular layer.
Definition: view.h:385
void UpdateItems()
Function UpdateItems() Iterates through the list of items that asked for updating and updates them.
Definition: view.cpp:1394
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SyncLayersVisibility(const BOARD *aBoard)
Function SyncLayersVisibility Updates "visibility" property of each layer of a given BOARD.
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Definition: color4d.h:60
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
BOX2I GetDefaultViewBBox() const override
void UpdateColors()
Updates the color settings in the painter and GAL.
void ClearTopLayers()
Function ClearTopLayers() Removes all layers from the on-the-top set (they are no longer displayed ov...
Definition: view.cpp:890
virtual void SetHighContrastLayer(int aLayer) override
int LAYER_NUM
This can be replaced with int and removed.
layer for drc markers which have been individually excluded
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
bool SwitchBackend(GAL_TYPE aGalType) override
Function SwitchBackend Switches method of rendering graphics.
layer for drc markers with SEVERITY_WARNING
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns 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: color4d.h:57
ZONE_CONTAINERS & Zones()
Definition: class_board.h:290
smd pads, front layer
see class PGM_BASE
void SetWorksheet(KIGFX::WS_PROXY_VIEW_ITEM *aWorksheet)
Function SetWorksheet Sets (or updates) worksheet used by the draw panel.
Meta control for all vias opacity/visibility.
Main rendering target (cached)
Definition: definitions.h:48
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:186
#define _(s)
Definition: 3d_actions.cpp:33
int GetLayerOrder(int aLayer) const
Function GetLayerOrder() Returns rendering order of a particular layer.
Definition: view.cpp:653
EDA_DRAW_FRAME * GetParentEDAFrame() const
Function GetParentEDAFrame() Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
currently selected items overlay
void ClearHighContrastLayers()
Function ClearHighContrastLayers Clears the list of active layers.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void SetPainter(PAINTER *aPainter)
Function SetPainter() Sets the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:191
Color settings are a bit different than most of the settings objects in that there can be more than o...
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:327
virtual void SetTopLayer(int aLayer) override
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:776
void SetActiveLayer(PCB_LAYER_ID aLayer)
void SetGAL(GAL *aGal)
Function SetGAL() Assigns a rendering device for the VIEW.
Definition: view.cpp:500
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
TRACKS & Tracks()
Definition: class_board.h:281
show footprints references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR
Additional netnames layers (not associated with a PCB layer)
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1513
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
bool IsLayerVisible(int aLayer) const
Function IsLayerVisible() Returns information about visibility of a particular layer.
Definition: view.h:402
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:176