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 <board.h>
33 #include <footprint.h>
34 #include <pcb_track.h>
35 #include <macros.h>
36 #include <pcb_marker.h>
37 #include <pcb_base_frame.h>
38 #include <pcbnew_settings.h>
39 #include <ratsnest/ratsnest_data.h>
41 
42 #include <pgm_base.h>
44 #include <confirm.h>
45 
47 #include <zoom_defines.h>
48 
49 #include <functional>
50 #include <memory>
51 #include <thread>
52 
53 using namespace std::placeholders;
54 
56 {
61  Dwgs_User,
62  Cmts_User,
65 
75 
78 
85 
94 
125 
134 
137 };
138 
139 
140 PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
141  const wxPoint& aPosition, const wxSize& aSize,
142  KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
143  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
144 {
145  m_view = new KIGFX::PCB_VIEW( true );
146  m_view->SetGAL( m_gal );
147 
148  m_painter = std::make_unique<KIGFX::PCB_PAINTER>( m_gal );
149  m_view->SetPainter( m_painter.get() );
150  // This fixes the zoom in and zoom out limits:
152 
155 
156  // View controls is the first in the event handler chain, so the Tool Framework operates
157  // on updated viewport data.
159 
160  // Load display options (such as filled/outline display of items).
161  // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
162  // which is not always the case (namely when it is used from a wxDialog like the pad editor)
163  if( !IsDialogPreview() )
164  {
165  KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( m_view );
166  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
167 
168  if( frame )
169  view->UpdateDisplayOptions( frame->GetDisplayOptions() );
170  }
171 }
172 
173 
175 {
176 }
177 
178 
180 {
181 
182  m_view->Clear();
183 
184  auto zones = aBoard->Zones();
185  std::atomic<size_t> next( 0 );
186  std::atomic<size_t> count_done( 0 );
187  size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
188 
189  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
190  {
191  std::thread t = std::thread( [ &count_done, &next, &zones ]( )
192  {
193  for( size_t i = next.fetch_add( 1 ); i < zones.size(); i = next.fetch_add( 1 ) )
194  zones[i]->CacheTriangulation();
195 
196  count_done++;
197  } );
198 
199  t.detach();
200  }
201 
202  if( m_drawingSheet )
203  m_drawingSheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
204 
205  // Load drawings
206  for( BOARD_ITEM* drawing : aBoard->Drawings() )
207  m_view->Add( drawing );
208 
209  // Load tracks
210  for( PCB_TRACK* track : aBoard->Tracks() )
211  m_view->Add( track );
212 
213  // Load footprints and its additional elements
214  for( FOOTPRINT* footprint : aBoard->Footprints() )
215  m_view->Add( footprint );
216 
217  // DRC markers
218  for( PCB_MARKER* marker : aBoard->Markers() )
219  m_view->Add( marker );
220 
221  // Finalize the triangulation threads
222  while( count_done < parallelThreadCount )
223  std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
224 
225  // Load zones
226  for( ZONE* zone : aBoard->Zones() )
227  m_view->Add( zone );
228 
229  // Ratsnest
230  m_ratsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aBoard->GetConnectivity() );
231  m_view->Add( m_ratsnest.get() );
232 }
233 
234 
236 {
237  m_drawingSheet.reset( aDrawingSheet );
238  m_view->Add( m_drawingSheet.get() );
239 }
240 
241 
243 {
244  COLOR_SETTINGS* cs = nullptr;
245 
246  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
247 
248  if( frame )
249  {
250  cs = frame->GetColorSettings();
251  }
252  else
253  {
254  PCBNEW_SETTINGS* app = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
255 
256  if( app )
257  cs = Pgm().GetSettingsManager().GetColorSettings( app->m_ColorTheme );
258  else
259  cs = Pgm().GetSettingsManager().GetColorSettings();
260  }
261 
262  wxCHECK_RET( cs, "null COLOR_SETTINGS" );
263 
264  auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
265  rs->LoadColors( cs );
266 
270 }
271 
272 
274 {
275  // Set display settings for high contrast mode
277 
278  SetTopLayer( aLayer );
279  rSettings->SetActiveLayer( aLayer );
280 
281  rSettings->ClearHighContrastLayers();
282  rSettings->SetLayerIsHighContrast( aLayer );
283 
284  if( IsCopperLayer( aLayer ) )
285  {
286  // Bring some other layers to the front in case of copper layers and make them colored
287  // fixme do not like the idea of storing the list of layers here,
288  // should be done in some other way I guess..
289  LAYER_NUM layers[] = {
292  ZONE_LAYER_FOR( aLayer ),
298  };
299 
300  for( unsigned int i : layers )
301  rSettings->SetLayerIsHighContrast( i );
302 
303  // Pads should be shown too
304  if( aLayer == B_Cu )
305  {
306  rSettings->SetLayerIsHighContrast( LAYER_PAD_BK );
307  rSettings->SetLayerIsHighContrast( LAYER_MOD_BK );
308  }
309  else if( aLayer == F_Cu )
310  {
311  rSettings->SetLayerIsHighContrast( LAYER_PAD_FR );
312  rSettings->SetLayerIsHighContrast( LAYER_MOD_FR );
313  }
314  }
315 
317 }
318 
319 
321 {
324  m_view->SetTopLayer( aLayer );
325 
326  // Layers that should always have on-top attribute enabled
327  const std::vector<LAYER_NUM> layers = {
335  };
336 
337  for( auto layer : layers )
338  m_view->SetTopLayer( layer );
339 
340  // Extra layers that are brought to the top if a F.* or B.* is selected
341  const std::vector<LAYER_NUM> frontLayers = {
344  };
345 
346  const std::vector<LAYER_NUM> backLayers = {
349  };
350 
351  const std::vector<LAYER_NUM>* extraLayers = NULL;
352 
353  // Bring a few more extra layers to the top depending on the selected board side
354  if( IsFrontLayer( aLayer ) )
355  extraLayers = &frontLayers;
356  else if( IsBackLayer( aLayer ) )
357  extraLayers = &backLayers;
358 
359  if( extraLayers )
360  {
361  for( auto layer : *extraLayers )
362  {
363  m_view->SetTopLayer( layer );
364 
365  if( layer < PCB_LAYER_ID_COUNT )
366  m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
367  }
368 
369  // Move the active layer to the top of the stack but below all the overlay layers
370  if( !IsCopperLayer( aLayer ) )
371  {
373  m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ),
375 
376  // Fix up pad and via netnames to be below. This is hacky, we need a rethink
377  // of layer ordering...
382  }
383  }
384  else if( IsCopperLayer( aLayer ) )
385  {
386  // Display labels for copper layers on the top
387  m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
388  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
389  }
390  else
391  {
392  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
393  }
394 
395  m_view->EnableTopLayer( true );
397 }
398 
399 
401 {
402  // Load layer & elements visibility settings
403  for( LAYER_NUM i = 0; i < PCB_LAYER_ID_COUNT; ++i )
404  m_view->SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
405 
407  m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
408 
409  // Via layers controlled by dependencies
413 
414  // Pad layers controlled by dependencies
417 
418  // Always enable netname layers, as their visibility is controlled by layer dependencies
420  m_view->SetLayerVisible( i, true );
421 
422  for( LAYER_NUM i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
423  m_view->SetLayerVisible( i, true );
424 
425  // Enable some layers that are GAL specific
434 }
435 
436 
438  std::vector<MSG_PANEL_ITEM>& aList )
439 {
440  BOARD* board = static_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() )->GetBoard();
441  wxString txt;
442  int viasCount = 0;
443  int trackSegmentsCount = 0;
444 
445  for( PCB_TRACK* item : board->Tracks() )
446  {
447  if( item->Type() == PCB_VIA_T )
448  viasCount++;
449  else
450  trackSegmentsCount++;
451  }
452 
453  txt.Printf( wxT( "%d" ), board->GetPadCount() );
454  aList.emplace_back( _( "Pads" ), txt );
455 
456  txt.Printf( wxT( "%d" ), viasCount );
457  aList.emplace_back( _( "Vias" ), txt );
458 
459  txt.Printf( wxT( "%d" ), trackSegmentsCount );
460  aList.emplace_back( _( "Track Segments" ), txt );
461 
462  txt.Printf( wxT( "%d" ), board->GetNodesCount() );
463  aList.emplace_back( _( "Nodes" ), txt );
464 
465  txt.Printf( wxT( "%d" ), board->GetNetCount() - 1 /* don't include "No Net" in count */ );
466  aList.emplace_back( _( "Nets" ), txt );
467 
468  txt.Printf( wxT( "%d" ), board->GetConnectivity()->GetUnconnectedCount() );
469  aList.emplace_back( _( "Unrouted" ), txt );
470 }
471 
472 
474 {
475  PCB_BASE_FRAME* frame = nullptr;
476 
477  if( !IsDialogPreview() )
478  frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
479 
480  try
481  {
482  // Check if the current rendering backend can be properly initialized
483  m_view->UpdateItems();
484  }
485  catch( const std::runtime_error& e )
486  {
487  DisplayError( GetParent(), e.what() );
488 
489  // Use the fallback if we have one
490  if( GAL_FALLBACK != m_backend )
491  {
493 
494  if( frame )
495  frame->ActivateGalCanvas();
496  }
497  }
498 
499  if( frame )
500  {
501  SetTopLayer( frame->GetActiveLayer() );
502  KIGFX::PAINTER* painter = m_view->GetPainter();
503  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
504  settings->LoadDisplayOptions( frame->GetDisplayOptions(), frame->ShowPageLimits() );
505  }
506 }
507 
508 
510 {
511  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
512  {
513  LAYER_NUM layer = GAL_LAYER_ORDER[i];
514  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
515 
516  m_view->SetLayerOrder( layer, i );
517  }
518 }
519 
520 
522 {
523  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
525  m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
526  return rv;
527 }
528 
529 
531 {
532  if( m_ratsnest )
533  m_view->Update( m_ratsnest.get() );
534 }
535 
536 
538 {
540  return m_drawingSheet->ViewBBox();
541 
542  return BOX2I();
543 }
544 
545 
547 {
548  // caching makes no sense for Cairo and other software renderers
550 
551  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
552  m_view->SetLayerTarget( i, target );
553 
554  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
555  {
556  LAYER_NUM layer = GAL_LAYER_ORDER[i];
557  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
558 
559  // Set layer display dependencies & targets
560  if( IsCopperLayer( layer ) )
561  {
562  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
563  m_view->SetRequired( GetNetnameLayer( layer ), layer );
564  }
565  else if( IsNonCopperLayer( layer ) )
566  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
567  else if( IsNetnameLayer( layer ) )
568  m_view->SetLayerDisplayOnly( layer );
569  }
570 
573 
574  // Some more required layers settings
577 
578  // Holes can be independent of their host objects (cf: printing drill marks)
584 
585  // Via visibility
589 
590  // Pad visibility
594 
595  // Front footprints
599 
600  // Back footprints
604 
611 
620 
624 }
625 
626 
628 {
629  return static_cast<KIGFX::PCB_VIEW*>( m_view );
630 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:252
CITER next(CITER it)
Definition: ptree.cpp:126
void SetScaleLimits(double aMaximum, double aMinimum)
Set minimum and maximum values for scale.
Definition: view.h:303
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:512
void setDefaultLayerDeps()
Currently used drawing-sheet.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
ZONES & Zones()
Definition: board.h:239
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Mark the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:392
void SetLayerOrder(int aLayer, int aRenderingOrder)
Set rendering order of a particular layer.
Definition: view.cpp:641
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:838
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
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.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
An implementation of class VIEW_CONTROLS for wxWidgets library.
to draw via holes (pad holes do not use this layer)
virtual bool SwitchBackend(GAL_TYPE aGalType)
Switch 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()
< Reassign layer order to the initial settings.
MARKERS & Markers()
Definition: board.h:242
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.
show footprints values (when texts are visible)
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
Definition: view.cpp:905
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:228
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:865
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:207
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:701
const LAYER_NUM GAL_LAYER_ORDER[]
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
This file contains miscellaneous commonly used macros and functions.
Classes used in Pcbnew, CvPcb and GerbView.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Called when the window is shown for the first time.
show footprints on front
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:427
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Ratsnest view item.
unsigned GetNodesCount(int aNet=-1) const
Definition: board.cpp:1081
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
PCB_LAYER_ID
A quick note on layer IDs:
Contains all the knowledge about how to draw graphical object onto any particular output device.
Definition: painter.h:57
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Definition: pcb_view.cpp:125
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
#define NULL
unsigned GetNetCount() const
Definition: board.h:715
void DisplayBoard(BOARD *aBoard)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void Clear()
Remove all items from the view.
Definition: view.cpp:1092
unsigned GetPadCount() const
Definition: board.cpp:2006
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
FOOTPRINTS & Footprints()
Definition: board.h:233
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:415
Meta control for all pads opacity/visibility (color ignored)
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
to draw usual through hole vias
#define ZOOM_MAX_LIMIT_PCBNEW
Definition: zoom_defines.h:62
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:50
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:344
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
#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:387
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
Definition: view.cpp:1398
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
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.
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:890
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
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.
Definition: board.cpp:531
bool SwitchBackend(GAL_TYPE aGalType) override
Force refresh of the ratsnest visual representation.
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
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:471
smd pads, front layer
see class PGM_BASE
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: board.h:190
#define ZOOM_MIN_LIMIT_PCBNEW
Definition: zoom_defines.h:63
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition: view.cpp:649
EDA_DRAW_FRAME * GetParentEDAFrame() const
Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
currently selected items overlay
void ClearHighContrastLayers()
Clear the list of active layers.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void SetPainter(PAINTER *aPainter)
Set the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:197
Color settings are a bit different than most of the settings objects in that there can be more than o...
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:322
drawingsheet frame and titleblock
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.
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:774
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:495
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
DRAWINGS & Drawings()
Definition: board.h:236
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
TRACKS & Tracks()
Definition: board.h:230
show footprints references (when texts are visible)
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, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1504
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:404
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:184