KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gerbview_control.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) 2017 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <base_units.h>
22#include <confirm.h>
23#include <common.h>
25#include <export_to_pcbnew.h>
26#include <gerber_file_image.h>
28#include <gerbview_painter.h>
29#include <gerbview_frame.h>
30#include <gerbview_settings.h>
31#include <string_utils.h>
32#include <excellon_image.h>
33#include <tool/tool_manager.h>
34#include <project.h>
35#include <view/view.h>
37#include <wx/filedlg.h>
38#include <kiplatform/ui.h>
39
40#include "gerbview_actions.h"
41#include "gerbview_control.h"
43
44
45GERBVIEW_CONTROL::GERBVIEW_CONTROL() : TOOL_INTERACTIVE( "gerbview.Control" ), m_frame( nullptr )
46{
47}
48
49
54
55
57{
58 m_frame->LoadAutodetectedFiles( wxEmptyString );
59
60 return 0;
61}
62
63
65{
66 m_frame->LoadGerberFiles( wxEmptyString );
67
68 return 0;
69}
70
71
73{
74 m_frame->LoadExcellonFiles( wxEmptyString );
75
76 return 0;
77}
78
79
81{
82 m_frame->LoadGerberJobFile( wxEmptyString );
83 canvas()->Refresh();
84
85 return 0;
86}
87
88
90{
91 m_frame->LoadZipArchiveFile( wxEmptyString );
92 canvas()->Refresh();
93
94 return 0;
95}
96
97
99{
100 m_frame->ToggleLayerManager();
101
102 return 0;
103}
104
105
107{
108 int layercount = 0;
109
110 GERBER_FILE_IMAGE_LIST* images = m_frame->GetGerberLayout()->GetImagesList();
111
112 // Count the Gerber layers which are actually currently used
113 for( int ii = 0; ii < (int) images->ImagesMaxCount(); ++ii )
114 {
115 if( images->GetGbrImage( ii ) )
116 layercount++;
117 }
118
119 if( layercount == 0 )
120 {
121 DisplayInfoMessage( m_frame, _( "None of the Gerber layers contain any data" ) );
122 return 0;
123 }
124
125 wxString fileDialogName( NAMELESS_PROJECT + wxT( "." ) + FILEEXT::KiCadPcbFileExtension );
126 wxString path = m_frame->GetMruPath();
127
128 wxFileDialog filedlg( m_frame, _( "Export as KiCad Board File" ), path, fileDialogName,
129 FILEEXT::PcbFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
130
132
133 if( filedlg.ShowModal() == wxID_CANCEL )
134 return 0;
135
136 wxFileName fileName = EnsureFileExtension( filedlg.GetPath(), FILEEXT::KiCadPcbFileExtension );
137
139
140 if( layerdlg.ShowModal() != wxID_OK )
141 return 0;
142
143 m_frame->SetMruPath( fileName.GetPath() );
144
145 GBR_TO_PCB_EXPORTER gbr_exporter( m_frame->GetGerberLayout()->GetImagesList(), m_frame, fileName.GetFullPath() );
146
147 gbr_exporter.ExportPcb( layerdlg.GetLayersLookUpTable(), layerdlg.GetCopperLayersCount() );
148
149 return 0;
150}
151
152
154{
155 auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>( getView()->GetPainter() )->GetSettings();
156 const auto& selection = m_toolMgr->GetTool<GERBVIEW_SELECTION_TOOL>()->GetSelection();
157 GERBER_DRAW_ITEM* item = nullptr;
158
159 if( selection.Size() == 1 )
160 {
161 item = static_cast<GERBER_DRAW_ITEM*>( selection[0] );
162 }
163
165 {
166 m_frame->m_SelComponentBox->SetSelection( 0 );
167 m_frame->m_SelNetnameBox->SetSelection( 0 );
168 m_frame->m_SelAperAttributesBox->SetSelection( 0 );
169
170 settings->ClearHighlightSelections();
171
172 GERBER_FILE_IMAGE* gerber = m_frame->GetGbrImage( m_frame->GetActiveLayer() );
173
174 if( gerber )
175 gerber->m_Selected_Tool = settings->m_dcodeHighlightValue;
176 }
177 else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightNet ) )
178 {
179 wxString net_name = item->GetNetAttributes().m_Netname;
180 settings->m_netHighlightString = net_name;
181 m_frame->m_SelNetnameBox->SetStringSelection( UnescapeString( net_name ) );
182 }
183 else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightComponent ) )
184 {
185 wxString net_attr = item->GetNetAttributes().m_Cmpref;
186 settings->m_componentHighlightString = net_attr;
187 m_frame->m_SelComponentBox->SetStringSelection( net_attr );
188 }
189 else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightAttribute ) )
190 {
191 D_CODE* apertDescr = item->GetDcodeDescr();
192
193 if( apertDescr )
194 {
195 wxString ap_name = apertDescr->m_AperFunction;
196 settings->m_attributeHighlightString = ap_name;
197 m_frame->m_SelAperAttributesBox->SetStringSelection( ap_name );
198 }
199 }
200 else if( item && aEvent.IsAction( &GERBVIEW_ACTIONS::highlightDCode ) )
201 {
202 D_CODE* apertDescr = item->GetDcodeDescr();
203
204 if( apertDescr )
205 {
206 int dcodeSelected = -1;
207 GERBER_FILE_IMAGE* gerber = m_frame->GetGbrImage( m_frame->GetActiveLayer() );
208
209 if( gerber )
210 dcodeSelected = apertDescr->m_Num_Dcode;
211
212 if( dcodeSelected > 0 )
213 {
214 settings->m_dcodeHighlightValue = dcodeSelected;
215 gerber->m_Selected_Tool = dcodeSelected;
216 m_frame->syncLayerBox( false );
217 }
218 }
219 }
220
222 canvas()->Refresh();
223
224 return 0;
225}
226
227
229{
230 GERBVIEW_SETTINGS* cfg = m_frame->gvconfig();
231 KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
232
234 {
236
238 []( KIGFX::VIEW_ITEM* aItem )
239 {
240 GERBER_DRAW_ITEM* item = dynamic_cast<GERBER_DRAW_ITEM*>( aItem );
241
242 if( !item )
243 return false;
244
245 switch( item->m_ShapeType )
246 {
247 case GBR_CIRCLE:
248 case GBR_ARC:
249 case GBR_SEGMENT:
250 return true;
251
252 default:
253 return false;
254 }
255 } );
256 }
258 {
260
262 []( KIGFX::VIEW_ITEM* aItem )
263 {
264 GERBER_DRAW_ITEM* item = dynamic_cast<GERBER_DRAW_ITEM*>( aItem );
265
266 if( !item )
267 return false;
268
269 switch( item->m_ShapeType )
270 {
271 case GBR_SPOT_CIRCLE:
272 case GBR_SPOT_RECT:
273 case GBR_SPOT_OVAL:
274 case GBR_SPOT_POLY:
275 case GBR_SPOT_MACRO:
276 return true;
277
278 default:
279 return false;
280 }
281 } );
282 }
284 {
286
288 []( KIGFX::VIEW_ITEM* aItem )
289 {
290 GERBER_DRAW_ITEM* item = dynamic_cast<GERBER_DRAW_ITEM*>( aItem );
291
292 return ( item && item->m_ShapeType == GBR_POLYGON );
293 } );
294 }
296 {
298 }
299 else if( aEvent.IsAction( &GERBVIEW_ACTIONS::dcodeDisplay ) )
300 {
301 m_frame->SetElementVisibility( LAYER_DCODES, !cfg->m_Appearance.show_dcodes );
302 }
303 else if( aEvent.IsAction( &ACTIONS::highContrastMode ) )
304 {
308 }
309 else if( aEvent.IsAction( &ACTIONS::highContrastModeCycle ) )
310 {
312
313 switch( mode )
314 {
318 }
319 }
321 {
323 }
325 {
327 }
329 {
331 }
333 {
335
337 cfg->m_Display.m_XORMode = false;
338
339 m_frame->UpdateXORLayers();
340 }
341 else if( aEvent.IsAction( &GERBVIEW_ACTIONS::toggleXORMode ) )
342 {
344
346 cfg->m_Display.m_ForceOpacityMode = false;
347
348 m_frame->UpdateXORLayers();
349 }
350 else if( aEvent.IsAction( &GERBVIEW_ACTIONS::flipGerberView ) )
351 {
353 view->SetMirror( cfg->m_Display.m_FlipGerberView, false );
354 }
355
356 bool contrastModeChanged = aEvent.IsAction( &ACTIONS::highContrastMode )
361
362 if( contrastModeChanged )
363 {
364 switch( cfg->m_Display.m_InactiveLayerMode )
365 {
367 m_frame->SelectToolbarAction( GERBVIEW_ACTIONS::showInactiveLayers );
368 break;
369
371 m_frame->SelectToolbarAction( GERBVIEW_ACTIONS::dimInactiveLayers );
372 break;
373
375 m_frame->SelectToolbarAction( GERBVIEW_ACTIONS::hideInactiveLayers );
376 break;
377 }
378 }
379
380 m_frame->ApplyDisplaySettingsToGAL();
381
382 if( contrastModeChanged )
383 {
385 }
386 else
387 {
389 }
390 m_frame->GetCanvas()->Refresh();
391
392 return 0;
393}
394
395
397{
398 int layer = m_frame->GetActiveLayer();
399
400 if( layer < ( (int) GERBER_FILE_IMAGE_LIST::GetImagesList().GetLoadedImageCount() - 1 ) )
401 m_frame->SetActiveLayer( layer + 1, true );
402
403 return 0;
404}
405
406
408{
409 int layer = m_frame->GetActiveLayer();
410
411 if( layer > 0 )
412 m_frame->SetActiveLayer( layer - 1, true );
413
414 return 0;
415}
416
417
419{
420 int layer = m_frame->GetActiveLayer();
422
423 if( layer > 0 && list.GetGbrImage( layer ) && list.GetGbrImage( layer - 1 ) )
424 {
425 m_frame->RemapLayers( list.SwapImages( layer, layer - 1 ) );
426 m_frame->SetActiveLayer( layer - 1 );
427 }
428
429 return 0;
430}
431
432
434{
435 int layer = m_frame->GetActiveLayer();
437
438 if( layer < ( (int) list.GetLoadedImageCount() - 1 )
439 && list.GetGbrImage( layer ) && list.GetGbrImage( layer + 1 ) )
440 {
441 m_frame->RemapLayers( list.SwapImages( layer, layer + 1 ) );
442 m_frame->SetActiveLayer( layer + 1 );
443 }
444
445 return 0;
446}
447
448
450{
451 m_frame->Erase_Current_DrawLayer( true );
452 m_frame->ClearMsgPanel();
453
454 return 0;
455}
456
457
459{
460 m_frame->Clear_DrawLayers( false );
461 m_toolMgr->RunAction( ACTIONS::zoomFitScreen );
462 canvas()->Refresh();
463 m_frame->ClearMsgPanel();
464
465 // Clear pending highlight selections, now outdated
467 static_cast<KIGFX::GERBVIEW_PAINTER*>( getView()->GetPainter() )->GetSettings();
468 settings->ClearHighlightSelections();
469
470 return 0;
471}
472
473
475{
476 struct SAVED_LAYER
477 {
478 wxString fileName;
479 wxString archiveFileName;
480 VECTOR2I displayOffset;
481 EDA_ANGLE displayRotation;
482 bool visible;
483 bool restored = false;
484 };
485
486 // Store filenames and display settings before clearing the images.
487 wxArrayString listOfGerberFiles;
488 std::vector<int> fileType;
489 wxArrayString archiveFiles;
490 std::vector<wxArrayString> archiveMembers;
491 std::vector<SAVED_LAYER> savedLayers;
492 GERBER_FILE_IMAGE_LIST* list = m_frame->GetImagesList();
493 LSET oldVisibility = m_frame->GetVisibleLayers();
494
495 for( unsigned i = 0; i < list->ImagesMaxCount(); i++ )
496 {
497 GERBER_FILE_IMAGE* image = list->GetGbrImage( i );
498
499 if( !image || !image->m_InUse )
500 continue;
501
502 savedLayers.push_back( { image->m_FileName, image->m_ArchiveFileName, image->m_DisplayOffset,
503 image->m_DisplayRotation, oldVisibility[i] } );
504
505 if( !image->m_ArchiveFileName.IsEmpty() )
506 {
507 int archiveIndex = archiveFiles.Index( image->m_ArchiveFileName );
508
509 if( archiveIndex == wxNOT_FOUND )
510 {
511 archiveIndex = archiveFiles.GetCount();
512 archiveFiles.Add( image->m_ArchiveFileName );
513 archiveMembers.emplace_back();
514 }
515
516 archiveMembers[archiveIndex].Add( image->m_FileName );
517 continue;
518 }
519
520 EXCELLON_IMAGE* drill_file = dynamic_cast<EXCELLON_IMAGE*>( image );
521
522 if( drill_file )
523 fileType.push_back( 1 );
524 else
525 fileType.push_back( 0 );
526
527 listOfGerberFiles.Add( image->m_FileName );
528 }
529
530 // Clear all layers
531 m_frame->Clear_DrawLayers( false );
532 m_frame->ClearMsgPanel();
533
534 // Load the layers from stored paths
535 wxBusyCursor wait;
536 if( !listOfGerberFiles.IsEmpty() )
537 m_frame->LoadListOfGerberAndDrillFiles( wxEmptyString, listOfGerberFiles, &fileType );
538
539 for( unsigned i = 0; i < archiveFiles.GetCount(); i++ )
540 m_frame->LoadZipArchiveFile( archiveFiles[i], &archiveMembers[i] );
541
542 // Loading and sorting may assign a file to a different layer number.
543 LSET restoredVisibility = m_frame->GetVisibleLayers();
544
545 for( unsigned i = 0; i < list->ImagesMaxCount(); i++ )
546 {
547 GERBER_FILE_IMAGE* image = list->GetGbrImage( i );
548
549 if( !image || !image->m_InUse )
550 continue;
551
552 for( SAVED_LAYER& saved : savedLayers )
553 {
554 if( saved.restored || saved.fileName != image->m_FileName
555 || saved.archiveFileName != image->m_ArchiveFileName )
556 {
557 continue;
558 }
559
560 image->SetDrawOffetAndRotation( VECTOR2D( saved.displayOffset.x / gerbIUScale.IU_PER_MM,
561 saved.displayOffset.y / gerbIUScale.IU_PER_MM ),
562 saved.displayRotation );
563 restoredVisibility[i] = saved.visible;
564 saved.restored = true;
565 break;
566 }
567 }
568
569 m_frame->SetVisibleLayers( restoredVisibility );
570 m_frame->ReFillLayerWidget();
571
572 KIGFX::VIEW* view = getView();
573 view->RecacheAllItems();
574 view->MarkDirty();
575 view->UpdateAllItems( KIGFX::ALL );
576 canvas()->Refresh();
577
578 return 0;
579}
580
581
583{
585 GERBVIEW_SELECTION& selection = selTool->GetSelection();
586
587 if( selection.GetSize() == 1 )
588 {
589 EDA_ITEM* item = (EDA_ITEM*) selection.Front();
590
591 std::vector<MSG_PANEL_ITEM> msgItems;
592 item->GetMsgPanelInfo( m_frame, msgItems );
593 m_frame->SetMsgPanel( msgItems );
594 }
595 else
596 {
597 m_frame->EraseMsgBox();
598 }
599
600 return 0;
601}
602
603
605{
606 m_frame->LoadZipArchiveFile( *aEvent.Parameter<wxString*>() );
607 canvas()->Refresh();
608
609 return 0;
610}
611
612
614{
615 // The event parameter is a string containing names of dropped files.
616 // Each file name has been enclosed with "", so file names with space character are allowed.
617 wxString files = *aEvent.Parameter<wxString*>();
618 // ie : files = "file1""another file""file3"...
619
620 std::vector<wxString> aFileNameList;
621
622 // Isolate each file name, deletting ""
623 files = files.AfterFirst( '"' );
624
625 // Gerber files are enclosed with "".
626 // Load files names in array.
627 while( !files.empty() )
628 {
629 wxString fileName = files.BeforeFirst( '"' );
630 // Check if file exists. If not, keep on and ignore fileName
631 if( wxFileName( fileName ).Exists() )
632 aFileNameList.push_back( fileName );
633 files = files.AfterFirst( '"' );
634 files = files.AfterFirst( '"' );
635 }
636
637 if( !aFileNameList.empty() )
638 m_frame->OpenProjectFiles( aFileNameList, KICTL_CREATE );
639
640 return 0;
641}
642
643
645{
654
660
668
682
687
690}
constexpr EDA_IU_SCALE gerbIUScale
Definition base_units.h:127
static TOOL_ACTION updateUnits
Definition actions.h:203
static TOOL_ACTION highContrastModeCycle
Definition actions.h:152
static TOOL_ACTION highContrastMode
Definition actions.h:151
static TOOL_ACTION zoomFitScreen
Definition actions.h:138
static TOOL_ACTION print
Definition actions.h:60
Show the Gerber files loaded and allow the user to choose between Gerber layers and pcb layers.
int ShowModal() override
A gerber DCODE (also called Aperture) definition.
Definition dcode.h:76
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
Definition dcode.h:210
int m_Num_Dcode
D code value ( >= 10 )
Definition dcode.h:200
virtual KIGFX::VIEW * GetView() const
Return a pointer to the KIGFX::VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition eda_item.h:296
static const TOOL_EVENT ClearedEvent
Definition actions.h:347
static const TOOL_EVENT SelectedEvent
Definition actions.h:345
static const TOOL_EVENT UnselectedEvent
Definition actions.h:346
Handle a drill image.
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
GBR_INACTIVE_LAYER_MODE m_InactiveLayerMode
How inactive layers are displayed.
bool m_XORMode
Display layers in exclusive-or mode.
bool m_FlipGerberView
Display as a mirror image.
bool m_ForceOpacityMode
Display layers in transparency (alpha channel) forced mode.
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
wxString m_Cmpref
the component reference parent of the data
wxString m_Netname
for items associated to a net: the netname
A helper class to export a Gerber set of files to Pcbnew.
bool ExportPcb(const int *aLayerLookUpTable, int aCopperLayers)
Save a board from a set of Gerber images.
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
GBR_BASIC_SHAPE_TYPE m_ShapeType
const GBR_NETLIST_METADATA & GetNetAttributes() const
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
static GERBER_FILE_IMAGE_LIST & GetImagesList()
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
Hold the image data and parameters for one gerber file and layer parameters.
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
static TOOL_ACTION flashedDisplayOutlines
static TOOL_ACTION highlightAttribute
static TOOL_ACTION exportToPcbnew
static TOOL_ACTION highlightNet
static TOOL_ACTION toggleXORMode
static TOOL_ACTION loadZipFile
static TOOL_ACTION toggleLayerManager
static TOOL_ACTION openGerber
static TOOL_ACTION clearAllLayers
static TOOL_ACTION showInactiveLayers
static TOOL_ACTION layerNext
static TOOL_ACTION flipGerberView
static TOOL_ACTION openAutodetected
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION toggleForceOpacityMode
static TOOL_ACTION dimInactiveLayers
static TOOL_ACTION linesDisplayOutlines
static TOOL_ACTION layerPrev
static TOOL_ACTION openDrillFile
static TOOL_ACTION polygonsDisplayOutlines
static TOOL_ACTION highlightComponent
static TOOL_ACTION openZipFile
static TOOL_ACTION highlightDCode
static TOOL_ACTION moveLayerUp
static TOOL_ACTION moveLayerDown
static TOOL_ACTION loadGerbFiles
static TOOL_ACTION hideInactiveLayers
static TOOL_ACTION openJobFile
static TOOL_ACTION clearLayer
static TOOL_ACTION highlightClear
EDA_DRAW_PANEL_GAL * canvas()
int OpenDrillFile(const TOOL_EVENT &aEvent)
int OpenAutodetected(const TOOL_EVENT &aEvent)
int LayerNext(const TOOL_EVENT &aEvent)
int HighlightControl(const TOOL_EVENT &aEvent)
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int MoveLayerDown(const TOOL_EVENT &aEvent)
int ClearLayer(const TOOL_EVENT &aEvent)
int LayerPrev(const TOOL_EVENT &aEvent)
void setTransitions() override
Set up handlers for various events.
int ReloadAllLayers(const TOOL_EVENT &aEvent)
GERBVIEW_FRAME * m_frame
int ToggleLayerManager(const TOOL_EVENT &aEvent)
int OpenJobFile(const TOOL_EVENT &aEvent)
int MoveLayerUp(const TOOL_EVENT &aEvent)
int ExportToPcbnew(const TOOL_EVENT &aEvent)
int OpenGerber(const TOOL_EVENT &aEvent)
int LoadGerbFiles(const TOOL_EVENT &aEvent)
int ClearAllLayers(const TOOL_EVENT &aEvent)
int DisplayControl(const TOOL_EVENT &aEvent)
int LoadZipfile(const TOOL_EVENT &aEvent)
int OpenZipFile(const TOOL_EVENT &aEvent)
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
Selection tool for GerbView, based on the one in Pcbnew.
GERBVIEW_SELECTION & GetSelection()
Return the set of currently selected items.
GBR_DISPLAY_OPTIONS m_Display
Methods for drawing GerbView specific items.
Store GerbView specific render settings.
void ClearHighlightSelections()
Clear all highlight selections (dcode, net, component, attribute selection)
An abstract base class for deriving all objects that can be added to a VIEW.
Definition view_item.h:82
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
Definition view.cpp:638
void RecacheAllItems()
Rebuild GAL display lists.
Definition view.cpp:1597
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition view.cpp:1743
void MarkDirty()
Force redraw of view on the next rendering.
Definition view.h:681
PAINTER * GetPainter() const
Return the painter object used by the view for drawing VIEW_ITEM objects.
Definition view.h:227
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
Definition view.cpp:1759
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
T * getEditFrame() const
Return the application window object, casted to requested user type.
Definition tool_base.h:182
TOOL_MANAGER * m_toolMgr
Definition tool_base.h:220
KIGFX::VIEW * getView() const
Return the instance of KIGFX::VIEW object used in the application.
Definition tool_base.cpp:34
RESET_REASON
Determine the reason of reset for a tool.
Definition tool_base.h:74
Generic, UI-independent tool event.
Definition tool_event.h:167
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
T Parameter() const
Return a parameter assigned to the event.
Definition tool_event.h:484
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
TOOL_INTERACTIVE(TOOL_ID aId, const std::string &aName)
Create a tool with given id & name.
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
Definition common.cpp:848
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition confirm.cpp:245
This file is part of the common library.
#define _(s)
GBR_INACTIVE_LAYER_MODE
@ GBR_SPOT_OVAL
@ GBR_SEGMENT
@ GBR_SPOT_POLY
@ GBR_SPOT_RECT
@ GBR_CIRCLE
@ GBR_POLYGON
@ GBR_SPOT_CIRCLE
@ GBR_ARC
@ GBR_SPOT_MACRO
static const std::string KiCadPcbFileExtension
static wxString PcbFileWildcard()
#define KICTL_CREATE
caller thinks requested project files may not exist.
@ LAYER_DCODES
Definition layer_ids.h:551
@ LAYER_NEGATIVE_OBJECTS
Definition layer_ids.h:552
@ COLOR
Color has changed.
Definition view_item.h:50
@ REPAINT
Item needs to be redrawn.
Definition view_item.h:54
@ ALL
All except INITIAL_ADD.
Definition view_item.h:55
void AllowNetworkFileSystems(wxDialog *aDialog)
Configure a file dialog to show network and virtual file systems.
Definition wxgtk/ui.cpp:533
#define NAMELESS_PROJECT
default name for nameless projects
Definition project.h:41
MODEL3D_FORMAT_TYPE fileType(const char *aFileName)
wxString UnescapeString(const wxString &aSource)
std::string path
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
VECTOR2< double > VECTOR2D
Definition vector2d.h:707
Definition of file extensions used in Kicad.