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 <worksheet_viewitem.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 using namespace std::placeholders;
46 
48 {
50  LAYER_DRC,
54 
57 
62 
65 
96 
99 
102 };
103 
104 
105 PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
106  const wxPoint& aPosition, const wxSize& aSize,
107  KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
108  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
109 {
110  m_view = new KIGFX::PCB_VIEW( true );
111  m_view->SetGAL( m_gal );
112 
113  m_painter.reset( new KIGFX::PCB_PAINTER( m_gal ) );
114  m_view->SetPainter( m_painter.get() );
115 
118 
119  // View controls is the first in the event handler chain, so the Tool Framework operates
120  // on updated viewport data.
122 
123  // Load display options (such as filled/outline display of items).
124  // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
125  // which is not always the case (namely when it is used from a wxDialog like the pad editor)
127 
128  if( frame )
129  {
130  auto opts = (PCB_DISPLAY_OPTIONS*) frame->GetDisplayOptions();
131  static_cast<KIGFX::PCB_VIEW*>( m_view )->UpdateDisplayOptions( opts );
132  }
133 }
134 
135 
137 {
138 }
139 
140 
142 {
143 
144  m_view->Clear();
145 
146  auto zones = aBoard->Zones();
147  std::atomic<size_t> next( 0 );
148  std::atomic<size_t> count_done( 0 );
149  size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
150 
151  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
152  {
153  std::thread t = std::thread( [ &count_done, &next, &zones ]( )
154  {
155  for( size_t i = next.fetch_add( 1 ); i < zones.size(); i = next.fetch_add( 1 ) )
156  zones[i]->CacheTriangulation();
157 
158  count_done++;
159  } );
160 
161  t.detach();
162  }
163 
164  if( m_worksheet )
165  m_worksheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
166 
167  // Load drawings
168  for( auto drawing : const_cast<BOARD*>(aBoard)->Drawings() )
169  m_view->Add( drawing );
170 
171  // Load tracks
172  for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
173  m_view->Add( track );
174 
175  // Load modules and its additional elements
176  for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
177  m_view->Add( module );
178 
179  // Segzones (deprecated, equivalent of ZONE_CONTAINERfilled areas for very old boards)
180  for( SEGZONE* zone = aBoard->m_SegZoneDeprecated; zone; zone = zone->Next() )
181  m_view->Add( zone );
182 
183  // DRC markers
184  for( int marker_idx = 0; marker_idx < aBoard->GetMARKERCount(); ++marker_idx )
185  {
186  m_view->Add( aBoard->GetMARKER( marker_idx ) );
187  }
188 
189  // Finalize the triangulation threads
190  while( count_done < parallelThreadCount )
191  std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
192 
193  // Load zones
194  for( auto zone : aBoard->Zones() )
195  m_view->Add( zone );
196 
197  // Ratsnest
198  m_ratsnest.reset( new KIGFX::RATSNEST_VIEWITEM( aBoard->GetConnectivity() ) );
199  m_view->Add( m_ratsnest.get() );
200 }
201 
202 
204 {
205  m_worksheet.reset( aWorksheet );
206  m_view->Add( m_worksheet.get() );
207 }
208 
209 
211 {
213  rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
214  rs->ImportLegacyColors( aSettings );
215  m_gal->SetGridColor( aSettings->GetLayerColor( LAYER_GRID ) );
216  m_gal->SetCursorColor( aSettings->GetItemColor( LAYER_CURSOR ) );
217 }
218 
219 
221 {
222  // Set display settings for high contrast mode
224 
225  SetTopLayer( aLayer );
226 
227  rSettings->ClearActiveLayers();
228  rSettings->SetActiveLayer( aLayer );
229 
230  if( IsCopperLayer( aLayer ) )
231  {
232  // Bring some other layers to the front in case of copper layers and make them colored
233  // fixme do not like the idea of storing the list of layers here,
234  // should be done in some other way I guess..
235  LAYER_NUM layers[] = {
236  GetNetnameLayer( aLayer ),
241  };
242 
243  for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i )
244  rSettings->SetActiveLayer( layers[i] );
245 
246  // Pads should be shown too
247  if( aLayer == B_Cu )
248  {
249  rSettings->SetActiveLayer( LAYER_PAD_BK );
250  rSettings->SetActiveLayer( LAYER_MOD_BK );
252  }
253  else if( aLayer == F_Cu )
254  {
255  rSettings->SetActiveLayer( LAYER_PAD_FR );
256  rSettings->SetActiveLayer( LAYER_MOD_FR );
258  }
259  }
260 
262 }
263 
264 
266 {
269  m_view->SetTopLayer( aLayer );
270 
271  // Layers that should always have on-top attribute enabled
272  const LAYER_NUM layers[] = {
277  };
278 
279  for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i )
280  m_view->SetTopLayer( layers[i] );
281 
282  // Extra layers that are brought to the top if a F.* or B.* is selected
283  const LAYER_NUM frontLayers[] = {
286  };
287 
288  const LAYER_NUM backLayers[] = {
291  };
292 
293  const LAYER_NUM* extraLayers = NULL;
294 
295  // Bring a few more extra layers to the top depending on the selected board side
296  if( IsFrontLayer( aLayer ) )
297  extraLayers = frontLayers;
298  else if( IsBackLayer( aLayer ) )
299  extraLayers = backLayers;
300 
301  if( extraLayers )
302  {
303  const LAYER_NUM* l = extraLayers;
304 
305  while( *l >= 0 )
306  m_view->SetTopLayer( *l++ );
307 
308  // Move the active layer to the top
309  if( !IsCopperLayer( aLayer ) )
311  }
312  else if( IsCopperLayer( aLayer ) )
313  {
314  // Display labels for copper layers on the top
315  m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
316  }
317 
319 }
320 
321 
323 {
324  // Load layer & elements visibility settings
325  for( LAYER_NUM i = 0; i < PCB_LAYER_ID_COUNT; ++i )
327 
329  m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
330 
331  // Always enable netname layers, as their visibility is controlled by layer dependencies
333  m_view->SetLayerVisible( i, true );
334 
335  // Enable some layers that are GAL specific
340 }
341 
342 
343 void PCB_DRAW_PANEL_GAL::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector<MSG_PANEL_ITEM>& aList )
344 {
345  BOARD* board = static_cast<PCB_BASE_FRAME*>( m_parent )->GetBoard();
346  wxString txt;
347  int viasCount = 0;
348  int trackSegmentsCount = 0;
349 
350  for( const BOARD_ITEM* item = board->m_Track; item; item = item->Next() )
351  {
352  if( item->Type() == PCB_VIA_T )
353  viasCount++;
354  else
355  trackSegmentsCount++;
356  }
357 
358  txt.Printf( wxT( "%d" ), board->GetPadCount() );
359  aList.push_back( MSG_PANEL_ITEM( _( "Pads" ), txt, DARKGREEN ) );
360 
361  txt.Printf( wxT( "%d" ), viasCount );
362  aList.push_back( MSG_PANEL_ITEM( _( "Vias" ), txt, DARKGREEN ) );
363 
364  txt.Printf( wxT( "%d" ), trackSegmentsCount );
365  aList.push_back( MSG_PANEL_ITEM( _( "Track Segments" ), txt, DARKGREEN ) );
366 
367  txt.Printf( wxT( "%d" ), board->GetNodesCount() );
368  aList.push_back( MSG_PANEL_ITEM( _( "Nodes" ), txt, DARKCYAN ) );
369 
370  txt.Printf( wxT( "%d" ), board->GetNetCount() - 1 /* don't include "No Net" in count */ );
371  aList.push_back( MSG_PANEL_ITEM( _( "Nets" ), txt, RED ) );
372 
373  txt.Printf( wxT( "%d" ), board->GetConnectivity()->GetUnconnectedCount() );
374  aList.push_back( MSG_PANEL_ITEM( _( "Unrouted" ), txt, BLUE ) );
375 }
376 
377 
379 {
380  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParent() );
381 
382  try
383  {
384  // Check if the current rendering backend can be properly initialized
385  m_view->UpdateItems();
386  }
387  catch( const std::runtime_error& e )
388  {
389  // Fallback to software renderer
390  DisplayError( frame, e.what() );
391  bool use_gal = SwitchBackend( GAL_TYPE_CAIRO );
392 
393  if( frame )
394  frame->UseGalCanvas( use_gal );
395  }
396 
397  if( frame )
398  {
399  SetTopLayer( frame->GetActiveLayer() );
401  KIGFX::PAINTER* painter = m_view->GetPainter();
402  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
403  settings->LoadDisplayOptions( displ_opts, frame->ShowPageLimits() );
404  }
405 }
406 
407 
409 {
410  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
411  {
412  LAYER_NUM layer = GAL_LAYER_ORDER[i];
413  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
414 
415  m_view->SetLayerOrder( layer, i );
416  }
417 }
418 
419 
421 {
422  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
424  m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
425  return rv;
426 }
427 
428 
430 {
431  if( m_ratsnest )
432  m_view->Update( m_ratsnest.get() );
433 }
434 
435 
437 {
438  if( m_worksheet )
439  return m_worksheet->ViewBBox();
440 
441  return BOX2I();
442 }
443 
444 
446 {
447  // caching makes no sense for Cairo and other software renderers
449 
450  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
451  m_view->SetLayerTarget( i, target );
452 
453  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
454  {
455  LAYER_NUM layer = GAL_LAYER_ORDER[i];
456  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
457 
458  // Set layer display dependencies & targets
459  if( IsCopperLayer( layer ) )
460  m_view->SetRequired( GetNetnameLayer( layer ), layer );
461  else if( IsNetnameLayer( layer ) )
462  m_view->SetLayerDisplayOnly( layer );
463  }
464 
467 
468  // Some more required layers settings
474 
475  // Front modules
479 
480  // Back modules
484 
491 
496 }
497 
498 
500 {
501  return static_cast<KIGFX::PCB_VIEW*>( m_view );
502 }
bool ShowPageLimits() const
Definition: draw_frame.h:385
void SetWorksheet(KIGFX::WORKSHEET_VIEWITEM *aWorksheet)
Function SetWorksheet Sets (or updates) worksheet used by the draw panel.
Definition: colors.h:57
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
MARKER_PCB * GetMARKER(int index) const
Function GetMARKER returns the MARKER at a given index.
Definition: class_board.h:327
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:414
void SetLayerOrder(int aLayer, int aRenderingOrder)
Function SetLayerOrder() Sets rendering order of a particular layer.
Definition: view.cpp:661
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:857
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 BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
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&#39;s a back layer.
void setDefaultLayerOrder()
Reassigns layer order to the initial settings.
EDA_DRAW_FRAME * GetParentEDAFrame() const
Function GetParentEDAFrame() Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
Class BOARD to handle a board.
Class that computes missing connections on a PCB.
MODULE * Next() const
Definition: class_module.h:123
show modules on back
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)
std::unique_ptr< KIGFX::WORKSHEET_VIEWITEM > m_worksheet
Currently used worksheet
void UpdateAllLayersOrder()
Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers...
Definition: view.cpp:924
Add new GAL layers here.
The base class for create windows for drawing purpose.
Definition: draw_frame.h:78
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:211
void ImportLegacyColors(const COLORS_DESIGN_SETTINGS *aSettings) override
Function ImportLegacyColors Loads a list of color settings for layers.
Definition: pcb_painter.cpp:76
smd pads, back layer
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:699
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[]
Functions relatives to tracks, vias and segments used to fill zones.
KIGFX::PCB_VIEW * view() const
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
Auxiliary rendering target (noncached)
Definition: definitions.h:42
virtual void UseGalCanvas(bool aEnable) override
>
SEGZONE * Next() const
Definition: class_track.h:363
Classes used in Pcbnew, CvPcb and GerbView.
show modules on front
std::unique_ptr< KIGFX::RATSNEST_VIEWITEM > m_ratsnest
Ratsnest view item
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
Class that handles properties and drawing of worksheet layout.
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
Class PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:62
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Function SetLayerTarget() Changes the rendering target for a particular layer.
Definition: view.h:445
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
Markers used to show a drc problem on boards.
wxWindow * m_parent
Pointer to the parent window.
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings...
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:308
unsigned GetNodesCount(int aNet=-1)
Function GetNodesCount.
void ClearActiveLayers()
Function ClearActiveLayers Clears the list of active layers.
Definition: painter.h:98
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:1108
const wxString & GetFileName() const
Definition: class_board.h:237
int GetLayerOrder(int aLayer) const
Function GetLayerOrder() Returns rendering order of a particular layer.
Definition: view.cpp:669
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
DLIST< SEGZONE > m_SegZoneDeprecated
Definition: class_board.h:250
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:433
to draw usual through hole vias
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:43
general purpose overlay
Definition: colors.h:60
void SetLayerVisible(int aLayer, bool aVisible=true)
Function SetLayerVisible() Controls the visibility of a particular layer.
Definition: view.h:410
void UpdateItems()
Function UpdateItems() Iterates through the list of items that asked for updating and updates them...
Definition: view.cpp:1411
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
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:1530
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:909
virtual void SetHighContrastLayer(int aLayer) override
>
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
BOARD * GetBoard()
bool SwitchBackend(GAL_TYPE aGalType) override
Function SwitchBackend Switches method of rendering graphics.
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS *aOptions, bool aShowPageLimits)
Function LoadDisplayOptions Loads settings related to display options (high-contrast mode...
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it&#39;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 IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
ZONE_CONTAINERS & Zones()
Definition: class_board.h:256
TRACK * Next() const
Definition: class_track.h:99
smd pads, front layer
Main rendering target (cached)
Definition: definitions.h:41
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:170
DLIST< MODULE > m_Modules
Definition: class_board.h:248
size_t i
Definition: json11.cpp:597
currently selected items overlay
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
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:96
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:344
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
>
DLIST< TRACK > m_Track
Definition: class_board.h:249
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 OnShow() override
>
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:795
void SetGAL(GAL *aGal)
Function SetGAL() Assigns a rendering device for the VIEW.
Definition: view.cpp:517
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:296
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
EDA_UNITS_T
Definition: common.h:159
virtual void * GetDisplayOptions()
A way to pass info to draw functions.
Definition: draw_frame.h:941
show modules references (when texts are visibles)
Additional netnames layers (not associated with a PCB layer)
int GetMARKERCount() const
Function GetMARKERCount.
Definition: class_board.h:339
bool IsNetnameLayer(LAYER_NUM aLayer)
Function IsNetnameLayer tests whether a layer is a netname layer.
unsigned GetNetCount() const
Function GetNetCount.
Definition: class_board.h:779
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:457