KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef ZONE_H
22#define ZONE_H
23
24
25#include <atomic>
26#include <mutex>
27#include <vector>
28#include <map>
29#include <board_item.h>
31#include <layer_ids.h>
32#include <lset.h>
34#include <zone_settings.h>
36
37
38class LINE_READER;
39class PCB_EDIT_FRAME;
40class BOARD;
41class ZONE;
42class MSG_PANEL_ITEM;
43
44
57{
58 std::vector<int> m_IsolatedOutlines;
60};
61
62
70{
71public:
72 ZONE( BOARD_ITEM_CONTAINER* parent );
73
74 ZONE( const ZONE& aZone );
75 ZONE& operator=( const ZONE &aOther );
76
77 ~ZONE();
78
79 void CopyFrom( const BOARD_ITEM* aOther ) override;
80
81 static inline bool ClassOf( const EDA_ITEM* aItem )
82 {
83 return aItem && aItem->Type() == PCB_ZONE_T;
84 }
85
86 void Serialize( google::protobuf::Any &aContainer ) const override;
87 bool Deserialize( const google::protobuf::Any &aContainer ) override;
88
92 bool IsConnected() const override
93 {
94 return !GetIsRuleArea();
95 }
96
100 void InitDataFromSrcInCopyCtor( const ZONE& aZone, PCB_LAYER_ID aLayer = UNDEFINED_LAYER );
101
106 bool IsConflicting() const;
107
111 VECTOR2I GetPosition() const override;
112 void SetPosition( const VECTOR2I& aPos ) override {}
113
117 void SetAssignedPriority( unsigned aPriority ) { m_priority = aPriority; }
118
122 unsigned GetAssignedPriority() const { return m_priority; }
123
124 bool HigherPriority( const ZONE* aOther ) const;
125
126 bool SameNet( const ZONE* aOther ) const;
127
128 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
129 wxString GetFriendlyName() const override;
130
131 void SetLayerSet( const LSET& aLayerSet ) override;
132
133 virtual LSET GetLayerSet() const override
134 {
135 std::lock_guard<std::mutex> lock( m_layerSetMutex );
136 return m_layerSet;
137 }
138
144 void SetLayerSetAndRemoveUnusedFills( const LSET& aLayerSet );
145
147 {
148 return m_layerProperties[aLayer];
149 }
150
151 std::map<PCB_LAYER_ID, ZONE_LAYER_PROPERTIES>& LayerProperties() { return m_layerProperties; }
152
153 const std::map<PCB_LAYER_ID, ZONE_LAYER_PROPERTIES>& LayerProperties() const
154 {
155 return m_layerProperties;
156 }
157
158 void SetLayerProperties( const std::map<PCB_LAYER_ID, ZONE_LAYER_PROPERTIES>& aOther );
159
160 const wxString& GetZoneName() const { return m_zoneName; }
161 void SetZoneName( const wxString& aName ) { m_zoneName = aName; }
162
163 bool Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const override
164 {
165 return BOARD_ITEM::Matches( GetZoneName(), aSearchData );
166 }
167
171 const BOX2I GetBoundingBox() const override;
172
177 void CacheBoundingBox();
178
182 std::optional<int> GetLocalClearance() const override;
183 void SetLocalClearance( std::optional<int> aClearance ) { m_ZoneClearance = aClearance.value_or( 0 ); };
184
191 std::optional<int> GetLocalClearance( wxString* aSource ) const override
192 {
193 if( m_isRuleArea )
194 return std::optional<int>();
195
196 if( aSource )
197 *aSource = _( "zone" );
198
199 return GetLocalClearance();
200 }
201
205 bool IsOnCopperLayer() const override;
206
207 virtual void SetLayer( PCB_LAYER_ID aLayer ) override;
208
215 bool SetNetCode( int aNetCode, bool aNoAssert ) override;
217
223 void SetNet( NETINFO_ITEM* aNetInfo ) override;
224
225 virtual PCB_LAYER_ID GetLayer() const override;
226
227 // Return the first layer in GUI sequence.
229
230 virtual bool IsOnLayer( PCB_LAYER_ID ) const override;
231
232 virtual std::vector<int> ViewGetLayers() const override;
233
234 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
235
236 void SetFillMode( ZONE_FILL_MODE aFillMode );
237
239
240 void SetThermalReliefGap( int aThermalReliefGap )
241 {
242 if( m_thermalReliefGap != aThermalReliefGap )
243 SetNeedRefill( true );
244
245 m_thermalReliefGap = aThermalReliefGap;
246 }
247
249 int GetThermalReliefGap( PAD* aPad, wxString* aSource = nullptr ) const;
250
251 void SetThermalReliefSpokeWidth( int aThermalReliefSpokeWidth )
252 {
253 if( m_thermalReliefSpokeWidth != aThermalReliefSpokeWidth )
254 SetNeedRefill( true );
255
256 m_thermalReliefSpokeWidth = aThermalReliefSpokeWidth;
257 }
258
260
266 double CalculateFilledArea();
267
272 double CalculateOutlineArea();
273
280 {
281 return m_area;
282 }
283
290 {
291 return m_outlinearea;
292 }
293
295 {
296 std::lock_guard<std::mutex> lock( m_fillFlagsMutex );
297 return m_fillFlags.test( aLayer );
298 }
299
300 void SetFillFlag( PCB_LAYER_ID aLayer, bool aFlag )
301 {
302 std::lock_guard<std::mutex> lock( m_fillFlagsMutex );
303 m_fillFlags.set( aLayer, aFlag );
304 }
305
306 bool IsFilled() const { return m_isFilled; }
307 void SetIsFilled( bool isFilled ) { m_isFilled = isFilled; }
308
309 bool NeedRefill() const { return m_needRefill; }
310 void SetNeedRefill( bool aNeedRefill ) { m_needRefill = aNeedRefill; }
311
313 void SetPadConnection( ZONE_CONNECTION aPadConnection ) { m_PadConnection = aPadConnection; }
314
315 int GetMinThickness() const { return m_ZoneMinThickness; }
316 void SetMinThickness( int aMinThickness )
317 {
318 m_ZoneMinThickness = aMinThickness;
319 m_hatchThickness = std::max( m_hatchThickness, aMinThickness );
320 m_hatchGap = std::max( m_hatchGap, aMinThickness );
321 m_thievingSettings.line_width = std::max( m_thievingSettings.line_width, aMinThickness );
322 SetNeedRefill( true );
323 }
324
325 int GetHatchThickness() const { return m_hatchThickness; }
326 void SetHatchThickness( int aThickness ) { m_hatchThickness = aThickness; }
327
328 int GetHatchGap() const { return m_hatchGap; }
329 void SetHatchGap( int aStep ) { m_hatchGap = aStep; }
330
331 EDA_ANGLE GetHatchOrientation() const { return m_hatchOrientation.GetAngle(); }
332 void SetHatchOrientation( const EDA_ANGLE& aStep ) { m_hatchOrientation = aStep; }
333
335 void SetHatchSmoothingLevel( int aLevel ) { m_hatchSmoothingLevel = aLevel; }
336
338 void SetHatchSmoothingValue( double aValue ) { m_hatchSmoothingValue = aValue; }
339
340 double GetHatchHoleMinArea() const { return m_hatchHoleMinArea; }
341 void SetHatchHoleMinArea( double aPct ) { m_hatchHoleMinArea = aPct; }
342
344 void SetHatchBorderAlgorithm( int aAlgo ) { m_hatchBorderAlgorithm = aAlgo; }
345
350
352 void SetThievingSettings( const THIEVING_SETTINGS& aSettings )
353 {
354 if( m_thievingSettings != aSettings )
355 SetNeedRefill( true );
356
357 m_thievingSettings = aSettings;
358 }
359
362 {
363 if( m_thievingSettings.pattern != aPattern )
364 SetNeedRefill( true );
365
366 m_thievingSettings.pattern = aPattern;
367 }
368
369 int GetThievingElementSize() const { return m_thievingSettings.element_size; }
370 void SetThievingElementSize( int aSize )
371 {
372 if( m_thievingSettings.element_size != aSize )
373 SetNeedRefill( true );
374
375 m_thievingSettings.element_size = aSize;
376 }
377
378 int GetThievingGap() const { return m_thievingSettings.gap; }
379 void SetThievingGap( int aGap )
380 {
381 if( m_thievingSettings.gap != aGap )
382 SetNeedRefill( true );
383
384 m_thievingSettings.gap = aGap;
385 }
386
387 int GetThievingLineWidth() const { return m_thievingSettings.line_width; }
388 void SetThievingLineWidth( int aWidth )
389 {
390 if( m_thievingSettings.line_width != aWidth )
391 SetNeedRefill( true );
392
393 m_thievingSettings.line_width = aWidth;
394 }
395
396 bool GetThievingStagger() const { return m_thievingSettings.stagger; }
397 void SetThievingStagger( bool aStagger )
398 {
399 if( m_thievingSettings.stagger != aStagger )
400 SetNeedRefill( true );
401
402 m_thievingSettings.stagger = aStagger;
403 }
404
405 EDA_ANGLE GetThievingOrientation() const { return m_thievingSettings.orientation.GetAngle(); }
406
407 void SetThievingOrientation( const EDA_ANGLE& aOrientation )
408 {
409 EDA_ORIENTATION normalizedOrientation( aOrientation );
410
411 if( m_thievingSettings.orientation != normalizedOrientation )
412 SetNeedRefill( true );
413
414 m_thievingSettings.orientation = normalizedOrientation;
415 }
416
418 int GetLocalFlags() const { return m_localFlgs; }
419 void SetLocalFlags( int aFlags ) { m_localFlgs = aFlags; }
420
422 const SHAPE_POLY_SET* Outline() const { return m_Poly; }
423
424 void SetOutline( SHAPE_POLY_SET* aOutline ) { m_Poly = aOutline; }
425
427
429
430 // @copydoc BOARD_ITEM::GetEffectiveShape
431 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
433 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
434
442 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
443
452 bool HitTestFilledArea( PCB_LAYER_ID aLayer, const VECTOR2I& aRefPos, int aAccuracy = 0 ) const;
453
462 bool HitTestCutout( const VECTOR2I& aRefPos, int* aOutlineIdx = nullptr, int* aHoleIdx = nullptr ) const;
463
469 void GetInteractingZones( PCB_LAYER_ID aLayer, std::vector<ZONE*>* aSameNetCollidingZones,
470 std::vector<ZONE*>* aOtherNetIntersectingZones ) const;
471
482
497 void TransformSmoothedOutlineToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
498 int aError, ERROR_LOC aErrorLoc, SHAPE_POLY_SET* aBoardOutline ) const;
499
500 double GetCoverageArea( int aTextMargin ) const override;
501
515 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
516 int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth = false ) const override;
517
527 bool HitTestForCorner( const VECTOR2I& refPos, int aAccuracy,
528 SHAPE_POLY_SET::VERTEX_INDEX* aCornerHit = nullptr ) const;
529
539 bool HitTestForEdge( const VECTOR2I& refPos, int aAccuracy,
540 SHAPE_POLY_SET::VERTEX_INDEX* aCornerHit = nullptr ) const;
541
545 bool HitTest( const BOX2I& aRect, bool aContained = true, int aAccuracy = 0 ) const override;
546
550 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
551
557 bool UnFill();
558
559 /* Geometric transformations: */
560
566 void Move( const VECTOR2I& offset ) override;
567
574 void MoveEdge( const VECTOR2I& offset, int aEdge );
575
582 void Rotate( const VECTOR2I& aCentre, const EDA_ANGLE& aAngle ) override;
583
591 virtual void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
592
593 void OnFootprintRescaled( double aRatioX, double aRatioY, double aLinearFactor, const VECTOR2I& aAnchor,
594 const EDA_ANGLE& aParentRotate ) override;
595
596 void OnFootprintTransformed() override;
597
604 void Mirror( const VECTOR2I& aMirrorRef, FLIP_DIRECTION aFlipDirection ) override;
605
609 wxString GetClass() const override
610 {
611 return wxT( "ZONE" );
612 }
613
617 int GetNumCorners( void ) const
618 {
619 return m_Poly->TotalVertices();
620 }
621
628 {
629 return m_Poly->Iterate();
630 }
631
638 {
639 return m_Poly->IterateWithHoles();
640 }
641
648 {
649 return m_Poly->CIterateWithHoles();
650 }
651
652 void RemoveAllContours( void )
653 {
654 m_Poly->RemoveAllContours();
655 }
656
657 const VECTOR2I& GetCornerPosition( int aCornerIndex ) const
658 {
660
661 // Convert global to relative indices
662 if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
663 throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
664
665 return m_Poly->CVertex( index );
666 }
667
671 void NewHole()
672 {
673 m_Poly->NewHole();
674 }
675
685 bool AppendCorner( const VECTOR2I& aPosition, int aHoleIdx, bool aAllowDuplication = false );
686
689
691 {
692 std::lock_guard<std::mutex> lock( m_filledPolysListMutex );
693 return m_FilledPolysList.count( aLayer ) > 0;
694 }
695
699 std::shared_ptr<SHAPE_POLY_SET> GetFilledPolysList( PCB_LAYER_ID aLayer ) const
700 {
701 std::lock_guard<std::mutex> lock( m_filledPolysListMutex );
702 wxASSERT( m_FilledPolysList.count( aLayer ) );
703 return m_FilledPolysList.at( aLayer );
704 }
705
707 {
708 std::lock_guard<std::mutex> lock( m_filledPolysListMutex );
709
710 auto it = m_FilledPolysList.find( aLayer );
711
712 if( it == m_FilledPolysList.end() )
713 return nullptr;
714
715 return it->second.get();
716 }
717
729 std::vector<PCB_LAYER_ID> GetFilledLayers() const;
730
739
741 const SHAPE_POLY_SET::TASK_SUBMITTER& aSubmitter = {} );
742
746 void SetFilledPolysList( PCB_LAYER_ID aLayer, const SHAPE_POLY_SET& aPolysList )
747 {
748 std::lock_guard<std::mutex> lock( m_filledPolysListMutex );
749 m_FilledPolysList[aLayer] = std::make_shared<SHAPE_POLY_SET>( aPolysList );
750 }
751
759 bool IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const;
760
761 void SetIsIsland( PCB_LAYER_ID aLayer, int aPolyIdx )
762 {
763 m_insulatedIslands[aLayer].insert( aPolyIdx );
764 }
765
766 bool BuildSmoothedPoly( SHAPE_POLY_SET& aSmoothedPoly, PCB_LAYER_ID aLayer, SHAPE_POLY_SET* aBoardOutline,
767 SHAPE_POLY_SET* aSmoothedPolyWithApron = nullptr ) const;
768
770
772
773 void SetCornerRadius( unsigned int aRadius );
774
775 unsigned int GetCornerRadius() const { return m_cornerRadius; }
776
783 void RemoveCutout( int aOutlineIdx, int aHoleIdx );
784
791 void AddPolygon( std::vector<VECTOR2I>& aPolygon );
792
793 void AddPolygon( const SHAPE_LINE_CHAIN& aPolygon );
794
795 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
796
797 BITMAPS GetMenuImage() const override;
798
799 EDA_ITEM* Clone() const override;
800 ZONE* Clone( PCB_LAYER_ID aLayer ) const;
801
802 BOARD_ITEM* Duplicate( bool addToParentGroup, BOARD_COMMIT* aCommit = nullptr ) const override;
803
808
814
819
828
832 bool GetIsRuleArea() const { return m_isRuleArea; }
833 void SetIsRuleArea( bool aEnable ) { m_isRuleArea = aEnable; }
835 void SetPlacementAreaEnabled( bool aEnabled ) { m_placementAreaEnabled = aEnabled; }
836
838 void SetPlacementAreaSource( const wxString& aSource ) { m_placementAreaSource = aSource; }
841
843 bool GetDoNotAllowVias() const { return m_doNotAllowVias; }
845 bool GetDoNotAllowPads() const { return m_doNotAllowPads; }
847
848 void SetDoNotAllowZoneFills( bool aEnable ) { m_doNotAllowZoneFills = aEnable; }
849 void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; }
850 void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; }
851 void SetDoNotAllowPads( bool aEnable ) { m_doNotAllowPads = aEnable; }
852 void SetDoNotAllowFootprints( bool aEnable ) { m_doNotAllowFootprints = aEnable; }
853
856
857 long long int GetMinIslandArea() const { return m_minIslandArea; }
858 void SetMinIslandArea( long long int aArea ) { m_minIslandArea = aArea; }
859
863
868 void SetBorderHatchPitch( int aPitch ) { m_borderHatchPitch = aPitch; }
869
873 static int GetDefaultHatchPitch();
874
884 void SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE aBorderHatchStyle, int aBorderHatchPitch,
885 bool aRebuildBorderHatch );
886
890 void UnHatchBorder();
891
896 void HatchBorder();
897
898 std::vector<SEG> GetHatchLines() const;
899
904 void BuildHashValue( PCB_LAYER_ID aLayer );
905
910
911 double Similarity( const BOARD_ITEM& aOther ) const override;
912
913 bool operator==( const ZONE& aOther ) const;
914 bool operator==( const BOARD_ITEM& aOther ) const override;
915
916#if defined(DEBUG)
917 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
918
919 void SetFillPoly( PCB_LAYER_ID aLayer, SHAPE_POLY_SET* aPoly )
920 {
921 {
922 std::lock_guard<std::mutex> lock( m_filledPolysListMutex );
923 m_FilledPolysList[ aLayer ] = std::make_shared<SHAPE_POLY_SET>( *aPoly );
924 }
925
926 SetFillFlag( aLayer, true );
927 }
928
929#endif
930
931private:
937 bool unFillLocked();
938
939protected:
940 virtual void swapData( BOARD_ITEM* aImage ) override;
941
942protected:
945 unsigned int m_cornerRadius;
946
948 wxString m_zoneName;
949
950 mutable std::mutex m_layerSetMutex;
952
953 std::map<PCB_LAYER_ID, ZONE_LAYER_PROPERTIES> m_layerProperties;
954
960 unsigned m_priority;
961
967
974
981
991
993 int m_ZoneClearance; // Clearance value in internal units.
994 int m_ZoneMinThickness; // Minimum thickness value in filled areas.
995 int m_fillVersion; // See BOARD_DESIGN_SETTINGS for version
996 // differences.
998
1003 long long int m_minIslandArea;
1004
1007
1013 std::atomic<bool> m_needRefill;
1014
1015 int m_thermalReliefGap; // Width of the gap in thermal reliefs.
1016 int m_thermalReliefSpokeWidth; // Width of the copper bridge in thermal reliefs.
1017
1018 ZONE_FILL_MODE m_fillMode; // fill with POLYGONS vs HATCH_PATTERN
1019 int m_hatchThickness; // thickness of lines (if 0 -> solid shape)
1020 int m_hatchGap; // gap between lines (0 -> solid shape
1021 EDA_ORIENTATION m_hatchOrientation; // orientation of grid lines
1022 int m_hatchSmoothingLevel; // 0 = no smoothing
1023 // 1 = fillet
1024 // 2 = arc low def
1025 // 3 = arc high def
1026 double m_hatchSmoothingValue; // hole chamfer/fillet size (ratio of hole size)
1027 double m_hatchHoleMinArea; // min size before holes are dropped (ratio)
1028 int m_hatchBorderAlgorithm; // 0 = use min zone thickness
1029 // 1 = use hatch thickness
1030
1031 THIEVING_SETTINGS m_thievingSettings; // valid when m_fillMode == COPPER_THIEVING
1032
1033 int m_localFlgs; // Variable used in polygon calculations.
1034
1035 /* set of filled polygons used to draw a zone as a filled area.
1036 * from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
1037 * (they are all in one piece) In very simple cases m_FilledPolysList is same
1038 * as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
1039 * a polygon equivalent to m_Poly, without holes but with extra outline segment
1040 * connecting "holes" with external main outline. In complex cases an outline
1041 * described by m_Poly can have many filled areas
1042 */
1043 mutable std::mutex m_filledPolysListMutex;
1044 std::map<PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>> m_FilledPolysList;
1045
1047 mutable std::mutex m_fillFlagsMutex;
1049
1051 std::map<PCB_LAYER_ID, HASH_128> m_filledPolysHash;
1052
1053 ZONE_BORDER_DISPLAY_STYLE m_borderStyle; // border display style, see enum above
1054 int m_borderHatchPitch; // for DIAGONAL_EDGE, distance between 2 lines
1055 std::vector<SEG> m_borderHatchLines; // hatch lines
1056
1058 std::map<PCB_LAYER_ID, std::set<int>> m_insulatedIslands;
1059
1060 double m_area; // The filled zone area
1061 double m_outlinearea; // The outline zone area
1062
1064 BOX2I computeBoundingBox() const;
1065
1066 void invalidateBoundingBoxCache() const;
1067
1070 mutable std::atomic<int> m_bboxCacheTimeStamp{ -1 };
1071
1072};
1073
1074
1080
1081#endif // ZONE_H
int index
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
virtual bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:86
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition eda_item.h:484
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
An "orientation", held as an angle constrained to the range [0, 360) degrees.
Definition eda_angle.h:473
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition richio.h:65
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:50
Handle the data for a net.
Definition netinfo.h:50
Definition pad.h:61
The main frame for Pcbnew.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
ITERATOR_TEMPLATE< VECTOR2I > ITERATOR
ITERATOR_TEMPLATE< const VECTOR2I > CONST_ITERATOR
std::function< void(std::function< void()>)> TASK_SUBMITTER
Callback that submits a unit of work for asynchronous execution.
Handle a list of polygons defining a copper zone.
Definition zone.h:70
void SetHatchThickness(int aThickness)
Definition zone.h:326
void CacheTriangulation(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, const SHAPE_POLY_SET::TASK_SUBMITTER &aSubmitter={})
Definition zone.cpp:1681
void SetNeedRefill(bool aNeedRefill)
Definition zone.h:310
double GetOutlineArea()
This area is cached from the most recent call to CalculateOutlineArea().
Definition zone.h:289
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if a point is near an outline edge or a corner of this zone.
Definition zone.cpp:940
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition zone.cpp:1484
void SetHatchBorderAlgorithm(int aAlgo)
Definition zone.h:344
int m_borderHatchPitch
Definition zone.h:1054
wxString m_placementAreaSource
Definition zone.h:973
const SHAPE_POLY_SET * Outline() const
Definition zone.h:422
bool m_isRuleArea
A zone outline can be a rule area.
Definition zone.h:966
void SetDoNotAllowPads(bool aEnable)
Definition zone.h:851
void SetLayerProperties(const std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > &aOther)
Definition zone.cpp:707
int GetHatchBorderAlgorithm() const
Definition zone.h:343
ZONE & operator=(const ZONE &aOther)
Definition zone.cpp:101
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition zone.h:832
PLACEMENT_SOURCE_T m_placementAreaSourceType
Definition zone.h:972
std::optional< int > GetLocalClearance() const override
Definition zone.cpp:1062
const THIEVING_SETTINGS & GetThievingSettings() const
Definition zone.h:351
void SetLocalClearance(std::optional< int > aClearance)
Definition zone.h:183
bool m_doNotAllowVias
Definition zone.h:987
bool UnFill()
Removes the zone filling.
Definition zone.cpp:528
bool NeedRefill() const
Definition zone.h:309
bool GetDoNotAllowVias() const
Definition zone.h:843
bool AppendCorner(const VECTOR2I &aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
Definition zone.cpp:1464
void TransformSolidAreasShapesToPolygon(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aBuffer) const
Convert solid areas full shapes to polygon set (the full shape is the polygon area with a thick outli...
Definition zone.cpp:2075
void SetCornerRadius(unsigned int aRadius)
Definition zone.cpp:878
ZONE_FILL_MODE m_fillMode
Definition zone.h:1018
THIEVING_SETTINGS m_thievingSettings
Definition zone.h:1031
void SetPosition(const VECTOR2I &aPos) override
Definition zone.h:112
bool m_doNotAllowFootprints
Definition zone.h:990
bool unFillLocked()
Internal implementation of UnFill() that assumes the caller already holds m_filledPolysListMutex.
Definition zone.cpp:536
void TransformSmoothedOutlineToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, 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:1955
int m_ZoneMinThickness
Definition zone.h:994
BOARD_ITEM * Duplicate(bool addToParentGroup, BOARD_COMMIT *aCommit=nullptr) const override
Create a copy of this BOARD_ITEM.
Definition zone.cpp:230
int GetThievingLineWidth() const
Definition zone.h:387
void AddPolygon(std::vector< VECTOR2I > &aPolygon)
Add a polygon to the zone outline.
Definition zone.cpp:1447
ZONE_LAYER_PROPERTIES & LayerProperties(PCB_LAYER_ID aLayer)
Definition zone.h:146
double m_hatchSmoothingValue
Definition zone.h:1026
void SetLocalFlags(int aFlags)
Definition zone.h:419
int m_thermalReliefSpokeWidth
Definition zone.h:1016
wxString GetPlacementAreaSource() const
Definition zone.h:837
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:1097
void Mirror(const VECTOR2I &aMirrorRef, FLIP_DIRECTION aFlipDirection) override
Mirror the outlines relative to a given horizontal axis the layer is not changed.
Definition zone.cpp:1401
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:1058
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
Definition zone.h:948
void HatchBorder()
Compute the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_bor...
Definition zone.cpp:1582
std::map< PCB_LAYER_ID, std::shared_ptr< SHAPE_POLY_SET > > m_FilledPolysList
Definition zone.h:1044
std::optional< int > GetLocalClearance(wxString *aSource) const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
Definition zone.h:191
std::shared_ptr< SHAPE_POLY_SET > GetFilledPolysList(PCB_LAYER_ID aLayer) const
Definition zone.h:699
bool GetDoNotAllowPads() const
Definition zone.h:845
const BOX2I GetBoundingBox() const override
Definition zone.cpp:787
void SetMinThickness(int aMinThickness)
Definition zone.h:316
void SetPlacementAreaSource(const wxString &aSource)
Definition zone.h:838
BOX2I computeBoundingBox() const
Compute the bbox from scratch. Shared so the cached value can't diverge from the live one.
Definition zone.cpp:778
void SetThievingOrientation(const EDA_ANGLE &aOrientation)
Definition zone.h:407
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition zone.cpp:733
double GetFilledArea()
This area is cached from the most recent call to CalculateFilledArea().
Definition zone.h:279
PLACEMENT_SOURCE_T GetPlacementAreaSourceType() const
Definition zone.h:839
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition zone.h:163
double m_outlinearea
Definition zone.h:1061
std::mutex m_filledPolysListMutex
Definition zone.h:1043
void SetThievingPattern(THIEVING_PATTERN aPattern)
Definition zone.h:361
wxString GetFriendlyName() const override
Definition zone.cpp:1302
bool GetDoNotAllowTracks() const
Definition zone.h:844
std::mutex m_fillFlagsMutex
Temp variables used while filling.
Definition zone.h:1047
int GetLocalFlags() const
Definition zone.h:418
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition zone.cpp:216
void SetHatchOrientation(const EDA_ANGLE &aStep)
Definition zone.h:332
wxString GetClass() const override
Definition zone.h:609
void SetBorderDisplayStyle(ZONE_BORDER_DISPLAY_STYLE aBorderHatchStyle, int aBorderHatchPitch, bool aRebuildBorderHatch)
Set all hatch parameters for the zone.
Definition zone.cpp:1563
void SetThievingElementSize(int aSize)
Definition zone.h:370
void SetHatchSmoothingValue(double aValue)
Definition zone.h:338
void CacheOutlineTriangulation()
Triangulate the zone outline only.
Definition zone.cpp:1675
SHAPE_POLY_SET::ITERATOR IterateWithHoles()
Return an iterator to visit all points of the zone's main outline with holes.
Definition zone.h:637
std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > m_layerProperties
Definition zone.h:953
void OnFootprintTransformed() override
Hook for items inside a footprint to refresh after the FP transform changes (translate,...
Definition zone.cpp:833
bool IsFilled() const
Definition zone.h:306
bool HitTestForCorner(const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
Test if the given VECTOR2I is near a corner.
Definition zone.cpp:950
void SetHatchSmoothingLevel(int aLevel)
Definition zone.h:335
bool m_doNotAllowTracks
Definition zone.h:988
bool IsConnected() const override
Not all ZONEs are really BOARD_CONNECTED_ITEMs....
Definition zone.h:92
void SetThermalReliefSpokeWidth(int aThermalReliefSpokeWidth)
Definition zone.h:251
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition zone.cpp:573
void SetPlacementAreaSourceType(PLACEMENT_SOURCE_T aType)
Definition zone.h:840
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition zone.cpp:640
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
Definition zone.h:854
LSET m_fillFlags
Definition zone.h:1048
SHAPE_POLY_SET * Outline()
Definition zone.h:421
void SetHatchStyle(ZONE_BORDER_DISPLAY_STYLE aStyle)
Definition zone.h:688
bool m_doNotAllowPads
Definition zone.h:989
void NewHole()
Create a new hole on the zone; i.e., a new contour on the zone's outline.
Definition zone.h:671
ZONE(BOARD_ITEM_CONTAINER *parent)
Definition zone.cpp:52
void SetFillFlag(PCB_LAYER_ID aLayer, bool aFlag)
Definition zone.h:300
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition zone.cpp:247
bool SetNetCode(int aNetCode, bool aNoAssert) override
Override that clamps the netcode to 0 when this zone is in copper-thieving fill mode.
Definition zone.cpp:622
void Move(const VECTOR2I &offset) override
Move the outlines.
Definition zone.cpp:1257
bool IsIsland(PCB_LAYER_ID aLayer, int aPolyIdx) const
Check if a given filled polygon is an insulated island.
Definition zone.cpp:1714
std::atomic< int > m_bboxCacheTimeStamp
Definition zone.h:1070
bool IsCopperThieving() const
Definition zone.h:349
BOX2I m_bboxCache
Lock-free bbox cache, valid while m_bboxCacheTimeStamp matches the board timestamp.
Definition zone.h:1069
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition zone.h:943
TEARDROP_TYPE m_teardropType
A zone outline can be a teardrop zone with different rules for priority (always bigger priority than ...
Definition zone.h:980
std::map< PCB_LAYER_ID, HASH_128 > m_filledPolysHash
A hash value used in zone filling calculations to see if the filled areas are up to date.
Definition zone.h:1051
~ZONE()
Definition zone.cpp:118
long long int GetMinIslandArea() const
Definition zone.h:857
int m_hatchSmoothingLevel
Definition zone.h:1022
void SetThievingStagger(bool aStagger)
Definition zone.h:397
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
Definition zone.cpp:2188
SHAPE_POLY_SET * GetFill(PCB_LAYER_ID aLayer)
Definition zone.h:706
LSET m_layerSet
Definition zone.h:951
void SetIsRuleArea(bool aEnable)
Definition zone.h:833
std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > & LayerProperties()
Definition zone.h:151
int m_ZoneClearance
Definition zone.h:993
void CopyFrom(const BOARD_ITEM *aOther) override
Definition zone.cpp:111
void SetThievingGap(int aGap)
Definition zone.h:379
void SetDoNotAllowTracks(bool aEnable)
Definition zone.h:850
void SetFilledPolysList(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPolysList)
Set the list of filled polygons.
Definition zone.h:746
bool m_placementAreaEnabled
Placement rule area data.
Definition zone.h:971
const wxString & GetZoneName() const
Definition zone.h:160
void CacheBoundingBox()
Used to preload the zone bounding box cache so we don't have to worry about mutex-locking it each tim...
Definition zone.cpp:842
int GetMinThickness() const
Definition zone.h:315
virtual void swapData(BOARD_ITEM *aImage) override
Definition zone.cpp:1652
bool HitTestForEdge(const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
Test if the given VECTOR2I is near a segment defined by 2 corners.
Definition zone.cpp:961
static bool ClassOf(const EDA_ITEM *aItem)
Definition zone.h:81
SHAPE_POLY_SET GetBoardOutline() const
Definition zone.cpp:916
void RemoveCutout(int aOutlineIdx, int aHoleIdx)
Remove a cutout from the zone.
Definition zone.cpp:1418
void Rotate(const VECTOR2I &aCentre, const EDA_ANGLE &aAngle) override
Rotate the outlines.
Definition zone.cpp:1338
ZONE_SETTINGS::CORNER_SMOOTHING GetCornerSmoothingType() const
Definition zone.h:771
bool HigherPriority(const ZONE *aOther) const
Definition zone.cpp:508
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const VECTOR2I &aRefPos, int aAccuracy=0) const
Test if the given VECTOR2I is within the bounds of a filled area of this zone.
Definition zone.cpp:1068
void SetIsFilled(bool isFilled)
Definition zone.h:307
std::mutex m_layerSetMutex
Definition zone.h:950
void SetFillMode(ZONE_FILL_MODE aFillMode)
Definition zone.cpp:646
int GetFillFlag(PCB_LAYER_ID aLayer)
Definition zone.h:294
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition zone.cpp:1646
int m_hatchGap
Definition zone.h:1020
ZONE_CONNECTION GetPadConnection() const
Definition zone.h:312
bool HasFilledPolysForLayer(PCB_LAYER_ID aLayer) const
Definition zone.h:690
int GetHatchThickness() const
Definition zone.h:325
double GetHatchHoleMinArea() const
Definition zone.h:340
void SetThievingSettings(const THIEVING_SETTINGS &aSettings)
Definition zone.h:352
void invalidateBoundingBoxCache() const
Definition zone.cpp:821
void SetLayerSet(const LSET &aLayerSet) override
Definition zone.cpp:665
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:1127
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
Definition zone.cpp:771
int m_hatchBorderAlgorithm
Definition zone.h:1028
bool GetPlacementAreaEnabled() const
Definition zone.h:834
void SetDoNotAllowVias(bool aEnable)
Definition zone.h:849
bool IsTeardropArea() const
Definition zone.h:807
std::vector< SEG > m_borderHatchLines
Definition zone.h:1055
VECTOR2I GetPosition() const override
Definition zone.cpp:564
int GetThermalReliefSpokeWidth() const
Definition zone.h:259
int GetBorderHatchPitch() const
HatchBorder related methods.
Definition zone.h:867
void SetNet(NETINFO_ITEM *aNetInfo) override
Override that drops aNetInfo when this zone is in copper-thieving fill mode.
Definition zone.cpp:631
virtual void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
Definition zone.cpp:1369
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle() const
Definition zone.h:687
void BuildHashValue(PCB_LAYER_ID aLayer)
Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash.
Definition zone.cpp:899
void SetThermalReliefGap(int aThermalReliefGap)
Definition zone.h:240
EDA_ANGLE GetHatchOrientation() const
Definition zone.h:331
bool BuildSmoothedPoly(SHAPE_POLY_SET &aSmoothedPoly, PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aBoardOutline, SHAPE_POLY_SET *aSmoothedPolyWithApron=nullptr) const
Definition zone.cpp:1777
int m_fillVersion
Definition zone.h:995
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition zone.cpp:1978
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition zone.h:657
EDA_ORIENTATION m_hatchOrientation
Definition zone.h:1021
bool GetDoNotAllowFootprints() const
Definition zone.h:846
ZONE_FILL_MODE GetFillMode() const
Definition zone.h:238
double m_hatchHoleMinArea
Definition zone.h:1027
std::vector< PCB_LAYER_ID > GetFilledLayers() const
Create a list of triangles that "fill" the solid areas used for instance to draw these solid areas on...
Definition zone.cpp:1660
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles() const
Return an iterator to visit all points of the zone's main outline with holes.
Definition zone.h:647
SHAPE_POLY_SET::ITERATOR Iterate()
Return an iterator to visit all points of the zone's main outline without holes.
Definition zone.h:627
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition zone.h:133
bool GetThievingStagger() const
Definition zone.h:396
void SetDoNotAllowFootprints(bool aEnable)
Definition zone.h:852
bool HasKeepoutParametersSet() const
Accessor to determine if any keepout parameters are set.
Definition zone.h:823
void SetBorderHatchPitch(int aPitch)
Definition zone.h:868
void SetThievingLineWidth(int aWidth)
Definition zone.h:388
void GetInteractingZones(PCB_LAYER_ID aLayer, std::vector< ZONE * > *aSameNetCollidingZones, std::vector< ZONE * > *aOtherNetIntersectingZones) const
Some intersecting zones, despite being on the same layer with the same net, cannot be merged due to o...
Definition zone.cpp:1726
void SetLayerSetAndRemoveUnusedFills(const LSET &aLayerSet)
Set the zone to be on the aLayerSet layers and only remove the fill polygons from the unused layers,...
Definition zone.cpp:2084
int GetHatchGap() const
Definition zone.h:328
double CalculateOutlineArea()
Compute the area of the zone outline (not the filled area).
Definition zone.cpp:1948
int GetThievingGap() const
Definition zone.h:378
void SetHatchHoleMinArea(double aPct)
Definition zone.h:341
unsigned m_priority
Priority: when a zone outline is inside and other zone, if its priority is higher the other zone prio...
Definition zone.h:960
TEARDROP_TYPE GetTeardropAreaType() const
Definition zone.h:818
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition zone.cpp:370
bool IsConflicting() const
For rule areas which exclude footprints (and therefore participate in courtyard conflicts during move...
Definition zone.cpp:558
bool m_doNotAllowZoneFills
For keepout zones only: what is not allowed inside the keepout ( pads, tracks and vias )
Definition zone.h:986
ISLAND_REMOVAL_MODE m_islandRemovalMode
Definition zone.h:997
std::vector< SEG > GetHatchLines() const
Definition zone.cpp:1622
bool m_isFilled
True when a zone was filled, false after deleting the filled areas.
Definition zone.h:1006
double GetHatchSmoothingValue() const
Definition zone.h:337
std::atomic< bool > m_needRefill
False when a zone was refilled, true after changes in zone params.
Definition zone.h:1013
THIEVING_PATTERN GetThievingPattern() const
Definition zone.h:360
bool GetDoNotAllowZoneFills() const
Definition zone.h:842
void MoveEdge(const VECTOR2I &offset, int aEdge)
Move the outline Edge.
Definition zone.cpp:1315
int GetHatchSmoothingLevel() const
Definition zone.h:334
unsigned int GetCornerRadius() const
Definition zone.h:775
int m_thermalReliefGap
Definition zone.h:1015
void SetIsIsland(PCB_LAYER_ID aLayer, int aPolyIdx)
Definition zone.h:761
int GetThievingElementSize() const
Definition zone.h:369
int m_localFlgs
Definition zone.h:1033
SHAPE_POLY_SET GetLibraryOutline() const
Definition zone.cpp:910
bool IsOnCopperLayer() const override
Definition zone.cpp:615
double CalculateFilledArea()
Compute the area currently occupied by the zone fill.
Definition zone.cpp:1937
void SetDoNotAllowZoneFills(bool aEnable)
Definition zone.h:848
int m_hatchThickness
Definition zone.h:1019
void OnFootprintRescaled(double aRatioX, double aRatioY, double aLinearFactor, const VECTOR2I &aAnchor, const EDA_ANGLE &aParentRotate) override
Apply a parent footprint scale to this item.
Definition zone.cpp:1355
void SetCornerSmoothingType(ZONE_SETTINGS::CORNER_SMOOTHING aType)
Definition zone.h:769
ZONE_SETTINGS::CORNER_SMOOTHING m_cornerSmoothingType
Definition zone.h:944
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, 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:2038
void SetAssignedPriority(unsigned aPriority)
Definition zone.h:117
double m_area
Definition zone.h:1060
unsigned int m_cornerRadius
Definition zone.h:945
void SetPadConnection(ZONE_CONNECTION aPadConnection)
Definition zone.h:313
void SetZoneName(const wxString &aName)
Definition zone.h:161
bool operator==(const ZONE &aOther) const
Definition zone.cpp:2120
void SetTeardropAreaType(TEARDROP_TYPE aType)
Set the type of teardrop if the zone is a teardrop area for non teardrop area, the type must be TEARD...
Definition zone.h:813
void UnHatchBorder()
Clear the zone's hatch.
Definition zone.cpp:1576
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
Definition zone.h:855
EDA_ANGLE GetThievingOrientation() const
Definition zone.h:405
double GetCoverageArea(int aTextMargin) const override
Return the board area this item covers, used to rank candidates under the cursor so a click on a smal...
Definition zone.cpp:2000
void SetOutline(SHAPE_POLY_SET *aOutline)
Definition zone.h:424
PCB_LAYER_ID GetFirstLayer() const
Definition zone.cpp:595
void SetMinIslandArea(long long int aArea)
Definition zone.h:858
virtual std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
Definition zone.cpp:713
HASH_128 GetHashValue(PCB_LAYER_ID aLayer)
Definition zone.cpp:890
ZONE_CONNECTION m_PadConnection
Definition zone.h:992
void InitDataFromSrcInCopyCtor(const ZONE &aZone, PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
Copy aZone data to me.
Definition zone.cpp:124
const std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > & LayerProperties() const
Definition zone.h:153
int GetThermalReliefGap() const
Definition zone.h:248
void RemoveAllContours(void)
Definition zone.h:652
void SetHatchGap(int aStep)
Definition zone.h:329
static int GetDefaultHatchPitch()
Definition zone.cpp:1640
void SetPlacementAreaEnabled(bool aEnabled)
Definition zone.h:835
unsigned GetAssignedPriority() const
Definition zone.h:122
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition zone.h:617
bool SameNet(const ZONE *aOther) const
Definition zone.cpp:522
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
Definition zone.h:1053
long long int m_minIslandArea
When island removal mode is set to AREA, islands below this area will be removed.
Definition zone.h:1003
DRC_CONSTRAINT_T
Definition drc_rule.h:49
@ NULL_CONSTRAINT
Definition drc_rule.h:50
#define _(s)
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition layer_ids.h:180
@ DEFAULT
Flashing follows connectivity.
Definition layer_ids.h:181
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ UNDEFINED_LAYER
Definition layer_ids.h:57
FLIP_DIRECTION
Definition mirror.h:23
#define DECLARE_ENUM_TO_WXANY(type)
Definition property.h:851
A storage class for 128-bit hash value.
Definition hash_128.h:32
A struct recording the isolated and single-pad islands within a zone.
Definition zone.h:57
std::vector< int > m_SingleConnectionOutlines
Definition zone.h:59
std::vector< int > m_IsolatedOutlines
Definition zone.h:58
Structure to hold the necessary information in order to index a vertex on a SHAPE_POLY_SET object: th...
Parameters that drive copper-thieving fill generation.
TEARDROP_TYPE
define the type of a teardrop: on a via or pad, or a track end
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition typeinfo.h:100
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
THIEVING_PATTERN
Shape stamped onto the grid for a copper-thieving fill.
ISLAND_REMOVAL_MODE
Whether or not to remove isolated islands from a zone.
ZONE_FILL_MODE
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
PLACEMENT_SOURCE_T
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition zones.h:43