KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_zone_manager.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) 2023 Ethan Chien <[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
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, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <algorithm>
22#include <memory>
23#include <optional>
24#include <wx/dataview.h>
25#include <wx/debug.h>
26#include <wx/event.h>
27#include <wx/gdicmn.h>
28#include <wx/wupdlock.h>
29#include <pcb_edit_frame.h>
30#include <wx/string.h>
31#include <pcb_draw_panel_gal.h>
32#include <tool/tool_manager.h>
34#include <view/view.h>
37#include <zone.h>
38#include <zone_settings_bag.h>
39#include <board.h>
40#include <bitmaps.h>
41#include <string_utils.h>
42#include <zone_filler.h>
43#include <zone_utils.h>
44
48#include "dialog_zone_manager.h"
49
50
52 DIALOG_ZONE_MANAGER_BASE( aParent ),
53 m_pcbFrame( aParent ),
54 m_zoneSettingsBag( aParent->GetBoard() ),
56 m_isFillingZones( false ),
57 m_zoneFillComplete( false ),
58 m_zonesToDelete()
59{
60#ifdef __APPLE__
61 m_sizerZoneOP->InsertSpacer( m_sizerZoneOP->GetItemCount(), 5 );
62#endif
63
64 m_btnMoveTop->SetBitmap( KiBitmapBundle( BITMAPS::small_top ) );
65 m_btnMoveUp->SetBitmap( KiBitmapBundle( BITMAPS::small_up ) );
66 m_btnMoveDown->SetBitmap( KiBitmapBundle( BITMAPS::small_down ) );
67 m_btnMoveBottom->SetBitmap( KiBitmapBundle( BITMAPS::small_bottom ) );
68 m_btnDelete->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
69 m_btnAutoAssign->SetBitmap( KiBitmapBundle( BITMAPS::small_sort_desc ) );
70
71 m_panelZoneProperties = new PANEL_ZONE_PROPERTIES( m_zonePanel, aParent, m_zoneSettingsBag );
72 m_sizerProperties->Add( m_panelZoneProperties, 1, wxEXPAND, 5 );
73
74 m_zonePreviewNotebook = new ZONE_PREVIEW_NOTEBOOK( m_zonePanel, aParent );
75 m_sizerPreview->Add( m_zonePreviewNotebook, 1, wxBOTTOM | wxLEFT | wxRIGHT | wxEXPAND, 5 );
76 m_sizerPreview->Layout();
77
78 for( const auto& [k, v] : MODEL_ZONES_OVERVIEW::GetColumnNames() )
79 {
81 m_viewZonesOverview->AppendIconTextColumn( v, k, wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_DEFAULT );
82 else
83 m_viewZonesOverview->AppendTextColumn( v, k, wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_DEFAULT );
84 }
85
86 m_modelZonesOverview = new MODEL_ZONES_OVERVIEW( this, m_pcbFrame, m_zoneSettingsBag );
87 m_viewZonesOverview->AssociateModel( m_modelZonesOverview.get() );
88 m_viewZonesOverview->SetLayoutDirection( wxLayout_LeftToRight );
89
90 m_layerFilter->Clear();
91 m_layerFilter->Append( _( "All Layers" ) );
92
93 LSET usedLayers;
94 BOARD* board = m_pcbFrame->GetBoard();
95
96 for( ZONE* zone : m_zoneSettingsBag.GetClonedZoneList() )
97 usedLayers |= zone->GetLayerSet();
98
99 for( PCB_LAYER_ID layer : usedLayers.Seq() )
100 {
101 m_layerFilter->Append( board->GetLayerName( layer ),
102 reinterpret_cast<void*>( static_cast<intptr_t>( layer ) ) );
103 }
104
105 m_modelZonesOverview->SetLayerFilter( UNDEFINED_LAYER );
106 m_layerFilter->SetSelection( 0 );
107
108 m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(), m_viewZonesOverview->GetSelection() );
109
110 if( m_modelZonesOverview->GetCount() )
111 SelectZoneTableItem( m_modelZonesOverview->GetItem( 0 ) );
112 else
113 m_panelZoneProperties->SetZone( nullptr );
114
115 // Control values set before the dialog is shown may not render, so re-apply them once
116 // it is on screen (issue 24797).
117 CallAfter(
118 [this]()
119 {
120 if( m_panelZoneProperties->GetZone() )
121 m_panelZoneProperties->TransferZoneSettingsToWindow();
122 } );
123
124 Layout();
125 m_MainBoxSizer->Fit( this );
126 finishDialogSettings();
127
128#if wxUSE_DRAG_AND_DROP
129 m_viewZonesOverview->EnableDragSource( wxDF_UNICODETEXT );
130 m_viewZonesOverview->EnableDropTarget( wxDF_UNICODETEXT );
131
132 int id = m_viewZonesOverview->GetId();
133 Bind( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, &DIALOG_ZONE_MANAGER::OnBeginDrag, this, id );
134 Bind( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, &DIALOG_ZONE_MANAGER::OnDropPossible, this, id );
135 Bind( wxEVT_DATAVIEW_ITEM_DROP, &DIALOG_ZONE_MANAGER::OnDrop, this, id );
136#endif // wxUSE_DRAG_AND_DROP
137
138 Bind( EVT_ZONE_NAME_UPDATE, &DIALOG_ZONE_MANAGER::OnZoneNameUpdate, this );
139 Bind( EVT_ZONE_NET_UPDATE, &DIALOG_ZONE_MANAGER::OnZoneNetUpdate, this );
140 Bind( EVT_ZONES_OVERVIEW_COUNT_CHANGE, &DIALOG_ZONE_MANAGER::OnZonesTableRowCountChange, this );
141 Bind( wxEVT_CHECKBOX, &DIALOG_ZONE_MANAGER::OnCheckBoxClicked, this );
142 Bind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this );
143 Bind( wxEVT_CHAR_HOOK, &DIALOG_ZONE_MANAGER::OnDialogCharHook, this );
144 Bind( wxEVT_BOOKCTRL_PAGE_CHANGED,
145 [this]( wxNotebookEvent& aEvent )
146 {
147 Layout();
148 },
149 m_zonePreviewNotebook->GetId() );
150}
151
152
154
155
157{
158 return true;
159}
160
161
162void DIALOG_ZONE_MANAGER::PostProcessZoneViewSelChange( wxDataViewItem const& aItem )
163{
164 bool textCtrlHasFocus = m_filterCtrl->HasFocus();
165 long filterInsertPos = m_filterCtrl->GetInsertionPoint();
166
167 if( aItem.IsOk() )
168 {
169 m_viewZonesOverview->Select( aItem );
170 m_viewZonesOverview->EnsureVisible( aItem );
171 SelectZoneTableItem( aItem );
172 }
173 else
174 {
175 if( m_modelZonesOverview->GetCount() )
176 {
177 wxDataViewItem first_item = m_modelZonesOverview->GetItem( 0 );
178 m_viewZonesOverview->Select( first_item );
179 m_viewZonesOverview->EnsureVisible( first_item );
180 m_zonePreviewNotebook->OnZoneSelectionChanged( m_modelZonesOverview->GetZone( first_item ) );
181 }
182 else
183 {
184 m_zonePreviewNotebook->OnZoneSelectionChanged( nullptr );
185 }
186 }
187
188 if( textCtrlHasFocus )
189 {
190 m_filterCtrl->SetFocus();
191 m_filterCtrl->SetInsertionPoint( filterInsertPos );
192 }
193}
194
195
197{
198 aEvent.Skip();
199}
200
201
203{
204 if( aEvent.GetKeyCode() == WXK_UP )
205 {
207 }
208 else if( aEvent.GetKeyCode() == WXK_DOWN )
209 {
211 }
212 else
213 {
214 aEvent.Skip();
215 }
216}
217
218
220{
221 unsigned count = m_modelZonesOverview->GetCount();
222
223 if( count == 0 )
224 return;
225
226 wxDataViewItem current = m_viewZonesOverview->GetSelection();
227 unsigned currentRow = 0;
228
229 if( current.IsOk() )
230 currentRow = m_modelZonesOverview->GetRow( current );
231
232 int newRow = (int) currentRow + aDirection;
233 newRow = std::max( 0, std::min( newRow, (int) count - 1 ) );
234
235 if( !current.IsOk() || (unsigned) newRow != currentRow )
236 PostProcessZoneViewSelChange( m_modelZonesOverview->GetItem( (unsigned) newRow ) );
237}
238
239
240void DIALOG_ZONE_MANAGER::OnTableChar( wxKeyEvent& aEvent )
241{
242 GenericProcessChar( aEvent );
243}
244
245
246void DIALOG_ZONE_MANAGER::OnTableCharHook( wxKeyEvent& aEvent )
247{
248 GenericProcessChar( aEvent );
249}
250
251
252void DIALOG_ZONE_MANAGER::OnIdle( wxIdleEvent& aEvent )
253{
254 WXUNUSED( aEvent )
255 m_viewZonesOverview->SetFocus();
256 Unbind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this );
257}
258
259
260void DIALOG_ZONE_MANAGER::onDialogResize( wxSizeEvent& event )
261{
262 event.Skip();
263}
264
265
267{
268 wxWindowUpdateLocker updateLock( this );
269
270 m_panelZoneProperties->SetZone( zone );
271 m_zonePreviewNotebook->OnZoneSelectionChanged( zone );
272
273 Layout();
274}
275
276
278{
279 Bind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this );
280}
281
282
284{
285 SelectZoneTableItem( aEvent.GetItem() );
286}
287
288
289void DIALOG_ZONE_MANAGER::SelectZoneTableItem( wxDataViewItem const& aItem )
290{
291 ZONE* zone = m_modelZonesOverview->GetZone( aItem );
292
293 if( !zone )
294 return;
295
297}
298
299
300void DIALOG_ZONE_MANAGER::OnOk( wxCommandEvent& aEvt )
301{
302 m_panelZoneProperties->TransferZoneSettingsFromWindow();
303
304 m_zoneSettingsBag.UpdateClonedZones();
305
306 for( const auto& [ zone, zoneClone ] : m_zoneSettingsBag.GetZonesCloneMap() )
307 {
308 std::map<PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>> filled_zone_to_restore;
309 ZONE* internal_zone = zone; // Duplicate the zone pointer to allow capture on older MacOS (13)
310
311 zone->GetLayerSet().RunOnLayers(
312 [&]( PCB_LAYER_ID layer )
313 {
314 std::shared_ptr<SHAPE_POLY_SET> fill = internal_zone->GetFilledPolysList( layer );
315
316 if( fill )
317 filled_zone_to_restore[layer] = fill;
318 } );
319
320 *zone = *zoneClone;
321
322 for( const auto& [ layer, fill ] : filled_zone_to_restore )
323 zone->SetFilledPolysList( layer, *fill );
324 }
325
326 aEvt.Skip();
327}
328
329
330#if wxUSE_DRAG_AND_DROP
331
332void DIALOG_ZONE_MANAGER::OnBeginDrag( wxDataViewEvent& aEvent )
333{
334 wxTextDataObject* obj = new wxTextDataObject;
335 obj->SetText( "42" ); //FIXME - Workaround for drop on GTK
336 aEvent.SetDataObject( obj );
337 aEvent.SetDragFlags( wxDrag_AllowMove );
338 const wxDataViewItem it = aEvent.GetItem();
339
340 if( it.IsOk() )
342}
343
344
345void DIALOG_ZONE_MANAGER::OnDropPossible( wxDataViewEvent& aEvent )
346{
347 aEvent.SetDropEffect( wxDragMove ); // check 'move' drop effect
348}
349
350
351void DIALOG_ZONE_MANAGER::OnDrop( wxDataViewEvent& aEvent )
352{
353 if( aEvent.GetDataFormat() != wxDF_UNICODETEXT )
354 {
355 aEvent.Veto();
356 return;
357 }
358
359 if( !m_priorityDragIndex.has_value() )
360 return;
361
362 const wxDataViewItem it = aEvent.GetItem();
363
364 if( !it.IsOk() )
365 {
366 aEvent.Veto();
367 return;
368 }
369
370 unsigned int drop_index = m_modelZonesOverview->GetRow( it );
371 const std::optional<unsigned> rtn = m_modelZonesOverview->SwapZonePriority( *m_priorityDragIndex, drop_index );
372
373 if( rtn.has_value() )
374 {
375 const wxDataViewItem item = m_modelZonesOverview->GetItem( *rtn );
376
377 if( item.IsOk() )
378 m_viewZonesOverview->Select( item );
379 }
380}
381
382#endif // wxUSE_DRAG_AND_DROP
383
384
389
390
395
396
401
402
407
408
409void DIALOG_ZONE_MANAGER::OnDeleteClick( wxCommandEvent& aEvent )
410{
411 if( !m_viewZonesOverview->HasSelection() )
412 return;
413
414 const wxDataViewItem selectedItem = m_viewZonesOverview->GetSelection();
415
416 if( !selectedItem.IsOk() )
417 return;
418
419 ZONE* selectedZone = m_modelZonesOverview->GetZone( selectedItem );
420
421 if( !selectedZone )
422 return;
423
424 // Find the original zone from the clone
425 ZONE* originalZone = nullptr;
426
427 for( const auto& [orig, clone] : m_zoneSettingsBag.GetZonesCloneMap() )
428 {
429 if( clone.get() == selectedZone )
430 {
431 originalZone = orig;
432 break;
433 }
434 }
435
436 if( !originalZone )
437 return;
438
439 if( std::find( m_zonesToDelete.begin(), m_zonesToDelete.end(), originalZone )
440 != m_zonesToDelete.end() )
441 {
442 return;
443 }
444
445 wxString msg = wxString::Format( _( "Delete zone '%s'?" ), originalZone->GetZoneName() );
446
447 if( !IsOK( this, msg ) )
448 return;
449
450 m_zonesToDelete.push_back( originalZone );
451
452 m_zoneSettingsBag.RemoveZone( originalZone );
453
454 if( originalZone->IsSelected() )
455 {
456 if( PCB_SELECTION_TOOL* selTool = m_pcbFrame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>() )
457 {
458 selTool->RemoveItemFromSel( originalZone );
459 }
460 }
461
462 if( KIGFX::VIEW* view = m_pcbFrame->GetCanvas()->GetView() )
463 view->Hide( originalZone, true );
464
465 m_pcbFrame->GetCanvas()->Refresh();
466
467 wxString currentFilter = m_filterCtrl->GetValue();
468
470 m_viewZonesOverview->AssociateModel( m_modelZonesOverview.get() );
471
472 if( !currentFilter.IsEmpty() )
473 m_modelZonesOverview->ApplyFilter( currentFilter, wxDataViewItem() );
474
475 if( m_modelZonesOverview->GetCount() > 0 )
476 {
477 wxDataViewItem firstItem = m_modelZonesOverview->GetItem( 0 );
478 PostProcessZoneViewSelChange( firstItem );
479 }
480 else
481 {
482 m_zonePreviewNotebook->OnZoneSelectionChanged( nullptr );
483 m_panelZoneProperties->SetZone( nullptr );
484 }
485}
486
487
488void DIALOG_ZONE_MANAGER::OnAutoAssignClick( wxCommandEvent& aEvent )
489{
490 BOARD* board = m_pcbFrame->GetBoard();
491
492 // Save original priorities so we can restore them after copying to clones.
493 // The dialog operates on clones; originals must stay untouched until OnOk.
494 std::unordered_map<ZONE*, unsigned> savedPriorities;
495
496 for( ZONE* zone : board->Zones() )
497 savedPriorities[zone] = zone->GetAssignedPriority();
498
499 if( AutoAssignZonePriorities( board ) )
500 {
501 for( auto& [original, clone] : m_zoneSettingsBag.GetZonesCloneMap() )
502 {
503 unsigned newPri = original->GetAssignedPriority();
504 clone->SetAssignedPriority( newPri );
505 m_zoneSettingsBag.SetZonePriority( clone.get(), newPri );
506 }
507
509 m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(),
510 m_viewZonesOverview->GetSelection() ) );
511 }
512
513 for( auto& [zone, priority] : savedPriorities )
514 zone->SetAssignedPriority( priority );
515}
516
517
518void DIALOG_ZONE_MANAGER::OnFilterCtrlCancel( wxCommandEvent& aEvent )
519{
521 aEvent.Skip();
522}
523
524
525void DIALOG_ZONE_MANAGER::OnFilterCtrlSearch( wxCommandEvent& aEvent )
526{
527 PostProcessZoneViewSelChange( m_modelZonesOverview->ApplyFilter( aEvent.GetString(),
528 m_viewZonesOverview->GetSelection() ) );
529 aEvent.Skip();
530}
531
532
534{
535 PostProcessZoneViewSelChange( m_modelZonesOverview->ApplyFilter( aEvent.GetString(),
536 m_viewZonesOverview->GetSelection() ) );
537 aEvent.Skip();
538}
539
540
541void DIALOG_ZONE_MANAGER::OnFilterCtrlEnter( wxCommandEvent& aEvent )
542{
543 PostProcessZoneViewSelChange( m_modelZonesOverview->ApplyFilter( aEvent.GetString(),
544 m_viewZonesOverview->GetSelection() ) );
545 aEvent.Skip();
546}
547
548
549void DIALOG_ZONE_MANAGER::OnLayerFilterChanged( wxCommandEvent& aEvent )
550{
551 int sel = m_layerFilter->GetSelection();
552
553 if( sel <= 0 )
554 {
555 m_modelZonesOverview->SetLayerFilter( UNDEFINED_LAYER );
556 }
557 else
558 {
559 void* data = m_layerFilter->GetClientData( sel );
560 PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( reinterpret_cast<intptr_t>( data ) );
561 m_modelZonesOverview->SetLayerFilter( layer );
562 }
563
565 m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(),
566 m_viewZonesOverview->GetSelection() ) );
567}
568
569
571{
572 if( m_isFillingZones )
573 return;
574
575 m_isFillingZones = true;
576
577 if( !m_panelZoneProperties->TransferZoneSettingsFromWindow() )
578 {
579 m_isFillingZones = false;
580 return;
581 }
582
583 m_zoneSettingsBag.UpdateClonedZones();
584
585 BOARD* board = m_pcbFrame->GetBoard();
586 board->IncrementTimeStamp();
587
588 // Save the original zones before swapping so we can restore them later
589 ZONES originalZones = board->Zones();
590
591 // Do not use a commit here since we're operating on cloned zones that are not owned by the
592 // board. Using a commit would create undo entries pointing to the clones, which would cause
593 // corruption when the commit is destroyed.
594 m_filler = std::make_unique<ZONE_FILLER>( board, nullptr );
595 auto reporter = std::make_unique<WX_PROGRESS_REPORTER>( this, _( "Fill All Zones" ), 5, PR_CAN_ABORT );
596 m_filler->SetProgressReporter( reporter.get() );
597
598 // TODO: replace these const_cast calls with a different solution that avoids mutating the
599 // container of the board. This is relatively safe as-is because the original zones list is
600 // swapped back in below, but still should be changed to avoid invalidating the board state
601 // in case this code is refactored to be a non-modal dialog in the future.
602 const_cast<ZONES&>( board->Zones() ) = m_zoneSettingsBag.GetClonedZoneList();
603
604 m_zoneFillComplete = m_filler->Fill( board->Zones() );
605 board->BuildConnectivity();
606
607 m_zonePreviewNotebook->OnZoneSelectionChanged( m_panelZoneProperties->GetZone() );
608
609 // Restore the original zones. The connectivity MUST be rebuilt to remove stale pointers to
610 // cloned zones in case of a cancel.
611 const_cast<ZONES&>( board->Zones() ) = originalZones;
612 board->BuildConnectivity();
613
614 m_isFillingZones = false;
615}
616
617
618void DIALOG_ZONE_MANAGER::OnZoneNameUpdate( wxCommandEvent& aEvent )
619{
620 if( ZONE* zone = m_panelZoneProperties->GetZone() )
621 m_modelZonesOverview->RowChanged( m_modelZonesOverview->GetRow( m_modelZonesOverview->GetItemByZone( zone ) ) );
622}
623
624
625void DIALOG_ZONE_MANAGER::OnZoneNetUpdate( wxCommandEvent& aEvent )
626{
627 if( ZONE* zone = m_panelZoneProperties->GetZone() )
628 m_modelZonesOverview->RowChanged( m_modelZonesOverview->GetRow( m_modelZonesOverview->GetItemByZone( zone ) ) );
629}
630
631
633{
634 unsigned count = aEvent.GetInt();
635
638 {
639 btn->Enable( count > 1 );
640 }
641}
642
643
644void DIALOG_ZONE_MANAGER::OnCheckBoxClicked( wxCommandEvent& aEvent )
645{
646 const wxObject* sender = aEvent.GetEventObject();
647
648 if( aEvent.GetEventObject() == m_checkName )
649 m_modelZonesOverview->EnableFitterByName( aEvent.IsChecked() );
650 else if( aEvent.GetEventObject() == m_checkNet )
651 m_modelZonesOverview->EnableFitterByNet( aEvent.IsChecked() );
652
653 if( ( sender == m_checkName || sender == m_checkNet ) && !m_filterCtrl->IsEmpty() )
654 m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(), m_viewZonesOverview->GetSelection() );
655}
656
657
659{
660 if( !m_viewZonesOverview->HasSelection() )
661 return;
662
663 const wxDataViewItem selectedItem = m_viewZonesOverview->GetSelection();
664
665 if( !selectedItem.IsOk() )
666 return;
667
668 const unsigned int selectedRow = m_modelZonesOverview->GetRow( selectedItem );
669 const std::optional<unsigned> new_index = m_modelZonesOverview->MoveZoneIndex( selectedRow, aMove );
670
671 if( new_index.has_value() )
672 {
673 wxDataViewItem new_item = m_modelZonesOverview->GetItem( *new_index );
675 }
676}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:106
@ small_sort_desc
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
const ZONES & Zones() const
Definition board.h:425
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
Definition board.cpp:201
void IncrementTimeStamp()
Definition board.cpp:283
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition board.cpp:793
DIALOG_ZONE_MANAGER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Zone Manager"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void OnZoneNameUpdate(wxCommandEvent &aEvent)
void OnViewZonesOverviewOnLeftUp(wxMouseEvent &aEvent) override
~DIALOG_ZONE_MANAGER() override
void GenericProcessChar(wxKeyEvent &event)
PCB_BASE_FRAME * m_pcbFrame
wxObjectDataPtr< MODEL_ZONES_OVERVIEW > m_modelZonesOverview
PANEL_ZONE_PROPERTIES * m_panelZoneProperties
void OnMoveDownClick(wxCommandEvent &aEvent) override
void PostProcessZoneViewSelChange(wxDataViewItem const &aItem)
std::unique_ptr< ZONE_FILLER > m_filler
void OnMoveTopClick(wxCommandEvent &aEvent) override
void OnTableChar(wxKeyEvent &event) override
void onDialogResize(wxSizeEvent &event) override
void OnMoveUpClick(wxCommandEvent &aEvent) override
void OnDialogCharHook(wxKeyEvent &aEvent)
void OnUpdateDisplayedZonesClick(wxCommandEvent &aEvent) override
void MoveSelectedZonePriority(ZONE_INDEX_MOVEMENT aMove)
ZONE_SETTINGS_BAG m_zoneSettingsBag
void OnDataViewCtrlSelectionChanged(wxDataViewEvent &event) override
std::optional< unsigned > m_priorityDragIndex
void OnTableCharHook(wxKeyEvent &event) override
void OnIdle(wxIdleEvent &aEvent)
void OnZoneNetUpdate(wxCommandEvent &aEvent)
void OnCheckBoxClicked(wxCommandEvent &aEvent)
void OnFilterCtrlTextChange(wxCommandEvent &aEvent) override
void NavigateZoneSelection(int aDirection)
bool TransferDataToWindow() override
ZONE_PREVIEW_NOTEBOOK * m_zonePreviewNotebook
void SelectZoneTableItem(wxDataViewItem const &aItem)
void OnOk(wxCommandEvent &aEvt) override
void OnFilterCtrlCancel(wxCommandEvent &aEvent) override
std::vector< ZONE * > m_zonesToDelete
void OnFilterCtrlEnter(wxCommandEvent &aEvent) override
void OnMoveBottomClick(wxCommandEvent &aEvent) override
void OnZoneSelectionChanged(ZONE *aZone)
DIALOG_ZONE_MANAGER(PCB_BASE_FRAME *aParent)
void OnZonesTableRowCountChange(wxCommandEvent &aEvent)
void OnDeleteClick(wxCommandEvent &aEvent) override
void OnLayerFilterChanged(wxCommandEvent &aEvent) override
void OnFilterCtrlSearch(wxCommandEvent &aEvent) override
void OnAutoAssignClick(wxCommandEvent &aEvent) override
bool IsSelected() const
Definition eda_item.h:132
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
void RunOnLayers(const std::function< void(PCB_LAYER_ID)> &aFunction) const
Execute a function on each layer of the LSET.
Definition lset.h:263
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition lset.cpp:309
static std::map< int, wxString > GetColumnNames()
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
The selection tool: currently supports:
A bitmap button widget that behaves like a standard dialog button except with an icon.
Handle a list of polygons defining a copper zone.
Definition zone.h:70
std::shared_ptr< SHAPE_POLY_SET > GetFilledPolysList(PCB_LAYER_ID aLayer) const
Definition zone.h:697
const wxString & GetZoneName() const
Definition zone.h:160
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition zone.h:133
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition confirm.cpp:274
#define _(s)
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ UNDEFINED_LAYER
Definition layer_ids.h:57
ZONE_INDEX_MOVEMENT
std::vector< ZONE * > ZONES
IbisParser parser & reporter
#define PR_CAN_ABORT
bool AutoAssignZonePriorities(BOARD *aBoard, PROGRESS_REPORTER *aReporter)
Automatically assign zone priorities based on connectivity analysis of overlapping regions.