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 <track.h>
35 #include <pcb_marker.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 #include <zoom_defines.h>
47 
48 #include <functional>
49 #include <memory>
50 #include <thread>
51 
52 using namespace std::placeholders;
53 
55 {
60  Dwgs_User,
61  Cmts_User,
64 
74 
77 
84 
93 
124 
133 
136 };
137 
138 
139 PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
140  const wxPoint& aPosition, const wxSize& aSize,
141  KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
142  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
143 {
144  m_view = new KIGFX::PCB_VIEW( true );
145  m_view->SetGAL( m_gal );
146 
147  m_painter = std::make_unique<KIGFX::PCB_PAINTER>( m_gal );
148  m_view->SetPainter( m_painter.get() );
149  // This fixes the zoom in and zoom out limits:
151 
154 
155  // View controls is the first in the event handler chain, so the Tool Framework operates
156  // on updated viewport data.
158 
159  // Load display options (such as filled/outline display of items).
160  // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
161  // which is not always the case (namely when it is used from a wxDialog like the pad editor)
162  if( !IsDialogPreview() )
163  {
164  KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( m_view );
165  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
166 
167  if( frame )
168  view->UpdateDisplayOptions( frame->GetDisplayOptions() );
169  }
170 }
171 
172 
174 {
175 }
176 
177 
179 {
180 
181  m_view->Clear();
182 
183  auto zones = aBoard->Zones();
184  std::atomic<size_t> next( 0 );
185  std::atomic<size_t> count_done( 0 );
186  size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
187 
188  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
189  {
190  std::thread t = std::thread( [ &count_done, &next, &zones ]( )
191  {
192  for( size_t i = next.fetch_add( 1 ); i < zones.size(); i = next.fetch_add( 1 ) )
193  zones[i]->CacheTriangulation();
194 
195  count_done++;
196  } );
197 
198  t.detach();
199  }
200 
201  if( m_drawingSheet )
202  m_drawingSheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
203 
204  // Load drawings
205  for( BOARD_ITEM* drawing : aBoard->Drawings() )
206  m_view->Add( drawing );
207 
208  // Load tracks
209  for( TRACK* track : aBoard->Tracks() )
210  m_view->Add( track );
211 
212  // Load footprints and its additional elements
213  for( FOOTPRINT* footprint : aBoard->Footprints() )
214  m_view->Add( footprint );
215 
216  // DRC markers
217  for( PCB_MARKER* marker : aBoard->Markers() )
218  m_view->Add( marker );
219 
220  // Finalize the triangulation threads
221  while( count_done < parallelThreadCount )
222  std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
223 
224  // Load zones
225  for( ZONE* zone : aBoard->Zones() )
226  m_view->Add( zone );
227 
228  // Ratsnest
229  m_ratsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aBoard->GetConnectivity() );
230  m_view->Add( m_ratsnest.get() );
231 }
232 
233 
235 {
236  m_drawingSheet.reset( aDrawingSheet );
237  m_view->Add( m_drawingSheet.get() );
238 }
239 
240 
242 {
243  COLOR_SETTINGS* cs = nullptr;
244 
245  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
246 
247  if( frame )
248  {
249  cs = frame->GetColorSettings();
250  }
251  else
252  {
253  PCBNEW_SETTINGS* app = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
254 
255  if( app )
256  cs = Pgm().GetSettingsManager().GetColorSettings( app->m_ColorTheme );
257  else
258  cs = Pgm().GetSettingsManager().GetColorSettings();
259  }
260 
261  wxCHECK_RET( cs, "null COLOR_SETTINGS" );
262 
263  auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
264  rs->LoadColors( cs );
265 
269 }
270 
271 
273 {
274  // Set display settings for high contrast mode
276 
277  SetTopLayer( aLayer );
278  rSettings->SetActiveLayer( aLayer );
279 
280  rSettings->ClearHighContrastLayers();
281  rSettings->SetLayerIsHighContrast( aLayer );
282 
283  if( IsCopperLayer( aLayer ) )
284  {
285  // Bring some other layers to the front in case of copper layers and make them colored
286  // fixme do not like the idea of storing the list of layers here,
287  // should be done in some other way I guess..
288  LAYER_NUM layers[] = {
291  ZONE_LAYER_FOR( aLayer ),
297  };
298 
299  for( unsigned int i : layers )
300  rSettings->SetLayerIsHighContrast( i );
301 
302  // Pads should be shown too
303  if( aLayer == B_Cu )
304  {
305  rSettings->SetLayerIsHighContrast( LAYER_PAD_BK );
306  rSettings->SetLayerIsHighContrast( LAYER_MOD_BK );
307  }
308  else if( aLayer == F_Cu )
309  {
310  rSettings->SetLayerIsHighContrast( LAYER_PAD_FR );
311  rSettings->SetLayerIsHighContrast( LAYER_MOD_FR );
312  }
313  }
314 
316 }
317 
318 
320 {
323  m_view->SetTopLayer( aLayer );
324 
325  // Layers that should always have on-top attribute enabled
326  const std::vector<LAYER_NUM> layers = {
334  };
335 
336  for( auto layer : layers )
337  m_view->SetTopLayer( layer );
338 
339  // Extra layers that are brought to the top if a F.* or B.* is selected
340  const std::vector<LAYER_NUM> frontLayers = {
343  };
344 
345  const std::vector<LAYER_NUM> backLayers = {
348  };
349 
350  const std::vector<LAYER_NUM>* extraLayers = NULL;
351 
352  // Bring a few more extra layers to the top depending on the selected board side
353  if( IsFrontLayer( aLayer ) )
354  extraLayers = &frontLayers;
355  else if( IsBackLayer( aLayer ) )
356  extraLayers = &backLayers;
357 
358  if( extraLayers )
359  {
360  for( auto layer : *extraLayers )
361  {
362  m_view->SetTopLayer( layer );
363 
364  if( layer < PCB_LAYER_ID_COUNT )
365  m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
366  }
367 
368  // Move the active layer to the top of the stack but below all the overlay layers
369  if( !IsCopperLayer( aLayer ) )
370  {
372  m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ),
374 
375  // Fix up pad and via netnames to be below. This is hacky, we need a rethink
376  // of layer ordering...
381  }
382  }
383  else if( IsCopperLayer( aLayer ) )
384  {
385  // Display labels for copper layers on the top
386  m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
387  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
388  }
389  else
390  {
391  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
392  }
393 
394  m_view->EnableTopLayer( true );
396 }
397 
398 
400 {
401  // Load layer & elements visibility settings
402  for( LAYER_NUM i = 0; i < PCB_LAYER_ID_COUNT; ++i )
403  m_view->SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
404 
406  m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
407 
408  // Via layers controlled by dependencies
412 
413  // Pad layers controlled by dependencies
416 
417  // Always enable netname layers, as their visibility is controlled by layer dependencies
419  m_view->SetLayerVisible( i, true );
420 
421  for( LAYER_NUM i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
422  m_view->SetLayerVisible( i, true );
423 
424  // Enable some layers that are GAL specific
433 }
434 
435 
437  std::vector<MSG_PANEL_ITEM>& aList )
438 {
439  BOARD* board = static_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() )->GetBoard();
440  wxString txt;
441  int viasCount = 0;
442  int trackSegmentsCount = 0;
443 
444  for( TRACK* item : board->Tracks() )
445  {
446  if( item->Type() == PCB_VIA_T )
447  viasCount++;
448  else
449  trackSegmentsCount++;
450  }
451 
452  txt.Printf( wxT( "%d" ), board->GetPadCount() );
453  aList.emplace_back( _( "Pads" ), txt );
454 
455  txt.Printf( wxT( "%d" ), viasCount );
456  aList.emplace_back( _( "Vias" ), txt );
457 
458  txt.Printf( wxT( "%d" ), trackSegmentsCount );
459  aList.emplace_back( _( "Track Segments" ), txt );
460 
461  txt.Printf( wxT( "%d" ), board->GetNodesCount() );
462  aList.emplace_back( _( "Nodes" ), txt );
463 
464  txt.Printf( wxT( "%d" ), board->GetNetCount() - 1 /* don't include "No Net" in count */ );
465  aList.emplace_back( _( "Nets" ), txt );
466 
467  txt.Printf( wxT( "%d" ), board->GetConnectivity()->GetUnconnectedCount() );
468  aList.emplace_back( _( "Unrouted" ), txt );
469 }
470 
471 
473 {
474  PCB_BASE_FRAME* frame = nullptr;
475 
476  if( !IsDialogPreview() )
477  frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
478 
479  try
480  {
481  // Check if the current rendering backend can be properly initialized
482  m_view->UpdateItems();
483  }
484  catch( const std::runtime_error& e )
485  {
486  DisplayError( GetParent(), e.what() );
487 
488  // Use the fallback if we have one
489  if( GAL_FALLBACK != m_backend )
490  {
492 
493  if( frame )
494  frame->ActivateGalCanvas();
495  }
496  }
497 
498  if( frame )
499  {
500  SetTopLayer( frame->GetActiveLayer() );
501  KIGFX::PAINTER* painter = m_view->GetPainter();
502  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
503  settings->LoadDisplayOptions( frame->GetDisplayOptions(), frame->ShowPageLimits() );
504  }
505 }
506 
507 
509 {
510  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
511  {
512  LAYER_NUM layer = GAL_LAYER_ORDER[i];
513  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
514 
515  m_view->SetLayerOrder( layer, i );
516  }
517 }
518 
519 
521 {
522  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
524  m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
525  return rv;
526 }
527 
528 
530 {
531  if( m_ratsnest )
532  m_view->Update( m_ratsnest.get() );
533 }
534 
535 
537 {
539  return m_drawingSheet->ViewBBox();
540 
541  return BOX2I();
542 }
543 
544 
546 {
547  // caching makes no sense for Cairo and other software renderers
549 
550  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
551  m_view->SetLayerTarget( i, target );
552 
553  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
554  {
555  LAYER_NUM layer = GAL_LAYER_ORDER[i];
556  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
557 
558  // Set layer display dependencies & targets
559  if( IsCopperLayer( layer ) )
560  {
561  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
562  m_view->SetRequired( GetNetnameLayer( layer ), layer );
563  }
564  else if( IsNonCopperLayer( layer ) )
565  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
566  else if( IsNetnameLayer( layer ) )
567  m_view->SetLayerDisplayOnly( layer );
568  }
569 
572 
573  // Some more required layers settings
576 
577  // Holes can be independent of their host objects (cf: printing drill marks)
583 
584  // Via visibility
588 
589  // Pad visibility
593 
594  // Front footprints
598 
599  // Back footprints
603 
610 
619 
623 }
624 
625 
627 {
628  return static_cast<KIGFX::PCB_VIEW*>( m_view );
629 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:253
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:522
void setDefaultLayerDeps()
Currently used drawing-sheet.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
ZONES & Zones()
Definition: board.h:309
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Mark the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:391
void SetLayerOrder(int aLayer, int aRenderingOrder)
Set rendering order of a particular layer.
Definition: view.cpp:639
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:832
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:82
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:312
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 visibles)
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
Definition: view.cpp:899
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:298
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:859
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:700
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
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:426
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Ratsnest view item.
unsigned GetNodesCount(int aNet=-1) const
Definition: board.cpp:1006
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:783
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:1083
unsigned GetPadCount() const
Definition: board.cpp:1891
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
#define ZOOM_MIN_LIMIT_PCBNEW
Definition: zoom_defines.h:63
FOOTPRINTS & Footprints()
Definition: board.h:303
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:414
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:46
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:414
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)
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
ZONE handles 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:1389
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:884
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:507
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:453
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 _(s)
Definition: 3d_actions.cpp:33
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition: view.cpp:647
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 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:321
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:770
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:494
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:306
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
TRACKS & Tracks()
Definition: board.h:300
show footprints references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR
Definition: track.h:83
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:1508
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