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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2015 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>
39 #include <PolyLine.h>
41 #include <class_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;
50 class MSG_PANEL_ITEM;
51 
52 
57 struct SEGMENT
58 {
59  wxPoint m_Start; // starting point of a segment
60  wxPoint m_End; // ending point of a segment
61 
62  SEGMENT() {}
63 
64  SEGMENT( const wxPoint& aStart, const wxPoint& aEnd )
65  {
66  m_Start = aStart;
67  m_End = aEnd;
68  }
69 };
70 
71 
79 {
80 public:
81 
86 
87  ZONE_CONTAINER( BOARD* parent );
88 
89  ZONE_CONTAINER( const ZONE_CONTAINER& aZone );
90  ZONE_CONTAINER& operator=( const ZONE_CONTAINER &aOther );
91 
93 
106  const wxPoint& GetPosition() const override;
107  void SetPosition( const wxPoint& aPos ) override {}
108 
113  void SetPriority( unsigned aPriority ) { m_priority = aPriority; }
114 
119  unsigned GetPriority() const { return m_priority; }
120 
121  void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) override;
122 
131  void Draw( EDA_DRAW_PANEL* panel,
132  wxDC* DC,
133  GR_DRAWMODE aDrawMode,
134  const wxPoint& offset = ZeroOffset ) override;
135 
144  void DrawFilledArea( EDA_DRAW_PANEL* panel,
145  wxDC* DC,
146  GR_DRAWMODE aDrawMode,
147  const wxPoint& offset = ZeroOffset );
148 
158  void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
159  GR_DRAWMODE draw_mode = GR_OR );
160 
164  const EDA_RECT GetBoundingBox() const override;
165 
166  int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const override;
167 
174 
179  bool IsOnCopperLayer() const
180  {
181  return IsCopperLayer( GetLayer() );
182  }
183 
185  void SetFillMode( int aFillMode ) { m_FillMode = aFillMode; }
186  int GetFillMode() const { return m_FillMode; }
187 
188  void SetThermalReliefGap( int aThermalReliefGap ) { m_ThermalReliefGap = aThermalReliefGap; }
189  int GetThermalReliefGap( D_PAD* aPad = NULL ) const;
190 
191  void SetThermalReliefCopperBridge( int aThermalReliefCopperBridge )
192  {
193  m_ThermalReliefCopperBridge = aThermalReliefCopperBridge;
194  }
195  int GetThermalReliefCopperBridge( D_PAD* aPad = NULL ) const;
196 
197  void SetArcSegmentCount( int aArcSegCount ) { m_ArcToSegmentsCount = aArcSegCount; }
198  int GetArcSegmentCount() const { return m_ArcToSegmentsCount; }
199 
200  bool IsFilled() const { return m_IsFilled; }
201  void SetIsFilled( bool isFilled ) { m_IsFilled = isFilled; }
202 
203  int GetZoneClearance() const { return m_ZoneClearance; }
204  void SetZoneClearance( int aZoneClearance ) { m_ZoneClearance = aZoneClearance; }
205 
206  ZoneConnection GetPadConnection( D_PAD* aPad = NULL ) const;
207  void SetPadConnection( ZoneConnection aPadConnection ) { m_PadConnection = aPadConnection; }
208 
209  int GetMinThickness() const { return m_ZoneMinThickness; }
210  void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; }
211 
212  int GetSelectedCorner() const
213  {
214  // Transform relative indices to global index
215  int globalIndex;
216  m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
217 
218  return globalIndex;
219  }
220 
221  void SetSelectedCorner( int aCorner )
222  {
223  SHAPE_POLY_SET::VERTEX_INDEX selectedCorner;
224 
225  // If the global index of the corner is correct, assign it to m_CornerSelection
226  if( m_Poly->GetRelativeIndices( aCorner, &selectedCorner ) )
227  {
228  if( m_CornerSelection == nullptr )
230 
231  *m_CornerSelection = selectedCorner;
232  }
233  else
234  throw( std::out_of_range( "aCorner-th vertex does not exist" ) );
235  }
236 
238  // Like HitTest but selects the current corner to be operated on
239  void SetSelectedCorner( const wxPoint& aPosition );
240 
241  int GetLocalFlags() const { return m_localFlgs; }
242  void SetLocalFlags( int aFlags ) { m_localFlgs = aFlags; }
243 
244  std::vector <SEGMENT>& FillSegments() { return m_FillSegmList; }
245  const std::vector <SEGMENT>& FillSegments() const { return m_FillSegmList; }
246 
248  const SHAPE_POLY_SET* Outline() const { return const_cast< SHAPE_POLY_SET* >( m_Poly ); }
249 
250  void SetOutline( SHAPE_POLY_SET* aOutline ) { m_Poly = aOutline; }
251 
258  virtual bool HitTest( const wxPoint& aPosition ) const override;
259 
267  bool HitTestInsideZone( const wxPoint& aPosition ) const
268  {
269  return m_Poly->Contains( VECTOR2I( aPosition ), 0 );
270  }
271 
278  bool HitTestFilledArea( const wxPoint& aRefPos ) const;
279 
292  int aCircleToSegmentsCount,
293  double aCorrectionFactor ) const;
315  bool BuildFilledSolidAreasPolygons( BOARD* aPcb, SHAPE_POLY_SET* aOutlineBuffer = NULL );
316 
331 
332 
348  int aMinClearanceValue,
349  bool aUseNetClearance );
359  bool HitTestForCorner( const wxPoint& refPos, SHAPE_POLY_SET::VERTEX_INDEX& aCornerHit ) const;
360 
368  bool HitTestForCorner( const wxPoint& refPos ) const;
369 
378  bool HitTestForEdge( const wxPoint& refPos, SHAPE_POLY_SET::VERTEX_INDEX& aCornerHit ) const;
379 
386  bool HitTestForEdge( const wxPoint& refPos ) const;
387 
391  bool HitTest( const EDA_RECT& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
392 
402 
409  bool UnFill();
410 
411  /* Geometric transformations: */
412 
418  void Move( const wxPoint& offset ) override;
419 
426  void MoveEdge( const wxPoint& offset, int aEdge );
427 
434  void Rotate( const wxPoint& centre, double angle ) override;
435 
442  virtual void Flip( const wxPoint& aCentre ) override;
443 
450  void Mirror( const wxPoint& mirror_ref );
451 
457  wxString GetClass() const override
458  {
459  return wxT( "ZONE_CONTAINER" );
460  }
461 
466  int GetNumCorners( void ) const
467  {
468  return m_Poly->TotalVertices();
469  }
470 
477  {
478  return m_Poly->Iterate();
479  }
480 
487  {
488  return m_Poly->IterateWithHoles();
489  }
490 
497  {
498  return m_Poly->CIterateWithHoles();
499  }
500 
501  void RemoveAllContours( void )
502  {
504  }
505 
506  const VECTOR2I& GetCornerPosition( int aCornerIndex ) const
507  {
509 
510  // Convert global to relative indices
511  if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
512  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
513 
514  return m_Poly->CVertex( index );
515  }
516 
517  void SetCornerPosition( int aCornerIndex, wxPoint new_pos )
518  {
519  SHAPE_POLY_SET::VERTEX_INDEX relativeIndices;
520 
521  // Convert global to relative indices
522  if( m_Poly->GetRelativeIndices( aCornerIndex, &relativeIndices ) )
523  {
524  m_Poly->Vertex( relativeIndices ).x = new_pos.x;
525  m_Poly->Vertex( relativeIndices ).y = new_pos.y;
526  }
527  else
528  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
529  }
530 
535  void NewHole()
536  {
537  m_Poly->NewHole();
538  }
539 
546  void AppendCorner( wxPoint position, bool aAllowDuplication = false )
547  {
548  if( m_Poly->OutlineCount() == 0 )
549  m_Poly->NewOutline();
550 
551  m_Poly->Append( position.x, position.y, -1, -1, aAllowDuplication );
552  }
553 
555  {
556  return m_hatchStyle;
557  }
558 
559  void SetHatchStyle( HATCH_STYLE aStyle )
560  {
561  m_hatchStyle = aStyle;
562  }
563 
571  bool IsSame( const ZONE_CONTAINER &aZoneToCompare );
572 
578  {
580  }
581 
588  {
589  return m_FilledPolysList;
590  }
591 
596  void AddFilledPolysList( SHAPE_POLY_SET& aPolysList )
597  {
598  m_FilledPolysList = aPolysList;
599  }
600 
608  {
609  if( m_smoothedPoly )
610  return m_smoothedPoly;
611  else
612  return m_Poly;
613  };
614 
615  void SetCornerSmoothingType( int aType ) { m_cornerSmoothingType = aType; };
616 
618 
619  void SetCornerRadius( unsigned int aRadius );
620 
621  unsigned int GetCornerRadius() const { return m_cornerRadius; };
622 
628  void AddPolygon( std::vector< wxPoint >& aPolygon );
629 
636  {
637  m_FilledPolysList.Append( aPolygon );
638  }
639 
640  void AddFillSegments( std::vector< SEGMENT >& aSegments )
641  {
642  m_FillSegmList.insert( m_FillSegmList.end(), aSegments.begin(), aSegments.end() );
643  }
644 
645  wxString GetSelectMenuText() const override;
646 
647  BITMAP_DEF GetMenuImage() const override;
648 
649  EDA_ITEM* Clone() const override;
650 
654  bool GetIsKeepout() const { return m_isKeepout; }
656  bool GetDoNotAllowVias() const { return m_doNotAllowVias; }
657  bool GetDoNotAllowTracks() const { return m_doNotAllowTracks; }
658 
659  void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
660  void SetDoNotAllowCopperPour( bool aEnable ) { m_doNotAllowCopperPour = aEnable; }
661  void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; }
662  void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; }
663 
672  int GetHatchPitch() const;
673 
680  static int GetDefaultHatchPitchMils() { return 20; }
681 
691  void SetHatch( int aHatchStyle, int aHatchPitch, bool aRebuildHatch );
692 
698  void SetHatchPitch( int aPitch );
699 
704  void UnHatch();
705 
711  void Hatch();
712 
713  const std::vector<SEG>& GetHatchLines() const { return m_HatchLines; }
714 
715 
716 #if defined(DEBUG)
717  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
718 #endif
719 
720 
721 
722 private:
723  void buildFeatureHoleList( BOARD* aPcb, SHAPE_POLY_SET& aFeatures );
724 
726  SHAPE_POLY_SET* m_smoothedPoly; // Corner-smoothed version of m_Poly
728  unsigned int m_cornerRadius;
729 
730  /* Priority: when a zone outline is inside and other zone, if its priority is higher
731  * the other zone priority, it will be created inside.
732  * if priorities are equal, a DRC error is set
733  */
734  unsigned m_priority;
735 
736  /* A zone outline can be a keepout zone.
737  * It will be never filled, and DRC should test for pads, tracks and vias
738  */
740 
741  /* For keepout zones only:
742  * what is not allowed inside the keepout ( pads, tracks and vias )
743  */
747 
751 
755 
758 
761 
764 
765 
768 
771 
774 
778  std::vector <SEGMENT> m_FillSegmList;
779 
780  /* set of filled polygons used to draw a zone as a filled area.
781  * from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
782  * (they are all in one piece) In very simple cases m_FilledPolysList is same
783  * as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
784  * a polygon equivalent to m_Poly, without holes but with extra outline segment
785  * connecting "holes" with external main outline. In complex cases an outline
786  * described by m_Poly can have many filled areas
787  */
789 
790  HATCH_STYLE m_hatchStyle; // hatch style, see enum above
791  int m_hatchPitch; // for DIAGONAL_EDGE, distance between 2 hatch lines
792  std::vector<SEG> m_HatchLines; // hatch lines
793 
817  typedef union {
821 
822  // Sanity check: assure that the conversion VECTOR2I->wxPoint using the previous union is
823  // correct, making sure that the access for x and y attributes is still safe.
824  static_assert(offsetof(wxPoint,x) == offsetof(VECTOR2I,x),
825  "wxPoint::x and VECTOR2I::x have different offsets");
826 
827  static_assert(offsetof(wxPoint,y) == offsetof(VECTOR2I,y),
828  "wxPoint::y and VECTOR2I::y have different offsets");
829 
830 };
831 
832 
833 #endif // CLASS_ZONE_H_
wxPoint m_End
Definition: class_zone.h:60
void SetDoNotAllowTracks(bool aEnable)
Definition: class_zone.h:662
void MoveEdge(const wxPoint &offset, int aEdge)
Function MoveEdge Move the outline Edge.
Definition: class_zone.cpp:730
int NewHole(int aOutline=-1)
Creates a new hole in a given outline
void SetCornerSmoothingType(int aType)
Definition: class_zone.h:615
void SetHatchPitch(int aPitch)
Function SetHatchPitch sets the hatch pitch parameter for the zone.
Definition: class_zone.cpp:899
Class BOARD_CONNECTED_ITEM.
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:179
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:78
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:749
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:376
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
Definition: class_zone.cpp:629
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:466
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: class_zone.cpp:833
PNG memory record (file in memory).
Definition: bitmap_types.h:38
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:524
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: class_zone.cpp:148
int GetMinThickness() const
Definition: class_zone.h:209
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:655
bool m_doNotAllowTracks
Definition: class_zone.h:746
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox (virtual)
Definition: class_zone.cpp:349
int GetArcSegmentCount() const
Definition: class_zone.h:198
void SetCornerRadius(unsigned int aRadius)
Definition: class_zone.cpp:475
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:770
bool BuildFilledSolidAreasPolygons(BOARD *aPcb, SHAPE_POLY_SET *aOutlineBuffer=NULL)
Function BuildFilledSolidAreasPolygons Build the filled solid areas data from real outlines (stored i...
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:240
bool IsFilled() const
Definition: class_zone.h:200
ZoneConnection
How pads are covered by copper in zone.
Definition: zones.h:55
CONST_ITERATOR CIterateWithHoles(int aOutline) const
int TotalVertices() const
Returns total number of vertices stored in the set.
SHAPE_POLY_SET * Outline()
Definition: class_zone.h:247
Struct VERTEX_INDEX.
int GetCornerSmoothingType() const
Definition: class_zone.h:617
void SetArcSegmentCount(int aArcSegCount)
Definition: class_zone.h:197
void SetHatch(int aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Function SetHatch sets all hatch parameters for the zone.
Definition: class_zone.cpp:889
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...
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles() const
Function CIterateWithHoles returns an iterator to visit all points of the zone's main outline with ho...
Definition: class_zone.h:496
void buildFeatureHoleList(BOARD *aPcb, SHAPE_POLY_SET &aFeatures)
int m_localFlgs
Variable used in polygon calculations.
Definition: class_zone.h:773
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590
int GetThermalReliefCopperBridge(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:466
void SetIsFilled(bool isFilled)
Definition: class_zone.h:201
void AddFilledPolysList(SHAPE_POLY_SET &aPolysList)
Function AddFilledPolysList sets the list of filled polygons.
Definition: class_zone.h:596
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:506
unsigned int GetCornerRadius() const
Definition: class_zone.h:621
void TransformOutlinesShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aMinClearanceValue, bool aUseNetClearance)
Function TransformOutlinesShapeWithClearanceToPolygon Convert the outlines shape to a polygon with no...
void SetOutline(SHAPE_POLY_SET *aOutline)
Definition: class_zone.h:250
int GetClearance(BOARD_CONNECTED_ITEM *aItem=NULL) const override
Function GetClearance returns the clearance in 1/10000 inches.
Definition: class_zone.cpp:596
const std::vector< SEG > & GetHatchLines() const
Definition: class_zone.h:713
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:661
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:113
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:654
std::vector< SEGMENT > & FillSegments()
Definition: class_zone.h:244
SHAPE_POLY_SET * m_smoothedPoly
Definition: class_zone.h:726
void AddFillSegments(std::vector< SEGMENT > &aSegments)
Definition: class_zone.h:640
SHAPE_POLY_SET::ITERATOR Iterate()
Function Iterate returns an iterator to visit all points of the zone's main outline without holes...
Definition: class_zone.h:476
int m_ArcToSegmentsCount
The number of segments to convert a circle to a polygon.
Definition: class_zone.h:754
int m_ThermalReliefCopperBridge
Definition: class_zone.h:763
ZoneConnection GetPadConnection(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:801
std::vector< SEG > m_HatchLines
Definition: class_zone.h:792
ZoneConnection m_PadConnection
Definition: class_zone.h:748
void TestForCopperIslandAndRemoveInsulatedIslands(BOARD *aPcb)
Function TestForCopperIslandAndRemoveInsulatedIslands Remove insulated copper islands found in m_Fill...
ZONE_CONTAINER & operator=(const ZONE_CONTAINER &aOther)
Definition: class_zone.cpp:112
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:41
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's outline...
Definition: class_zone.h:535
bool HitTestInsideZone(const wxPoint &aPosition) const
Function HitTest tests if a point is inside the zone area, i.e.
Definition: class_zone.h:267
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:757
void AppendCorner(wxPoint position, bool aAllowDuplication=false)
Function AppendCorner.
Definition: class_zone.h:546
int m_FillMode
How to fill areas: 0 => use filled polygons, 1 => fill with segments.
Definition: class_zone.h:767
virtual void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
Definition: class_zone.cpp:769
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Function GetRelativeIndices.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:725
int GetThermalReliefGap(D_PAD *aPad=NULL) const
Definition: class_zone.cpp:457
ZONE_CONTAINER(BOARD *parent)
Definition: class_zone.cpp:53
unsigned m_priority
Definition: class_zone.h:734
void AddFilledPolygon(SHAPE_POLY_SET &aPolygon)
add a polygon to the zone filled areas list.
Definition: class_zone.h:635
void Rotate(const wxPoint &centre, double angle) override
Function Rotate Move the outlines.
Definition: class_zone.cpp:743
bool m_doNotAllowVias
Definition: class_zone.h:745
bool UnFill()
Function UnFill Removes the zone filling.
Definition: class_zone.cpp:154
int m_cornerSmoothingType
Definition: class_zone.h:727
SEGMENT(const wxPoint &aStart, const wxPoint &aEnd)
Definition: class_zone.h:64
const SHAPE_POLY_SET * Outline() const
Definition: class_zone.h:248
HATCH_STYLE
Zone hatch styles.
Definition: class_zone.h:85
void SetZoneClearance(int aZoneClearance)
Definition: class_zone.h:204
SHAPE_POLY_SET * GetSmoothedPoly() const
Function GetSmoothedPoly returns a pointer to the corner-smoothed version of m_Poly if it exists...
Definition: class_zone.h:607
int NewOutline()
Creates a new empty polygon in the set and returns its index
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...
Definition: class_zone.cpp:810
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:788
const SHAPE_POLY_SET & GetFilledPolysList() const
Function GetFilledPolysList returns a reference to the list of filled polygons.
Definition: class_zone.h:587
bool FillZoneAreasWithSegments()
Function FillZoneAreasWithSegments Fill sub areas in a zone with segments with m_ZoneMinThickness wid...
void SetSelectedCorner(int aCorner)
Definition: class_zone.h:221
unsigned int m_cornerRadius
Definition: class_zone.h:728
void SetThermalReliefCopperBridge(int aThermalReliefCopperBridge)
Definition: class_zone.h:191
void AddClearanceAreasPolygonsToPolysList_NG(BOARD *aPcb)
Function AddClearanceAreasPolygonsToPolysList Supports a min thickness area constraint.
void Move(const wxPoint &offset) override
Function Move Move the outlines.
Definition: class_zone.cpp:713
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:42
HATCH_STYLE m_hatchStyle
Definition: class_zone.h:790
const wxPoint & GetPosition() const override
Function GetPosition.
Definition: class_zone.cpp:167
void SetDoNotAllowCopperPour(bool aEnable)
Definition: class_zone.h:660
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool m_doNotAllowCopperPour
Definition: class_zone.h:744
wxString GetClass() const override
Function GetClass returns the class name.
Definition: class_zone.h:457
bool IsOnCopperLayer() const
Function IsOnCopperLayer.
Definition: class_zone.h:179
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:760
bool GetDoNotAllowTracks() const
Definition: class_zone.h:657
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:750
void SetCornerPosition(int aCornerIndex, wxPoint new_pos)
Definition: class_zone.h:517
Board layer functions and definitions.
int GetFillMode() const
Definition: class_zone.h:186
void UnHatch()
Function UnHatch clears the zone's hatch.
Definition: class_zone.cpp:905
int GetLocalFlags() const
Definition: class_zone.h:241
bool GetDoNotAllowVias() const
Definition: class_zone.h:656
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
const std::vector< SEGMENT > & FillSegments() const
Definition: class_zone.h:245
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
SHAPE_POLY_SET::ITERATOR IterateWithHoles()
Function IterateWithHoles returns an iterator to visit all points of the zone's main outline with hol...
Definition: class_zone.h:486
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:483
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:623
Class EDA_RECT handles the component boundary box.
HATCH_STYLE GetHatchStyle() const
Definition: class_zone.h:554
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:919
void SetHatchStyle(HATCH_STYLE aStyle)
Definition: class_zone.h:559
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:242
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
int GetSelectedCorner() const
Definition: class_zone.h:212
Struct SEGMENT is a simple container used when filling areas with segments.
Definition: class_zone.h:57
void SetPosition(const wxPoint &aPos) override
Definition: class_zone.h:107
static int GetDefaultHatchPitchMils()
Function GetDefaultHatchPitchMils.
Definition: class_zone.h:680
int GetHatchPitch() const
Hatch related methods.
Definition: class_zone.cpp:883
void AddClearanceAreasPolygonsToPolysList(BOARD *aPcb)
Function AddClearanceAreasPolygonsToPolysList Add non copper areas polygons (pads and tracks with cle...
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:777
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:659
void SetPadConnection(ZoneConnection aPadConnection)
Definition: class_zone.h:207
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:119
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
void SetFillMode(int aFillMode)
How to fill areas: 0 = use filled polygons, 1 => fill with segments.
Definition: class_zone.h:185
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:508
void SetMinThickness(int aMinThickness)
Definition: class_zone.h:210
void SetThermalReliefGap(int aThermalReliefGap)
Definition: class_zone.h:188
wxPoint m_Start
Definition: class_zone.h:59
int GetZoneClearance() const
Definition: class_zone.h:203
Union to handle conversion between references to wxPoint and to VECTOR2I.
Definition: class_zone.h:817
SEGMENT()
Definition: class_zone.h:62
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1) const
Returns true if a given subpolygon contains the point aP.
std::vector< SEGMENT > m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:778
void ClearFilledPolysList()
Function ClearFilledPolysList clears the list of filled polygons.
Definition: class_zone.h:577
void RemoveAllContours(void)
Definition: class_zone.h:501
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline) ...