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>
29 #include <ws_proxy_view_item.h>
30 #include <ratsnest_viewitem.h>
31 #include <ratsnest_data.h>
33 
34 #include <colors_design_settings.h>
35 #include <class_board.h>
36 #include <class_module.h>
37 #include <class_track.h>
38 #include <class_marker_pcb.h>
39 #include <pcb_base_frame.h>
40 #include <confirm.h>
41 
43 
44 #include <functional>
45 #include <thread>
46 using namespace std::placeholders;
47 
49 {
52  LAYER_DRC,
55 
58 
63 
66 
97 
100 
103 };
104 
105 
106 PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
107  const wxPoint& aPosition, const wxSize& aSize,
108  KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
109  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
110 {
111  m_view = new KIGFX::PCB_VIEW( true );
112  m_view->SetGAL( m_gal );
113 
114  m_painter.reset( new KIGFX::PCB_PAINTER( m_gal ) );
115  m_view->SetPainter( m_painter.get() );
116 
119 
120  // View controls is the first in the event handler chain, so the Tool Framework operates
121  // on updated viewport data.
123 
124  // Load display options (such as filled/outline display of items).
125  // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
126  // which is not always the case (namely when it is used from a wxDialog like the pad editor)
127  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
128 
129  if( frame )
130  static_cast<KIGFX::PCB_VIEW*>( m_view )->UpdateDisplayOptions(
131  frame->GetDisplayOptions() );
132 }
133 
134 
136 {
137 }
138 
139 
141 {
142 
143  m_view->Clear();
144 
145  auto zones = aBoard->Zones();
146  std::atomic<size_t> next( 0 );
147  std::atomic<size_t> count_done( 0 );
148  size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
149 
150  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
151  {
152  std::thread t = std::thread( [ &count_done, &next, &zones ]( )
153  {
154  for( size_t i = next.fetch_add( 1 ); i < zones.size(); i = next.fetch_add( 1 ) )
155  zones[i]->CacheTriangulation();
156 
157  count_done++;
158  } );
159 
160  t.detach();
161  }
162 
163  if( m_worksheet )
164  m_worksheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
165 
166  // Load drawings
167  for( auto drawing : const_cast<BOARD*>(aBoard)->Drawings() )
168  m_view->Add( drawing );
169 
170  // Load tracks
171  for( auto track : aBoard->Tracks() )
172  m_view->Add( track );
173 
174  // Load modules and its additional elements
175  for( auto module : aBoard->Modules() )
176  m_view->Add( module );
177 
178  // DRC markers
179  for( int marker_idx = 0; marker_idx < aBoard->GetMARKERCount(); ++marker_idx )
180  {
181  m_view->Add( aBoard->GetMARKER( marker_idx ) );
182  }
183 
184  // Finalize the triangulation threads
185  while( count_done < parallelThreadCount )
186  std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
187 
188  // Load zones
189  for( auto zone : aBoard->Zones() )
190  m_view->Add( zone );
191 
192  // Ratsnest
193  m_ratsnest.reset( new KIGFX::RATSNEST_VIEWITEM( aBoard->GetConnectivity() ) );
194  m_view->Add( m_ratsnest.get() );
195 }
196 
197 
199 {
200  m_worksheet.reset( aWorksheet );
201  m_view->Add( m_worksheet.get() );
202 }
203 
204 
206 {
208  rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
209  rs->ImportLegacyColors( aSettings );
210  m_gal->SetGridColor( aSettings->GetLayerColor( LAYER_GRID ) );
211  m_gal->SetCursorColor( aSettings->GetItemColor( LAYER_CURSOR ) );
212 }
213 
214 
216 {
217  // Set display settings for high contrast mode
219 
220  SetTopLayer( aLayer );
221 
222  rSettings->ClearActiveLayers();
223  rSettings->SetActiveLayer( aLayer );
224 
225  if( IsCopperLayer( aLayer ) )
226  {
227  // Bring some other layers to the front in case of copper layers and make them colored
228  // fixme do not like the idea of storing the list of layers here,
229  // should be done in some other way I guess..
230  LAYER_NUM layers[] = {
231  GetNetnameLayer( aLayer ),
236  };
237 
238  for( unsigned int i : layers )
239  rSettings->SetActiveLayer( i );
240 
241  // Pads should be shown too
242  if( aLayer == B_Cu )
243  {
244  rSettings->SetActiveLayer( LAYER_PAD_BK );
245  rSettings->SetActiveLayer( LAYER_MOD_BK );
247  }
248  else if( aLayer == F_Cu )
249  {
250  rSettings->SetActiveLayer( LAYER_PAD_FR );
251  rSettings->SetActiveLayer( LAYER_MOD_FR );
253  }
254  }
255 
257 }
258 
259 
261 {
264  m_view->SetTopLayer( aLayer );
265 
266  // Layers that should always have on-top attribute enabled
267  const std::vector<LAYER_NUM> layers = {
272  };
273 
274  for( auto layer : layers )
275  m_view->SetTopLayer( layer );
276 
277  // Extra layers that are brought to the top if a F.* or B.* is selected
278  const std::vector<LAYER_NUM> frontLayers = {
281  };
282 
283  const std::vector<LAYER_NUM> backLayers = {
286  };
287 
288  const std::vector<LAYER_NUM>* extraLayers = NULL;
289 
290  // Bring a few more extra layers to the top depending on the selected board side
291  if( IsFrontLayer( aLayer ) )
292  extraLayers = &frontLayers;
293  else if( IsBackLayer( aLayer ) )
294  extraLayers = &backLayers;
295 
296  if( extraLayers )
297  {
298  for( auto layer : *extraLayers )
299  m_view->SetTopLayer( layer );
300 
301  // Move the active layer to the top
302  if( !IsCopperLayer( aLayer ) )
304  }
305  else if( IsCopperLayer( aLayer ) )
306  {
307  // Display labels for copper layers on the top
308  m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
309  }
310 
311  m_view->EnableTopLayer( true );
313 }
314 
315 
317 {
318  // Load layer & elements visibility settings
319  for( LAYER_NUM i = 0; i < PCB_LAYER_ID_COUNT; ++i )
321 
323  m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
324 
325  // Always enable netname layers, as their visibility is controlled by layer dependencies
327  m_view->SetLayerVisible( i, true );
328 
329  // Enable some layers that are GAL specific
335 }
336 
337 
338 void PCB_DRAW_PANEL_GAL::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector<MSG_PANEL_ITEM>& aList )
339 {
340  BOARD* board = static_cast<PCB_BASE_FRAME*>( m_parent )->GetBoard();
341  wxString txt;
342  int viasCount = 0;
343  int trackSegmentsCount = 0;
344 
345  for( auto item : board->Tracks() )
346  {
347  if( item->Type() == PCB_VIA_T )
348  viasCount++;
349  else
350  trackSegmentsCount++;
351  }
352 
353  txt.Printf( wxT( "%d" ), board->GetPadCount() );
354  aList.push_back( MSG_PANEL_ITEM( _( "Pads" ), txt, DARKGREEN ) );
355 
356  txt.Printf( wxT( "%d" ), viasCount );
357  aList.push_back( MSG_PANEL_ITEM( _( "Vias" ), txt, DARKGREEN ) );
358 
359  txt.Printf( wxT( "%d" ), trackSegmentsCount );
360  aList.push_back( MSG_PANEL_ITEM( _( "Track Segments" ), txt, DARKGREEN ) );
361 
362  txt.Printf( wxT( "%d" ), board->GetNodesCount() );
363  aList.push_back( MSG_PANEL_ITEM( _( "Nodes" ), txt, DARKCYAN ) );
364 
365  txt.Printf( wxT( "%d" ), board->GetNetCount() - 1 /* don't include "No Net" in count */ );
366  aList.push_back( MSG_PANEL_ITEM( _( "Nets" ), txt, RED ) );
367 
368  txt.Printf( wxT( "%d" ), board->GetConnectivity()->GetUnconnectedCount() );
369  aList.push_back( MSG_PANEL_ITEM( _( "Unrouted" ), txt, BLUE ) );
370 }
371 
372 
374 {
375  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParent() );
376 
377  try
378  {
379  // Check if the current rendering backend can be properly initialized
380  m_view->UpdateItems();
381  }
382  catch( const std::runtime_error& e )
383  {
384  // Fallback to software renderer
385  DisplayError( frame, e.what() );
387 
388  if( frame )
389  frame->ActivateGalCanvas();
390  }
391 
392  if( frame )
393  {
394  SetTopLayer( frame->GetActiveLayer() );
395  KIGFX::PAINTER* painter = m_view->GetPainter();
396  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
397  settings->LoadDisplayOptions( frame->GetDisplayOptions(), frame->ShowPageLimits() );
398  }
399 }
400 
401 
403 {
404  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
405  {
406  LAYER_NUM layer = GAL_LAYER_ORDER[i];
407  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
408 
409  m_view->SetLayerOrder( layer, i );
410  }
411 }
412 
413 
415 {
416  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
418  m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
419  return rv;
420 }
421 
422 
424 {
425  if( m_ratsnest )
426  m_view->Update( m_ratsnest.get() );
427 }
428 
429 
431 {
433  return m_worksheet->ViewBBox();
434 
435  return BOX2I();
436 }
437 
438 
440 {
441  // caching makes no sense for Cairo and other software renderers
443 
444  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
445  m_view->SetLayerTarget( i, target );
446 
447  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
448  {
449  LAYER_NUM layer = GAL_LAYER_ORDER[i];
450  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
451 
452  // Set layer display dependencies & targets
453  if( IsCopperLayer( layer ) )
454  m_view->SetRequired( GetNetnameLayer( layer ), layer );
455  else if( IsNetnameLayer( layer ) )
456  m_view->SetLayerDisplayOnly( layer );
457  }
458 
461 
462  // Some more required layers settings
468 
469  // Front modules
473 
474  // Back modules
478 
485 
490 }
491 
492 
494 {
495  return static_cast<KIGFX::PCB_VIEW*>( m_view );
496 }
Definition: colors.h:57
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:236
CITER next(CITER it)
Definition: ptree.cpp:130
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
to draw blind/buried vias
BOX2< VECTOR2I > BOX2I
Definition: box2.h:520
void setDefaultLayerDeps()
Sets rendering targets & dependencies for layers.
Class that draws missing connections on a PCB.
int GetMARKERCount() const
Function GetMARKERCount.
Definition: class_board.h:344
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:416
void SetLayerOrder(int aLayer, int aRenderingOrder)
Function SetLayerOrder() Sets rendering order of a particular layer.
Definition: view.cpp:664
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:860
Class RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output ...
Definition: painter.h:56
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.
Handle colors used to draw all items or layers.
Class 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.
Class that computes missing connections on a PCB.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
to draw via holes (pad holes do not use this layer)
show modules values (when texts are visibles)
void UpdateAllLayersOrder()
Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers.
Definition: view.cpp:927
Add new GAL layers here.
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:226
const wxString & GetFileName() const
Definition: class_board.h:216
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use Display options are relative to...
void ImportLegacyColors(const COLORS_DESIGN_SETTINGS *aSettings) override
Function ImportLegacyColors Loads a list of color settings for layers.
Definition: pcb_painter.cpp:79
virtual void EnableTopLayer(bool aEnable)
Function EnableTopLayer() Enables or disables display of the top layer.
Definition: view.cpp:887
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
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:701
void SetActiveLayer(int aLayerId, bool aEnabled=true)
Function SetActiveLayer Sets the specified layer as active - it means that it can be drawn in a speci...
Definition: painter.h:76
const LAYER_NUM GAL_LAYER_ORDER[]
Definitions for tracks, vias and zones.
bool ShowPageLimits() const
Auxiliary rendering target (noncached)
Definition: definitions.h:49
Classes used in Pcbnew, CvPcb and GerbView.
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
show modules on front
std::unique_ptr< KIGFX::RATSNEST_VIEWITEM > m_ratsnest
Ratsnest view item
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:48
Class PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:61
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Function SetLayerTarget() Changes the rendering target for a particular layer.
Definition: view.h:434
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
Markers used to show a drc problem on boards.
wxWindow * m_parent
Current mouse cursor shape id.
PCB_LAYER_ID
A quick note on layer IDs:
Class PAINTER contains all the knowledge about how to draw graphical object onto any particular outpu...
Definition: painter.h:313
virtual void ActivateGalCanvas() override
unsigned GetNodesCount(int aNet=-1)
Function GetNodesCount.
unsigned GetNetCount() const
Function GetNetCount.
Definition: class_board.h:767
void ClearActiveLayers()
Function ClearActiveLayers Clears the list of active layers.
Definition: painter.h:98
MODULES & Modules()
Definition: class_board.h:227
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:1111
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:422
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
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:301
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
Definition: colors.h:60
void SetLayerVisible(int aLayer, bool aVisible=true)
Function SetLayerVisible() Controls the visibility of a particular layer.
Definition: view.h:399
void UpdateItems()
Function UpdateItems() Iterates through the list of items that asked for updating and updates them.
Definition: view.cpp:1421
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 void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1540
#define _(s)
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
unsigned GetPadCount()
Function GetPadCount.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
BOX2I GetDefaultViewBBox() const override
void UseColorScheme(const COLORS_DESIGN_SETTINGS *aSettings)
Function UseColorScheme Applies layer color settings.
void ClearTopLayers()
Function ClearTopLayers() Removes all layers from the on-the-top set (they are no longer displayed ov...
Definition: view.cpp:912
virtual void SetHighContrastLayer(int aLayer) override
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
MARKER_PCB * GetMARKER(int index) const
Function GetMARKER returns the MARKER at a given index.
Definition: class_board.h:332
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
bool SwitchBackend(GAL_TYPE aGalType) override
Function SwitchBackend Switches method of rendering graphics.
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:450
ZONE_CONTAINERS & Zones()
Definition: class_board.h:241
smd pads, front layer
void SetWorksheet(KIGFX::WS_PROXY_VIEW_ITEM *aWorksheet)
Function SetWorksheet Sets (or updates) worksheet used by the draw panel.
Main rendering target (cached)
Definition: definitions.h:48
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
int GetLayerOrder(int aLayer) const
Function GetLayerOrder() Returns rendering order of a particular layer.
Definition: view.cpp:672
size_t i
Definition: json11.cpp:649
EDA_DRAW_FRAME * GetParentEDAFrame() const
Function GetParentEDAFrame() Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
currently selected items overlay
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer 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:189
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:346
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
virtual void SetTopLayer(int aLayer) override
Module description (excepted pads)
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:798
void SetGAL(GAL *aGal)
Function SetGAL() Assigns a rendering device for the VIEW.
Definition: view.cpp:519
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
EDA_UNITS_T
Definition: common.h:133
TRACKS & Tracks()
Definition: class_board.h:218
show modules references (when texts are visibles)
Additional netnames layers (not associated with a PCB layer)
bool IsNetnameLayer(LAYER_NUM aLayer)
Function IsNetnameLayer tests 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:416