KiCad PCB EDA Suite
zone.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6  * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include <bitmaps.h>
28 #include <geometry/shape_null.h>
29 #include <core/mirror.h>
30 #include <advanced_config.h>
31 #include <pcb_edit_frame.h>
32 #include <pcb_screen.h>
33 #include <board.h>
34 #include <board_design_settings.h>
35 #include <pad.h>
36 #include <zone.h>
37 #include <string_utils.h>
38 #include <math_for_graphics.h>
41 #include <trigo.h>
42 #include <i18n_utility.h>
43 
44 ZONE::ZONE( BOARD_ITEM_CONTAINER* aParent, bool aInFP ) :
45  BOARD_CONNECTED_ITEM( aParent, aInFP ? PCB_FP_ZONE_T : PCB_ZONE_T ),
46  m_area( 0.0 )
47 {
48  m_CornerSelection = nullptr; // no corner is selected
49  m_isFilled = false; // fill status : true when the zone is filled
53  m_hv45 = false;
54  m_hatchThickness = 0;
55  m_hatchGap = 0;
56  m_hatchOrientation = 0.0;
57  m_hatchSmoothingLevel = 0; // Grid pattern smoothing type. 0 = no smoothing
58  m_hatchSmoothingValue = 0.1; // Grid pattern chamfer value relative to the gap value
59  // used only if m_hatchSmoothingLevel > 0
60  m_hatchHoleMinArea = 0.3; // Min size before holes are dropped (ratio of hole size)
61  m_hatchBorderAlgorithm = 1; // 0 = use zone min thickness; 1 = use hatch width
62  m_priority = 0;
64  SetIsRuleArea( aInFP ); // Zones living in footprints have the rule area option
65  SetDoNotAllowCopperPour( false ); // has meaning only if m_isRuleArea == true
66  SetDoNotAllowVias( true ); // has meaning only if m_isRuleArea == true
67  SetDoNotAllowTracks( true ); // has meaning only if m_isRuleArea == true
68  SetDoNotAllowPads( true ); // has meaning only if m_isRuleArea == true
69  SetDoNotAllowFootprints( false ); // has meaning only if m_isRuleArea == true
70  m_cornerRadius = 0;
71  SetLocalFlags( 0 ); // flags temporary used in zone calculations
72  m_Poly = new SHAPE_POLY_SET(); // Outlines
73  m_fillVersion = 5; // set the "old" way to build filled polygon areas (< 6.0.x)
75  aParent->GetZoneSettings().ExportSetting( *this );
76 
80 
81  m_needRefill = false; // True only after edits.
82 }
83 
84 
85 ZONE::ZONE( const ZONE& aZone )
86  : BOARD_CONNECTED_ITEM( aZone ),
87  m_Poly( nullptr ),
88  m_CornerSelection( nullptr )
89 {
91 }
92 
93 
94 ZONE& ZONE::operator=( const ZONE& aOther )
95 {
97 
98  InitDataFromSrcInCopyCtor( aOther );
99 
100  return *this;
101 }
102 
103 
105 {
106  delete m_Poly;
107  delete m_CornerSelection;
108 }
109 
110 
112 {
113  // members are expected non initialize in this.
114  // InitDataFromSrcInCopyCtor() is expected to be called
115  // only from a copy constructor.
116 
117  // Copy only useful EDA_ITEM flags:
118  m_flags = aZone.m_flags;
120 
121  // Replace the outlines for aZone outlines.
122  delete m_Poly;
123  m_Poly = new SHAPE_POLY_SET( *aZone.m_Poly );
124 
127  m_zoneName = aZone.m_zoneName;
128  m_priority = aZone.m_priority;
129  m_isRuleArea = aZone.m_isRuleArea;
130  SetLayerSet( aZone.GetLayerSet() );
131 
137 
139  m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
144 
145  m_isFilled = aZone.m_isFilled;
146  m_needRefill = aZone.m_needRefill;
147 
150 
151  m_fillMode = aZone.m_fillMode; // solid vs. hatched
153  m_hatchGap = aZone.m_hatchGap;
159 
160  // For corner moving, corner index to drag, or nullptr if no selection
161  delete m_CornerSelection;
162  m_CornerSelection = nullptr;
163 
164  for( PCB_LAYER_ID layer : aZone.GetLayerSet().Seq() )
165  {
166  m_FilledPolysList[layer] = aZone.m_FilledPolysList.at( layer );
167  m_RawPolysList[layer] = aZone.m_RawPolysList.at( layer );
168  m_filledPolysHash[layer] = aZone.m_filledPolysHash.at( layer );
169  m_FillSegmList[layer] = aZone.m_FillSegmList.at( layer ); // vector <> copy
170  m_insulatedIslands[layer] = aZone.m_insulatedIslands.at( layer );
171  }
172 
176 
177  SetLocalFlags( aZone.GetLocalFlags() );
178 
179  m_netinfo = aZone.m_netinfo;
180 
181  m_hv45 = aZone.m_hv45;
182  m_area = aZone.m_area;
183 }
184 
185 
187 {
188  return new ZONE( *this );
189 }
190 
191 
193 {
194  bool change = false;
195 
196  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
197  {
198  change |= !pair.second.IsEmpty();
199  m_insulatedIslands[pair.first].clear();
200  pair.second.RemoveAllContours();
201  }
202 
203  for( std::pair<const PCB_LAYER_ID, std::vector<SEG> >& pair : m_FillSegmList )
204  {
205  change |= !pair.second.empty();
206  pair.second.clear();
207  }
208 
209  m_isFilled = false;
210  m_fillFlags.clear();
211 
212  return change;
213 }
214 
215 
216 wxPoint ZONE::GetPosition() const
217 {
218  return (wxPoint) GetCornerPosition( 0 );
219 }
220 
221 
223 {
224  return BOARD_ITEM::GetLayer();
225 }
226 
227 
229 {
230  return ( m_layerSet & LSET::AllCuMask() ).count() > 0;
231 }
232 
233 
234 bool ZONE::CommonLayerExists( const LSET aLayerSet ) const
235 {
236  LSET common = GetLayerSet() & aLayerSet;
237 
238  return common.count() > 0;
239 }
240 
241 
243 {
244  SetLayerSet( LSET( aLayer ) );
245 
246  m_layer = aLayer;
247 }
248 
249 
250 void ZONE::SetLayerSet( LSET aLayerSet )
251 {
252  if( aLayerSet.count() == 0 )
253  return;
254 
255  if( m_layerSet != aLayerSet )
256  {
257  SetNeedRefill( true );
258 
259  UnFill();
260 
261  m_FillSegmList.clear();
262  m_FilledPolysList.clear();
263  m_RawPolysList.clear();
264  m_filledPolysHash.clear();
265  m_insulatedIslands.clear();
266 
267  for( PCB_LAYER_ID layer : aLayerSet.Seq() )
268  {
269  m_FillSegmList[layer] = {};
270  m_FilledPolysList[layer] = {};
271  m_RawPolysList[layer] = {};
272  m_filledPolysHash[layer] = {};
273  m_insulatedIslands[layer] = {};
274  }
275  }
276 
277  m_layerSet = aLayerSet;
278 
279  // Set the single layer parameter. For zones that can be on many layers, this parameter
280  // is arbitrary at best, but some code still uses it.
281  // Priority is F_Cu then B_Cu then to the first selected layer
282  m_layer = aLayerSet.Seq()[0];
283 
284  if( m_layer != F_Cu && aLayerSet[B_Cu] )
285  m_layer = B_Cu;
286 }
287 
288 
290 {
291  return m_layerSet;
292 }
293 
294 
295 void ZONE::ViewGetLayers( int aLayers[], int& aCount ) const
296 {
297  LSEQ layers = m_layerSet.Seq();
298 
299  for( unsigned int idx = 0; idx < layers.size(); idx++ )
300  aLayers[idx] = LAYER_ZONE_START + layers[idx];
301 
302  aCount = layers.size();
303 }
304 
305 
306 double ZONE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
307 {
308  constexpr double HIDE = std::numeric_limits<double>::max();
309 
310  return aView->IsLayerVisible( LAYER_ZONES ) ? 0.0 : HIDE;
311 }
312 
313 
314 bool ZONE::IsOnLayer( PCB_LAYER_ID aLayer ) const
315 {
316  return m_layerSet.test( aLayer );
317 }
318 
319 
321 {
322  auto bb = m_Poly->BBox();
323 
324  EDA_RECT ret( (wxPoint) bb.GetOrigin(), wxSize( bb.GetWidth(), bb.GetHeight() ) );
325 
326  return ret;
327 }
328 
329 
330 int ZONE::GetThermalReliefGap( PAD* aPad, wxString* aSource ) const
331 {
332  if( aPad->GetEffectiveThermalGap() == 0 )
333  {
334  if( aSource )
335  *aSource = _( "zone" );
336 
337  return m_thermalReliefGap;
338  }
339 
340  return aPad->GetEffectiveThermalGap( aSource );
341 
342 }
343 
344 
345 int ZONE::GetThermalReliefSpokeWidth( PAD* aPad, wxString* aSource ) const
346 {
347  if( aPad->GetEffectiveThermalSpokeWidth() == 0 )
348  {
349  if( aSource )
350  *aSource = _( "zone" );
351 
353  }
354 
355  return aPad->GetEffectiveThermalSpokeWidth( aSource );
356 }
357 
358 
359 void ZONE::SetCornerRadius( unsigned int aRadius )
360 {
361  if( m_cornerRadius != aRadius )
362  SetNeedRefill( true );
363 
364  m_cornerRadius = aRadius;
365 }
366 
367 
369 {
370  if( ADVANCED_CFG::GetCfg().m_DebugZoneFiller && LSET::InternalCuMask().Contains( aLayer ) )
371  return false;
372 
374 }
375 
376 
378 
379 
381 {
382  if( !m_filledPolysHash.count( aLayer ) )
383  return g_nullPoly.GetHash();
384  else
385  return m_filledPolysHash.at( aLayer );
386 }
387 
388 
390 {
391  if( !m_FilledPolysList.count( aLayer ) )
393  else
394  m_filledPolysHash[aLayer] = m_FilledPolysList.at( aLayer ).GetHash();
395 }
396 
397 
398 bool ZONE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
399 {
400  // When looking for an "exact" hit aAccuracy will be 0 which works poorly for very thin
401  // lines. Give it a floor.
402  int accuracy = std::max( aAccuracy, Millimeter2iu( 0.1 ) );
403 
404  return HitTestForCorner( aPosition, accuracy * 2 ) || HitTestForEdge( aPosition, accuracy );
405 }
406 
407 
408 void ZONE::SetSelectedCorner( const wxPoint& aPosition, int aAccuracy )
409 {
411 
412  // If there is some corner to be selected, assign it to m_CornerSelection
413  if( HitTestForCorner( aPosition, aAccuracy * 2, corner )
414  || HitTestForEdge( aPosition, aAccuracy, corner ) )
415  {
416  if( m_CornerSelection == nullptr )
418 
419  *m_CornerSelection = corner;
420  }
421 }
422 
423 bool ZONE::HitTestForCorner( const wxPoint& refPos, int aAccuracy,
424  SHAPE_POLY_SET::VERTEX_INDEX& aCornerHit ) const
425 {
426  return m_Poly->CollideVertex( VECTOR2I( refPos ), aCornerHit, aAccuracy );
427 }
428 
429 
430 bool ZONE::HitTestForCorner( const wxPoint& refPos, int aAccuracy ) const
431 {
433  return HitTestForCorner( refPos, aAccuracy, dummy );
434 }
435 
436 
437 bool ZONE::HitTestForEdge( const wxPoint& refPos, int aAccuracy,
438  SHAPE_POLY_SET::VERTEX_INDEX& aCornerHit ) const
439 {
440  return m_Poly->CollideEdge( VECTOR2I( refPos ), aCornerHit, aAccuracy );
441 }
442 
443 
444 bool ZONE::HitTestForEdge( const wxPoint& refPos, int aAccuracy ) const
445 {
447  return HitTestForEdge( refPos, aAccuracy, dummy );
448 }
449 
450 
451 bool ZONE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
452 {
453  // Calculate bounding box for zone
454  EDA_RECT bbox = GetBoundingBox();
455  bbox.Normalize();
456 
457  EDA_RECT arect = aRect;
458  arect.Normalize();
459  arect.Inflate( aAccuracy );
460 
461  if( aContained )
462  {
463  return arect.Contains( bbox );
464  }
465  else
466  {
467  // Fast test: if aBox is outside the polygon bounding box, rectangles cannot intersect
468  if( !arect.Intersects( bbox ) )
469  return false;
470 
471  int count = m_Poly->TotalVertices();
472 
473  for( int ii = 0; ii < count; ii++ )
474  {
475  auto vertex = m_Poly->CVertex( ii );
476  auto vertexNext = m_Poly->CVertex( ( ii + 1 ) % count );
477 
478  // Test if the point is within the rect
479  if( arect.Contains( ( wxPoint ) vertex ) )
480  return true;
481 
482  // Test if this edge intersects the rect
483  if( arect.Intersects( ( wxPoint ) vertex, ( wxPoint ) vertexNext ) )
484  return true;
485  }
486 
487  return false;
488  }
489 }
490 
491 
492 int ZONE::GetLocalClearance( wxString* aSource ) const
493 {
494  if( m_isRuleArea )
495  return 0;
496 
497  if( aSource )
498  *aSource = _( "zone" );
499 
500  return m_ZoneClearance;
501 }
502 
503 
504 bool ZONE::HitTestFilledArea( PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy ) const
505 {
506  // Rule areas have no filled area, but it's generally nice to treat their interior as if it were
507  // filled so that people don't have to select them by their outline (which is min-width)
508  if( GetIsRuleArea() )
509  return m_Poly->Contains( VECTOR2I( aRefPos.x, aRefPos.y ), -1, aAccuracy );
510 
511  if( !m_FilledPolysList.count( aLayer ) )
512  return false;
513 
514  return m_FilledPolysList.at( aLayer ).Contains( VECTOR2I( aRefPos.x, aRefPos.y ), -1,
515  aAccuracy );
516 }
517 
518 
519 bool ZONE::HitTestCutout( const VECTOR2I& aRefPos, int* aOutlineIdx, int* aHoleIdx ) const
520 {
521  // Iterate over each outline polygon in the zone and then iterate over
522  // each hole it has to see if the point is in it.
523  for( int i = 0; i < m_Poly->OutlineCount(); i++ )
524  {
525  for( int j = 0; j < m_Poly->HoleCount( i ); j++ )
526  {
527  if( m_Poly->Hole( i, j ).PointInside( aRefPos ) )
528  {
529  if( aOutlineIdx )
530  *aOutlineIdx = i;
531 
532  if( aHoleIdx )
533  *aHoleIdx = j;
534 
535  return true;
536  }
537  }
538  }
539 
540  return false;
541 }
542 
543 
544 void ZONE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
545 {
546  EDA_UNITS units = aFrame->GetUserUnits();
547  wxString msg;
548 
549  if( GetIsRuleArea() )
550  msg = _( "Rule Area" );
551  else if( IsOnCopperLayer() )
552  msg = _( "Copper Zone" );
553  else
554  msg = _( "Non-copper Zone" );
555 
556  // Display Cutout instead of Outline for holes inside a zone (i.e. when num contour !=0).
557  // Check whether the selected corner is in a hole; i.e., in any contour but the first one.
558  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
559  msg << wxT( " " ) << _( "Cutout" );
560 
561  aList.emplace_back( _( "Type" ), msg );
562 
563  if( GetIsRuleArea() )
564  {
565  msg.Empty();
566 
567  if( GetDoNotAllowVias() )
568  AccumulateDescription( msg, _( "No vias" ) );
569 
570  if( GetDoNotAllowTracks() )
571  AccumulateDescription( msg, _( "No tracks" ) );
572 
573  if( GetDoNotAllowPads() )
574  AccumulateDescription( msg, _( "No pads" ) );
575 
577  AccumulateDescription( msg, _( "No copper zones" ) );
578 
580  AccumulateDescription( msg, _( "No footprints" ) );
581 
582  if( !msg.IsEmpty() )
583  aList.emplace_back( MSG_PANEL_ITEM( _( "Restrictions" ), msg ) );
584  }
585  else if( IsOnCopperLayer() )
586  {
587  if( aFrame->GetName() == PCB_EDIT_FRAME_NAME )
588  {
589  aList.emplace_back( _( "Net" ), UnescapeString( GetNetname() ) );
590 
591  aList.emplace_back( _( "Net Class" ), UnescapeString( GetNetClass()->GetName() ) );
592  }
593 
594  // Display priority level
595  aList.emplace_back( _( "Priority" ), wxString::Format( wxT( "%d" ), GetPriority() ) );
596  }
597 
598  if( aFrame->GetName() == PCB_EDIT_FRAME_NAME )
599  {
600  if( IsLocked() )
601  aList.emplace_back( _( "Status" ), _( "Locked" ) );
602  }
603 
604  wxString layerDesc;
605  int count = 0;
606 
607  for( PCB_LAYER_ID layer : m_layerSet.Seq() )
608  {
609  if( count == 0 )
610  layerDesc = GetBoard()->GetLayerName( layer );
611 
612  count++;
613  }
614 
615  if( count > 1 )
616  layerDesc.Printf( _( "%s and %d more" ), layerDesc, count - 1 );
617 
618  aList.emplace_back( _( "Layer" ), layerDesc );
619 
620  if( !m_zoneName.empty() )
621  aList.emplace_back( _( "Name" ), m_zoneName );
622 
623  switch( m_fillMode )
624  {
625  case ZONE_FILL_MODE::POLYGONS: msg = _( "Solid" ); break;
626  case ZONE_FILL_MODE::HATCH_PATTERN: msg = _( "Hatched" ); break;
627  default: msg = _( "Unknown" ); break;
628  }
629 
630  aList.emplace_back( _( "Fill Mode" ), msg );
631 
632  msg = MessageTextFromValue( units, m_area, true, EDA_DATA_TYPE::AREA );
633  aList.emplace_back( _( "Filled Area" ), msg );
634 
635  wxString source;
636  int clearance = GetOwnClearance( GetLayer(), &source );
637 
638  if( !source.IsEmpty() )
639  {
640  aList.emplace_back( wxString::Format( _( "Min Clearance: %s" ),
641  MessageTextFromValue( units, clearance ) ),
642  wxString::Format( _( "(from %s)" ),
643  source ) );
644  }
645 
646  // Useful for statistics, especially when zones are complex the number of hatches
647  // and filled polygons can explain the display and DRC calculation time:
648  msg.Printf( wxT( "%d" ), (int) m_borderHatchLines.size() );
649  aList.emplace_back( MSG_PANEL_ITEM( _( "HatchBorder Lines" ), msg ) );
650 }
651 
652 
653 void ZONE::Move( const wxPoint& offset )
654 {
655  /* move outlines */
656  m_Poly->Move( offset );
657 
658  HatchBorder();
659 
660  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
661  pair.second.Move( offset );
662 
663  for( std::pair<const PCB_LAYER_ID, std::vector<SEG> >& pair : m_FillSegmList )
664  {
665  for( SEG& seg : pair.second )
666  {
667  seg.A += VECTOR2I( offset );
668  seg.B += VECTOR2I( offset );
669  }
670  }
671 }
672 
673 
674 void ZONE::MoveEdge( const wxPoint& offset, int aEdge )
675 {
676  int next_corner;
677 
678  if( m_Poly->GetNeighbourIndexes( aEdge, nullptr, &next_corner ) )
679  {
680  m_Poly->SetVertex( aEdge, m_Poly->CVertex( aEdge ) + VECTOR2I( offset ) );
681  m_Poly->SetVertex( next_corner, m_Poly->CVertex( next_corner ) + VECTOR2I( offset ) );
682  HatchBorder();
683 
684  SetNeedRefill( true );
685  }
686 }
687 
688 
689 void ZONE::Rotate( const wxPoint& aCentre, double aAngle )
690 {
691  aAngle = -DECIDEG2RAD( aAngle );
692 
693  m_Poly->Rotate( aAngle, VECTOR2I( aCentre ) );
694  HatchBorder();
695 
696  /* rotate filled areas: */
697  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
698  pair.second.Rotate( aAngle, VECTOR2I( aCentre ) );
699 
700  for( std::pair<const PCB_LAYER_ID, std::vector<SEG> >& pair : m_FillSegmList )
701  {
702  for( SEG& seg : pair.second )
703  {
704  wxPoint a( seg.A );
705  RotatePoint( &a, aCentre, aAngle );
706  seg.A = a;
707  wxPoint b( seg.B );
708  RotatePoint( &b, aCentre, aAngle );
709  seg.B = a;
710  }
711  }
712 }
713 
714 
715 void ZONE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
716 {
717  Mirror( aCentre, aFlipLeftRight );
718  int copperLayerCount = GetBoard()->GetCopperLayerCount();
719 
720  SetLayerSet( FlipLayerMask( GetLayerSet(), copperLayerCount ) );
721 }
722 
723 
724 void ZONE::Mirror( const wxPoint& aMirrorRef, bool aMirrorLeftRight )
725 {
726  // ZONEs mirror about the x-axis (why?!?)
727  m_Poly->Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
728 
729  HatchBorder();
730 
731  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
732  pair.second.Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
733 
734  for( std::pair<const PCB_LAYER_ID, std::vector<SEG> >& pair : m_FillSegmList )
735  {
736  for( SEG& seg : pair.second )
737  {
738  if( aMirrorLeftRight )
739  {
740  MIRROR( seg.A.x, aMirrorRef.x );
741  MIRROR( seg.B.x, aMirrorRef.x );
742  }
743  else
744  {
745  MIRROR( seg.A.y, aMirrorRef.y );
746  MIRROR( seg.B.y, aMirrorRef.y );
747  }
748  }
749  }
750 }
751 
752 
753 ZONE_CONNECTION ZONE::GetPadConnection( PAD* aPad, wxString* aSource ) const
754 {
755  if( aPad == nullptr || aPad->GetEffectiveZoneConnection() == ZONE_CONNECTION::INHERITED )
756  {
757  if( aSource )
758  *aSource = _( "zone" );
759 
760  return m_PadConnection;
761  }
762  else
763  {
764  return aPad->GetEffectiveZoneConnection( aSource );
765  }
766 }
767 
768 
769 void ZONE::RemoveCutout( int aOutlineIdx, int aHoleIdx )
770 {
771  // Ensure the requested cutout is valid
772  if( m_Poly->OutlineCount() < aOutlineIdx || m_Poly->HoleCount( aOutlineIdx ) < aHoleIdx )
773  return;
774 
775  SHAPE_POLY_SET cutPoly( m_Poly->Hole( aOutlineIdx, aHoleIdx ) );
776 
777  // Add the cutout back to the zone
779 
780  SetNeedRefill( true );
781 }
782 
783 
784 void ZONE::AddPolygon( const SHAPE_LINE_CHAIN& aPolygon )
785 {
786  wxASSERT( aPolygon.IsClosed() );
787 
788  // Add the outline as a new polygon in the polygon set
789  if( m_Poly->OutlineCount() == 0 )
790  m_Poly->AddOutline( aPolygon );
791  else
792  m_Poly->AddHole( aPolygon );
793 
794  SetNeedRefill( true );
795 }
796 
797 
798 void ZONE::AddPolygon( std::vector< wxPoint >& aPolygon )
799 {
800  if( aPolygon.empty() )
801  return;
802 
803  SHAPE_LINE_CHAIN outline;
804 
805  // Create an outline and populate it with the points of aPolygon
806  for( const wxPoint& pt : aPolygon)
807  outline.Append( pt );
808 
809  outline.SetClosed( true );
810 
811  AddPolygon( outline );
812 }
813 
814 
815 bool ZONE::AppendCorner( wxPoint aPosition, int aHoleIdx, bool aAllowDuplication )
816 {
817  // Ensure the main outline exists:
818  if( m_Poly->OutlineCount() == 0 )
819  m_Poly->NewOutline();
820 
821  // If aHoleIdx >= 0, the corner musty be added to the hole, index aHoleIdx.
822  // (remember: the index of the first hole is 0)
823  // Return error if if does dot exist.
824  if( aHoleIdx >= m_Poly->HoleCount( 0 ) )
825  return false;
826 
827  m_Poly->Append( aPosition.x, aPosition.y, -1, aHoleIdx, aAllowDuplication );
828 
829  SetNeedRefill( true );
830 
831  return true;
832 }
833 
834 
835 wxString ZONE::GetSelectMenuText( EDA_UNITS aUnits ) const
836 {
837  wxString layerDesc;
838  int count = 0;
839 
840  for( PCB_LAYER_ID layer : m_layerSet.Seq() )
841  {
842  if( count == 0 )
843  layerDesc = GetBoard()->GetLayerName( layer );
844 
845  count++;
846  }
847 
848  if( count > 1 )
849  layerDesc.Printf( _( "%s and %d more" ), layerDesc, count - 1 );
850 
851  // Check whether the selected contour is a hole (contour index > 0)
852  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
853  {
854  if( GetIsRuleArea() )
855  return wxString::Format( _( "Rule Area Cutout on %s" ), layerDesc );
856  else
857  return wxString::Format( _( "Zone Cutout on %s" ), layerDesc );
858  }
859  else
860  {
861  if( GetIsRuleArea() )
862  return wxString::Format( _( "Rule Area on %s" ), layerDesc );
863  else
864  return wxString::Format( _( "Zone %s on %s" ), GetNetnameMsg(), layerDesc );
865  }
866 }
867 
868 
870 {
871  return m_borderHatchPitch;
872 }
873 
874 
875 void ZONE::SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE aHatchStyle, int aHatchPitch,
876  bool aRebuildHatch )
877 {
878  SetHatchPitch( aHatchPitch );
879  m_borderStyle = aHatchStyle;
880 
881  if( aRebuildHatch )
882  HatchBorder();
883 }
884 
885 
886 void ZONE::SetHatchPitch( int aPitch )
887 {
888  m_borderHatchPitch = aPitch;
889 }
890 
891 
893 {
894  m_borderHatchLines.clear();
895 }
896 
897 
898 // Creates hatch lines inside the outline of the complex polygon
899 // sort function used in ::HatchBorder to sort points by descending wxPoint.x values
900 bool sortEndsByDescendingX( const VECTOR2I& ref, const VECTOR2I& tst )
901 {
902  return tst.x < ref.x;
903 }
904 
905 
907 {
908  UnHatchBorder();
909 
911  || m_borderHatchPitch == 0
912  || m_Poly->IsEmpty() )
913  {
914  return;
915  }
916 
917  // define range for hatch lines
918  int min_x = m_Poly->CVertex( 0 ).x;
919  int max_x = m_Poly->CVertex( 0 ).x;
920  int min_y = m_Poly->CVertex( 0 ).y;
921  int max_y = m_Poly->CVertex( 0 ).y;
922 
923  for( auto iterator = m_Poly->IterateWithHoles(); iterator; iterator++ )
924  {
925  if( iterator->x < min_x )
926  min_x = iterator->x;
927 
928  if( iterator->x > max_x )
929  max_x = iterator->x;
930 
931  if( iterator->y < min_y )
932  min_y = iterator->y;
933 
934  if( iterator->y > max_y )
935  max_y = iterator->y;
936  }
937 
938  // Calculate spacing between 2 hatch lines
939  int spacing;
940 
942  spacing = m_borderHatchPitch;
943  else
944  spacing = m_borderHatchPitch * 2;
945 
946  // set the "length" of hatch lines (the length on horizontal axis)
947  int hatch_line_len = m_borderHatchPitch;
948 
949  // To have a better look, give a slope depending on the layer
950  LAYER_NUM layer = GetLayer();
951  int slope_flag = (layer & 1) ? 1 : -1; // 1 or -1
952  double slope = 0.707106 * slope_flag; // 45 degrees slope
953  int max_a, min_a;
954 
955  if( slope_flag == 1 )
956  {
957  max_a = KiROUND( max_y - slope * min_x );
958  min_a = KiROUND( min_y - slope * max_x );
959  }
960  else
961  {
962  max_a = KiROUND( max_y - slope * max_x );
963  min_a = KiROUND( min_y - slope * min_x );
964  }
965 
966  min_a = (min_a / spacing) * spacing;
967 
968  // calculate an offset depending on layer number,
969  // for a better look of hatches on a multilayer board
970  int offset = (layer * 7) / 8;
971  min_a += offset;
972 
973  // loop through hatch lines
974  std::vector<VECTOR2I> pointbuffer;
975  pointbuffer.reserve( 256 );
976 
977  for( int a = min_a; a < max_a; a += spacing )
978  {
979  pointbuffer.clear();
980 
981  // Iterate through all vertices
982  for( auto iterator = m_Poly->IterateSegmentsWithHoles(); iterator; iterator++ )
983  {
984  double x, y;
985 
986  SEG segment = *iterator;
987 
988  if( FindLineSegmentIntersection( a, slope, segment.A.x, segment.A.y, segment.B.x,
989  segment.B.y, x, y ) )
990  pointbuffer.emplace_back( KiROUND( x ), KiROUND( y ) );
991  }
992 
993  // sort points in order of descending x (if more than 2) to
994  // ensure the starting point and the ending point of the same segment
995  // are stored one just after the other.
996  if( pointbuffer.size() > 2 )
997  sort( pointbuffer.begin(), pointbuffer.end(), sortEndsByDescendingX );
998 
999  // creates lines or short segments inside the complex polygon
1000  for( size_t ip = 0; ip + 1 < pointbuffer.size(); ip += 2 )
1001  {
1002  int dx = pointbuffer[ip + 1].x - pointbuffer[ip].x;
1003 
1004  // Push only one line for diagonal hatch,
1005  // or for small lines < twice the line length
1006  // else push 2 small lines
1008  || std::abs( dx ) < 2 * hatch_line_len )
1009  {
1010  m_borderHatchLines.emplace_back( SEG( pointbuffer[ip], pointbuffer[ ip + 1] ) );
1011  }
1012  else
1013  {
1014  double dy = pointbuffer[ip + 1].y - pointbuffer[ip].y;
1015  slope = dy / dx;
1016 
1017  if( dx > 0 )
1018  dx = hatch_line_len;
1019  else
1020  dx = -hatch_line_len;
1021 
1022  int x1 = KiROUND( pointbuffer[ip].x + dx );
1023  int x2 = KiROUND( pointbuffer[ip + 1].x - dx );
1024  int y1 = KiROUND( pointbuffer[ip].y + dx * slope );
1025  int y2 = KiROUND( pointbuffer[ip + 1].y - dx * slope );
1026 
1027  m_borderHatchLines.emplace_back( SEG( pointbuffer[ip].x, pointbuffer[ip].y,
1028  x1, y1 ) );
1029 
1030  m_borderHatchLines.emplace_back( SEG( pointbuffer[ip+1].x, pointbuffer[ip+1].y,
1031  x2, y2 ) );
1032  }
1033  }
1034  }
1035 }
1036 
1037 
1039 {
1040  return Mils2iu( 20 );
1041 }
1042 
1043 
1045 {
1046  return BITMAPS::add_zone;
1047 }
1048 
1049 
1051 {
1052  assert( aImage->Type() == PCB_ZONE_T || aImage->Type() == PCB_FP_ZONE_T );
1053 
1054  std::swap( *((ZONE*) this), *((ZONE*) aImage) );
1055 }
1056 
1057 
1059 {
1060  if( aLayer == UNDEFINED_LAYER )
1061  {
1062  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
1063  pair.second.CacheTriangulation();
1064 
1065  m_Poly->CacheTriangulation( false );
1066  }
1067  else
1068  {
1069  if( m_FilledPolysList.count( aLayer ) )
1071  }
1072 }
1073 
1074 
1075 bool ZONE::IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const
1076 {
1077  if( GetNetCode() < 1 )
1078  return true;
1079 
1080  if( !m_insulatedIslands.count( aLayer ) )
1081  return false;
1082 
1083  return m_insulatedIslands.at( aLayer ).count( aPolyIdx );
1084 }
1085 
1086 
1087 void ZONE::GetInteractingZones( PCB_LAYER_ID aLayer, std::vector<ZONE*>* aZones ) const
1088 {
1089  int epsilon = Millimeter2iu( 0.001 );
1090 
1091  for( ZONE* candidate : GetBoard()->Zones() )
1092  {
1093  if( candidate == this )
1094  continue;
1095 
1096  if( !candidate->GetLayerSet().test( aLayer ) )
1097  continue;
1098 
1099  if( candidate->GetIsRuleArea() )
1100  continue;
1101 
1102  if( candidate->GetNetCode() != GetNetCode() )
1103  continue;
1104 
1105  for( auto iter = m_Poly->CIterate(); iter; iter++ )
1106  {
1107  if( candidate->m_Poly->Collide( iter.Get(), epsilon ) )
1108  {
1109  aZones->push_back( candidate );
1110  break;
1111  }
1112  }
1113  }
1114 }
1115 
1116 
1118  SHAPE_POLY_SET* aBoardOutline,
1119  SHAPE_POLY_SET* aSmoothedPolyWithApron ) const
1120 {
1121  if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations will not like it ...
1122  return false;
1123 
1124  // Processing of arc shapes in zones is not yet supported because Clipper can't do boolean
1125  // operations on them. The poly outline must be converted to segments first.
1126  SHAPE_POLY_SET flattened = *m_Poly;
1127  flattened.ClearArcs();
1128 
1129  if( GetIsRuleArea() )
1130  {
1131  // We like keepouts just the way they are....
1132  aSmoothedPoly = flattened;
1133  return true;
1134  }
1135 
1136  const BOARD* board = GetBoard();
1137  int maxError = ARC_HIGH_DEF;
1138  bool keepExternalFillets = false;
1139 
1140  if( board )
1141  {
1142  BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings();
1143 
1144  maxError = bds.m_MaxError;
1145  keepExternalFillets = bds.m_ZoneKeepExternalFillets;
1146  }
1147 
1148  auto smooth = [&]( SHAPE_POLY_SET& aPoly )
1149  {
1150  switch( m_cornerSmoothingType )
1151  {
1153  aPoly = aPoly.Chamfer( (int) m_cornerRadius );
1154  break;
1155 
1157  {
1158  aPoly = aPoly.Fillet( (int) m_cornerRadius, maxError );
1159  break;
1160  }
1161 
1162  default:
1163  break;
1164  }
1165  };
1166 
1167  std::vector<ZONE*> interactingZones;
1168  GetInteractingZones( aLayer, &interactingZones );
1169 
1170  SHAPE_POLY_SET* maxExtents = &flattened;
1171  SHAPE_POLY_SET withFillets;
1172 
1173  aSmoothedPoly = flattened;
1174 
1175  // Should external fillets (that is, those applied to concave corners) be kept? While it
1176  // seems safer to never have copper extend outside the zone outline, 5.1.x and prior did
1177  // indeed fill them so we leave the mode available.
1178  if( keepExternalFillets )
1179  {
1180  withFillets = flattened;
1181  smooth( withFillets );
1182  withFillets.BooleanAdd( flattened, SHAPE_POLY_SET::PM_FAST );
1183  maxExtents = &withFillets;
1184  }
1185 
1186  for( ZONE* zone : interactingZones )
1187  {
1188  SHAPE_POLY_SET flattened_outline = *zone->Outline();
1189  flattened_outline.ClearArcs();
1190  aSmoothedPoly.BooleanAdd( flattened_outline, SHAPE_POLY_SET::PM_FAST );
1191  }
1192 
1193  if( aBoardOutline )
1194  {
1195  SHAPE_POLY_SET poly = *aBoardOutline;
1197  }
1198 
1199  smooth( aSmoothedPoly );
1200 
1201  if( aSmoothedPolyWithApron )
1202  {
1203  SHAPE_POLY_SET poly = *maxExtents;
1204  poly.Inflate( m_ZoneMinThickness, 64 );
1205  *aSmoothedPolyWithApron = aSmoothedPoly;
1206  aSmoothedPolyWithApron->BooleanIntersection( poly, SHAPE_POLY_SET::PM_FAST );
1207  }
1208 
1209  aSmoothedPoly.BooleanIntersection( *maxExtents, SHAPE_POLY_SET::PM_FAST );
1210 
1211  return true;
1212 }
1213 
1214 
1216 {
1217  m_area = 0.0;
1218 
1219  // Iterate over each outline polygon in the zone and then iterate over
1220  // each hole it has to compute the total area.
1221  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
1222  {
1223  SHAPE_POLY_SET& poly = pair.second;
1224 
1225  for( int i = 0; i < poly.OutlineCount(); i++ )
1226  {
1227  m_area += poly.Outline( i ).Area();
1228 
1229  for( int j = 0; j < poly.HoleCount( i ); j++ )
1230  m_area -= poly.Hole( i, j ).Area();
1231  }
1232  }
1233 
1234  return m_area;
1235 }
1236 
1237 
1238 void ZONE::TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aClearance,
1239  int aMaxError, ERROR_LOC aErrorLoc,
1240  SHAPE_POLY_SET* aBoardOutline ) const
1241 {
1242  // Creates the zone outline polygon (with holes if any)
1243  SHAPE_POLY_SET polybuffer;
1244  BuildSmoothedPoly( polybuffer, GetLayer(), aBoardOutline );
1245 
1246  // Calculate the polygon with clearance
1247  // holes are linked to the main outline, so only one polygon is created.
1248  if( aClearance )
1249  {
1250  const BOARD* board = GetBoard();
1251  int maxError = ARC_HIGH_DEF;
1252 
1253  if( board )
1254  maxError = board->GetDesignSettings().m_MaxError;
1255 
1256  int segCount = GetArcToSegmentCount( aClearance, maxError, 360.0 );
1257 
1258  if( aErrorLoc == ERROR_OUTSIDE )
1259  aClearance += aMaxError;
1260 
1261  polybuffer.Inflate( aClearance, segCount );
1262  }
1263 
1264  polybuffer.Fracture( SHAPE_POLY_SET::PM_FAST );
1265  aCornerBuffer.Append( polybuffer );
1266 }
1267 
1268 
1269 bool ZONE::IsKeepout() const
1270 {
1273 }
1274 
1275 
1276 bool ZONE::KeepoutAll() const
1277 {
1280 }
1281 
1282 
1284  ZONE( aParent, true )
1285 {
1286  // in a footprint, net classes are not managed.
1287  // so set the net to NETINFO_LIST::ORPHANED_ITEM
1288  SetNetCode( -1, true );
1289 }
1290 
1291 
1292 FP_ZONE::FP_ZONE( const FP_ZONE& aZone ) :
1293  ZONE( aZone )
1294 {
1295  InitDataFromSrcInCopyCtor( aZone );
1296 }
1297 
1298 
1300 {
1301  ZONE::operator=( aOther );
1302  return *this;
1303 }
1304 
1305 
1307 {
1308  return new FP_ZONE( *this );
1309 }
1310 
1311 
1312 double FP_ZONE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
1313 {
1314  constexpr double HIDE = (double)std::numeric_limits<double>::max();
1315 
1316  if( !aView )
1317  return 0;
1318 
1319  if( !aView->IsLayerVisible( LAYER_ZONES ) )
1320  return HIDE;
1321 
1322  bool flipped = GetParent() && GetParent()->GetLayer() == B_Cu;
1323 
1324  // Handle Render tab switches
1325  if( !flipped && !aView->IsLayerVisible( LAYER_MOD_FR ) )
1326  return HIDE;
1327 
1328  if( flipped && !aView->IsLayerVisible( LAYER_MOD_BK ) )
1329  return HIDE;
1330 
1331  // Other layers are shown without any conditions
1332  return 0.0;
1333 }
1334 
1335 
1336 std::shared_ptr<SHAPE> ZONE::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
1337 {
1338  std::shared_ptr<SHAPE> shape;
1339 
1340  if( m_FilledPolysList.find( aLayer ) == m_FilledPolysList.end() )
1341  {
1342  shape = std::make_shared<SHAPE_NULL>();
1343  }
1344  else
1345  {
1346  shape.reset( m_FilledPolysList.at( aLayer ).Clone() );
1347  }
1348 
1349  return shape;
1350 }
1351 
1352 
1354  PCB_LAYER_ID aLayer, int aClearance, int aError,
1355  ERROR_LOC aErrorLoc, bool aIgnoreLineWidth ) const
1356 {
1357  wxASSERT_MSG( !aIgnoreLineWidth, wxT( "IgnoreLineWidth has no meaning for zones." ) );
1358 
1359  if( !m_FilledPolysList.count( aLayer ) )
1360  return;
1361 
1362  aCornerBuffer = m_FilledPolysList.at( aLayer );
1363 
1364  // Rebuild filled areas only if clearance is not 0
1365  if( aClearance )
1366  {
1367  int numSegs = GetArcToSegmentCount( aClearance, aError, 360.0 );
1368 
1369  if( aErrorLoc == ERROR_OUTSIDE )
1370  aClearance += aError;
1371 
1372  aCornerBuffer.InflateWithLinkedHoles( aClearance, numSegs, SHAPE_POLY_SET::PM_FAST );
1373  }
1374 }
1375 
1376 
1378  int aError ) const
1379 {
1380  if( !m_FilledPolysList.count( aLayer ) || m_FilledPolysList.at( aLayer ).IsEmpty() )
1381  return;
1382 
1383  // Just add filled areas if filled polygons outlines have no thickness
1384  if( !GetFilledPolysUseThickness() || GetMinThickness() == 0 )
1385  {
1386  const SHAPE_POLY_SET& polys = m_FilledPolysList.at( aLayer );
1387  aCornerBuffer.Append( polys );
1388  return;
1389  }
1390 
1391  // Filled areas have polygons with outline thickness.
1392  // we must create the polygons and add inflated polys
1393  SHAPE_POLY_SET polys = m_FilledPolysList.at( aLayer );
1394 
1395  auto board = GetBoard();
1396  int maxError = ARC_HIGH_DEF;
1397 
1398  if( board )
1399  maxError = board->GetDesignSettings().m_MaxError;
1400 
1401  int numSegs = GetArcToSegmentCount( GetMinThickness(), maxError, 360.0 );
1402 
1404 
1405  aCornerBuffer.Append( polys );
1406 }
1407 
1408 
1409 static struct ZONE_DESC
1410 {
1412  {
1414  .Map( ZONE_CONNECTION::INHERITED, _HKI( "Inherited" ) )
1415  .Map( ZONE_CONNECTION::NONE, _HKI( "None" ) )
1416  .Map( ZONE_CONNECTION::THERMAL, _HKI( "Thermal reliefs" ) )
1417  .Map( ZONE_CONNECTION::FULL, _HKI( "Solid" ) )
1418  .Map( ZONE_CONNECTION::THT_THERMAL, _HKI( "Reliefs for PTH" ) );
1419 
1421  REGISTER_TYPE( ZONE );
1423  propMgr.AddProperty( new PROPERTY<ZONE, unsigned>( _HKI( "Priority" ),
1425  //propMgr.AddProperty( new PROPERTY<ZONE, bool>( "Filled",
1426  //&ZONE::SetIsFilled, &ZONE::IsFilled ) );
1427  propMgr.AddProperty( new PROPERTY<ZONE, wxString>( _HKI( "Name" ),
1429  propMgr.AddProperty( new PROPERTY<ZONE, int>( _HKI( "Clearance Override" ),
1432  propMgr.AddProperty( new PROPERTY<ZONE, int>( _HKI( "Min Width" ),
1435  propMgr.AddProperty( new PROPERTY_ENUM<ZONE, ZONE_CONNECTION>( _HKI( "Pad Connections" ),
1437  propMgr.AddProperty( new PROPERTY<ZONE, int>( _HKI( "Thermal Relief Gap" ),
1440  propMgr.AddProperty( new PROPERTY<ZONE, int>( _HKI( "Thermal Relief Width" ),
1443  }
1444 } _ZONE_DESC;
1445 
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
Definition: zone.h:928
int TotalVertices() const
Delete aIdx-th polygon from the set.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:759
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: zone.h:525
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: zone.cpp:1044
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
ZONE_CONNECTION GetPadConnection() const
Definition: zone.h:241
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:104
bool m_doNotAllowFootprints
Definition: zone.h:851
void SetCornerRadius(unsigned int aRadius)
Definition: zone.cpp:359
void CacheTriangulation(PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
Create a list of triangles that "fill" the solid areas used for instance to draw these solid areas on...
Definition: zone.cpp:1058
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
unsigned int m_cornerRadius
Definition: zone.h:826
#define TYPE_HASH(x)
Definition: property.h:59
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint.
Definition: lset.cpp:576
ENUM_TO_WXANY(ZONE_CONNECTION)
int OutlineCount() const
Return the number of vertices in a given outline/hole.
void RemoveCutout(int aOutlineIdx, int aHoleIdx)
Remove a cutout from the zone.
Definition: zone.cpp:769
void SetZoneName(const wxString &aName)
Definition: zone.h:130
bool GetDoNotAllowFootprints() const
Definition: zone.h:740
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:362
void SetDoNotAllowTracks(bool aEnable)
Definition: zone.h:747
void UnHatchBorder()
Clear the zone's hatch.
Definition: zone.cpp:892
ZONE_FILL_MODE m_fillMode
How to fill areas:
Definition: zone.h:886
SEGMENT_ITERATOR IterateSegmentsWithHoles()
Return an iterator object, for the aOutline-th outline in the set (with holes).
int m_ZoneClearance
Definition: zone.h:854
unsigned GetPriority() const
Definition: zone.h:122
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset difference For aFastMode meaning, see function booleanOp.
NETCLASS * GetNetClass() const override
Return the NETCLASS for this item.
Definition: zone.h:87
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: zone.h:735
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
int m_cornerSmoothingType
Definition: zone.h:825
void SetBorderDisplayStyle(ZONE_BORDER_DISPLAY_STYLE aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Set all hatch parameters for the zone.
Definition: zone.cpp:875
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: zone.h:824
int GetBorderHatchPitch() const
HatchBorder related methods.
Definition: zone.cpp:869
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
Definition: zone.h:829
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the aGlobalIndex-th vertex in the poly set.
int m_hatchSmoothingLevel
Definition: zone.h:890
void SetLayerSet(LSET aLayerSet) override
Definition: zone.cpp:250
ZONE_CONNECTION m_PadConnection
Definition: zone.h:853
bool GetDoNotAllowVias() const
Definition: zone.h:737
double m_area
Definition: zone.h:937
bool m_doNotAllowTracks
Definition: zone.h:849
bool IsEmpty() const
~ZONE()
Definition: zone.cpp:104
long long int m_minIslandArea
When island removal mode is set to AREA, islands below this area will be removed.
Definition: zone.h:864
double m_hatchOrientation
Definition: zone.h:889
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: zone.cpp:289
static ENUM_MAP< T > & Instance()
Definition: property.h:510
bool CommonLayerExists(const LSET aLayerSet) const
Test if this zone shares a common layer with the given layer set.
Definition: zone.cpp:234
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
Structure to hold the necessary information in order to index a vertex on a SHAPE_POLY_SET object: th...
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Return the aIndex-th subpolygon in the set.
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:41
std::map< PCB_LAYER_ID, std::set< int > > m_insulatedIslands
For each layer, a set of insulated islands that were not removed.
Definition: zone.h:933
bool BuildSmoothedPoly(SHAPE_POLY_SET &aSmoothedPoly, PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aBoardOutline, SHAPE_POLY_SET *aSmoothedPolyWithApron=nullptr) const
Definition: zone.cpp:1117
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
Definition: zone.cpp:314
show footprints on back
Definition: layer_ids.h:216
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_MIL
Definition: zones.h:30
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, int aAccuracy=0, bool aUseBBoxCaches=false) const
Return true if a given subpolygon contains the point aP.
int GetEffectiveThermalGap(wxString *aSource=nullptr) const
Return the effective thermal gap having resolved any inheritance.
Definition: pad.cpp:879
double Area(bool aAbsolute=true) const
Return the area of this chain.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:480
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:229
The base class for create windows for drawing purpose.
MD5_HASH GetHashValue(PCB_LAYER_ID aLayer)
Definition: zone.cpp:380
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: zone.cpp:544
VECTOR2< int > VECTOR2I
Definition: vector2d.h:622
virtual bool IsLocked() const
Definition: board_item.cpp:64
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
void SetPriority(unsigned aPriority)
Definition: zone.h:117
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:590
ZONE(BOARD_ITEM_CONTAINER *parent, bool aInFP=false)
The ctor to build ZONE, but compatible with FP_ZONE requirement.
Definition: zone.cpp:44
int m_hatchThickness
Definition: zone.h:887
#define REGISTER_TYPE(x)
Definition: property_mgr.h:248
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy=0) const
Test if the given wxPoint is within the bounds of a filled area of this zone.
Definition: zone.cpp:504
bool Contains(const wxPoint &aPoint) const
Definition: eda_rect.cpp:57
LSET m_layerSet
Definition: zone.h:831
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Definition: zone.cpp:1050
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a corner.
Definition: zone.cpp:423
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: zone.cpp:715
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: zone.cpp:1336
void Mirror(bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 })
Mirror the line points about y or x (or both)
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
Control for copper zone opacity/visibility (color ignored)
Definition: layer_ids.h:238
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
bool m_doNotAllowVias
Definition: zone.h:848
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Definition: mirror.h:40
void SetIsRuleArea(bool aEnable)
Definition: zone.h:744
int GetThermalReliefGap() const
Definition: zone.h:191
bool GetNeighbourIndexes(int aGlobalIndex, int *aPrevious, int *aNext)
Return the global indexes of the previous and the next corner of the aGlobalIndex-th corner of a cont...
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
int GetEffectiveThermalSpokeWidth(wxString *aSource=nullptr) const
Return the effective thermal spoke width having resolved any inheritance.
Definition: pad.cpp:860
void Rotate(const wxPoint &aCentre, double aAngle) override
Move the outlines.
Definition: zone.cpp:689
void SetVertex(const VERTEX_INDEX &aIndex, const VECTOR2I &aPos)
Accessor function to set the position of a specific point.
void GetInteractingZones(PCB_LAYER_ID aLayer, std::vector< ZONE * > *aZones) const
Some intersecting zones, despite being on the same layer with the same net, cannot be merged due to o...
Definition: zone.cpp:1087
bool HitTestCutout(const VECTOR2I &aRefPos, int *aOutlineIdx=nullptr, int *aHoleIdx=nullptr) const
Test if the given point is contained within a cutout of the zone.
Definition: zone.cpp:519
std::map< PCB_LAYER_ID, bool > m_fillFlags
Definition: zone.h:923
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
bool GetDoNotAllowPads() const
Definition: zone.h:739
void MoveEdge(const wxPoint &offset, int aEdge)
Move the outline Edge.
Definition: zone.cpp:674
Display value expressed in distance units (mm/inch)
Definition: property.h:53
bool GetDoNotAllowCopperPour() const
Definition: zone.h:736
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
Definition: zone.cpp:295
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:516
pads are covered by copper
int GetLocalClearance() const
Definition: zone.h:157
int GetMinThickness() const
Definition: zone.h:244
const EDA_RECT GetBoundingBox() const override
Definition: zone.cpp:320
MD5_HASH GetHash() const
void Move(const VECTOR2I &aVector) override
bool IsClosed() const override
static int GetDefaultHatchPitch()
Definition: zone.cpp:1038
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
void SetDoNotAllowPads(bool aEnable)
Definition: zone.h:748
void HatchBorder()
Compute the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_bor...
Definition: zone.cpp:906
ITERATOR IterateWithHoles(int aOutline)
Represent a set of closed polygons.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if a point is near an outline edge or a corner of this zone.
Definition: zone.cpp:398
SHAPE_LINE_CHAIN & Outline(int aIndex)
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: zone.cpp:222
void SetSelectedCorner(int aCorner)
Definition: zone.h:285
ZONE_CONNECTION GetEffectiveZoneConnection(wxString *aSource=nullptr) const
Return the zone connection in effect (either locally overridden or overridden in the parent footprint...
Definition: pad.cpp:839
int GetLocalFlags() const
Definition: zone.h:305
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Check if point aP lies inside a polygon (any type) defined by the line chain.
bool GetDoNotAllowTracks() const
Definition: zone.h:738
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
int m_thermalReliefGap
Definition: zone.h:876
show footprints on front
Definition: layer_ids.h:215
bool m_hv45
Definition: zone.h:935
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Definition: lset.cpp:719
Virtual layers for stacking zones and tracks on a given copper layer.
Definition: layer_ids.h:253
void InitDataFromSrcInCopyCtor(const ZONE &aZone)
Copy aZone data to me.
Definition: zone.cpp:111
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: zone.h:900
#define _(s)
ISLAND_REMOVAL_MODE m_islandRemovalMode
Definition: zone.h:858
void SetDoNotAllowVias(bool aEnable)
Definition: zone.h:746
a few functions useful in geometry calculations.
Handle a list of polygons defining a copper zone.
Definition: zone.h:56
class ZONE, a copper pour area
Definition: typeinfo.h:105
bool sortEndsByDescendingX(const VECTOR2I &ref, const VECTOR2I &tst)
Definition: zone.cpp:900
static SHAPE_POLY_SET g_nullPoly
Definition: zone.cpp:377
void SetMinThickness(int aMinThickness)
Definition: zone.h:245
void TransformSolidAreasShapesToPolygon(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aError=ARC_HIGH_DEF) const
Convert solid areas full shapes to polygon set (the full shape is the polygon area with a thick outli...
Definition: zone.cpp:1377
std::map< PCB_LAYER_ID, MD5_HASH > m_filledPolysHash
A hash value used in zone filling calculations to see if the filled areas are up to date.
Definition: zone.h:926
virtual const ZONE_SETTINGS & GetZoneSettings() const
Fetch the zone settings for this container.
void BooleanIntersection(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset union between a and b, store the result in it self For aFastMode meaning,...
int NewOutline()
Creates a new hole in a given outline.
int HoleCount(int aOutline) const
Return the reference to aIndex-th outline in the set.
#define ZONE_THICKNESS_MIL
Definition: zones.h:31
int m_ZoneMinThickness
Definition: zone.h:855
CONST_ITERATOR CIterate(int aFirst, int aLast, bool aIterateHoles=false) const
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
Definition: eda_item.cpp:243
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
int AddHole(const SHAPE_LINE_CHAIN &aHole, int aOutline=-1)
Return the area of this poly set.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:477
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:153
wxString UnescapeString(const wxString &aSource)
Thermal relief only for THT pads.
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_RawPolysList
Definition: zone.h:919
wxString GetNetnameMsg() const
void BuildHashValue(PCB_LAYER_ID aLayer)
Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash.
Definition: zone.cpp:389
bool m_isRuleArea
Definition: zone.h:842
void Inflate(int aAmount, int aCircleSegCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
Perform outline inflation/deflation.
Some functions to handle hotkeys in KiCad.
void Move(const wxPoint &offset) override
Move the outlines.
Definition: zone.cpp:653
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
std::map< PCB_LAYER_ID, std::vector< SEG > > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
Definition: zone.h:908
int m_borderHatchPitch
Definition: zone.h:929
Definition: seg.h:40
EDA_UNITS
Definition: eda_units.h:38
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new hole to the given outline (default: last) and returns its index.
void Normalize()
Ensures that the height ant width are positive.
Definition: eda_rect.cpp:35
bool IsKeepout() const
Definition: zone.cpp:1269
Use thermal relief for pads.
std::vector< SEG > m_borderHatchLines
Definition: zone.h:930
void SetLocalFlags(int aFlags)
Definition: zone.h:306
bool CollideEdge(const VECTOR2I &aPoint, VERTEX_INDEX &aClosestVertex, int aClearance=0) const
Check whether aPoint collides with any edge of any of the contours of the polygon.
void SetPadConnection(ZONE_CONNECTION aPadConnection)
Definition: zone.h:242
bool AppendCorner(wxPoint aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
Definition: zone.cpp:815
int m_hatchBorderAlgorithm
Definition: zone.h:896
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a segment defined by 2 corners.
Definition: zone.cpp:437
ZONE_DESC()
Definition: zone.cpp:1411
wxPoint GetPosition() const override
Definition: zone.cpp:216
bool m_isFilled
True when a zone was filled, false after deleting the filled areas.
Definition: zone.h:867
FP_ZONE & operator=(const FP_ZONE &aOther)
Definition: zone.cpp:1299
void AccumulateDescription(wxString &aDesc, const wxString &aItem)
Utility to build comma separated lists in messages.
Definition: string_utils.h:319
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
void SetDoNotAllowCopperPour(bool aEnable)
Definition: zone.h:745
bool IsIsland(PCB_LAYER_ID aLayer, int aPolyIdx) const
Check if a given filled polygon is an insulated island.
Definition: zone.cpp:1075
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:65
NETINFO_ITEM * m_netinfo
Store all information about the net that item belongs to.
void SetHatchPitch(int aPitch)
Set the hatch pitch parameter for the zone.
Definition: zone.cpp:886
Definition: layer_ids.h:71
int m_hatchGap
Definition: zone.h:888
void AddProperty(PROPERTY_BASE *aProperty)
Register a property.
int GetCopperLayerCount() const
Definition: board.cpp:455
class ZONE, managed by a footprint
Definition: typeinfo.h:94
VECTOR2I A
Definition: seg.h:48
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition: zone.h:565
Handle the component boundary box.
Definition: eda_rect.h:42
double DECIDEG2RAD(double deg)
Definition: trigo.h:233
FP_ZONE(BOARD_ITEM_CONTAINER *aParent)
Definition: zone.cpp:1283
void ClearArcs()
Appends a vertex at the end of the given outline/hole (default: the last outline)
void Mirror(const wxPoint &aMirrorRef, bool aMirrorLeftRight)
Mirror the outlines relative to a given horizontal axis the layer is not changed.
Definition: zone.cpp:724
bool IsOnCopperLayer() const override
Definition: zone.cpp:228
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73
bool m_doNotAllowCopperPour
Definition: zone.h:847
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
void InflateWithLinkedHoles(int aFactor, int aCircleSegmentsCount, POLYGON_MODE aFastMode)
Perform outline inflation/deflation, using round corners.
Pads are not covered.
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: zone.cpp:186
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
Definition: eda_rect.cpp:150
PCB_LAYER_ID m_layer
Definition: board_item.h:313
int m_fillVersion
Definition: zone.h:856
void SetThermalReliefGap(int aThermalReliefGap)
Definition: zone.h:183
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
Definition: zone_settings.h:46
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void TransformSmoothedOutlineToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc, SHAPE_POLY_SET *aBoardOutline) const
Convert the outlines shape to a polygon with no holes inflated (optional) by max( aClearanceValue,...
Definition: zone.cpp:1238
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:36
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition: zone.cpp:242
void CacheTriangulation(bool aPartition=true)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
#define PCB_EDIT_FRAME_NAME
void SetNeedRefill(bool aNeedRefill)
Definition: zone.h:238
double m_hatchHoleMinArea
Definition: zone.h:895
double CalculateFilledArea()
Compute the area currently occupied by the zone fill.
Definition: zone.cpp:1215
#define ZONE_THERMAL_RELIEF_GAP_MIL
Definition: zones.h:29
void SetLocalClearance(int aClearance)
Definition: zone.h:158
bool m_needRefill
False when a zone was refilled, true after changes in zone params.
Definition: zone.h:874
void AddPolygon(std::vector< wxPoint > &aPolygon)
Add a polygon to the zone outline.
Definition: zone.cpp:798
int GetThermalReliefSpokeWidth() const
Definition: zone.h:202
Abstract interface for BOARD_ITEMs capable of storing other items inside.
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:53
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
ZONE & operator=(const ZONE &aOther)
Definition: zone.cpp:94
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: zone.cpp:835
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the zone shape to a closed polygon Used in filling zones calculations Circles and arcs are ap...
Definition: zone.cpp:1353
Definition: pad.h:57
bool UnFill()
Removes the zone filling.
Definition: zone.cpp:192
wxString GetZoneName() const
Definition: zone.h:129
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: zone.cpp:1312
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:136
bool m_forceVisible
Definition: eda_item.h:479
static constexpr int Millimeter2iu(double mm)
#define _HKI(x)
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: zone.h:918
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:143
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: zone.cpp:306
unsigned m_priority
Definition: zone.h:837
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
double m_hatchSmoothingValue
Definition: zone.h:894
A specialization of ZONE for use in footprints.
Definition: zone.h:947
bool CollideVertex(const VECTOR2I &aPoint, VERTEX_INDEX &aClosestVertex, int aClearance=0) const
Check whether aPoint collides with any vertex of any of the contours of the polygon.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
int m_thermalReliefSpokeWidth
Definition: zone.h:877
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:364
static struct ZONE_DESC _ZONE_DESC
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
void SetDoNotAllowFootprints(bool aEnable)
Definition: zone.h:749
bool GetFilledPolysUseThickness() const
Definition: zone.h:691
bool KeepoutAll() const
Definition: zone.cpp:1276
Container for design settings for a BOARD object.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:405
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...
void SetThermalReliefSpokeWidth(int aThermalReliefSpokeWidth)
Definition: zone.h:194
bool m_doNotAllowPads
Definition: zone.h:850
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: zone.cpp:1306
VECTOR2I B
Definition: seg.h:49