KiCad PCB EDA Suite
pcb_base_frame.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) 2018 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
7  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #include <fctsys.h>
28 #include <kiface_i.h>
29 #include <eda_base_frame.h>
30 #include <confirm.h>
31 #include <kiface_i.h>
32 #include <dialog_helpers.h>
33 #include <pcb_base_frame.h>
34 #include <base_units.h>
35 #include <msgpanel.h>
36 #include <pgm_base.h>
37 #include <3d_viewer/eda_3d_viewer.h> // To include VIEWER3D_FRAMENAME
38 #include <pcbnew.h>
39 #include <fp_lib_table.h>
40 #include <pcbnew_id.h>
41 #include <class_board.h>
42 #include <class_track.h>
43 #include <class_module.h>
44 #include <class_drawsegment.h>
45 #include <collectors.h>
46 #include <pcb_draw_panel_gal.h>
47 #include <pcb_view.h>
48 #include <math/vector2d.h>
49 #include <trigo.h>
50 #include <pcb_painter.h>
51 #include <tool/tool_manager.h>
52 #include <tool/tool_dispatcher.h>
53 #include <tools/pcb_actions.h>
54 
55 const wxChar PCB_BASE_FRAME::AUTO_ZOOM_KEY[] = wxT( "AutoZoom" );
56 const wxChar PCB_BASE_FRAME::ZOOM_KEY[] = wxT( "Zoom" );
57 
58 // Configuration entry names.
59 static const wxChar UserGridSizeXEntry[] = wxT( "PcbUserGrid_X" );
60 static const wxChar UserGridSizeYEntry[] = wxT( "PcbUserGrid_Y" );
61 static const wxChar UserGridUnitsEntry[] = wxT( "PcbUserGrid_Unit" );
62 static const wxChar DisplayPadFillEntry[] = wxT( "DiPadFi" );
63 static const wxChar DisplayViaFillEntry[] = wxT( "DiViaFi" );
64 static const wxChar DisplayPadNumberEntry[] = wxT( "DiPadNu" );
65 static const wxChar DisplayModuleEdgeEntry[] = wxT( "DiModEd" );
66 static const wxChar DisplayModuleTextEntry[] = wxT( "DiModTx" );
67 static const wxChar FastGrid1Entry[] = wxT( "FastGrid1" );
68 static const wxChar FastGrid2Entry[] = wxT( "FastGrid2" );
69 
70 
71 BEGIN_EVENT_TABLE( PCB_BASE_FRAME, EDA_DRAW_FRAME )
76 
79 
81 END_EVENT_TABLE()
82 
83 
84 PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
85  const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
86  long aStyle, const wxString & aFrameName ) :
87  EDA_DRAW_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
88  m_Pcb( nullptr ),
89  m_configSettings( aFrameType )
90 {
91  m_UserGridSize = wxPoint( (int) 10 * IU_PER_MILS, (int) 10 * IU_PER_MILS );
92 
93  m_FastGrid1 = 0;
94  m_FastGrid2 = 0;
95 
96  m_zoomLevelCoeff = 11.0 * IU_PER_MILS; // Adjusted to roughly displays zoom level = 1
97  // when the screen shows a 1:1 image
98  // obviously depends on the monitor,
99  // but this is an acceptable value
100 }
101 
102 
104 {
105  // Ensure m_canvasType is up to date, to save it in config
107 
108  delete m_Pcb;
109 }
110 
111 
113 {
114  return dynamic_cast<EDA_3D_VIEWER*>( FindWindowByName( QUALIFIED_VIEWER3D_FRAMENAME( this ) ) );
115 }
116 
117 
118 void PCB_BASE_FRAME::Update3DView( bool aForceReload, const wxString* aTitle )
119 {
120  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
121 
122  if( draw3DFrame )
123  {
124  if( aTitle )
125  draw3DFrame->SetTitle( *aTitle );
126 
127  draw3DFrame->NewDisplay( aForceReload );
128  }
129 }
130 
131 
133 {
134  // This is a lazy loading function, it loads the project specific table when
135  // that table is asked for, not before.
136 
138 
139  // its gotta be NULL or a FP_LIB_TABLE, or a bug.
140  wxASSERT( !tbl || tbl->Type() == FP_LIB_TABLE_T );
141 
142  if( !tbl )
143  {
144  // Stack the project specific FP_LIB_TABLE overlay on top of the global table.
145  // ~FP_LIB_TABLE() will not touch the fallback table, so multiple projects may
146  // stack this way, all using the same global fallback table.
147  tbl = new FP_LIB_TABLE( &GFootprintTable );
148 
149  SetElem( ELEM_FPTBL, tbl );
150 
151  wxString projectFpLibTableFileName = FootprintLibTblName();
152 
153  try
154  {
155  tbl->Load( projectFpLibTableFileName );
156  }
157  catch( const IO_ERROR& ioe )
158  {
159  DisplayErrorMessage( nullptr, _( "Error loading project footprint libraries" ),
160  ioe.What() );
161  }
162  }
163 
164  return tbl;
165 }
166 
167 
169 {
170  if( m_Pcb != aBoard )
171  {
172  delete m_Pcb;
173  m_Pcb = aBoard;
175  }
176 }
177 
178 
180 {
181  if( module )
182  {
183  GetBoard()->Add( module, ADD_APPEND );
184 
185  module->SetFlags( IS_NEW );
186 
187  module->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized at the moment
188 
189  module->SetTimeStamp( GetNewTimeStamp() );
190 
191  // Put it on FRONT layer,
192  // (Can be stored flipped if the lib is an archive built from a board)
193  if( module->IsFlipped() )
194  module->Flip( module->GetPosition(), m_configSettings.m_FlipLeftRight );
195 
196  // Place it in orientation 0,
197  // even if it is not saved with orientation 0 in lib
198  // (Can happen if the lib is an archive built from a board)
199  module->SetOrientation( 0 );
200  }
201 }
202 
203 
204 void PCB_BASE_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
205 {
206  wxASSERT( m_Pcb );
207  m_Pcb->SetPageSettings( aPageSettings );
208 
209  if( GetScreen() )
210  GetScreen()->InitDataPoints( aPageSettings.GetSizeIU() );
211 }
212 
213 
215 {
216  wxASSERT( m_Pcb );
217  return m_Pcb->GetPageSettings();
218 }
219 
220 
221 const wxSize PCB_BASE_FRAME::GetPageSizeIU() const
222 {
223  wxASSERT( m_Pcb );
224 
225  // this function is only needed because EDA_DRAW_FRAME is not compiled
226  // with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
227  // into an application specific source file.
228  return m_Pcb->GetPageSettings().GetSizeIU();
229 }
230 
231 
232 const wxPoint& PCB_BASE_FRAME::GetAuxOrigin() const
233 {
234  wxASSERT( m_Pcb );
235  return m_Pcb->GetAuxOrigin();
236 }
237 
238 
239 void PCB_BASE_FRAME::SetAuxOrigin( const wxPoint& aPoint )
240 {
241  wxASSERT( m_Pcb );
242  m_Pcb->SetAuxOrigin( aPoint );
243 }
244 
245 
246 const wxPoint& PCB_BASE_FRAME::GetGridOrigin() const
247 {
248  wxASSERT( m_Pcb );
249  return m_Pcb->GetGridOrigin();
250 }
251 
252 
253 void PCB_BASE_FRAME::SetGridOrigin( const wxPoint& aPoint )
254 {
255  wxASSERT( m_Pcb );
256  m_Pcb->SetGridOrigin( aPoint );
257 }
258 
259 
261 {
262  wxASSERT( m_Pcb );
263  return m_Pcb->GetTitleBlock();
264 }
265 
266 
267 void PCB_BASE_FRAME::SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
268 {
269  wxASSERT( m_Pcb );
270  m_Pcb->SetTitleBlock( aTitleBlock );
271 }
272 
273 
275 {
276  wxASSERT( m_Pcb );
277  return m_Pcb->GetDesignSettings();
278 }
279 
280 
282 {
283  wxASSERT( m_Pcb );
284  m_Pcb->SetDesignSettings( aSettings );
285 }
286 
287 
289 {
290  m_drawBgColor= aColor;
291  m_auimgr.Update();
292 }
293 
294 
296 {
297  wxASSERT( m_Pcb );
298  return m_Pcb->GetZoneSettings();
299 }
300 
301 
303 {
304  wxASSERT( m_Pcb );
305  m_Pcb->SetZoneSettings( aSettings );
306 }
307 
308 
310 {
311  wxASSERT( m_Pcb );
312  return m_Pcb->GetPlotOptions();
313 }
314 
315 
317 {
318  wxASSERT( m_Pcb );
319  m_Pcb->SetPlotOptions( aSettings );
320 }
321 
322 
323 EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
324 {
325  wxASSERT( m_Pcb );
326 
327  EDA_RECT area = aBoardEdgesOnly ? m_Pcb->GetBoardEdgesBoundingBox() : m_Pcb->GetBoundingBox();
328 
329  if( area.GetWidth() == 0 && area.GetHeight() == 0 )
330  {
331  wxSize pageSize = GetPageSizeIU();
332 
334  {
335  area.SetOrigin( 0, 0 );
336  area.SetEnd( pageSize.x, pageSize.y );
337  }
338  else
339  {
340  area.SetOrigin( -pageSize.x / 2, -pageSize.y / 2 );
341  area.SetEnd( pageSize.x / 2, pageSize.y / 2 );
342  }
343  }
344 
345  return area;
346 }
347 
348 
350 {
351  EDA_RECT ibbbox = GetBoardBoundingBox();
352 
353  double sizeX = (double) ibbbox.GetWidth();
354  double sizeY = (double) ibbbox.GetHeight();
355  wxPoint centre = ibbbox.Centre();
356 
357  // Reserve a 10% margin around board bounding box.
358  double margin_scale_factor = 1.1;
359 
360  return bestZoom( sizeX, sizeY, margin_scale_factor, centre );
361 }
362 
363 
364 // Virtual function
366 {
367 }
368 
369 
371 {
372  // call my base class
374 
375  // tooltips in toolbars
377 
378  // status bar
379  UpdateMsgPanel();
380 }
381 
382 
384 {
385  EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
386 
387  if( !draw3DFrame )
388  draw3DFrame = new EDA_3D_VIEWER( &Kiway(), this, _( "3D Viewer" ) );
389 
390  // Raising the window does not show the window on Windows if iconized. This should work
391  // on any platform.
392  if( draw3DFrame->IsIconized() )
393  draw3DFrame->Iconize( false );
394 
395  draw3DFrame->Raise();
396  draw3DFrame->Show( true );
397 
398  // Raising the window does not set the focus on Linux. This should work on any platform.
399  if( wxWindow::FindFocus() != draw3DFrame )
400  draw3DFrame->SetFocus();
401 
402  return draw3DFrame;
403 }
404 
405 
406 // Note: virtual, overridden in PCB_EDIT_FRAME;
408 {
409  PCB_LAYER_ID preslayer = GetActiveLayer();
410  auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
411 
412  // Check if the specified layer matches the present layer
413  if( layer == preslayer )
414  return;
415 
416  // Copper layers cannot be selected unconditionally; how many of those layers are
417  // currently enabled needs to be checked.
418  if( IsCopperLayer( layer ) )
419  {
420  // If only one copper layer is enabled, the only such layer that can be selected to
421  // is the "Copper" layer (so the selection of any other copper layer is disregarded).
422  if( m_Pcb->GetCopperLayerCount() < 2 )
423  {
424  if( layer != B_Cu )
425  return;
426  }
427 
428  // If more than one copper layer is enabled, the "Copper" and "Component" layers
429  // can be selected, but the total number of copper layers determines which internal
430  // layers are also capable of being selected.
431  else
432  {
433  if( layer != B_Cu && layer != F_Cu && layer >= ( m_Pcb->GetCopperLayerCount() - 1 ) )
434  return;
435  }
436  }
437 
438  // Is yet more checking required? E.g. when the layer to be selected is a non-copper
439  // layer, or when switching between a copper layer and a non-copper layer, or vice-versa?
440  // ...
441 
442  GetScreen()->m_Active_Layer = layer;
443 
444  if( displ_opts->m_ContrastModeDisplay )
445  GetCanvas()->Refresh();
446 }
447 
448 
449 void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
450 {
451  auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
452 
453  displ_opts->m_DisplayPadFill = !displ_opts->m_DisplayPadFill;
454 
455  if( GetCanvas() )
456  {
457  // Apply new display options to the GAL canvas
458  auto view = static_cast<KIGFX::PCB_VIEW*>( GetCanvas()->GetView() );
459  view->UpdateDisplayOptions( displ_opts );
460 
461  // Update pads
462  BOARD* board = GetBoard();
463  for( auto module : board->Modules() )
464  {
465  for( auto pad : module->Pads() )
466  view->Update( pad, KIGFX::GEOMETRY );
467  }
468  }
469 
470  GetCanvas()->Refresh();
471 }
472 
473 
474 void PCB_BASE_FRAME::OnToggleGraphicDrawMode( wxCommandEvent& aEvent )
475 {
476  auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
477  displ_opts->m_DisplayDrawItemsFill = !displ_opts->m_DisplayDrawItemsFill;
478  GetCanvas()->Refresh();
479 }
480 
481 
482 void PCB_BASE_FRAME::OnToggleEdgeDrawMode( wxCommandEvent& aEvent )
483 {
484  auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
485  displ_opts->m_DisplayModEdgeFill = !displ_opts->m_DisplayModEdgeFill;
486 
487  if( GetCanvas() )
488  {
489  // Apply new display options to the GAL canvas
490  auto view = static_cast<KIGFX::PCB_VIEW*>( GetCanvas()->GetView() );
491  view->UpdateDisplayOptions( displ_opts );
492  view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
493  }
494 
495  GetCanvas()->Refresh();
496 }
497 
498 
499 void PCB_BASE_FRAME::OnToggleTextDrawMode( wxCommandEvent& aEvent )
500 {
501  auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
502  displ_opts->m_DisplayModTextFill = !displ_opts->m_DisplayModTextFill;
503 
504  if( GetCanvas() )
505  {
506  // Apply new display options to the canvas
507  auto view = static_cast<KIGFX::PCB_VIEW*>( GetCanvas()->GetView() );
508  view->UpdateDisplayOptions( displ_opts );
509  view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
510  }
511 
512  GetCanvas()->Refresh();
513 }
514 
515 
516 void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
517 {
518  if( m_zoomSelectBox == NULL || m_zoomSelectBox->GetParent() == NULL )
519  return;
520 
521  int current = 0; // display Auto if no match found
522 
523  // check for a match within 1%
524  double zoom = GetCanvas()->GetLegacyZoom();
525 
526  for( unsigned i = 0; i < GetScreen()->m_ZoomList.size(); i++ )
527  {
528  if( std::fabs( zoom - GetScreen()->m_ZoomList[i] ) < ( zoom / 100.0 ) )
529  {
530  current = i + 1;
531  break;
532  }
533  }
534 
535  if( current != m_zoomSelectBox->GetSelection() )
536  m_zoomSelectBox->SetSelection( current );
537 }
538 
539 
541 {
543  GetCanvas()->GetView() );
544 
545  // account for the globals
547  guide.SetIgnoreMTextsOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
548  guide.SetIgnoreMTextsOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
549  guide.SetIgnoreModulesOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_BK ) );
550  guide.SetIgnoreModulesOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_FR ) );
551  guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( LAYER_PAD_BK ) );
552  guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( LAYER_PAD_FR ) );
553  guide.SetIgnoreThroughHolePads( ! m_Pcb->IsElementVisible( LAYER_PADS_TH ) );
554  guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
555  guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
556  guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIA_THROUGH ) );
557  guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIA_BBLIND ) );
558  guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIA_MICROVIA ) );
559  guide.SetIgnoreTracks( ! m_Pcb->IsElementVisible( LAYER_TRACKS ) );
560 
561  return guide;
562 }
563 
564 
565 /*
566  * Display the grid status.
567  */
569 {
570  wxString line;
571  wxString gridformatter;
572 
573  switch( m_userUnits )
574  {
575  case INCHES:
576  gridformatter = "grid X %.6f Y %.6f";
577  break;
578 
579  case MILLIMETRES:
580  gridformatter = "grid X %.6f Y %.6f";
581  break;
582 
583  default:
584  gridformatter = "grid X %f Y %f";
585  break;
586  }
587 
588  BASE_SCREEN* screen = GetScreen();
589  wxArrayString gridsList;
590 
591  int icurr = screen->BuildGridsChoiceList( gridsList, m_userUnits != INCHES );
592  GRID_TYPE& grid = screen->GetGrid( icurr );
593  double grid_x = To_User_Unit( m_userUnits, grid.m_Size.x );
594  double grid_y = To_User_Unit( m_userUnits, grid.m_Size.y );
595  line.Printf( gridformatter, grid_x, grid_y );
596 
597  SetStatusText( line, 4 );
598 }
599 
600 
601 /*
602  * Update the status bar information.
603  */
605 {
607 
608  BASE_SCREEN* screen = GetScreen();
609 
610  if( !screen )
611  return;
612 
613  wxString line;
615 
616  if( GetShowPolarCoords() ) // display polar coordinates
617  {
618  double dx = cursorPos.x - screen->m_LocalOrigin.x;
619  double dy = cursorPos.y - screen->m_LocalOrigin.y;
620  double theta = RAD2DEG( atan2( -dy, dx ) );
621  double ro = hypot( dx, dy );
622  wxString formatter;
623 
624  switch( GetUserUnits() )
625  {
626  case INCHES: formatter = wxT( "r %.6f theta %.1f" ); break;
627  case MILLIMETRES: formatter = wxT( "r %.6f theta %.1f" ); break;
628  case UNSCALED_UNITS: formatter = wxT( "r %f theta %f" ); break;
629  default: wxASSERT( false ); break;
630  }
631 
632  line.Printf( formatter, To_User_Unit( GetUserUnits(), ro ), theta );
633 
634  SetStatusText( line, 3 );
635  }
636 
637  // Display absolute coordinates:
638  double dXpos = To_User_Unit( GetUserUnits(), cursorPos.x );
639  double dYpos = To_User_Unit( GetUserUnits(), cursorPos.y );
640 
641  // The following sadly is an if Eeschema/if Pcbnew
642  wxString absformatter;
643  wxString locformatter;
644 
645  switch( GetUserUnits() )
646  {
647  case INCHES:
648  absformatter = "X %.6f Y %.6f";
649  locformatter = "dx %.6f dy %.6f dist %.4f";
650  break;
651 
652  case MILLIMETRES:
653  absformatter = "X %.6f Y %.6f";
654  locformatter = "dx %.6f dy %.6f dist %.3f";
655  break;
656 
657  case UNSCALED_UNITS:
658  absformatter = "X %f Y %f";
659  locformatter = "dx %f dy %f dist %f";
660  break;
661 
662  default:
663  wxASSERT( false );
664  break;
665  }
666 
667  line.Printf( absformatter, dXpos, dYpos );
668  SetStatusText( line, 2 );
669 
670  if( !GetShowPolarCoords() ) // display relative cartesian coordinates
671  {
672  // Display relative coordinates:
673  dXpos = To_User_Unit( GetUserUnits(), cursorPos.x - screen->m_LocalOrigin.x );
674  dYpos = To_User_Unit( GetUserUnits(), cursorPos.y - screen->m_LocalOrigin.y );
675 
676  // We already decided the formatter above
677  line.Printf( locformatter, dXpos, dYpos, hypot( dXpos, dYpos ) );
678  SetStatusText( line, 3 );
679  }
680 
681  DisplayGridMsg();
682 }
683 
684 
686 {
687  EDA_DRAW_FRAME::unitsChangeRefresh(); // Update the status bar.
688 
690 }
691 
692 
693 void PCB_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
694 {
696 
697  // Ensure grid id is an existent grid id:
698  if( (m_LastGridSizeId <= 0) ||
701 
702  wxString baseCfgName = GetName();
703 
704  EDA_UNITS_T userGridUnits;
705  aCfg->Read( baseCfgName + UserGridUnitsEntry, ( int* )&userGridUnits, ( int )INCHES );
706 
707  double tmp;
708  aCfg->Read( baseCfgName + UserGridSizeXEntry, &tmp, 0.01 );
709  m_UserGridSize.x = (int) From_User_Unit( userGridUnits, tmp );
710 
711  aCfg->Read( baseCfgName + UserGridSizeYEntry, &tmp, 0.01 );
712  m_UserGridSize.y = (int) From_User_Unit( userGridUnits, tmp );
713 
714  aCfg->Read( baseCfgName + DisplayPadFillEntry, &m_DisplayOptions.m_DisplayPadFill, true );
715  aCfg->Read( baseCfgName + DisplayViaFillEntry, &m_DisplayOptions.m_DisplayViaFill, true );
716  aCfg->Read( baseCfgName + DisplayPadNumberEntry, &m_DisplayOptions.m_DisplayPadNum, true );
717  aCfg->Read( baseCfgName + DisplayModuleEdgeEntry, &m_DisplayOptions.m_DisplayModEdgeFill, true );
718 
719  long itmp;
720  aCfg->Read( baseCfgName + FastGrid1Entry, &itmp, ( long )0);
721  m_FastGrid1 = itmp;
722  aCfg->Read( baseCfgName + FastGrid2Entry, &itmp, ( long )0);
723  m_FastGrid2 = itmp;
724 
725  aCfg->Read( baseCfgName + DisplayModuleTextEntry, &m_DisplayOptions.m_DisplayModTextFill, true );
726 }
727 
728 
729 void PCB_BASE_FRAME::SaveSettings( wxConfigBase* aCfg )
730 {
732 
733  wxString baseCfgName = GetName();
734 
735  aCfg->Write( baseCfgName + UserGridSizeXEntry, To_User_Unit( m_userUnits, m_UserGridSize.x ) );
736  aCfg->Write( baseCfgName + UserGridSizeYEntry, To_User_Unit( m_userUnits, m_UserGridSize.y ) );
737  aCfg->Write( baseCfgName + UserGridUnitsEntry, ( long )m_userUnits );
738  aCfg->Write( baseCfgName + DisplayPadFillEntry, m_DisplayOptions.m_DisplayPadFill );
739  aCfg->Write( baseCfgName + DisplayViaFillEntry, m_DisplayOptions.m_DisplayViaFill );
740  aCfg->Write( baseCfgName + DisplayPadNumberEntry, m_DisplayOptions.m_DisplayPadNum );
741  aCfg->Write( baseCfgName + DisplayModuleEdgeEntry, m_DisplayOptions.m_DisplayModEdgeFill );
742  aCfg->Write( baseCfgName + DisplayModuleTextEntry, m_DisplayOptions.m_DisplayModTextFill );
743  aCfg->Write( baseCfgName + FastGrid1Entry, ( long )m_FastGrid1 );
744  aCfg->Write( baseCfgName + FastGrid2Entry, ( long )m_FastGrid2 );
745 }
746 
747 
748 void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
749 {
750  EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged );
751 
753 
754  // The 3D viewer isn't in the Kiway, so send its update manually
755  EDA_3D_VIEWER* viewer = Get3DViewerFrame();
756 
757  if( viewer )
758  viewer->CommonSettingsChanged( aEnvVarsChanged );
759 }
760 
761 
763 {
764  GetScreen()->SetModify();
765  GetScreen()->SetSave();
766 
767  UpdateStatusBar();
768  UpdateMsgPanel();
769 }
770 
771 
773 {
775 }
776 
777 
779 {
780  UpdateStatusBar();
781  DisplayUnitsMsg();
782 
783  if( m_gridSelectBox == NULL )
784  return;
785 
786  // Update grid values with the current units setting.
787  m_gridSelectBox->Clear();
788  wxArrayString gridsList;
789  int icurr = GetScreen()->BuildGridsChoiceList( gridsList, GetUserUnits() != INCHES );
790 
791  for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ )
792  {
793  GRID_TYPE& grid = GetScreen()->GetGrid( i );
794  m_gridSelectBox->Append( gridsList[i], (void*) &grid.m_CmdId );
795  }
796 
797  m_gridSelectBox->Append( wxT( "---" ) );
798  m_gridSelectBox->Append( _( "Edit user grid..." ) );
799 
800  m_gridSelectBox->SetSelection( icurr );
801 }
802 
803 
805 {
806  if( m_zoomSelectBox == NULL )
807  return;
808 
809  wxString msg;
810 
811  m_zoomSelectBox->Clear();
812  m_zoomSelectBox->Append( _( "Zoom Auto" ) );
813  m_zoomSelectBox->SetSelection( 0 );
814 
815  for( unsigned i = 0; i < GetScreen()->m_ZoomList.size(); ++i )
816  {
817  msg = _( "Zoom " );
818 
819  double level = m_zoomLevelCoeff / (double)GetScreen()->m_ZoomList[i];
820  wxString value = wxString::Format( wxT( "%.2f" ), level );
821  msg += value;
822 
823  m_zoomSelectBox->Append( msg );
824 
825  if( GetScreen()->GetZoom() == GetScreen()->m_ZoomList[i] )
826  m_zoomSelectBox->SetSelection( i + 1 );
827  }
828 }
829 
830 
832 {
833  if( m_FastGrid1 >= (int)GetScreen()->GetGridCount() )
834  return;
835 
836  int cmdId = GetScreen()->GetGrids()[m_FastGrid1].m_CmdId - ID_POPUP_GRID_LEVEL_1000;
837  GetToolManager()->RunAction( "common.Control.gridPreset", true, cmdId );
838 }
839 
840 
842 {
843  if( m_FastGrid2 >= (int)GetScreen()->GetGridCount() )
844  return;
845 
846  int cmdId = GetScreen()->GetGrids()[m_FastGrid2].m_CmdId - ID_POPUP_GRID_LEVEL_1000;
847  GetToolManager()->RunAction( "common.Control.gridPreset", true, cmdId );
848 }
849 
850 
852 {
853  return static_cast<PCB_DRAW_PANEL_GAL*>( EDA_DRAW_FRAME::GetCanvas() );
854 }
855 
856 
858 {
860 
861  EDA_DRAW_PANEL_GAL* canvas = GetCanvas();
862 
863  if( m_toolManager )
864  {
866  GetCanvas()->GetViewControls(), this );
867  }
868 
869  SetBoard( m_Pcb );
870 
871  if( m_toolManager )
873 
874  // Transfer latest current display options from legacy to GAL canvas:
875  auto painter = static_cast<KIGFX::PCB_PAINTER*>( canvas->GetView()->GetPainter() );
876  auto settings = painter->GetSettings();
877  auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
878  settings->LoadDisplayOptions( displ_opts, ShowPageLimits() );
879 
880  canvas->GetView()->RecacheAllItems();
882  canvas->StartDrawing();
883 }
884 
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: class_board.h:792
virtual void SetBoard(BOARD *aBoard)
Function SetBoard sets the m_Pcb member in such as way as to ensure deleting any previous BOARD.
void SetZoneSettings(const ZONE_SETTINGS &aSettings)
Definition: class_board.h:565
to draw blind/buried vias
virtual void ShowChangedLanguage() override
Redraw the menus and what not in current language.
const PAGE_INFO & GetPageSettings() const
Definition: class_board.h:555
EVT_UPDATE_UI(ID_MODEDIT_LOAD_MODULE_FROM_BOARD, FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard) EVT_UPDATE_UI(ID_ADD_FOOTPRINT_TO_BOARD
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
void OnTogglePadDrawMode(wxCommandEvent &aEvent)
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
const PCB_PLOT_PARAMS & GetPlotOptions() const
Definition: class_board.h:558
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame.
virtual void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void CommonSettingsChanged(bool aEnvVarsChanged) override
Notification that common settings are updated.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
void SetGridOrigin(const wxPoint &aPoint)
Function SetGridOrigin sets the origin point of the grid.
Definition: class_board.h:369
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:258
void OnToggleTextDrawMode(wxCommandEvent &aEvent)
int BuildGridsChoiceList(wxArrayString &aGridsList, bool aMmFirst) const
Function BuildGridsChoiceList().
void SetGridOrigin(const wxPoint &aPoint) override
virtual void AddModuleToBoard(MODULE *module)
Adds the given module to the board.
void SetSave()
Definition: base_screen.h:226
bool IsFlipped() const
function IsFlipped
Definition: class_module.h:263
multilayer pads, usually with holes
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
TOOL_DISPATCHER * m_toolDispatcher
static const wxChar DisplayViaFillEntry[]
static const wxChar UserGridSizeYEntry[]
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: class_board.h:562
double bestZoom(double sizeX, double sizeY, double scaleFactor, wxPoint centre)
const EDA_RECT GetBoardEdgesBoundingBox() const
Function GetBoardEdgesBoundingBox Returns the board bounding box calculated using exclusively the boa...
Definition: class_board.h:804
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
The current canvas type.
static const wxChar DisplayModuleEdgeEntry[]
void OnToggleEdgeDrawMode(wxCommandEvent &aEvent)
void SetFastGrid2()
Function SetFastGrid2()
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: class_board.h:556
static const wxChar DisplayModuleTextEntry[]
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1402
double RAD2DEG(double rad)
Definition: trigo.h:211
void CommonSettingsChanged(bool aEnvVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
Definition: id.h:215
const wxPoint & GetGridOrigin() const override
Return the absolute coordinates of the origin of the snap grid.
int GetWidth() const
Definition: eda_rect.h:117
void OnToggleGraphicDrawMode(wxCommandEvent &aEvent)
void RecreateToolbars()
Rebuild all toolbars, and update the checked state of ckeck tools.
LSET GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
show modules values (when texts are visibles)
const GRID_TYPE & GetGrid() const
Return the grid object of the currently selected grid.
Definition: base_screen.h:286
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:540
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock) override
wxAuiManager m_auimgr
void SetDrawBgColor(COLOR4D aColor) override
double From_User_Unit(EDA_UNITS_T aUnits, double aValue, bool aUseMils)
Return in internal units the value "val" given in a real unit such as "in", "mm" or "deg".
Definition: base_units.cpp:282
VTBL_ENTRY _ELEM * GetElem(ELEM_T aIndex)
Typically wrapped somewhere else in a more meaningful function wrapper.
Definition: project.cpp:205
static const wxChar FastGrid2Entry[]
The base class for create windows for drawing purpose.
virtual const PCB_PLOT_PARAMS & GetPlotSettings() const
Function GetPlotSettings returns the PCB_PLOT_PARAMS for the BOARD owned by this frame.
COLOR4D m_drawBgColor
PCB_LAYER_ID m_Active_Layer
Definition: pcb_screen.h:44
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
void OnUpdateSelectZoom(wxUpdateUIEvent &aEvent)
wxChoice * m_gridSelectBox
void SetAuxOrigin(const wxPoint &aPoint)
Function SetAuxOrigin sets the origin point used for plotting.
Definition: class_board.h:362
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
const wxPoint & GetAuxOrigin() const override
Return the origin of the axis used for plotting and various exports.
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
static const wxChar AUTO_ZOOM_KEY[]
Key in KifaceSettings to store the canvas type.
Definitions for tracks, vias and zones.
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
bool ShowPageLimits() const
Auxiliary rendering target (noncached)
Definition: definitions.h:49
FP_LIB_TABLE GFootprintTable
The global footprint library table.
Definition: pcbnew.cpp:303
void DisplayUnitsMsg()
Display current unit pane on the status bar.
VTBL_ENTRY void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:217
Classes used in Pcbnew, CvPcb and GerbView.
show modules on front
void SetFastGrid1()
Function SetFastGrid1()
#define IS_NEW
New item, just created.
Definition: base_struct.h:120
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:63
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
timestamp_t GetNewTimeStamp()
Definition: common.cpp:217
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
PCB_LAYER_ID
A quick note on layer IDs:
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
Function GetCollectorsGuide.
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:265
virtual void ActivateGalCanvas() override
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
EDA_3D_VIEWER * CreateAndShow3D_Frame()
Shows the 3D view frame.
MODULES & Modules()
Definition: class_board.h:236
PCB_GENERAL_SETTINGS & Settings()
void OnUpdateSelectGrid(wxUpdateUIEvent &aEvent)
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
double To_User_Unit(EDA_UNITS_T aUnit, double aValue, bool aUseMils)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:93
bool m_showBorderAndTitleBlock
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:74
void SetEnd(int x, int y)
Definition: eda_rect.h:134
Definition: common.h:155
wxChoice * m_zoomSelectBox
double GetLegacyZoom() const
Function GetLegacyZoom() Returns current view scale converted to zoom value used by the legacy canvas...
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Function Flip Flip this object, i.e.
to draw usual through hole vias
const ZONE_SETTINGS & GetZoneSettings() const
const GRIDS & GetGrids() const
Function GetGrids().
Definition: base_screen.h:339
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
Adds an item to the container.
Base window classes and related definitions.
static const wxChar UserGridSizeXEntry[]
Helper dialog and control classes.
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Function ResetTools() Resets all tools (i.e.
static const wxChar DisplayPadNumberEntry[]
wxRealPoint m_Size
Definition: base_screen.h:47
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:258
virtual KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
EDA_RECT GetBoardBoundingBox(bool aBoardEdgesOnly=false) const
Function GetBoardBoundingBox calculates the bounding box containing all board items (or board edge se...
void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aDesignSettings)
Function SetDesignSettings.
Definition: class_board.h:550
void SetGeneralSettings(PCB_GENERAL_SETTINGS *aGeneralSettings)
Definition: class_board.h:577
PCB_GENERAL_SETTINGS m_configSettings
void SetPosition(const wxPoint &aPos) override
const wxPoint & GetAuxOrigin() const
Definition: class_board.h:363
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
Definition: class_board.h:559
virtual void ActivateGalCanvas()
Use to start up the GAL drawing canvas.
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:541
wxPoint m_UserGridSize
virtual void ReCreateMenuBar() override
Recreates the menu bar.
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
#define _(s)
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void StartDrawing()
Function StartDrawing() Begins drawing if it was stopped previously.
KICAD_T Type() override
Definition: fp_lib_table.h:108
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
int GetHeight() const
Definition: eda_rect.h:118
const wxPoint & GetGridOrigin() const
Definition: class_board.h:370
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
virtual double BestZoom() override
Function BestZoom.
PCB_DISPLAY_OPTIONS m_DisplayOptions
void UpdateGridSelectBox()
static const wxChar FastGrid1Entry[]
virtual const wxString GetZoomLevelIndicator() const
Return a human readable value which can be displayed as zoom level indicator in dialogs.
virtual void SwitchLayer(wxDC *DC, PCB_LAYER_ID layer)
Class ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:49
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
void DisplayGridMsg()
Function DisplayGridMsg()
const TITLE_BLOCK & GetTitleBlock() const override
static const wxChar UserGridUnitsEntry[]
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
virtual void UpdateStatusBar() override
Update the status bar information.
double m_zoomLevelCoeff
smd pads, front layer
TITLE_BLOCK & GetTitleBlock()
Definition: class_board.h:561
see class PGM_BASE
EDA_UNITS_T m_userUnits
Declaration of the eda_3d_viewer class.
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
static const wxChar DisplayPadFillEntry[]
Class to handle a graphic segment.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
Class GRID_TYPE is for grid arrays.
Definition: base_screen.h:43
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.
PCB_EDIT_FRAME::OnUpdateSelectTrackWidth EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8, PCB_EDIT_FRAME::OnUpdateSelectViaSize) PCB_EDIT_FRAME
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools.
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
void SetOrientation(double newangle)
virtual void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aSettings)
size_t i
Definition: json11.cpp:597
int GetCopperLayerCount() const
Function GetCopperLayerCount.
size_t GetGridCount() const
Function GetGridCount().
Definition: base_screen.h:324
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const PAGE_INFO & GetPageSettings() const override
#define IU_PER_MILS
Definition: plotter.cpp:134
const ZONE_SETTINGS & GetZoneSettings() const
Definition: class_board.h:564
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, EDA_BASE_FRAME *aFrame)
Sets the work environment (model, view, view controls and the parent window).
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
wxPoint Centre() const
Definition: eda_rect.h:60
virtual void SetPageSettings(const PAGE_INFO &aPageSettings) override
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
void CommonSettingsChanged(bool aEnvVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
void SetZoneSettings(const ZONE_SETTINGS &aSettings)
void SetAuxOrigin(const wxPoint &aPoint) override
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
Definition: eda_3d_viewer.h:56
GAL_TYPE GetBackend() const
Function GetBackend Returns the type of backend currently used by GAL canvas.
TOOL_MANAGER * m_toolManager
void UpdateStatusBar() override
Update the status bar information.
Module description (excepted pads)
BOARD * GetBoard() const
void updateZoomSelectBox()
void SetModify()
Definition: base_screen.h:224
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:385
virtual void Update3DView(bool aForceReload, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
int m_CmdId
Definition: base_screen.h:46
Message panel definition file.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
Rendering engine changes.
Definition: tool_base.h:83
EDA_3D_VIEWER * Get3DViewerFrame()
virtual void ShowChangedLanguage()
Redraw the menus and what not in current language.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
const wxPoint GetPosition() const override
Definition: class_module.h:188
#define QUALIFIED_VIEWER3D_FRAMENAME(parent)
Definition: eda_3d_viewer.h:50
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
EDA_UNITS_T
Definition: common.h:154
VTBL_ENTRY const wxString FootprintLibTblName() const
Function FootprintLibTblName returns the path and filename of this project's fp-lib-table,...
Definition: project.cpp:120
show modules references (when texts are visibles)
static const wxChar ZOOM_KEY[]
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
Definition: base_screen.h:138
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:114
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:215
Color has changed.
Definition: view_item.h:57
virtual void UpdateMsgPanel()
Redraw the message panel.
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
const wxString GetZoomLevelIndicator() const override
Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level in...
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39