90    void Serialize( google::protobuf::Any &aContainer ) 
const override;
 
   91    bool Deserialize( 
const google::protobuf::Any &aContainer ) 
override;
 
  159    void SetLayerProperties( 
const std::map<PCB_LAYER_ID, ZONE_LAYER_PROPERTIES>& aOther );
 
  197            return std::optional<int>();
 
  200            *aSource = 
_( 
"zone" );
 
 
  341    virtual std::shared_ptr<SHAPE>
 
  351    bool HitTest( 
const VECTOR2I& aPosition, 
int aAccuracy = 0 ) 
const override;
 
  372                        int* aHoleIdx = 
nullptr ) 
const;
 
  380                              std::vector<ZONE*>* aOtherNetIntersectingZones ) 
const;
 
  422                                  int aClearance, 
int aError, 
ERROR_LOC aErrorLoc,
 
  423                                  bool ignoreLineWidth = 
false ) 
const override;
 
  453    bool HitTest( 
const BOX2I& aRect, 
bool aContained = 
true, 
int aAccuracy = 0 ) 
const override;
 
  513        return wxT( 
"ZONE" );
 
 
  521        return m_Poly->TotalVertices();
 
 
  541        return m_Poly->IterateWithHoles();
 
 
  551        return m_Poly->CIterateWithHoles();
 
 
  556        m_Poly->RemoveAllContours();
 
 
  564        if( !
m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
 
  565            throw( std::out_of_range( 
"aCornerIndex-th vertex does not exist" ) );
 
  567        return m_Poly->CVertex( index );
 
 
  666    void AddPolygon( std::vector<VECTOR2I>& aPolygon );
 
  762                                bool aRebuilBorderdHatch );
 
  794    virtual void Show( 
int nestLevel, std::ostream& os )
 const override { ShowDummy( os ); }
 
  796    void SetFillPoly( 
PCB_LAYER_ID aLayer, SHAPE_POLY_SET* aPoly )
 
 
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.
 
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...
 
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
 
Information pertinent to a Pcbnew printed circuit board.
 
The base class for create windows for drawing purpose.
 
A base class for most all the KiCad significant classes used in schematics and boards.
 
KICAD_T Type() const
Returns the type of object.
 
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
 
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
 
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
 
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
 
LSET is a set of PCB_LAYER_IDs.
 
EDA_MSG_PANEL items for displaying messages.
 
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
 
Handle a list of polygons defining a copper zone.
 
void SetHatchThickness(int aThickness)
 
void SetNeedRefill(bool aNeedRefill)
 
double GetOutlineArea()
This area is cached from the most recent call to CalculateOutlineArea().
 
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.
 
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
 
void SetHatchBorderAlgorithm(int aAlgo)
 
wxString m_placementAreaSource
 
const SHAPE_POLY_SET * Outline() const
 
void SetDoNotAllowPads(bool aEnable)
 
void SetLayerProperties(const std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > &aOther)
 
int GetHatchBorderAlgorithm() const
 
ZONE & operator=(const ZONE &aOther)
 
int m_cornerSmoothingType
 
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
 
PLACEMENT_SOURCE_T m_placementAreaSourceType
 
std::optional< int > GetLocalClearance() const override
 
void SetLocalClearance(std::optional< int > aClearance)
 
bool UnFill()
Removes the zone filling.
 
bool GetDoNotAllowVias() const
 
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...
 
void SetCornerRadius(unsigned int aRadius)
 
ZONE_FILL_MODE m_fillMode
 
const std::vector< SEG > & GetHatchLines() const
 
void SetPosition(const VECTOR2I &aPos) override
 
bool m_doNotAllowFootprints
 
void AddPolygon(std::vector< VECTOR2I > &aPolygon)
Add a polygon to the zone outline.
 
ZONE_LAYER_PROPERTIES & LayerProperties(PCB_LAYER_ID aLayer)
 
double m_hatchSmoothingValue
 
const std::shared_ptr< SHAPE_POLY_SET > & GetFilledPolysList(PCB_LAYER_ID aLayer) const
 
void SetLocalFlags(int aFlags)
 
