KiCad PCB EDA Suite
dialog_copper_zones.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2017 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
9  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
10  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, you may find one here:
24  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
25  * or you may search the http://www.gnu.org website for the version 2 license,
26  * or you may write to the Free Software Foundation, Inc.,
27  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  */
29 
30 #include <wx/wx.h>
31 #include <fctsys.h>
32 #include <kiface_i.h>
33 #include <confirm.h>
34 #include <PolyLine.h>
35 #include <pcbnew.h>
36 #include <wxPcbStruct.h>
37 #include <zones.h>
38 #include <base_units.h>
39 #include <widgets/text_ctrl_eval.h>
40 
41 #include <class_zone.h>
42 #include <class_board.h>
44 
45 #include <wx/imaglist.h> // needed for wx/listctrl.h, in wxGTK 2.8.12
46 #include <wx/listctrl.h>
48 
49 
55 {
56 public:
57  DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings );
58 
59 private:
61  wxConfigBase* m_Config;
62 
64 
69 
71 
74 
75  std::vector<PCB_LAYER_ID> m_LayerId;
76 
78  static wxString m_netNameShowFilter;
79 
85  void initDialog();
86 
87  void OnButtonOkClick( wxCommandEvent& event ) override;
88  void OnButtonCancelClick( wxCommandEvent& event ) override;
89  void OnClose( wxCloseEvent& event ) override;
90  void OnCornerSmoothingModeChoice( wxCommandEvent& event ) override;
91 
98  bool AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly = false );
99 
100  void OnNetSortingOptionSelected( wxCommandEvent& event ) override;
101  void ExportSetupToOtherCopperZones( wxCommandEvent& event ) override;
102  void OnPadsInZoneClick( wxCommandEvent& event ) override;
103  void OnRunFiltersButtonClick( wxCommandEvent& event ) override;
104 
106 
112  void initListNetsParams();
113 
120  wxBitmap makeLayerBitmap( COLOR4D aColor, COLOR4D aBackground );
121 };
122 
123 
124 #define LAYER_BITMAP_SIZE_X 20
125 #define LAYER_BITMAP_SIZE_Y 10
126 
127 // Initialize static member variables
128 wxString DIALOG_COPPER_ZONE::m_netNameShowFilter( wxT( "*" ) );
129 
130 
132 {
133  DIALOG_COPPER_ZONE dlg( aCaller, aSettings );
134 
135  ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() );
136  return result;
137 }
138 
139 
141  DIALOG_COPPER_ZONE_BASE( aParent )
142 {
143  m_Parent = aParent;
145 
146  m_ptr = aSettings;
147  m_settings = *aSettings;
148 
149  m_NetSortingByPadCount = true; // false = alphabetic sort, true = pad count sort
151 
152  SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
153 
154  // Fix static text widget minimum width to a suitable value so that
155  // resizing the dialog is not necessary when changing the corner smoothing type.
156  // Depends on the default text in the widget.
157  m_cornerSmoothingValue->SetMinSize( m_cornerSmoothingValue->GetSize() );
158 
159  initDialog();
160 
161  m_sdbSizerOK->SetDefault();
162 
164 }
165 
166 
168 {
169  BOARD* board = m_Parent->GetBoard();
170 
171  wxString msg;
172 
174  m_OrientEdgesOpt->SetSelection( 1 );
175 
176  m_FillModeCtrl->SetSelection( m_settings.m_FillMode == ZFM_SEGMENTS ? 1 : 0 );
177 
180  m_ZoneClearanceCtrl->SetValue( msg );
181 
184  m_ZoneMinThicknessCtrl->SetValue( msg );
185 
186  switch( m_settings.GetPadConnection() )
187  {
188  case PAD_ZONE_CONN_THT_THERMAL: // Thermals only for THT pads
189  m_PadInZoneOpt->SetSelection( 2 );
190  break;
191 
192  case PAD_ZONE_CONN_NONE: // Pads are not covered
193  m_PadInZoneOpt->SetSelection( 3 );
194  break;
195 
196  default:
197  case PAD_ZONE_CONN_THERMAL: // Use thermal relief for pads
198  m_PadInZoneOpt->SetSelection( 1 );
199  break;
200 
201  case PAD_ZONE_CONN_FULL: // pads are covered by copper
202  m_PadInZoneOpt->SetSelection( 0 );
203  break;
204  }
205 
207 
212 
214 
216 
218  {
220  m_OutlineAppearanceCtrl->SetSelection( 0 );
221  break;
222 
224  m_OutlineAppearanceCtrl->SetSelection( 1 );
225  break;
226 
228  m_OutlineAppearanceCtrl->SetSelection( 2 );
229  break;
230  }
231 
232  m_ArcApproximationOpt->SetSelection(
234 
235  // Create one column in m_LayerSelectionCtrl
236  wxListItem column0;
237  column0.SetId( 0 );
238  m_LayerSelectionCtrl->InsertColumn( 0, column0 );
239 
240  wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
241  m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
242 
243  int ctrlWidth = 0; // Min width for m_LayerSelectionCtrl to show the layers names
244  int imgIdx = 0;
245 
246  LSET cu_set = LSET::AllCuMask( board->GetCopperLayerCount() );
247 
249  for( LSEQ cu_stack = cu_set.UIOrder(); cu_stack; ++cu_stack, imgIdx++ )
250  {
251  PCB_LAYER_ID layer = *cu_stack;
252 
253  m_LayerId.push_back( layer );
254 
255  msg = board->GetLayerName( layer );
256 
257  msg.Trim();
258 
259  COLOR4D layerColor = m_Parent->Settings().Colors().GetLayerColor( layer );
260 
261  imageList->Add( makeLayerBitmap( layerColor, backgroundColor ) );
262 
263  int itemIndex = m_LayerSelectionCtrl->InsertItem(
264  m_LayerSelectionCtrl->GetItemCount(), msg, imgIdx );
265 
266  if( m_settings.m_CurrentZone_Layer == layer )
267  m_LayerSelectionCtrl->Select( itemIndex );
268 
269  wxSize tsize( GetTextSize( msg, m_LayerSelectionCtrl ) );
270  ctrlWidth = std::max( ctrlWidth, tsize.x );
271  }
272 
273  // The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
274  // unfortunately this option does not work well both on
275  // wxWidgets 2.8 ( column width too small), and
276  // wxWidgets 2.9 ( column width too large)
277  ctrlWidth += LAYER_BITMAP_SIZE_X + 25; // Add bitmap width + margin between bitmap and text
278  m_LayerSelectionCtrl->SetColumnWidth( 0, ctrlWidth );
279 
280  ctrlWidth += 25; // add small margin between text and window borders
281  // and room for vertical scroll bar
282  m_LayerSelectionCtrl->SetMinSize( wxSize( ctrlWidth, -1 ) );
283 
284  wxString netNameDoNotShowFilter = wxT( "Net-*" );
285  if( m_Config )
286  {
287  int opt = m_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
288  m_NetDisplayOption->SetSelection( opt );
289  m_Config->Read( ZONE_NET_FILTER_STRING_KEY, netNameDoNotShowFilter );
290  }
291  else
292  m_NetDisplayOption->SetSelection( 1 );
293 
296 
297  // Build list of nets:
298  m_DoNotShowNetNameFilter->SetValue( netNameDoNotShowFilter );
300 
301  wxCommandEvent event;
303 }
304 
305 
306 void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
307 {
308  Close( true );
309 }
310 
311 void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
312 {
314 
315  if( AcceptOptions( true ) )
316  {
317  *m_ptr = m_settings;
318  EndModal( ZONE_OK );
319  }
320 }
321 
322 
323 // called on system close button
324 void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
325 {
326  if( m_OnExitCode != ZONE_ABORT )
327  *m_ptr = m_settings;
328 
329  EndModal( m_OnExitCode );
330 }
331 
332 
333 bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
334 {
335  switch( m_PadInZoneOpt->GetSelection() )
336  {
337  case 3:
338  // Pads are not covered
340  break;
341 
342  case 2:
343  // Use thermal relief for THT pads
345  break;
346 
347  case 1:
348  // Use thermal relief for pads
350  break;
351 
352  case 0:
353  // pads are covered by copper
355  break;
356  }
357 
358  switch( m_OutlineAppearanceCtrl->GetSelection() )
359  {
360  case 0:
362  break;
363 
364  case 1:
366  break;
367 
368  case 2:
370  break;
371  }
372 
373  m_settings.m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ?
376 
377  if( m_Config )
378  {
381  wxString filter = m_DoNotShowNetNameFilter->GetValue();
382  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, filter );
383  }
384 
386  m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? ZFM_POLYGONS : ZFM_SEGMENTS;
387 
388  wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
390 
391  // Test if this is a reasonable value for this parameter
392  // A too large value can hang Pcbnew
393  #define CLEARANCE_MAX_VALUE ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS
394 
396  {
397  wxString msg;
398  msg.Printf( _( "Clearance must be smaller than %f\" / %f mm." ),
400  DisplayError( this, msg );
401  return false;
402  }
403 
404  txtvalue = m_ZoneMinThicknessCtrl->GetValue();
406 
408  {
409  wxString msg;
410  msg.Printf( _( "Minimum width must be larger than %f\" / %f mm." ),
412  DisplayError( this, msg );
413  return false;
414  }
415 
417  txtvalue = m_cornerSmoothingCtrl->GetValue();
419 
421 
422  if( m_OrientEdgesOpt->GetSelection() == 0 )
423  m_settings.m_Zone_45_Only = false;
424  else
425  m_settings.m_Zone_45_Only = true;
426 
429 
430  if( m_Config )
431  {
433  (double) m_settings.m_ZoneClearance / IU_PER_MILS );
434 
436  (double) m_settings.m_ZoneMinThickness / IU_PER_MILS );
437 
439  (double) m_settings.m_ThermalReliefGap / IU_PER_MILS );
440 
442  (double) m_settings.m_ThermalReliefCopperBridge / IU_PER_MILS );
443  }
444 
448  {
449  DisplayError( this,
450  _( "Thermal relief spoke must be greater than the minimum width." ) );
451  return false;
452  }
453 
454  // If we use only exportable to others zones parameters, exit here:
455  if( aUseExportableSetupOnly )
456  return true;
457 
458  // Get the layer selection for this zone
459  int ii = m_LayerSelectionCtrl->GetFirstSelected();
460 
461  if( ii < 0 && aPromptForErrors )
462  {
463  DisplayError( this, _( "No layer selected." ) );
464  return false;
465  }
466 
468 
469  // Get the net name selection for this zone
470  ii = m_ListNetNameSelection->GetSelection();
471 
472  if( ii < 0 && aPromptForErrors )
473  {
474  DisplayError( this, _( "No net selected." ) );
475  return false;
476  }
477 
478  if( ii == 0 ) // the not connected option was selected: this is not a good practice: warn:
479  {
480  if( !IsOK( this, _( "You have chosen the \"not connected\" option. This will create "
481  "insulated copper islands. Are you sure ?" ) ) )
482  return false;
483  }
484 
485  wxString net_name = m_ListNetNameSelection->GetString( ii );
486 
488 
489  // Search net_code for this net, if a net was selected
490  if( m_ListNetNameSelection->GetSelection() > 0 )
491  {
492  NETINFO_ITEM* net = m_Parent->GetBoard()->FindNet( net_name );
493 
494  if( net )
496  }
497 
498  return true;
499 }
500 
501 
503 {
504  int selection = m_cornerSmoothingChoice->GetSelection();
505 
506  switch( selection )
507  {
509  m_cornerSmoothingValue->Enable( false );
510  m_cornerSmoothingCtrl->Enable( false );
511  break;
513  m_cornerSmoothingValue->Enable( true );
514  m_cornerSmoothingCtrl->Enable( true );
515  m_cornerSmoothingValue->SetLabel( _( "Chamfer distance" ) );
517  break;
519  m_cornerSmoothingValue->Enable( true );
520  m_cornerSmoothingCtrl->Enable( true );
521  m_cornerSmoothingValue->SetLabel( _( "Fillet radius" ) );
523  break;
524  }
525 }
526 
527 
529 {
532 
534 
535  if( m_Config )
536  {
537  m_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetDisplayOption->GetSelection() );
538  wxString Filter = m_DoNotShowNetNameFilter->GetValue();
539  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, Filter );
540  }
541 }
542 
543 
545 {
546  if( !AcceptOptions( true, true ) )
547  return;
548 
549  // Export settings ( but layer and netcode ) to others copper zones
550  BOARD* pcb = m_Parent->GetBoard();
551 
552  for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
553  {
554  ZONE_CONTAINER* zone = pcb->GetArea( ii );
555 
556  // Cannot export settings from a copper zone
557  // to a zone keepout:
558  if( zone->GetIsKeepout() )
559  continue;
560 
561  m_settings.ExportSetting( *zone, false ); // false = partial export
562  m_Parent->OnModify();
563  }
564 
565  m_OnExitCode = ZONE_EXPORT_VALUES; // values are exported to others zones
566 }
567 
568 
569 void DIALOG_COPPER_ZONE::OnPadsInZoneClick( wxCommandEvent& event )
570 {
571  // Antipad and spokes are significant only for thermals
572  // However, even if thermals are disabled, these parameters must be set
573  // for pads which have local settings with thermal enabled
574  // Previously, wxTextCtrl widgets related to thermal settings were disabled,
575  // but this is not a good idea. We leave them always enabled.
576 }
577 
578 
580 {
581  switch( m_NetDisplayOption->GetSelection() )
582  {
583  case 0:
584  m_NetSortingByPadCount = false;
585  m_NetFiltering = false;
586  break;
587 
588  case 1:
589  m_NetSortingByPadCount = true;
590  m_NetFiltering = false;
591  break;
592 
593  case 2:
594  m_NetSortingByPadCount = false;
595  m_NetFiltering = true;
596  break;
597 
598  case 3:
599  m_NetSortingByPadCount = true;
600  m_NetFiltering = true;
601  break;
602  }
603 }
604 
605 
606 void DIALOG_COPPER_ZONE::OnRunFiltersButtonClick( wxCommandEvent& event )
607 {
609 
610  // Ensure filtered option for nets
611  if( m_NetDisplayOption->GetSelection() == 0 )
612  m_NetDisplayOption->SetSelection( 2 );
613  else if( m_NetDisplayOption->GetSelection() == 1 )
614  m_NetDisplayOption->SetSelection( 3 );
615 
618 }
619 
620 
622 {
623  wxArrayString listNetName;
624 
626 
627  if( m_NetFiltering )
628  {
629  wxString doNotShowFilter = m_DoNotShowNetNameFilter->GetValue();
630  wxString ShowFilter = m_ShowNetNameFilter->GetValue();
631 
632  for( unsigned ii = 0; ii < listNetName.GetCount(); ii++ )
633  {
634  if( listNetName[ii].Matches( doNotShowFilter ) )
635  {
636  listNetName.RemoveAt( ii );
637  ii--;
638  }
639  else if( !listNetName[ii].Matches( ShowFilter ) )
640  {
641  listNetName.RemoveAt( ii );
642  ii--;
643  }
644  }
645  }
646 
647  listNetName.Insert( wxT( "<no net>" ), 0 );
648 
649  // Ensure currently selected net for the zone is visible, regardless of filters
650  int selectedNetListNdx = -1;
651  int net_select = m_settings.m_NetcodeSelection;
652 
653  if( net_select > 0 )
654  {
655  NETINFO_ITEM* equipot = m_Parent->GetBoard()->FindNet( net_select );
656  if( equipot )
657  {
658  selectedNetListNdx = listNetName.Index( equipot->GetNetname() );
659 
660  if( wxNOT_FOUND == selectedNetListNdx )
661  {
662  // the currently selected net must *always* be visible.
663  listNetName.Insert( equipot->GetNetname(), 0 );
664  selectedNetListNdx = 0;
665  }
666  }
667  }
668  else if( net_select == 0 )
669  selectedNetListNdx = 0; // SetSelection() on "<no net>"
670  else
671  {
672  // selectedNetListNdx remains -1, no net selected.
673  }
674 
675  m_ListNetNameSelection->Clear();
676  m_ListNetNameSelection->InsertItems( listNetName, 0 );
677  m_ListNetNameSelection->SetSelection( 0 );
678 
679  if( selectedNetListNdx >= 0 )
680  {
681  m_ListNetNameSelection->SetSelection( selectedNetListNdx );
682  m_ListNetNameSelection->EnsureVisible( selectedNetListNdx );
683  }
684 }
685 
686 
687 wxBitmap DIALOG_COPPER_ZONE::makeLayerBitmap( COLOR4D aColor, COLOR4D aBackground )
688 {
689  wxBitmap bitmap( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
690  wxBrush brush;
691  wxMemoryDC iconDC;
692 
693  iconDC.SelectObject( bitmap );
694 
695  brush.SetStyle( wxBRUSHSTYLE_SOLID );
696  brush.SetColour( aBackground.WithAlpha(1.0).ToColour() );
697  iconDC.SetBrush( brush );
698  iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
699 
700  brush.SetColour( aColor.ToColour() );
701  iconDC.SetBrush( brush );
702  iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
703 
704  return bitmap;
705 }
void OnRunFiltersButtonClick(wxCommandEvent &event) override
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:673
int m_Zone_HatchingStyle
Option to show the zone area (outlines only, short hatches or full hatches.
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
#define ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF
Definition: pcbnew.h:42
int m_ArcToSegmentsCount
Option to select number of segments to approximate a circle 16 or 32 segments.
void OnButtonCancelClick(wxCommandEvent &event) override
#define LAYER_BITMAP_SIZE_Y
#define CLEARANCE_MAX_VALUE
static wxString m_netNameShowFilter
the filter to show nets (default * "*").
TEXT_CTRL_EVAL * m_cornerSmoothingCtrl
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
void SetCornerSmoothingType(int aType)
#define ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
Definition: pcbnew.h:41
long m_ThermalReliefCopperBridge
thickness of the copper bridge in thermal reliefs
Class BOARD to handle a board.
ZONE_EDIT_T
Exit codes for zone editing dialogs.
Definition: zones.h:47
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:204
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int GetCopperLayerCount() const
Function GetCopperLayerCount.
Class DIALOG_COPPER_ZONE is the derived class from dialog_copper_zone_frame created by wxFormBuilder...
TEXT_CTRL_EVAL * m_ZoneMinThicknessCtrl
#define ZONE_CLEARANCE_MAX_VALUE_MIL
Definition: zones.h:43
BOARD * GetBoard() const
Classes to handle copper zones.
unsigned int GetCornerRadius() const
ZoneConnection GetPadConnection() const
std::vector< PCB_LAYER_ID > m_LayerId
Handle the real layer number from layer name position in m_LayerSelectionCtrl.
bool AcceptOptions(bool aPromptForErrors, bool aUseExportableSetupOnly=false)
Function AcceptOptions.
Class DIALOG_COPPER_ZONE_BASE.
void initDialog()
Function initDialog fills in the dialog controls using the current settings.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Function GetTextSize returns the size of aSingleLine of text when it is rendered in aWindow using wha...
Definition: common.cpp:93
ZONE_EDIT_T m_OnExitCode
exit code: ZONE_ABORT if no change, ZONE_OK if new values accepted ZONE_EXPORT_VALUES if values are e...
Pads are not covered.
Definition: zones.h:57
void ExportSetting(ZONE_CONTAINER &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:602
int m_NetcodeSelection
Net code selection for the current zone.
int GetCornerSmoothingType() const
PCB_LAYER_ID
A quick note on layer IDs:
Class LSET is a set of PCB_LAYER_IDs.
if new values were accepted
Definition: zones.h:49
#define ZONE_NET_OUTLINES_HATCH_OPTION_KEY
Definition: zones.h:29
#define ZONE_NET_SORT_OPTION_KEY
Definition: zones.h:30
if values were exported to others zones
Definition: zones.h:50
PCB_BASE_FRAME * m_Parent
PCB_GENERAL_SETTINGS & Settings()
void OnButtonOkClick(wxCommandEvent &event) override
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
int m_ZonePriority
Priority (0 ... N) of the zone.
COLOR4D WithAlpha(double aAlpha) const
Function WithAlpha Returns a colour with the same colour, but the given alpha.
Definition: color4d.h:237
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:369
if no change
Definition: zones.h:48
int SortedNetnamesList(wxArrayString &aNames, bool aSortbyPadsCount)
Function SortedNetnamesList.
int m_ZoneClearance
Clearance value.
#define ZONE_THERMAL_RELIEF_GAP_STRING_KEY
Definition: zones.h:32
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
#define ZONE_NET_FILTER_STRING_KEY
Definition: zones.h:31
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1011
void ExportSetupToOtherCopperZones(wxCommandEvent &event) override
int GetNet() const
Function GetNet.
int ValueFromTextCtrl(const wxTextCtrl &aTextCtr)
Convert the number Value in a string according to the internal units and the selected unit (g_UserUni...
Definition: base_units.cpp:385
Thermal relief only for THT pads.
Definition: zones.h:60
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
COLORS_DESIGN_SETTINGS & Colors()
Class ZONE_SETTINGS handles zones parameters.
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
Function ConfigBaseWriteDouble This is a helper function to write doubles in config We cannot use wxC...
#define ZONE_MIN_THICKNESS_WIDTH_STRING_KEY
Definition: zones.h:35
ZONE_FILL_MODE m_FillMode
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:266
virtual void OnModify()
Function OnModify Virtual Must be called after a change in order to set the "modify" flag of the curr...
Class NETINFO_ITEM handles the data for a net.
Definition: class_netinfo.h:69
#define ZONE_THICKNESS_MIN_VALUE_MIL
Definition: zones.h:41
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
Definition: zones.h:33
void AddUnitSymbol(wxStaticText &Stext, EDA_UNITS_T aUnit)
Definition: base_units.cpp:514
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:982
Board layer functions and definitions.
#define max(a, b)
Definition: auxiliary.h:86
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
void SetCornerRadius(int aRadius)
void OnPadsInZoneClick(wxCommandEvent &event) override
DIALOG_COPPER_ZONE(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings)
#define ZONE_CLEARANCE_WIDTH_STRING_KEY
Definition: zones.h:34
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
void initListNetsParams()
Function initListNetsParams initializes m_NetSortingByPadCount and m_NetFiltering values according to...
ZONE_EDIT_T InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing...
void OnNetSortingOptionSelected(wxCommandEvent &event) override
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
void SetPadConnection(ZoneConnection aPadConnection)
void OnCornerSmoothingModeChoice(wxCommandEvent &event) override
bool m_NetSortingByPadCount
false = alphabetic sort.
const wxString & GetNetname() const
Function GetNetname.
wxBitmap makeLayerBitmap(COLOR4D aColor, COLOR4D aBackground)
Function makeLayerBitmap creates the colored rectangle bitmaps used in the layer selection widget...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:74
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:122
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:796
Use thermal relief for pads.
Definition: zones.h:58
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
wxConfigBase * m_Config
Current config.
long m_ThermalReliefGap
thickness of the gap in thermal reliefs
void OnClose(wxCloseEvent &event) override
int m_ZoneMinThickness
Min thickness value in filled areas.
#define LAYER_BITMAP_SIZE_X
pads are covered by copper
Definition: zones.h:59
LSEQ UIOrder() const
Definition: lset.cpp:786
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39