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 
40 #include <class_zone.h>
41 #include <class_board.h>
43 
44 #include <wx/imaglist.h> // needed for wx/listctrl.h, in wxGTK 2.8.12
45 #include <wx/listctrl.h>
47 
48 
54 {
55 public:
56  DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings );
57 
58 private:
60  wxConfigBase* m_Config;
61 
63 
68 
70 
73 
74  std::vector<PCB_LAYER_ID> m_LayerId;
75 
77  static wxString m_netNameShowFilter;
78 
84  void initDialog();
85 
86  void OnButtonOkClick( wxCommandEvent& event ) override;
87  void OnButtonCancelClick( wxCommandEvent& event ) override;
88  void OnClose( wxCloseEvent& event ) override;
89  void OnCornerSmoothingModeChoice( wxCommandEvent& event ) override;
90 
97  bool AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly = false );
98 
99  void OnNetSortingOptionSelected( wxCommandEvent& event ) override;
100  void ExportSetupToOtherCopperZones( wxCommandEvent& event ) override;
101  void OnPadsInZoneClick( wxCommandEvent& event ) override;
102  void OnRunFiltersButtonClick( wxCommandEvent& event ) override;
103 
105 
111  void initListNetsParams();
112 
118  wxBitmap makeLayerBitmap( COLOR4D aColor );
119 };
120 
121 
122 #define LAYER_BITMAP_SIZE_X 20
123 #define LAYER_BITMAP_SIZE_Y 10
124 
125 // Initialize static member variables
126 wxString DIALOG_COPPER_ZONE::m_netNameShowFilter( wxT( "*" ) );
127 
128 
130 {
131  DIALOG_COPPER_ZONE dlg( aCaller, aSettings );
132 
133  ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() );
134  return result;
135 }
136 
137 
139  DIALOG_COPPER_ZONE_BASE( aParent )
140 {
141  m_Parent = aParent;
143 
144  m_ptr = aSettings;
145  m_settings = *aSettings;
146 
147  m_NetSortingByPadCount = true; // false = alphabetic sort, true = pad count sort
149 
150  SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
151 
152  // Fix static text widget minimum width to a suitable value so that
153  // resizing the dialog is not necessary when changing the corner smoothing type.
154  // Depends on the default text in the widget.
155  m_cornerSmoothingValue->SetMinSize( m_cornerSmoothingValue->GetSize() );
156 
157  initDialog();
158 
159  m_sdbSizerOK->SetDefault();
160 
162 }
163 
164 
166 {
167  BOARD* board = m_Parent->GetBoard();
168 
169  wxString msg;
170 
172  m_OrientEdgesOpt->SetSelection( 1 );
173 
174  m_FillModeCtrl->SetSelection( m_settings.m_FillMode ? 1 : 0 );
175 
178  m_ZoneClearanceCtrl->SetValue( msg );
179 
182  m_ZoneMinThicknessCtrl->SetValue( msg );
183 
184  switch( m_settings.GetPadConnection() )
185  {
186  case PAD_ZONE_CONN_THT_THERMAL: // Thermals only for THT pads
187  m_PadInZoneOpt->SetSelection( 2 );
188  break;
189 
190  case PAD_ZONE_CONN_NONE: // Pads are not covered
191  m_PadInZoneOpt->SetSelection( 3 );
192  break;
193 
194  default:
195  case PAD_ZONE_CONN_THERMAL: // Use thermal relief for pads
196  m_PadInZoneOpt->SetSelection( 1 );
197  break;
198 
199  case PAD_ZONE_CONN_FULL: // pads are covered by copper
200  m_PadInZoneOpt->SetSelection( 0 );
201  break;
202  }
203 
205 
210 
212 
214 
216  {
218  m_OutlineAppearanceCtrl->SetSelection( 0 );
219  break;
220 
222  m_OutlineAppearanceCtrl->SetSelection( 1 );
223  break;
224 
226  m_OutlineAppearanceCtrl->SetSelection( 2 );
227  break;
228  }
229 
230  m_ArcApproximationOpt->SetSelection(
232 
233  // Create one column in m_LayerSelectionCtrl
234  wxListItem column0;
235  column0.SetId( 0 );
236  m_LayerSelectionCtrl->InsertColumn( 0, column0 );
237 
238  wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
239  m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
240 
241  int ctrlWidth = 0; // Min width for m_LayerSelectionCtrl to show the layers names
242  int imgIdx = 0;
243 
244  LSET cu_set = LSET::AllCuMask( board->GetCopperLayerCount() );
245 
246  for( LSEQ cu_stack = cu_set.UIOrder(); cu_stack; ++cu_stack, imgIdx++ )
247  {
248  PCB_LAYER_ID layer = *cu_stack;
249 
250  m_LayerId.push_back( layer );
251 
252  msg = board->GetLayerName( layer );
253 
254  msg.Trim();
255 
256  COLOR4D layerColor = board->GetLayerColor( layer );
257 
258  imageList->Add( makeLayerBitmap( layerColor ) );
259 
260  int itemIndex = m_LayerSelectionCtrl->InsertItem(
261  m_LayerSelectionCtrl->GetItemCount(), msg, imgIdx );
262 
263  if( m_settings.m_CurrentZone_Layer == layer )
264  m_LayerSelectionCtrl->Select( itemIndex );
265 
266  wxSize tsize( GetTextSize( msg, m_LayerSelectionCtrl ) );
267  ctrlWidth = std::max( ctrlWidth, tsize.x );
268  }
269 
270  // The most easy way to ensure the right size is to use wxLIST_AUTOSIZE
271  // unfortunately this option does not work well both on
272  // wxWidgets 2.8 ( column width too small), and
273  // wxWidgets 2.9 ( column width too large)
274  ctrlWidth += LAYER_BITMAP_SIZE_X + 25; // Add bitmap width + margin between bitmap and text
275  m_LayerSelectionCtrl->SetColumnWidth( 0, ctrlWidth );
276 
277  ctrlWidth += 25; // add small margin between text and window borders
278  // and room for vertical scroll bar
279  m_LayerSelectionCtrl->SetMinSize( wxSize( ctrlWidth, -1 ) );
280 
281  wxString netNameDoNotShowFilter = wxT( "Net-*" );
282  if( m_Config )
283  {
284  int opt = m_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
285  m_NetDisplayOption->SetSelection( opt );
286  m_Config->Read( ZONE_NET_FILTER_STRING_KEY, netNameDoNotShowFilter );
287  }
288  else
289  m_NetDisplayOption->SetSelection( 1 );
290 
293 
294  // Build list of nets:
295  m_DoNotShowNetNameFilter->SetValue( netNameDoNotShowFilter );
297 
298  wxCommandEvent event;
300 }
301 
302 
303 void DIALOG_COPPER_ZONE::OnButtonCancelClick( wxCommandEvent& event )
304 {
305  Close( true );
306 }
307 
308 void DIALOG_COPPER_ZONE::OnButtonOkClick( wxCommandEvent& event )
309 {
311 
312  if( AcceptOptions( true ) )
313  {
314  *m_ptr = m_settings;
315  EndModal( ZONE_OK );
316  }
317 }
318 
319 
320 // called on system close button
321 void DIALOG_COPPER_ZONE::OnClose( wxCloseEvent& event )
322 {
323  if( m_OnExitCode != ZONE_ABORT )
324  *m_ptr = m_settings;
325 
326  EndModal( m_OnExitCode );
327 }
328 
329 
330 bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
331 {
332  switch( m_PadInZoneOpt->GetSelection() )
333  {
334  case 3:
335  // Pads are not covered
337  break;
338 
339  case 2:
340  // Use thermal relief for THT pads
342  break;
343 
344  case 1:
345  // Use thermal relief for pads
347  break;
348 
349  case 0:
350  // pads are covered by copper
352  break;
353  }
354 
355  switch( m_OutlineAppearanceCtrl->GetSelection() )
356  {
357  case 0:
359  break;
360 
361  case 1:
363  break;
364 
365  case 2:
367  break;
368  }
369 
370  m_settings.m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ?
373 
374  if( m_Config )
375  {
378  wxString filter = m_DoNotShowNetNameFilter->GetValue();
379  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, filter );
380  }
381 
383  m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? 0 : 1;
384 
385  wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
387 
388  // Test if this is a reasonable value for this parameter
389  // A too large value can hang Pcbnew
390  #define CLEARANCE_MAX_VALUE ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS
391 
393  {
394  wxString msg;
395  msg.Printf( _( "Clearance must be smaller than %f\" / %f mm." ),
397  DisplayError( this, msg );
398  return false;
399  }
400 
401  txtvalue = m_ZoneMinThicknessCtrl->GetValue();
403 
405  {
406  wxString msg;
407  msg.Printf( _( "Minimum width must be larger than %f\" / %f mm." ),
409  DisplayError( this, msg );
410  return false;
411  }
412 
414  txtvalue = m_cornerSmoothingCtrl->GetValue();
416 
418 
419  if( m_OrientEdgesOpt->GetSelection() == 0 )
420  m_settings.m_Zone_45_Only = false;
421  else
422  m_settings.m_Zone_45_Only = true;
423 
426 
427  if( m_Config )
428  {
430  (double) m_settings.m_ZoneClearance / IU_PER_MILS );
431 
433  (double) m_settings.m_ZoneMinThickness / IU_PER_MILS );
434 
436  (double) m_settings.m_ThermalReliefGap / IU_PER_MILS );
437 
439  (double) m_settings.m_ThermalReliefCopperBridge / IU_PER_MILS );
440  }
441 
445  {
446  DisplayError( this,
447  _( "Thermal relief spoke must be greater than the minimum width." ) );
448  return false;
449  }
450 
451  // If we use only exportable to others zones parameters, exit here:
452  if( aUseExportableSetupOnly )
453  return true;
454 
455  // Get the layer selection for this zone
456  int ii = m_LayerSelectionCtrl->GetFirstSelected();
457 
458  if( ii < 0 && aPromptForErrors )
459  {
460  DisplayError( this, _( "No layer selected." ) );
461  return false;
462  }
463 
465 
466  // Get the net name selection for this zone
467  ii = m_ListNetNameSelection->GetSelection();
468 
469  if( ii < 0 && aPromptForErrors )
470  {
471  DisplayError( this, _( "No net selected." ) );
472  return false;
473  }
474 
475  if( ii == 0 ) // the not connected option was selected: this is not a good practice: warn:
476  {
477  if( !IsOK( this, _( "You have chosen the \"not connected\" option. This will create "
478  "insulated copper islands. Are you sure ?" ) ) )
479  return false;
480  }
481 
482  wxString net_name = m_ListNetNameSelection->GetString( ii );
483 
485 
486  // Search net_code for this net, if a net was selected
487  if( m_ListNetNameSelection->GetSelection() > 0 )
488  {
489  NETINFO_ITEM* net = m_Parent->GetBoard()->FindNet( net_name );
490 
491  if( net )
493  }
494 
495  return true;
496 }
497 
498 
500 {
501  int selection = m_cornerSmoothingChoice->GetSelection();
502 
503  switch( selection )
504  {
506  m_cornerSmoothingValue->Enable( false );
507  m_cornerSmoothingCtrl->Enable( false );
508  break;
510  m_cornerSmoothingValue->Enable( true );
511  m_cornerSmoothingCtrl->Enable( true );
512  m_cornerSmoothingValue->SetLabel( _( "Chamfer distance" ) );
514  break;
516  m_cornerSmoothingValue->Enable( true );
517  m_cornerSmoothingCtrl->Enable( true );
518  m_cornerSmoothingValue->SetLabel( _( "Fillet radius" ) );
520  break;
521  }
522 }
523 
524 
526 {
529 
531 
532  if( m_Config )
533  {
534  m_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetDisplayOption->GetSelection() );
535  wxString Filter = m_DoNotShowNetNameFilter->GetValue();
536  m_Config->Write( ZONE_NET_FILTER_STRING_KEY, Filter );
537  }
538 }
539 
540 
542 {
543  if( !AcceptOptions( true, true ) )
544  return;
545 
546  // Export settings ( but layer and netcode ) to others copper zones
547  BOARD* pcb = m_Parent->GetBoard();
548 
549  for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
550  {
551  ZONE_CONTAINER* zone = pcb->GetArea( ii );
552 
553  // Cannot export settings from a copper zone
554  // to a zone keepout:
555  if( zone->GetIsKeepout() )
556  continue;
557 
558  m_settings.ExportSetting( *zone, false ); // false = partial export
559  m_Parent->OnModify();
560  }
561 
562  m_OnExitCode = ZONE_EXPORT_VALUES; // values are exported to others zones
563 }
564 
565 
566 void DIALOG_COPPER_ZONE::OnPadsInZoneClick( wxCommandEvent& event )
567 {
568  // Antipad and spokes are significant only for thermals
569  // However, even if thermals are disabled, these parameters must be set
570  // for pads which have local settings with thermal enabled
571  // Previously, wxTextCtrl widgets related to thermal settings were disabled,
572  // but this is not a good idea. We leave them always enabled.
573 }
574 
575 
577 {
578  switch( m_NetDisplayOption->GetSelection() )
579  {
580  case 0:
581  m_NetSortingByPadCount = false;
582  m_NetFiltering = false;
583  break;
584 
585  case 1:
586  m_NetSortingByPadCount = true;
587  m_NetFiltering = false;
588  break;
589 
590  case 2:
591  m_NetSortingByPadCount = false;
592  m_NetFiltering = true;
593  break;
594 
595  case 3:
596  m_NetSortingByPadCount = true;
597  m_NetFiltering = true;
598  break;
599  }
600 }
601 
602 
603 void DIALOG_COPPER_ZONE::OnRunFiltersButtonClick( wxCommandEvent& event )
604 {
606 
607  // Ensure filtered option for nets
608  if( m_NetDisplayOption->GetSelection() == 0 )
609  m_NetDisplayOption->SetSelection( 2 );
610  else if( m_NetDisplayOption->GetSelection() == 1 )
611  m_NetDisplayOption->SetSelection( 3 );
612 
615 }
616 
617 
619 {
620  wxArrayString listNetName;
621 
623 
624  if( m_NetFiltering )
625  {
626  wxString doNotShowFilter = m_DoNotShowNetNameFilter->GetValue();
627  wxString ShowFilter = m_ShowNetNameFilter->GetValue();
628 
629  for( unsigned ii = 0; ii < listNetName.GetCount(); ii++ )
630  {
631  if( listNetName[ii].Matches( doNotShowFilter ) )
632  {
633  listNetName.RemoveAt( ii );
634  ii--;
635  }
636  else if( !listNetName[ii].Matches( ShowFilter ) )
637  {
638  listNetName.RemoveAt( ii );
639  ii--;
640  }
641  }
642  }
643 
644  listNetName.Insert( wxT( "<no net>" ), 0 );
645 
646  // Ensure currently selected net for the zone is visible, regardless of filters
647  int selectedNetListNdx = -1;
648  int net_select = m_settings.m_NetcodeSelection;
649 
650  if( net_select > 0 )
651  {
652  NETINFO_ITEM* equipot = m_Parent->GetBoard()->FindNet( net_select );
653  if( equipot )
654  {
655  selectedNetListNdx = listNetName.Index( equipot->GetNetname() );
656 
657  if( wxNOT_FOUND == selectedNetListNdx )
658  {
659  // the currently selected net must *always* be visible.
660  listNetName.Insert( equipot->GetNetname(), 0 );
661  selectedNetListNdx = 0;
662  }
663  }
664  }
665  else if( net_select == 0 )
666  selectedNetListNdx = 0; // SetSelection() on "<no net>"
667  else
668  {
669  // selectedNetListNdx remains -1, no net selected.
670  }
671 
672  m_ListNetNameSelection->Clear();
673  m_ListNetNameSelection->InsertItems( listNetName, 0 );
674  m_ListNetNameSelection->SetSelection( 0 );
675 
676  if( selectedNetListNdx >= 0 )
677  {
678  m_ListNetNameSelection->SetSelection( selectedNetListNdx );
679  m_ListNetNameSelection->EnsureVisible( selectedNetListNdx );
680  }
681 }
682 
683 
685 {
686  wxBitmap bitmap( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
687  wxBrush brush;
688  wxMemoryDC iconDC;
689 
690  iconDC.SelectObject( bitmap );
691  brush.SetColour( aColor.ToColour() );
692  brush.SetStyle( wxBRUSHSTYLE_SOLID );
693  iconDC.SetBrush( brush );
694  iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
695 
696  return bitmap;
697 }
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:639
COLOR4D GetLayerColor(PCB_LAYER_ID aLayer) const
Function GetLayerColor gets a layer color for any valid layer, including non-copper ones...
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:78
#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 * "*").
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:203
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...
#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:654
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
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.
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:368
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:101
#define ZONE_NET_FILTER_STRING_KEY
Definition: zones.h:31
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1051
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:384
Thermal relief only for THT pads.
Definition: zones.h:60
Class LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
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
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
Definition: base_units.cpp:265
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.
#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:509
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:1022
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:166
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
void SetPadConnection(ZoneConnection aPadConnection)
void OnCornerSmoothingModeChoice(wxCommandEvent &event) override
int m_FillMode
Mode for filling zone : 1 use segments, 0 use polygons.
bool m_NetSortingByPadCount
false = alphabetic sort.
const wxString & GetNetname() const
Function GetNetname.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:111
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:767
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...
wxBitmap makeLayerBitmap(COLOR4D aColor)
Function makeLayerBitmap creates the colored rectangle bitmaps used in the layer selection widget...
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:752
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39