void TransformSmoothedOutlineToPolygon(SHAPE_POLY_SET &aBuffer, 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,...
 
const std::optional< VECTOR2I > & HatchingOffset(PCB_LAYER_ID aLayer) const
 
void SetCornerSmoothingType(int aType)
 
int m_thermalReliefSpokeWidth
 
wxString GetPlacementAreaSource() const
 
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.
 
EDA_ANGLE m_hatchOrientation
 
void CacheTriangulation(PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
Create a list of triangles that "fill" the solid areas used for instance to draw these solid areas on...
 
void Mirror(const VECTOR2I &aMirrorRef, FLIP_DIRECTION aFlipDirection) override
Mirror the outlines relative to a given horizontal axis the layer is not changed.
 
std::map< PCB_LAYER_ID, std::set< int > > m_insulatedIslands
For each layer, a set of insulated islands that were not removed.
 
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
 
void HatchBorder()
Compute the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_bor...
 
std::map< PCB_LAYER_ID, std::shared_ptr< SHAPE_POLY_SET > > m_FilledPolysList
 
std::optional< int > GetLocalClearance(wxString *aSource) const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
 
void SetBorderDisplayStyle(ZONE_BORDER_DISPLAY_STYLE aBorderHatchStyle, int aBorderHatchPitch, bool aRebuilBorderdHatch)
Set all hatch parameters for the zone.
 
bool GetDoNotAllowPads() const
 
const BOX2I GetBoundingBox() const override
 
void SetMinThickness(int aMinThickness)
 
void SetPlacementAreaSource(const wxString &aSource)
 
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
 
double GetFilledArea()
This area is cached from the most recent call to CalculateFilledArea().
 
PLACEMENT_SOURCE_T GetPlacementAreaSourceType() const
 
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
 
wxString GetFriendlyName() const override
 
bool GetDoNotAllowTracks() const
 
int GetLocalFlags() const
 
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
 
void SetHatchOrientation(const EDA_ANGLE &aStep)
 
wxString GetClass() const override
 
void SetHatchSmoothingValue(double aValue)
 
bool m_needRefill
False when a zone was refilled, true after changes in zone params.
 
SHAPE_POLY_SET::ITERATOR IterateWithHoles()
Return an iterator to visit all points of the zone's main outline with holes.
 
std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > m_layerProperties
 
bool HitTestForCorner(const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
Test if the given VECTOR2I is near a corner.
 
void SetHatchSmoothingLevel(int aLevel)
 
bool IsConnected() const override
Not all ZONEs are really BOARD_CONNECTED_ITEMs....
 
void SetThermalReliefSpokeWidth(int aThermalReliefSpokeWidth)
 
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
 
void SetPlacementAreaSourceType(PLACEMENT_SOURCE_T aType)
 
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
 
ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
 
LSET m_fillFlags
Temp variables used while filling.
 
SHAPE_POLY_SET * Outline()
 
void SetHatchStyle(ZONE_BORDER_DISPLAY_STYLE aStyle)
 
void NewHole()
Create a new hole on the zone; i.e., a new contour on the zone's outline.
 
ZONE(BOARD_ITEM_CONTAINER *parent)
 
void SetFillFlag(PCB_LAYER_ID aLayer, bool aFlag)
 
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
 
void Move(const VECTOR2I &offset) override
Move the outlines.
 
bool IsIsland(PCB_LAYER_ID aLayer, int aPolyIdx) const
Check if a given filled polygon is an insulated island.
 
SHAPE_POLY_SET * m_Poly
Outline of the zone.
 
TEARDROP_TYPE m_teardropType
 
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.
 
long long int GetMinIslandArea() const
 
int m_hatchSmoothingLevel
 
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
 
SHAPE_POLY_SET * GetFill(PCB_LAYER_ID aLayer)
 
void SetIsRuleArea(bool aEnable)
 
std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > & LayerProperties()
 
void CopyFrom(const BOARD_ITEM *aOther) override
 
void SetDoNotAllowTracks(bool aEnable)
 
void SetFilledPolysList(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPolysList)
Set the list of filled polygons.
 
bool m_placementAreaEnabled
Placement rule area data.
 
const wxString & GetZoneName() const
 
void CacheBoundingBox()
Used to preload the zone bounding box cache so we don't have to worry about mutex-locking it each tim...
 
int GetMinThickness() const
 
virtual void swapData(BOARD_ITEM *aImage) override
 
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.
 
static bool ClassOf(const EDA_ITEM *aItem)
 
void RemoveCutout(int aOutlineIdx, int aHoleIdx)
Remove a cutout from the zone.
 
void Rotate(const VECTOR2I &aCentre, const EDA_ANGLE &aAngle) override
Rotate the outlines.
 
bool HigherPriority(const ZONE *aOther) const
 
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.
 
void SetIsFilled(bool isFilled)
 
void SetFillMode(ZONE_FILL_MODE aFillMode)
 
int GetFillFlag(PCB_LAYER_ID aLayer)
 
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
 
ZONE_CONNECTION GetPadConnection() const
 
void InitDataFromSrcInCopyCtor(const ZONE &aZone)
Copy aZone data to me.
 
bool HasFilledPolysForLayer(PCB_LAYER_ID aLayer) const
 
int GetHatchThickness() const
 
double GetHatchHoleMinArea() const
 
void SetLayerSet(const LSET &aLayerSet) override
 
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.
 
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
 
int m_hatchBorderAlgorithm
 
bool GetPlacementAreaEnabled() const
 
void SetDoNotAllowVias(bool aEnable)
 
bool IsTeardropArea() const
 
std::vector< SEG > m_borderHatchLines
 
VECTOR2I GetPosition() const override
 
int GetThermalReliefSpokeWidth() const
 
int GetBorderHatchPitch() const
HatchBorder related methods.
 
virtual void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
 
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle() const
 
void BuildHashValue(PCB_LAYER_ID aLayer)
Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash.
 
void SetThermalReliefGap(int aThermalReliefGap)
 
EDA_ANGLE GetHatchOrientation() const
 
bool BuildSmoothedPoly(SHAPE_POLY_SET &aSmoothedPoly, PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aBoardOutline, SHAPE_POLY_SET *aSmoothedPolyWithApron=nullptr) const
 
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
 
bool GetDoNotAllowFootprints() const
 
ZONE_FILL_MODE GetFillMode() const
 
double m_hatchHoleMinArea
 
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles() const
Return an iterator to visit all points of the zone's main outline with holes.
 
SHAPE_POLY_SET::ITERATOR Iterate()
Return an iterator to visit all points of the zone's main outline without holes.
 
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
 
void SetDoNotAllowFootprints(bool aEnable)
 
bool HasKeepoutParametersSet() const
Accessor to determine if any keepout parameters are set.
 
void SetBorderHatchPitch(int aPitch)
 
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...
 
void SetLayerSetAndRemoveUnusedFills(const LSET &aLayerSet)
Set the zone to be on the aLayerSet layers and only remove the fill polygons from the unused layers,...
 
double CalculateOutlineArea()
Compute the area of the zone outline (not the filled area).
 
std::mutex m_lock
Lock used for multi-threaded filling on multi-layer zones.
 
void SetHatchHoleMinArea(double aPct)
 
TEARDROP_TYPE GetTeardropAreaType() const
 
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
 
bool IsConflicting() const
For rule areas which exclude footprints (and therefore participate in courtyard conflicts during move...
 
bool m_doNotAllowZoneFills
 
ISLAND_REMOVAL_MODE m_islandRemovalMode
 
bool m_isFilled
True when a zone was filled, false after deleting the filled areas.
 
double GetHatchSmoothingValue() const
 
bool AppendCorner(VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
 
bool GetDoNotAllowZoneFills() const
 
void MoveEdge(const VECTOR2I &offset, int aEdge)
Move the outline Edge.
 
int GetHatchSmoothingLevel() const
 
unsigned int GetCornerRadius() const
 
int GetCornerSmoothingType() const
 
void SetIsIsland(PCB_LAYER_ID aLayer, int aPolyIdx)
 
bool IsOnCopperLayer() const override
 
double CalculateFilledArea()
Compute the area currently occupied by the zone fill.
 
void SetDoNotAllowZoneFills(bool aEnable)
 
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...
 
void SetAssignedPriority(unsigned aPriority)
 
unsigned int m_cornerRadius
 
void SetPadConnection(ZONE_CONNECTION aPadConnection)
 
void SetZoneName(const wxString &aName)
 
bool operator==(const ZONE &aOther) const
 
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...
 
void UnHatchBorder()
Clear the zone's hatch.
 
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
 
void SetOutline(SHAPE_POLY_SET *aOutline)
 
PCB_LAYER_ID GetFirstLayer() const
 
void SetMinIslandArea(long long int aArea)
 
virtual std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
 
HASH_128 GetHashValue(PCB_LAYER_ID aLayer)
 
ZONE_CONNECTION m_PadConnection
 
const std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > & LayerProperties() const
 
int GetThermalReliefGap() const
 
void RemoveAllContours(void)
 
void SetHatchGap(int aStep)
 
static int GetDefaultHatchPitch()
 
void SetPlacementAreaEnabled(bool aEnabled)
 
unsigned GetAssignedPriority() const
 
int GetNumCorners(void) const
Access to m_Poly parameters.
 
bool SameNet(const ZONE *aOther) const
 
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
 
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
 
long long int m_minIslandArea
When island removal mode is set to AREA, islands below this area will be removed.
 
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
 
@ DEFAULT
Flashing follows connectivity.
 
PCB_LAYER_ID
A quick note on layer IDs:
 
#define DECLARE_ENUM_TO_WXANY(type)
 
A storage class for 128-bit hash value.
 
A struct recording the isolated and single-pad islands within a zone.
 
std::vector< int > m_SingleConnectionOutlines
 
std::vector< int > m_IsolatedOutlines
 
Structure to hold the necessary information in order to index a vertex on a SHAPE_POLY_SET object: th...
 
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
 
VECTOR2< int32_t > VECTOR2I
 
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
 
ISLAND_REMOVAL_MODE
Whether or not to remove isolated islands from a zone.
 
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
 
ZONE_CONNECTION
How pads are covered by copper in zone.