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  * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include "pcb_draw_panel_gal.h"
27 #include <pcb_view.h>
28 #include <view/wx_view_controls.h>
29 #include <pcb_painter.h>
32 
33 #include <board.h>
34 #include <footprint.h>
35 #include <pcb_track.h>
36 #include <macros.h>
37 #include <pcb_marker.h>
38 #include <pcb_base_frame.h>
39 #include <pcbnew_settings.h>
40 #include <ratsnest/ratsnest_data.h>
42 
43 #include <pgm_base.h>
45 #include <confirm.h>
46 
48 #include <zoom_defines.h>
49 
50 #include <functional>
51 #include <memory>
52 #include <thread>
53 
54 using namespace std::placeholders;
55 
56 
58 {
63  Dwgs_User,
64  Cmts_User,
67 
77 
80 
87 
96 
127 
136 
139 };
140 
141 
142 PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
143  const wxPoint& aPosition, const wxSize& aSize,
144  KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
145  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType )
146 {
147  m_view = new KIGFX::PCB_VIEW( true );
148  m_view->SetGAL( m_gal );
149 
150  m_painter = std::make_unique<KIGFX::PCB_PAINTER>( m_gal );
151  m_view->SetPainter( m_painter.get() );
152 
153  // This fixes the zoom in and zoom out limits:
155 
158 
159  // View controls is the first in the event handler chain, so the Tool Framework operates
160  // on updated viewport data.
162 
163  // Load display options (such as filled/outline display of items).
164  // Can be made only if the parent window is an EDA_DRAW_FRAME (or a derived class)
165  // which is not always the case (namely when it is used from a wxDialog like the pad editor)
166  if( !IsDialogPreview() )
167  {
168  KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( m_view );
169  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
170 
171  if( frame )
172  view->UpdateDisplayOptions( frame->GetDisplayOptions() );
173  }
174 }
175 
176 
178 {
179 }
180 
181 
183 {
184 
185  m_view->Clear();
186 
187  auto zones = aBoard->Zones();
188  std::atomic<size_t> next( 0 );
189  std::atomic<size_t> count_done( 0 );
190  size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
191 
192  for( size_t ii = 0; ii < parallelThreadCount; ++ii )
193  {
194  std::thread t = std::thread( [ &count_done, &next, &zones ]( )
195  {
196  for( size_t i = next.fetch_add( 1 ); i < zones.size(); i = next.fetch_add( 1 ) )
197  zones[i]->CacheTriangulation();
198 
199  count_done++;
200  } );
201 
202  t.detach();
203  }
204 
205  if( m_drawingSheet )
206  m_drawingSheet->SetFileName( TO_UTF8( aBoard->GetFileName() ) );
207 
208  // Load drawings
209  for( BOARD_ITEM* drawing : aBoard->Drawings() )
210  m_view->Add( drawing );
211 
212  // Load tracks
213  for( PCB_TRACK* track : aBoard->Tracks() )
214  m_view->Add( track );
215 
216  // Load footprints and its additional elements
217  for( FOOTPRINT* footprint : aBoard->Footprints() )
218  m_view->Add( footprint );
219 
220  // DRC markers
221  for( PCB_MARKER* marker : aBoard->Markers() )
222  m_view->Add( marker );
223 
224  // Finalize the triangulation threads
225  while( count_done < parallelThreadCount )
226  std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
227 
228  // Load zones
229  for( ZONE* zone : aBoard->Zones() )
230  m_view->Add( zone );
231 
232  // Ratsnest
233  m_ratsnest = std::make_unique<RATSNEST_VIEW_ITEM>( aBoard->GetConnectivity() );
234  m_view->Add( m_ratsnest.get() );
235 }
236 
237 
239 {
240  m_drawingSheet.reset( aDrawingSheet );
241  m_view->Add( m_drawingSheet.get() );
242 }
243 
244 
246 {
247  COLOR_SETTINGS* cs = nullptr;
248 
249  PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
250 
251  if( frame )
252  {
253  cs = frame->GetColorSettings();
254  }
255  else
256  {
257  PCBNEW_SETTINGS* app = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
258 
259  if( app )
260  cs = Pgm().GetSettingsManager().GetColorSettings( app->m_ColorTheme );
261  else
262  cs = Pgm().GetSettingsManager().GetColorSettings();
263  }
264 
265  wxCHECK_RET( cs, "null COLOR_SETTINGS" );
266 
267  auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
268  rs->LoadColors( cs );
269 
273 }
274 
275 
277 {
278  // Set display settings for high contrast mode
280 
281  SetTopLayer( aLayer );
282  rSettings->SetActiveLayer( aLayer );
283 
284  rSettings->ClearHighContrastLayers();
285  rSettings->SetLayerIsHighContrast( aLayer );
286 
287  if( IsCopperLayer( aLayer ) )
288  {
289  // Bring some other layers to the front in case of copper layers and make them colored
290  // fixme do not like the idea of storing the list of layers here,
291  // should be done in some other way I guess..
292  LAYER_NUM layers[] = {
295  ZONE_LAYER_FOR( aLayer ),
302  };
303 
304  for( unsigned int i : layers )
305  rSettings->SetLayerIsHighContrast( i );
306 
307  // Pads should be shown too
308  if( aLayer == B_Cu )
309  {
310  rSettings->SetLayerIsHighContrast( LAYER_PAD_BK );
311  rSettings->SetLayerIsHighContrast( LAYER_MOD_BK );
312  }
313  else if( aLayer == F_Cu )
314  {
315  rSettings->SetLayerIsHighContrast( LAYER_PAD_FR );
316  rSettings->SetLayerIsHighContrast( LAYER_MOD_FR );
317  }
318  }
319 
321 }
322 
323 
325 {
328  m_view->SetTopLayer( aLayer );
329 
330  // Layers that should always have on-top attribute enabled
331  const std::vector<LAYER_NUM> layers = {
340  };
341 
342  for( auto layer : layers )
343  m_view->SetTopLayer( layer );
344 
345  // Extra layers that are brought to the top if a F.* or B.* is selected
346  const std::vector<LAYER_NUM> frontLayers = {
349  };
350 
351  const std::vector<LAYER_NUM> backLayers = {
354  };
355 
356  const std::vector<LAYER_NUM>* extraLayers = nullptr;
357 
358  // Bring a few more extra layers to the top depending on the selected board side
359  if( IsFrontLayer( aLayer ) )
360  extraLayers = &frontLayers;
361  else if( IsBackLayer( aLayer ) )
362  extraLayers = &backLayers;
363 
364  if( extraLayers )
365  {
366  for( auto layer : *extraLayers )
367  {
368  m_view->SetTopLayer( layer );
369 
370  if( layer < PCB_LAYER_ID_COUNT )
371  m_view->SetTopLayer( ZONE_LAYER_FOR( layer ) );
372  }
373 
374  // Move the active layer to the top of the stack but below all the overlay layers
375  if( !IsCopperLayer( aLayer ) )
376  {
378  m_view->SetLayerOrder( ZONE_LAYER_FOR( aLayer ),
380 
381  // Fix up pad and via netnames to be below. This is hacky, we need a rethink
382  // of layer ordering...
387  }
388  }
389  else if( IsCopperLayer( aLayer ) )
390  {
391  // Display labels for copper layers on the top
392  m_view->SetTopLayer( GetNetnameLayer( aLayer ) );
393  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
394  }
395  else
396  {
397  m_view->SetTopLayer( ZONE_LAYER_FOR( aLayer ) );
398  }
399 
400  m_view->EnableTopLayer( true );
402 }
403 
404 
406 {
407  // Load layer & elements visibility settings
408  for( LAYER_NUM i = 0; i < PCB_LAYER_ID_COUNT; ++i )
409  m_view->SetLayerVisible( i, aBoard->IsLayerVisible( PCB_LAYER_ID( i ) ) );
410 
412  m_view->SetLayerVisible( i, aBoard->IsElementVisible( i ) );
413 
414  // Via layers controlled by dependencies
418 
419  // Pad layers controlled by dependencies
422 
423  // Always enable netname layers, as their visibility is controlled by layer dependencies
425  m_view->SetLayerVisible( i, true );
426 
427  for( LAYER_NUM i = LAYER_ZONE_START; i < LAYER_ZONE_END; i++ )
428  m_view->SetLayerVisible( i, true );
429 
430  // Enable some layers that are GAL specific
439 }
440 
441 
443  std::vector<MSG_PANEL_ITEM>& aList )
444 {
445  BOARD* board = static_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() )->GetBoard();
446  wxString txt;
447  int viasCount = 0;
448  int trackSegmentsCount = 0;
449 
450  for( PCB_TRACK* item : board->Tracks() )
451  {
452  if( item->Type() == PCB_VIA_T )
453  viasCount++;
454  else
455  trackSegmentsCount++;
456  }
457 
458  txt.Printf( wxT( "%d" ), board->GetPadCount() );
459  aList.emplace_back( _( "Pads" ), txt );
460 
461  txt.Printf( wxT( "%d" ), viasCount );
462  aList.emplace_back( _( "Vias" ), txt );
463 
464  txt.Printf( wxT( "%d" ), trackSegmentsCount );
465  aList.emplace_back( _( "Track Segments" ), txt );
466 
467  txt.Printf( wxT( "%d" ), board->GetNodesCount() );
468  aList.emplace_back( _( "Nodes" ), txt );
469 
470  txt.Printf( wxT( "%d" ), board->GetNetCount() - 1 /* don't include "No Net" in count */ );
471  aList.emplace_back( _( "Nets" ), txt );
472 
473  txt.Printf( wxT( "%d" ), board->GetConnectivity()->GetUnconnectedCount() );
474  aList.emplace_back( _( "Unrouted" ), txt );
475 }
476 
477 
479 {
480  PCB_BASE_FRAME* frame = nullptr;
481 
482  if( !IsDialogPreview() )
483  frame = dynamic_cast<PCB_BASE_FRAME*>( GetParentEDAFrame() );
484 
485  try
486  {
487  // Check if the current rendering back end can be properly initialized
488  m_view->UpdateItems();
489  }
490  catch( const std::runtime_error& e )
491  {
492  DisplayError( GetParent(), e.what() );
493 
494  // Use the fallback if we have one
495  if( GAL_FALLBACK != m_backend )
496  {
498 
499  if( frame )
500  frame->ActivateGalCanvas();
501  }
502  }
503 
504  if( frame )
505  {
506  SetTopLayer( frame->GetActiveLayer() );
507  KIGFX::PAINTER* painter = m_view->GetPainter();
508  auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->GetSettings() );
509  settings->LoadDisplayOptions( frame->GetDisplayOptions(), frame->ShowPageLimits() );
510  }
511 }
512 
513 
515 {
516  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
517  {
518  LAYER_NUM layer = GAL_LAYER_ORDER[i];
519  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
520 
521  m_view->SetLayerOrder( layer, i );
522  }
523 }
524 
525 
527 {
528  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
530  m_gal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
531  return rv;
532 }
533 
534 
536 {
537  if( m_ratsnest )
538  m_view->Update( m_ratsnest.get() );
539 }
540 
541 
543 {
545  return m_drawingSheet->ViewBBox();
546 
547  return BOX2I();
548 }
549 
550 
552 {
553  // caching makes no sense for Cairo and other software renderers
555 
556  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
557  m_view->SetLayerTarget( i, target );
558 
559  for( LAYER_NUM i = 0; (unsigned) i < sizeof( GAL_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
560  {
561  LAYER_NUM layer = GAL_LAYER_ORDER[i];
562  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
563 
564  // Set layer display dependencies & targets
565  if( IsCopperLayer( layer ) )
566  {
567  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
568  m_view->SetRequired( GetNetnameLayer( layer ), layer );
569  }
570  else if( IsNonCopperLayer( layer ) )
571  {
572  m_view->SetRequired( ZONE_LAYER_FOR( layer ), layer );
573  }
574  else if( IsNetnameLayer( layer ) )
575  {
576  m_view->SetLayerDisplayOnly( layer );
577  }
578  }
579 
582 
583  // Some more required layers settings
586 
587  // Holes can be independent of their host objects (cf: printing drill marks)
593 
594  // Via visibility
598 
599  // Pad visibility
603 
604  // Front footprints
608 
609  // Back footprints
613 
620 
629 
633 }
634 
635 
637 {
638  return static_cast<KIGFX::PCB_VIEW*>( m_view );
639 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:271
CITER next(CITER it)
Definition: ptree.cpp:126
void SetScaleLimits(double aMaximum, double aMinimum)
Set minimum and maximum values for scale.
Definition: view.h:304
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
currently selected items overlay
Definition: layer_ids.h:214
smd pads, front layer
Definition: layer_ids.h:197
to draw micro vias
Definition: layer_ids.h:189
BOX2< VECTOR2I > BOX2I
Definition: box2.h:506
void setDefaultLayerDeps()
Currently used drawing-sheet.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
ZONES & Zones()
Definition: board.h:239
layer for drc markers with SEVERITY_ERROR
Definition: layer_ids.h:211
void SetRequired(int aLayerId, int aRequiredId, bool aRequired=true)
Mark the aRequiredId layer as required for the aLayerId layer.
Definition: view.cpp:393
void SetLayerOrder(int aLayer, int aRenderingOrder)
Set rendering order of a particular layer.
Definition: view.cpp:642
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:839
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
This file is part of the common library.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
Meta control for all pads opacity/visibility (color ignored)
Definition: layer_ids.h:225
An implementation of class VIEW_CONTROLS for wxWidgets library.
PCB cursor.
Definition: layer_ids.h:216
show footprints values (when texts are visible)
Definition: layer_ids.h:205
virtual bool SwitchBackend(GAL_TYPE aGalType)
Switch method of rendering graphics.
void setDefaultLayerOrder()
< Reassign layer order to the initial settings.
MARKERS & Markers()
Definition: board.h:242
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:184
Class that computes missing connections on a PCB.
smd pads, back layer
Definition: layer_ids.h:198
Additional netnames layers (not associated with a PCB layer)
Definition: layer_ids.h:160
static constexpr GAL_TYPE GAL_FALLBACK
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:196
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:40
show footprints on back
Definition: layer_ids.h:204
void UpdateAllLayersOrder()
Do everything that is needed to apply the rendering order of layers.
Definition: view.cpp:906
#define ZONE_LAYER_FOR(copperLayer)
Macro for getting the zone layer for a given copper layer.
Definition: layer_ids.h:251
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:866
to draw via holes (pad holes do not use this layer)
Definition: layer_ids.h:210
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
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:726
const LAYER_NUM GAL_LAYER_ORDER[]
bool ShowPageLimits() const
Auxiliary rendering target (noncached)
Definition: definitions.h:49
This file contains miscellaneous commonly used macros and functions.
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
Definition: layer_ids.h:932
Classes used in Pcbnew, CvPcb and GerbView.
to draw usual through hole vias
Definition: layer_ids.h:191
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Called when the window is shown for the first time.
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:461
std::unique_ptr< DS_PROXY_VIEW_ITEM > m_drawingSheet
Ratsnest view item.
unsigned GetNodesCount(int aNet=-1) const
Definition: board.cpp:1082
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
Contains all the knowledge about how to draw graphical object onto any particular output device.
Definition: painter.h:57
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:192
void UpdateDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Definition: pcb_view.cpp:125
virtual void ActivateGalCanvas() override
Use to start up the GAL drawing canvas.
unsigned GetNetCount() const
Definition: board.h:715
Meta control for all vias opacity/visibility.
Definition: layer_ids.h:188
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:886
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:1107
unsigned GetPadCount() const
Definition: board.cpp:1928
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
shadows for drc markers
Definition: layer_ids.h:232
FOOTPRINTS & Footprints()
Definition: board.h:233
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:449
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
#define ZOOM_MAX_LIMIT_PCBNEW
Definition: zoom_defines.h:62
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)
show footprints on front
Definition: layer_ids.h:203
bool IsNonCopperLayer(LAYER_NUM aLayerId)
Test whether a layer is a non copper layer.
Definition: layer_ids.h:798
Virtual layers for stacking zones and tracks on a given copper layer.
Definition: layer_ids.h:241
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:388
Handle a list of polygons defining a copper zone.
Definition: zone.h:56
void UpdateItems()
Iterate through the list of items that asked for updating and updates them.
Definition: view.cpp:1412
drawingsheet frame and titleblock
Definition: layer_ids.h:212
void SetCursorColor(const COLOR4D &aCursorColor)
Set the cursor color.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:863
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.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:787
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:891
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:532
bool SwitchBackend(GAL_TYPE aGalType) override
Force refresh of the ratsnest visual representation.
show footprints references (when texts are visible)
Definition: layer_ids.h:206
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:472
see class PGM_BASE
multilayer pads, usually with holes
Definition: layer_ids.h:208
Main rendering target (cached)
Definition: definitions.h:48
to draw blind/buried vias
Definition: layer_ids.h:190
layer for drc markers which have been individually excluded
Definition: layer_ids.h:231
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
general purpose overlay
Definition: layer_ids.h:213
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
Definition: layer_ids.h:955
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:64
#define ZOOM_MIN_LIMIT_PCBNEW
Definition: zoom_defines.h:63
Definition: layer_ids.h:70
int GetLayerOrder(int aLayer) const
Return rendering order of a particular layer.
Definition: view.cpp:650
EDA_DRAW_FRAME * GetParentEDAFrame() const
Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
layer for drc markers with SEVERITY_WARNING
Definition: layer_ids.h:230
void ClearHighContrastLayers()
Clear the list of active layers.
void SetPainter(PAINTER *aPainter)
Set the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:198
Color settings are a bit different than most of the settings objects in that there can be more than o...
to draw pad holes (plated)
Definition: layer_ids.h:209
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:50
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:323
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:775
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:496
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
DRAWINGS & Drawings()
Definition: board.h:236
#define NETNAMES_LAYER_INDEX(layer)
Macro for obtaining netname layer for a given PCB layer.
Definition: layer_ids.h:169
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
TRACKS & Tracks()
Definition: board.h:230
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:1518
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:405
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:184