KiCad PCB EDA Suite
class_zone.h
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) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef CLASS_ZONE_H_
31 #define CLASS_ZONE_H_
32 
33 
34 #include <vector>
35 #include <gr_basic.h>
36 #include <class_board_item.h>
37 #include <board_connected_item.h>
39 #include <PolyLine.h>
41 #include <zone_settings.h>
42 
43 
44 class EDA_RECT;
45 class LINE_READER;
46 class EDA_DRAW_PANEL;
47 class PCB_EDIT_FRAME;
48 class BOARD;
49 class ZONE_CONTAINER;
51 
52 typedef std::vector<SEG> ZONE_SEGMENT_FILL;
53 
61 {
62 public:
63 
68 
69  ZONE_CONTAINER( BOARD* parent );
70 
71  ZONE_CONTAINER( const ZONE_CONTAINER& aZone );
72  ZONE_CONTAINER& operator=( const ZONE_CONTAINER &aOther );
73 
75 
88  const wxPoint GetPosition() const override;
89  void SetPosition( const wxPoint& aPos ) override {}
90 
95  void SetPriority( unsigned aPriority ) { m_priority = aPriority; }
96 
101  unsigned GetPriority() const { return m_priority; }
102 
103  void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override;
104 
105  void SetLayerSet( LSET aLayerSet );
106 
107  virtual LSET GetLayerSet() const override;
108 
117  void Draw( EDA_DRAW_PANEL* panel,
118  wxDC* DC,
119  GR_DRAWMODE aDrawMode,
120  const wxPoint& offset = ZeroOffset ) override;
121 
130  void DrawFilledArea( EDA_DRAW_PANEL* panel,
131  wxDC* DC,
132  GR_DRAWMODE aDrawMode,
133  const wxPoint& offset = ZeroOffset );
134 
144  void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
145  GR_DRAWMODE draw_mode = GR_OR );
146 
150  const EDA_RECT GetBoundingBox() const override;
151 
152  int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const override;
153 
158  bool IsOnCopperLayer() const;
159 
164  bool CommonLayerExists( const LSET aLayerSet ) const;
165 
166  virtual void SetLayer( PCB_LAYER_ID aLayer ) override;
167 
168  virtual PCB_LAYER_ID GetLayer() const override;
169 
170  virtual bool IsOnLayer( PCB_LAYER_ID ) const override;
171 
172  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
173 
174  void SetFillMode( ZONE_FILL_MODE aFillMode ) { m_FillMode = aFillMode; }
176 
177  void SetThermalReliefGap( int aThermalReliefGap ) { m_ThermalReliefGap = aThermalReliefGap; }
178  int GetThermalReliefGap( D_PAD* aPad = NULL ) const;
179 
180  void SetThermalReliefCopperBridge( int aThermalReliefCopperBridge )
181  {
182  m_ThermalReliefCopperBridge = aThermalReliefCopperBridge;
183  }
184  int GetThermalReliefCopperBridge( D_PAD* aPad = NULL ) const;
185 
186  void SetArcSegmentCount( int aArcSegCount ) { m_ArcToSegmentsCount = aArcSegCount; }
187  int GetArcSegmentCount() const { return m_ArcToSegmentsCount; }
188 
189  bool IsFilled() const { return m_IsFilled; }
190  void SetIsFilled( bool isFilled ) { m_IsFilled = isFilled; }
191 
192  int GetZoneClearance() const { return m_ZoneClearance; }
193  void SetZoneClearance( int aZoneClearance ) { m_ZoneClearance = aZoneClearance; }
194 
195  ZoneConnection GetPadConnection( D_PAD* aPad = NULL ) const;
196  void SetPadConnection( ZoneConnection aPadConnection ) { m_PadConnection = aPadConnection; }
197 
198  int GetMinThickness() const { return m_ZoneMinThickness; }
199  void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; }
200 
201  int GetSelectedCorner() const
202  {
203  // Transform relative indices to global index
204  int globalIndex;
205  m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
206 
207  return globalIndex;
208  }
209 
210  void SetSelectedCorner( int aCorner )
211  {
212  SHAPE_POLY_SET::VERTEX_INDEX selectedCorner;
213 
214  // If the global index of the corner is correct, assign it to m_CornerSelection
215  if( m_Poly->GetRelativeIndices( aCorner, &selectedCorner ) )
216  {
217  if( m_CornerSelection == nullptr )
219 
220  *m_CornerSelection = selectedCorner;
221  }
222  else
223  throw( std::out_of_range( "aCorner-th vertex does not exist" ) );
224  }
225 
227  // Like HitTest but selects the current corner to be operated on
228  void SetSelectedCorner( const wxPoint& aPosition );
229 
230  int GetLocalFlags() const { return m_localFlgs; }
231  void SetLocalFlags( int aFlags ) { m_localFlgs = aFlags; }
232 
234  const ZONE_SEGMENT_FILL& FillSegments() const { return m_FillSegmList; }
235 
237  const SHAPE_POLY_SET* Outline() const { return const_cast< SHAPE_POLY_SET* >( m_Poly ); }
238 
239  void SetOutline( SHAPE_POLY_SET* aOutline ) { m_Poly = aOutline; }
240 
247  virtual bool HitTest( const wxPoint& aPosition ) const override;
248 
256  bool HitTestInsideZone( const wxPoint& aPosition ) const
257  {
258  return m_Poly->Contains( VECTOR2I( aPosition ), 0 );
259  }
260 
267  bool HitTestFilledArea( const wxPoint& aRefPos ) const;
268 
281  int aCircleToSegmentsCount,
282  double aCorrectionFactor ) const;
283 
299  int aMinClearanceValue,
300  bool aUseNetClearance ) const;
301 
303  int aClearanceValue,
304  int aCircleToSegmentsCount,
305  double aCorrectionFactor ) const override;
306 
316  bool HitTestForCorner( const wxPoint& refPos, SHAPE_POLY_SET::VERTEX_INDEX& aCornerHit ) const;
317 
325  bool HitTestForCorner( const wxPoint& refPos ) const;
326 
335  bool HitTestForEdge( const wxPoint& refPos, SHAPE_POLY_SET::VERTEX_INDEX& aCornerHit ) const;
336 
343  bool HitTestForEdge( const wxPoint& refPos ) const;
344 
348  bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
349 
350 
357  bool UnFill();
358 
359  /* Geometric transformations: */
360 
366  void Move( const wxPoint& offset ) override;
367 
374  void MoveEdge( const wxPoint& offset, int aEdge );
375 
382  void Rotate( const wxPoint& centre, double angle ) override;
383 
390  virtual void Flip( const wxPoint& aCentre ) override;
391 
398  void Mirror( const wxPoint& mirror_ref );
399 
405  wxString GetClass() const override
406  {
407  return wxT( "ZONE_CONTAINER" );
408  }
409 
414  int GetNumCorners( void ) const
415  {
416  return m_Poly->TotalVertices();
417  }
418 
425  {
426  return m_Poly->Iterate();
427  }
428 
435  {
436  return m_Poly->IterateWithHoles();
437  }
438 
445  {
446  return m_Poly->CIterateWithHoles();
447  }
448 
449  void RemoveAllContours( void )
450  {
452  }
453 
454  const VECTOR2I& GetCornerPosition( int aCornerIndex ) const
455  {
457 
458  // Convert global to relative indices
459  if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
460  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
461 
462  return m_Poly->CVertex( index );
463  }
464 
465  void SetCornerPosition( int aCornerIndex, wxPoint new_pos )
466  {
467  SHAPE_POLY_SET::VERTEX_INDEX relativeIndices;
468 
469  // Convert global to relative indices
470  if( m_Poly->GetRelativeIndices( aCornerIndex, &relativeIndices ) )
471  {
472  m_Poly->Vertex( relativeIndices ).x = new_pos.x;
473  m_Poly->Vertex( relativeIndices ).y = new_pos.y;
474  }
475  else
476  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
477  }
478 
483  void NewHole()
484  {
485  m_Poly->NewHole();
486  }
487 
496  bool AppendCorner( wxPoint aPosition, int aHoleIdx, bool aAllowDuplication = false );
497 
498  HATCH_STYLE GetHatchStyle() const
499  {
500  return m_hatchStyle;
501  }
502 
503  void SetHatchStyle( HATCH_STYLE aStyle )
504  {
505  m_hatchStyle = aStyle;
506  }
507 
515  bool IsSame( const ZONE_CONTAINER &aZoneToCompare );
516 
522  {
524  }
525 
532  //TODO - This should be called for each layer on which the zone exists
533 
535  {
536  return m_FilledPolysList;
537  }
538 
539  void CacheTriangulation();
540 
545  void SetFilledPolysList( SHAPE_POLY_SET& aPolysList )
546  {
547  m_FilledPolysList = aPolysList;
548  }
549 
554  void SetRawPolysList( SHAPE_POLY_SET& aPolysList )
555  {
556  m_RawPolysList = aPolysList;
557  }
558 
559 
566  bool BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly ) const;
567 
568  void SetCornerSmoothingType( int aType ) { m_cornerSmoothingType = aType; };
569 
571 
572  void SetCornerRadius( unsigned int aRadius );
573 
574  unsigned int GetCornerRadius() const { return m_cornerRadius; };
575 
581  void AddPolygon( std::vector< wxPoint >& aPolygon );
582 
583  void SetFillSegments( const ZONE_SEGMENT_FILL& aSegments )
584  {
585  m_FillSegmList = aSegments;
586  }
587 
589  {
590  return m_RawPolysList;
591  }
592 
593  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override;
594 
595  BITMAP_DEF GetMenuImage() const override;
596 
597  EDA_ITEM* Clone() const override;
598 
602  bool GetIsKeepout() const { return m_isKeepout; }
604  bool GetDoNotAllowVias() const { return m_doNotAllowVias; }
605  bool GetDoNotAllowTracks() const { return m_doNotAllowTracks; }
606 
607  void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
608  void SetDoNotAllowCopperPour( bool aEnable ) { m_doNotAllowCopperPour = aEnable; }
609  void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; }
610  void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; }
611 
620  int GetHatchPitch() const;
621 
626  static int GetDefaultHatchPitch();
627 
637  void SetHatch( int aHatchStyle, int aHatchPitch, bool aRebuildHatch );
638 
644  void SetHatchPitch( int aPitch );
645 
650  void UnHatch();
651 
657  void Hatch();
658 
659  const std::vector<SEG>& GetHatchLines() const { return m_HatchLines; }
660 
661  bool GetHV45() const { return m_hv45; }
662  void SetHV45( bool aConstrain ) { m_hv45 = aConstrain; }
663 
664 #if defined(DEBUG)
665  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
666 #endif
667 
668  virtual void SwapData( BOARD_ITEM* aImage ) override;
669 
670 private:
671 
674  unsigned int m_cornerRadius;
675 
677 
678  /* Priority: when a zone outline is inside and other zone, if its priority is higher
679  * the other zone priority, it will be created inside.
680  * if priorities are equal, a DRC error is set
681  */
682  unsigned m_priority;
683 
684  /* A zone outline can be a keepout zone.
685  * It will be never filled, and DRC should test for pads, tracks and vias
686  */
688 
689  /* For keepout zones only:
690  * what is not allowed inside the keepout ( pads, tracks and vias )
691  */
695 
699 
703 
706 
709 
712 
713 
716 
719 
722 
727 
728  /* set of filled polygons used to draw a zone as a filled area.
729  * from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
730  * (they are all in one piece) In very simple cases m_FilledPolysList is same
731  * as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
732  * a polygon equivalent to m_Poly, without holes but with extra outline segment
733  * connecting "holes" with external main outline. In complex cases an outline
734  * described by m_Poly can have many filled areas
735  */
738 
739  HATCH_STYLE m_hatchStyle; // hatch style, see enum above
740  int m_hatchPitch; // for DIAGONAL_EDGE, distance between 2 hatch lines
741  std::vector<SEG> m_HatchLines; // hatch lines
742  std::vector<int> m_insulatedIslands;
743 
744  bool m_hv45; // constrain edges to horizontal, vertical or 45ยบ
745 
769  typedef union {
773 
774  // Sanity check: assure that the conversion VECTOR2I->wxPoint using the previous union is
775  // correct, making sure that the access for x and y attributes is still safe.
776  static_assert(offsetof(wxPoint,x) == offsetof(VECTOR2I,x),
777  "wxPoint::x and VECTOR2I::x have different offsets");
778 
779  static_assert(offsetof(wxPoint,y) == offsetof(VECTOR2I,y),
780  "wxPoint::y and VECTOR2I::y have different offsets");
781 
782 };
783 
784 
785 #endif // CLASS_ZONE_H_
void SetFilledPolysList(SHAPE_POLY_SET &aPolysList)
Function SetFilledPolysList sets the list of filled polygons.
Definition: class_zone.h:545
void SetDoNotAllowTracks(bool aEnable)
Definition: class_zone.h:610
void MoveEdge(const wxPoint &offset, int aEdge)
Function MoveEdge Move the outline Edge.
Definition: class_zone.cpp:914
int NewHole(int aOutline=-1)
Creates a new hole in a given outline
void SetCornerSmoothingType(int aType)
Definition: class_zone.h:568
void SetHatchPitch(int aPitch)
Function SetHatchPitch sets the hatch pitch parameter for the zone.
void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &offset=ZeroOffset) override
Function Draw Draws the zone outline.
Definition: class_zone.cpp:276
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
std::vector< SEG > ZONE_SEGMENT_FILL
Definition: class_zone.h:50
Class LINE_READER is an abstract class from which implementation specific LINE_READERs may be derived...
Definition: richio.h:81
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:697
void DrawWhileCreateOutline(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE draw_mode=GR_OR)
Function DrawWhileCreateOutline Draws the zone outline when it is created.
Definition: class_zone.cpp:545
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: class_zone.h:414
PNG memory record (file in memory).
Definition: bitmap_types.h:41
bool CommonLayerExists(const LSET aLayerSet) const
Function CommonLayerExist Test if this zone shares a common layer with the given layer set...
Definition: class_zone.cpp:194
bool HitTestForEdge(const wxPoint &refPos, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners...
Definition: class_zone.cpp:695
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_zone.cpp:150
int GetMinThickness() const
Definition: class_zone.h:198
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:603
bool m_doNotAllowTracks
Definition: class_zone.h:694
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox (virtual)
Definition: class_zone.cpp:518
int GetArcSegmentCount() const
Definition: class_zone.h:187
void SetCornerRadius(unsigned int aRadius)
Definition: class_zone.cpp:646
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:718
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Function IsOnLayer tests to see if this object is on the given layer.
Definition: class_zone.cpp:265
std::vector< int > m_insulatedIslands
Definition: class_zone.h:742
void DrawFilledArea(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &offset=ZeroOffset)
Function DrawDrawFilledArea Draws the filled area for this zone (polygon list .m_FilledPolysList) ...
Definition: class_zone.cpp:406
bool IsFilled() const
Definition: class_zone.h:189
ZoneConnection
How pads are covered by copper in zone.
Definition: zones.h:50
CONST_ITERATOR CIterateWithHoles(int aOutline) const
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:175
bool BuildSmoothedPoly(SHAPE_POLY_SET &aSmoothedPoly) const
Function GetSmoothedPoly returns a pointer to the corner-smoothed version of m_Poly if it exists...
ZONE_SEGMENT_FILL & FillSegments()
Definition: class_zone.h:233
int TotalVertices() const
Returns total number of vertices stored in the set.
SHAPE_POLY_SET * Outline()
Definition: class_zone.h:236
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, bool aIgnoreHoles=false) const
Returns true if a given subpolygon contains the point aP.
Struct VERTEX_INDEX.
int GetCornerSmoothingType() const
Definition: class_zone.h:570
void SetArcSegmentCount(int aArcSegCount)
Definition: class_zone.h:186
void SetHatch(int aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Function SetHatch sets all hatch parameters for the zone.
void SetFillSegments(const ZONE_SEGMENT_FILL &aSegments)
Definition: class_zone.h:583
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:726
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Function Iterate returns an object to iterate through the points of the polygons between aFirst and a...
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles() const
Function CIterateWithHoles returns an iterator to visit all points of the zone&#39;s main outline with ho...
Definition: class_zone.h:444
const ZONE_SEGMENT_FILL & FillSegments() const
Definition: class_zone.h:234
int m_localFlgs
Variable used in polygon calculations.
Definition: class_zone.h:721
VECTOR2< int > VECTOR2I
Definition: vector2d.h:589
int GetThermalReliefCopperBridge(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:637
void SetIsFilled(bool isFilled)
Definition: class_zone.h:190
const wxPoint GetPosition() const override
Function GetPosition.
Definition: class_zone.cpp:169
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition: class_zone.h:454
unsigned int GetCornerRadius() const
Definition: class_zone.h:574
void SetOutline(SHAPE_POLY_SET *aOutline)
Definition: class_zone.h:239
static int GetDefaultHatchPitch()
Function GetDefaultHatchPitchMils.
int GetClearance(BOARD_CONNECTED_ITEM *aItem=NULL) const override
Function GetClearance returns the clearance in internal units.
Definition: class_zone.cpp:780
const std::vector< SEG > & GetHatchLines() const
Definition: class_zone.h:659
static wxPoint ZeroOffset
A value of wxPoint(0,0) which can be passed to the Draw() functions.
struct SHAPE_POLY_SET::VERTEX_INDEX VERTEX_INDEX
Struct VERTEX_INDEX.
void SetDoNotAllowVias(bool aEnable)
Definition: class_zone.h:609
SHAPE_POLY_SET m_RawPolysList
Definition: class_zone.h:737
void TransformSolidAreasShapesToPolygonSet(SHAPE_POLY_SET &aCornerBuffer, int aCircleToSegmentsCount, double aCorrectionFactor) const
Function TransformSolidAreasShapesToPolygonSet Convert solid areas full shapes to polygon set (the fu...
VECTOR2I & Vertex(int aIndex, int aOutline, int aHole)
Returns the index-th vertex in a given hole outline within a given outline
void SetPriority(unsigned aPriority)
Function SetPriority.
Definition: class_zone.h:95
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:602
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:230
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:210
SHAPE_POLY_SET::ITERATOR Iterate()
Function Iterate returns an iterator to visit all points of the zone&#39;s main outline without holes...
Definition: class_zone.h:424
int m_ArcToSegmentsCount
The number of segments to convert a circle to a polygon.
Definition: class_zone.h:702
PCB_LAYER_ID
A quick note on layer IDs:
Class LSET is a set of PCB_LAYER_IDs.
int m_ThermalReliefCopperBridge
Definition: class_zone.h:711
ZoneConnection GetPadConnection(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:997
std::vector< SEG > m_HatchLines
Definition: class_zone.h:741
ZoneConnection m_PadConnection
Definition: class_zone.h:696
ZONE_CONTAINER & operator=(const ZONE_CONTAINER &aOther)
Definition: class_zone.cpp:113
bool IsSame(const ZONE_CONTAINER &aZoneToCompare)
Function IsSame tests if 2 zones are equivalent: 2 zones are equivalent if they have same parameters ...
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:37
ITERATOR IterateWithHoles(int aOutline)
Function IterateWithHoles.
Class SHAPE_POLY_SET.
void NewHole()
Function NewHole creates a new hole on the zone; i.e., a new contour on the zone&#39;s outline...
Definition: class_zone.h:483
bool HitTestInsideZone(const wxPoint &aPosition) const
Function HitTest tests if a point is inside the zone area, i.e.
Definition: class_zone.h:256
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:705
virtual void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
Definition: class_zone.cpp:957
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Function GetRelativeIndices.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:672
int GetThermalReliefGap(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:628
ZONE_CONTAINER(BOARD *parent)
Definition: class_zone.cpp:52
unsigned m_priority
Definition: class_zone.h:682
void Rotate(const wxPoint &centre, double angle) override
Function Rotate Move the outlines.
Definition: class_zone.cpp:927
bool m_doNotAllowVias
Definition: class_zone.h:693
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:175
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Function SetLayer sets the layer this item is on.
Definition: class_zone.cpp:202
bool UnFill()
Function UnFill Removes the zone filling.
Definition: class_zone.cpp:156
int m_cornerSmoothingType
Definition: class_zone.h:673
void CacheTriangulation()
const SHAPE_POLY_SET * Outline() const
Definition: class_zone.h:237
HATCH_STYLE
Zone hatch styles.
Definition: class_zone.h:67
void SetZoneClearance(int aZoneClearance)
Definition: class_zone.h:193
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on...
Definition: class_zone.cpp:244
void AddPolygon(std::vector< wxPoint > &aPolygon)
add a polygon to the zone outline if the zone outline is empty, this is the main outline else it is a...
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:736
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:534
void SetSelectedCorner(int aCorner)
Definition: class_zone.h:210
void SetRawPolysList(SHAPE_POLY_SET &aPolysList)
Function SetFilledPolysList sets the list of filled polygons.
Definition: class_zone.h:554
unsigned int m_cornerRadius
Definition: class_zone.h:674
void SetThermalReliefCopperBridge(int aThermalReliefCopperBridge)
Definition: class_zone.h:180
void Move(const wxPoint &offset) override
Function Move Move the outlines.
Definition: class_zone.cpp:897
bool GetGlobalIndex(VERTEX_INDEX aRelativeIndices, int &aGlobalIdx)
Function GetGlobalIndex computes the global index of a vertex from the relative indices of polygon...
Definition: gr_basic.h:38
HATCH_STYLE m_hatchStyle
Definition: class_zone.h:739
void SetDoNotAllowCopperPour(bool aEnable)
Definition: class_zone.h:608
void TransformOutlinesShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aMinClearanceValue, bool aUseNetClearance) const
Function TransformOutlinesShapeWithClearanceToPolygon Convert the outlines shape to a polygon with no...
bool m_doNotAllowCopperPour
Definition: class_zone.h:692
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_zone.h:405
bool IsOnCopperLayer() const
Function IsOnCopperLayer.
Definition: class_zone.cpp:181
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:708
bool GetDoNotAllowTracks() const
Definition: class_zone.h:605
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:698
void SetFillMode(ZONE_FILL_MODE aFillMode)
Definition: class_zone.h:174
ZONE_FILL_MODE m_FillMode
How to fill areas: ZFM_POLYGONS => use filled polygons, ZFM_SEGMENTS => fill with segments...
Definition: class_zone.h:715
void SetCornerPosition(int aCornerIndex, wxPoint new_pos)
Definition: class_zone.h:465
Board layer functions and definitions.
void UnHatch()
Function UnHatch clears the zone&#39;s hatch.
int GetLocalFlags() const
Definition: class_zone.h:230
bool GetDoNotAllowVias() const
Definition: class_zone.h:604
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
SHAPE_POLY_SET::ITERATOR IterateWithHoles()
Function IterateWithHoles returns an iterator to visit all points of the zone&#39;s main outline with hol...
Definition: class_zone.h:434
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
Class ITERATOR_TEMPLATE.
virtual bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if a point is near an outline edge or a corner of this zone.
Definition: class_zone.cpp:654
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
bool HitTestFilledArea(const wxPoint &aRefPos) const
Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this z...
Definition: class_zone.cpp:807
void SetHV45(bool aConstrain)
Definition: class_zone.h:662
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
HATCH_STYLE GetHatchStyle() const
Definition: class_zone.h:498
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone&#39;s...
void SetHatchStyle(HATCH_STYLE aStyle)
Definition: class_zone.h:503
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
void SetLocalFlags(int aFlags)
Definition: class_zone.h:231
bool GetHV45() const
Definition: class_zone.h:661
int GetSelectedCorner() const
Definition: class_zone.h:201
void SetPosition(const wxPoint &aPos) override
Definition: class_zone.h:89
bool AppendCorner(wxPoint aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
int GetHatchPitch() const
Hatch related methods.
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aClearanceValue, int aCircleToSegmentsCount, double aCorrectionFactor) const override
void Mirror(const wxPoint &mirror_ref)
Function Mirror Mirror the outlines , relative to a given horizontal axis the layer is not changed...
Definition: class_zone.cpp:973
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
void SetIsKeepout(bool aEnable)
Definition: class_zone.h:607
void SetPadConnection(ZoneConnection aPadConnection)
Definition: class_zone.h:196
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:101
Class BOARD_CONNECTED_ITEM.
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
bool HitTestForCorner(const wxPoint &refPos, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:679
void SetMinThickness(int aMinThickness)
Definition: class_zone.h:199
SHAPE_POLY_SET & RawPolysList()
Definition: class_zone.h:588
ZONE_FILL_MODE
Definition: zone_settings.h:38
void SetThermalReliefGap(int aThermalReliefGap)
Definition: class_zone.h:177
EDA_UNITS_T
Definition: common.h:158
int GetZoneClearance() const
Definition: class_zone.h:192
Union to handle conversion between references to wxPoint and to VECTOR2I.
Definition: class_zone.h:769
void ClearFilledPolysList()
Function ClearFilledPolysList clears the list of filled polygons.
Definition: class_zone.h:521
void RemoveAllContours(void)
Definition: class_zone.h:449
void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it&#39;s internal state for displ...
Definition: class_zone.cpp:813