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
113 Layout();
114 m_MainBoxSizer->Fit( this );
115 finishDialogSettings();
116
117#if wxUSE_DRAG_AND_DROP
118 m_viewZonesOverview->EnableDragSource( wxDF_UNICODETEXT );
119 m_viewZonesOverview->EnableDropTarget( wxDF_UNICODETEXT );
120
121 int id = m_viewZonesOverview->GetId();
122 Bind( wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, &DIALOG_ZONE_MANAGER::OnBeginDrag, this, id );
123 Bind( wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, &DIALOG_ZONE_MANAGER::OnDropPossible, this, id );
124 Bind( wxEVT_DATAVIEW_ITEM_DROP, &DIALOG_ZONE_MANAGER::OnDrop, this, id );
125#endif // wxUSE_DRAG_AND_DROP
126
127 Bind( EVT_ZONE_NAME_UPDATE, &DIALOG_ZONE_MANAGER::OnZoneNameUpdate, this );
128 Bind( EVT_ZONE_NET_UPDATE, &DIALOG_ZONE_MANAGER::OnZoneNetUpdate, this );
129 Bind( EVT_ZONES_OVERVIEW_COUNT_CHANGE, &DIALOG_ZONE_MANAGER::OnZonesTableRowCountChange, this );
130 Bind( wxEVT_CHECKBOX, &DIALOG_ZONE_MANAGER::OnCheckBoxClicked, this );
131 Bind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this );
132 Bind( wxEVT_CHAR_HOOK, &DIALOG_ZONE_MANAGER::OnDialogCharHook, this );
133 Bind( wxEVT_BOOKCTRL_PAGE_CHANGED,
134 [this]( wxNotebookEvent& aEvent )
135 {
136 Layout();
137 },
138 m_zonePreviewNotebook->GetId() );
139}
140
141
143
144
146{
147 return true;
148}
149
150
151void DIALOG_ZONE_MANAGER::PostProcessZoneViewSelChange( wxDataViewItem const& aItem )
152{
153 bool textCtrlHasFocus = m_filterCtrl->HasFocus();
154 long filterInsertPos = m_filterCtrl->GetInsertionPoint();
155
156 if( aItem.IsOk() )
157 {
158 m_viewZonesOverview->Select( aItem );
159 m_viewZonesOverview->EnsureVisible( aItem );
160 SelectZoneTableItem( aItem );
161 }
162 else
163 {
164 if( m_modelZonesOverview->GetCount() )
165 {
166 wxDataViewItem first_item = m_modelZonesOverview->GetItem( 0 );
167 m_viewZonesOverview->Select( first_item );
168 m_viewZonesOverview->EnsureVisible( first_item );
169 m_zonePreviewNotebook->OnZoneSelectionChanged( m_modelZonesOverview->GetZone( first_item ) );
170 }
171 else
172 {
173 m_zonePreviewNotebook->OnZoneSelectionChanged( nullptr );
174 }
175 }
176
177 if( textCtrlHasFocus )
178 {
179 m_filterCtrl->SetFocus();
180 m_filterCtrl->SetInsertionPoint( filterInsertPos );
181 }
182}
183
184
186{
187 aEvent.Skip();
188}
189
190
192{
193 if( aEvent.GetKeyCode() == WXK_UP )
194 {
196 }
197 else if( aEvent.GetKeyCode() == WXK_DOWN )
198 {
200 }
201 else
202 {
203 aEvent.Skip();
204 }
205}
206
207
209{
210 unsigned count = m_modelZonesOverview->GetCount();
211
212 if( count == 0 )
213 return;
214
215 wxDataViewItem current = m_viewZonesOverview->GetSelection();
216 unsigned currentRow = 0;
217
218 if( current.IsOk() )
219 currentRow = m_modelZonesOverview->GetRow( current );
220
221 int newRow = (int) currentRow + aDirection;
222 newRow = std::max( 0, std::min( newRow, (int) count - 1 ) );
223
224 if( !current.IsOk() || (unsigned) newRow != currentRow )
225 PostProcessZoneViewSelChange( m_modelZonesOverview->GetItem( (unsigned) newRow ) );
226}
227
228
229void DIALOG_ZONE_MANAGER::OnTableChar( wxKeyEvent& aEvent )
230{
231 GenericProcessChar( aEvent );
232}
233
234
235void DIALOG_ZONE_MANAGER::OnTableCharHook( wxKeyEvent& aEvent )
236{
237 GenericProcessChar( aEvent );
238}
239
240
241void DIALOG_ZONE_MANAGER::OnIdle( wxIdleEvent& aEvent )
242{
243 WXUNUSED( aEvent )
244 m_viewZonesOverview->SetFocus();
245 Unbind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this );
246}
247
248
249void DIALOG_ZONE_MANAGER::onDialogResize( wxSizeEvent& event )
250{
251 event.Skip();
252}
253
254
256{
257 wxWindowUpdateLocker updateLock( this );
258
259 m_panelZoneProperties->SetZone( zone );
260 m_zonePreviewNotebook->OnZoneSelectionChanged( zone );
261
262 Layout();
263}
264
265
267{
268 Bind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this );
269}
270
271
273{
274 SelectZoneTableItem( aEvent.GetItem() );
275}
276
277
278void DIALOG_ZONE_MANAGER::SelectZoneTableItem( wxDataViewItem const& aItem )
279{
280 ZONE* zone = m_modelZonesOverview->GetZone( aItem );
281
282 if( !zone )
283 return;
284
286}
287
288
289void DIALOG_ZONE_MANAGER::OnOk( wxCommandEvent& aEvt )
290{
291 m_panelZoneProperties->TransferZoneSettingsFromWindow();
292
293 m_zoneSettingsBag.UpdateClonedZones();
294
295 for( const auto& [ zone, zoneClone ] : m_zoneSettingsBag.GetZonesCloneMap() )
296 {
297 std::map<PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>> filled_zone_to_restore;
298 ZONE* internal_zone = zone; // Duplicate the zone pointer to allow capture on older MacOS (13)
299
300 zone->GetLayerSet().RunOnLayers(
301 [&]( PCB_LAYER_ID layer )
302 {
303 std::shared_ptr<SHAPE_POLY_SET> fill = internal_zone->GetFilledPolysList( layer );
304
305 if( fill )
306 filled_zone_to_restore[layer] = fill;
307 } );
308
309 *zone = *zoneClone;
310
311 for( const auto& [ layer, fill ] : filled_zone_to_restore )
312 zone->SetFilledPolysList( layer, *fill );
313 }
314
315 aEvt.Skip();
316}
317
318
319#if wxUSE_DRAG_AND_DROP
320
321void DIALOG_ZONE_MANAGER::OnBeginDrag( wxDataViewEvent& aEvent )
322{
323 wxTextDataObject* obj = new wxTextDataObject;
324 obj->SetText( "42" ); //FIXME - Workaround for drop on GTK
325 aEvent.SetDataObject( obj );
326 aEvent.SetDragFlags( wxDrag_AllowMove );
327 const wxDataViewItem it = aEvent.GetItem();
328
329 if( it.IsOk() )
331}
332
333
334void DIALOG_ZONE_MANAGER::OnDropPossible( wxDataViewEvent& aEvent )
335{
336 aEvent.SetDropEffect( wxDragMove ); // check 'move' drop effect
337}
338
339
340void DIALOG_ZONE_MANAGER::OnDrop( wxDataViewEvent& aEvent )
341{
342 if( aEvent.GetDataFormat() != wxDF_UNICODETEXT )
343 {
344 aEvent.Veto();
345 return;
346 }
347
348 if( !m_priorityDragIndex.has_value() )
349 return;
350
351 const wxDataViewItem it = aEvent.GetItem();
352
353 if( !it.IsOk() )
354 {
355 aEvent.Veto();
356 return;
357 }
358
359 unsigned int drop_index = m_modelZonesOverview->GetRow( it );
360 const std::optional<unsigned> rtn = m_modelZonesOverview->SwapZonePriority( *m_priorityDragIndex, drop_index );
361
362 if( rtn.has_value() )
363 {
364 const wxDataViewItem item = m_modelZonesOverview->GetItem( *rtn );
365
366 if( item.IsOk() )
367 m_viewZonesOverview->Select( item );
368 }
369}
370
371#endif // wxUSE_DRAG_AND_DROP
372
373
378
379
384
385
390
391
396
397
398void DIALOG_ZONE_MANAGER::OnDeleteClick( wxCommandEvent& aEvent )
399{
400 if( !m_viewZonesOverview->HasSelection() )
401 return;
402
403 const wxDataViewItem selectedItem = m_viewZonesOverview->GetSelection();
404
405 if( !selectedItem.IsOk() )
406 return;
407
408 ZONE* selectedZone = m_modelZonesOverview->GetZone( selectedItem );
409
410 if( !selectedZone )
411 return;
412
413 // Find the original zone from the clone
414 ZONE* originalZone = nullptr;
415
416 for( const auto& [orig, clone] : m_zoneSettingsBag.GetZonesCloneMap() )
417 {
418 if( clone.get() == selectedZone )
419 {
420 originalZone = orig;
421 break;
422 }
423 }
424
425 if( !originalZone )
426 return;
427
428 if( std::find( m_zonesToDelete.begin(), m_zonesToDelete.end(), originalZone )
429 != m_zonesToDelete.end() )
430 {
431 return;
432 }
433
434 wxString msg = wxString::Format( _( "Delete zone '%s'?" ), originalZone->GetZoneName() );
435
436 if( !IsOK( this, msg ) )
437 return;
438
439 m_zonesToDelete.push_back( originalZone );
440
441 m_zoneSettingsBag.RemoveZone( originalZone );
442
443 if( originalZone->IsSelected() )
444 {
445 if( PCB_SELECTION_TOOL* selTool = m_pcbFrame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>() )
446 {
447 selTool->RemoveItemFromSel( originalZone );
448 }
449 }
450
451 if( KIGFX::VIEW* view = m_pcbFrame->GetCanvas()->GetView() )
452 view->Hide( originalZone, true );
453
454 m_pcbFrame->GetCanvas()->Refresh();
455
456 wxString currentFilter = m_filterCtrl->GetValue();
457
459 m_viewZonesOverview->AssociateModel( m_modelZonesOverview.get() );
460
461 if( !currentFilter.IsEmpty() )
462 m_modelZonesOverview->ApplyFilter( currentFilter, wxDataViewItem() );
463
464 if( m_modelZonesOverview->GetCount() > 0 )
465 {
466 wxDataViewItem firstItem = m_modelZonesOverview->GetItem( 0 );
467 PostProcessZoneViewSelChange( firstItem );
468 }
469 else
470 {
471 m_zonePreviewNotebook->OnZoneSelectionChanged( nullptr );
472 m_panelZoneProperties->SetZone( nullptr );
473 }
474}
475
476
477void DIALOG_ZONE_MANAGER::OnAutoAssignClick( wxCommandEvent& aEvent )
478{
479 BOARD* board = m_pcbFrame->GetBoard();
480
481 // Save original priorities so we can restore them after copying to clones.
482 // The dialog operates on clones; originals must stay untouched until OnOk.
483 std::unordered_map<ZONE*, unsigned> savedPriorities;
484
485 for( ZONE* zone : board->Zones() )
486 savedPriorities[zone] = zone->GetAssignedPriority();
487
488 if( AutoAssignZonePriorities( board ) )
489 {
490 for( auto& [original, clone] : m_zoneSettingsBag.GetZonesCloneMap() )
491 {
492 unsigned newPri = original->GetAssignedPriority();
493 clone->SetAssignedPriority( newPri );
494 m_zoneSettingsBag.SetZonePriority( clone.get(), newPri );
495 }
496
498 m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(),
499 m_viewZonesOverview->GetSelection() ) );
500 }
501
502 for( auto& [zone, priority] : savedPriorities )
503 zone->SetAssignedPriority( priority );
504}
505
506
507void DIALOG_ZONE_MANAGER::OnFilterCtrlCancel( wxCommandEvent& aEvent )
508{
510 aEvent.Skip();
511}
512
513
514void DIALOG_ZONE_MANAGER::OnFilterCtrlSearch( wxCommandEvent& aEvent )
515{
516 PostProcessZoneViewSelChange( m_modelZonesOverview->ApplyFilter( aEvent.GetString(),
517 m_viewZonesOverview->GetSelection() ) );
518 aEvent.Skip();
519}
520
521
523{
524 PostProcessZoneViewSelChange( m_modelZonesOverview->ApplyFilter( aEvent.GetString(),
525 m_viewZonesOverview->GetSelection() ) );
526 aEvent.Skip();
527}
528
529
530void DIALOG_ZONE_MANAGER::OnFilterCtrlEnter( wxCommandEvent& aEvent )
531{
532 PostProcessZoneViewSelChange( m_modelZonesOverview->ApplyFilter( aEvent.GetString(),
533 m_viewZonesOverview->GetSelection() ) );
534 aEvent.Skip();
535}
536
537
538void DIALOG_ZONE_MANAGER::OnLayerFilterChanged( wxCommandEvent& aEvent )
539{
540 int sel = m_layerFilter->GetSelection();
541
542 if( sel <= 0 )
543 {
544 m_modelZonesOverview->SetLayerFilter( UNDEFINED_LAYER );
545 }
546 else
547 {
548 void* data = m_layerFilter->GetClientData( sel );
549 PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( reinterpret_cast<intptr_t>( data ) );
550 m_modelZonesOverview->SetLayerFilter( layer );
551 }
552
554 m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(),
555 m_viewZonesOverview->GetSelection() ) );
556}
557
558
560{
561 if( m_isFillingZones )
562 return;
563
564 m_isFillingZones = true;
565
566 if( !m_panelZoneProperties->TransferZoneSettingsFromWindow() )
567 {
568 m_isFillingZones = false;
569 return;
570 }
571
572 m_zoneSettingsBag.UpdateClonedZones();
573
574 BOARD* board = m_pcbFrame->GetBoard();
575 board->IncrementTimeStamp();
576
577 // Save the original zones before swapping so we can restore them later
578 ZONES originalZones = board->Zones();
579
580 // Do not use a commit here since we're operating on cloned zones that are not owned by the
581 // board. Using a commit would create undo entries pointing to the clones, which would cause
582 // corruption when the commit is destroyed.
583 m_filler = std::make_unique<ZONE_FILLER>( board, nullptr );
584 auto reporter = std::make_unique<WX_PROGRESS_REPORTER>( this, _( "Fill All Zones" ), 5, PR_CAN_ABORT );
585 m_filler->SetProgressReporter( reporter.get() );
586
587 // TODO: replace these const_cast calls with a different solution that avoids mutating the
588 // container of the board. This is relatively safe as-is because the original zones list is
589 // swapped back in below, but still should be changed to avoid invalidating the board state
590 // in case this code is refactored to be a non-modal dialog in the future.
591 const_cast<ZONES&>( board->Zones() ) = m_zoneSettingsBag.GetClonedZoneList();
592
593 m_zoneFillComplete = m_filler->Fill( board->Zones() );
594 board->BuildConnectivity();
595
596 m_zonePreviewNotebook->OnZoneSelectionChanged( m_panelZoneProperties->GetZone() );
597
598 // Restore the original zones. The connectivity MUST be rebuilt to remove stale pointers to
599 // cloned zones in case of a cancel.
600 const_cast<ZONES&>( board->Zones() ) = originalZones;
601 board->BuildConnectivity();
602
603 m_isFillingZones = false;
604}
605
606
607void DIALOG_ZONE_MANAGER::OnZoneNameUpdate( wxCommandEvent& aEvent )
608{
609 if( ZONE* zone = m_panelZoneProperties->GetZone() )
610 m_modelZonesOverview->RowChanged( m_modelZonesOverview->GetRow( m_modelZonesOverview->GetItemByZone( zone ) ) );
611}
612
613
614void DIALOG_ZONE_MANAGER::OnZoneNetUpdate( wxCommandEvent& aEvent )
615{
616 if( ZONE* zone = m_panelZoneProperties->GetZone() )
617 m_modelZonesOverview->RowChanged( m_modelZonesOverview->GetRow( m_modelZonesOverview->GetItemByZone( zone ) ) );
618}
619
620
622{
623 unsigned count = aEvent.GetInt();
624
627 {
628 btn->Enable( count > 1 );
629 }
630}
631
632
633void DIALOG_ZONE_MANAGER::OnCheckBoxClicked( wxCommandEvent& aEvent )
634{
635 const wxObject* sender = aEvent.GetEventObject();
636
637 if( aEvent.GetEventObject() == m_checkName )
638 m_modelZonesOverview->EnableFitterByName( aEvent.IsChecked() );
639 else if( aEvent.GetEventObject() == m_checkNet )
640 m_modelZonesOverview->EnableFitterByNet( aEvent.IsChecked() );
641
642 if( ( sender == m_checkName || sender == m_checkNet ) && !m_filterCtrl->IsEmpty() )
643 m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(), m_viewZonesOverview->GetSelection() );
644}
645
646
648{
649 if( !m_viewZonesOverview->HasSelection() )
650 return;
651
652 const wxDataViewItem selectedItem = m_viewZonesOverview->GetSelection();
653
654 if( !selectedItem.IsOk() )
655 return;
656
657 const unsigned int selectedRow = m_modelZonesOverview->GetRow( selectedItem );
658 const std::optional<unsigned> new_index = m_modelZonesOverview->MoveZoneIndex( selectedRow, aMove );
659
660 if( new_index.has_value() )
661 {
662 wxDataViewItem new_item = m_modelZonesOverview->GetItem( *new_index );
664 }
665}
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:372
const ZONES & Zones() const
Definition board.h:424
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.