132 bool Matches(
const wxFindReplaceData& aSearchData,
void* aAuxData )
const override 176 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
277 int globalIndex = -1;
298 throw( std::out_of_range(
"aCorner-th vertex does not exist" ) );
326 virtual std::shared_ptr<SHAPE>
336 bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
357 int* aHoleIdx =
nullptr )
const;
360 int* aHoleIdx =
nullptr )
const 383 int aError = ARC_HIGH_DEF )
const;
415 bool ignoreLineWidth =
false )
const override;
458 bool HitTestForEdge(
const wxPoint& refPos,
int aAccuracy )
const;
464 bool HitTest(
const EDA_RECT& aRect,
bool aContained =
true,
int aAccuracy = 0 )
const override;
480 void Move(
const wxPoint& offset )
override;
488 void MoveEdge(
const wxPoint& offset,
int aEdge );
496 void Rotate(
const wxPoint& aCentre,
double aAngle )
override;
504 virtual void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
512 void Mirror(
const wxPoint& aMirrorRef,
bool aMirrorLeftRight );
519 return wxT(
"ZONE" );
571 throw( std::out_of_range(
"aCornerIndex-th vertex does not exist" ) );
592 throw( std::out_of_range(
"aCornerIndex-th vertex does not exist" ) );
613 bool AppendCorner( wxPoint aPosition,
int aHoleIdx,
bool aAllowDuplication =
false );
711 void AddPolygon( std::vector< wxPoint >& aPolygon );
781 bool aRebuildHatch );
818 virtual void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
int TotalVertices() const
Delete aIdx-th polygon from the set.
int NewHole(int aOutline=-1)
Adds a new outline to the set and returns its index.
int GetNumCorners(void) const
Access to m_Poly parameters.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
ZONE_CONNECTION
How pads are covered by copper in zone.
ZONE_CONNECTION GetPadConnection() const
wxString GetNetClassName() const override
Returns the netclass of the zone.
void SetIslandRemovalMode(ISLAND_REMOVAL_MODE aRemove)
bool m_doNotAllowFootprints
void SetCornerRadius(unsigned int aRadius)
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
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 SetHatchThickness(int aThickness)
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
unsigned int m_cornerRadius
SHAPE_POLY_SET::ITERATOR IterateWithHoles()
Return an iterator to visit all points of the zone's main outline with holes.
bool HasFilledPolysForLayer(PCB_LAYER_ID aLayer) const
void RemoveCutout(int aOutlineIdx, int aHoleIdx)
Remove a cutout from the zone.
void SetZoneName(const wxString &aName)
bool GetDoNotAllowFootprints() const
void SetFillSegments(PCB_LAYER_ID aLayer, const std::vector< SEG > &aSegments)
void SetDoNotAllowTracks(bool aEnable)
void UnHatchBorder()
Clear the zone's hatch.
ZONE_FILL_MODE m_fillMode
How to fill areas:
int GetHatchThickness() const
unsigned GetPriority() const
NETCLASS * GetNetClass() const override
Return the NETCLASS for this item.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles() const
Return an iterator to visit all points of the zone's main outline with holes.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
int m_cornerSmoothingType
void SetHatchStyle(ZONE_BORDER_DISPLAY_STYLE aStyle)
void SetBorderDisplayStyle(ZONE_BORDER_DISPLAY_STYLE aHatchStyle, int aHatchPitch, bool aRebuildHatch)
Set all hatch parameters for the zone.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
int GetBorderHatchPitch() const
HatchBorder related methods.
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the aGlobalIndex-th vertex in the poly set.
int m_hatchSmoothingLevel
void SetLayerSet(LSET aLayerSet) override
ZONE_CONNECTION m_PadConnection
virtual NETCLASS * GetNetClass() const
Return the NETCLASS for this item.
SHAPE_POLY_SET * Outline()
bool GetDoNotAllowVias() const
long long int m_minIslandArea
When island removal mode is set to AREA, islands below this area will be removed.
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
const SHAPE_POLY_SET * Outline() const
double m_hatchOrientation
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
double GetHatchSmoothingValue() const
bool HitTestCutout(const wxPoint &aRefPos, int *aOutlineIdx=nullptr, int *aHoleIdx=nullptr) const
bool CommonLayerExists(const LSET aLayerSet) const
Test if this zone shares a common layer with the given layer set.
CONST_ITERATOR CIterateWithHoles(int aOutline) const
Structure to hold the necessary information in order to index a vertex on a SHAPE_POLY_SET object: th...
std::map< PCB_LAYER_ID, std::set< int > > m_insulatedIslands
For each layer, a set of insulated islands that were not removed.
bool BuildSmoothedPoly(SHAPE_POLY_SET &aSmoothedPoly, PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aBoardOutline, SHAPE_POLY_SET *aSmoothedPolyWithApron=nullptr) const
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
bool IsSame(const ZONE &aZoneToCompare)
Test if 2 zones are equivalent.
const SHAPE_POLY_SET & GetFilledPolysList(PCB_LAYER_ID aLayer) const
SHAPE_POLY_SET::ITERATOR Iterate()
Return an iterator to visit all points of the zone's main outline without holes.
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Return an object to iterate through the points of the polygons between aFirst and aLast.
void SetHV45(bool aConstrain)
The base class for create windows for drawing purpose.
MD5_HASH GetHashValue(PCB_LAYER_ID aLayer)
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.
void SetPriority(unsigned aPriority)
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
ZONE(BOARD_ITEM_CONTAINER *parent, bool aInFP=false)
The ctor to build ZONE, but compatible with FP_ZONE requirement.
void SetFillMode(ZONE_FILL_MODE aFillMode)
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy=0) const
Test if the given wxPoint is within the bounds of a filled area of this zone.
int GetFillVersion() const
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void SetCornerPosition(int aCornerIndex, const wxPoint &new_pos)
virtual wxString GetNetClassName() const
Returns the netclass of the zone.
ZONE_FILL_MODE GetFillMode() const
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a corner.
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
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.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
void SetIsRuleArea(bool aEnable)
EDA_RECT m_bboxCache
Temp variables used while filling.
int GetThermalReliefGap() const
int GetFillFlag(PCB_LAYER_ID aLayer)
void Rotate(const wxPoint &aCentre, double aAngle) override
Move the outlines.
void SetVertex(const VERTEX_INDEX &aIndex, const VECTOR2I &aPos)
Accessor function to set the position of a specific point.
void GetInteractingZones(PCB_LAYER_ID aLayer, std::vector< ZONE * > *aZones) const
Some intersecting zones, despite being on the same layer with the same net, cannot be merged due to o...
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.
std::map< PCB_LAYER_ID, bool > m_fillFlags
double GetHatchHoleMinArea() const
void SetHatchSmoothingValue(double aValue)
bool GetDoNotAllowPads() const
void MoveEdge(const wxPoint &offset, int aEdge)
Move the outline Edge.
bool GetDoNotAllowCopperPour() const
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
LSET is a set of PCB_LAYER_IDs.
void NewHole()
Create a new hole on the zone; i.e., a new contour on the zone's outline.
int GetLocalClearance() const
int GetMinThickness() const
const EDA_RECT GetBoundingBox() const override
const std::vector< SEG > & GetHatchLines() const
void SetHatchGap(int aStep)
int GetHatchSmoothingLevel() const
static int GetDefaultHatchPitch()
const EDA_RECT GetCachedBoundingBox() const
ONLY TO BE USED BY CLIENTS WHICH SET UP THE CACHE!
void SetDoNotAllowPads(bool aEnable)
void HatchBorder()
Compute the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_bor...
ITERATOR IterateWithHoles(int aOutline)
std::vector< SEG > & FillSegments(PCB_LAYER_ID aLayer)
Represent a set of closed polygons.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if a point is near an outline edge or a corner of this zone.
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
void SetOutline(SHAPE_POLY_SET *aOutline)
void SetSelectedCorner(int aCorner)
A collection of nets and the parameters used to route or test these nets.
void SetCornerSmoothingType(int aType)
int GetLocalFlags() const
bool GetDoNotAllowTracks() const
void InitDataFromSrcInCopyCtor(const ZONE &aZone)
Copy aZone data to me.
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
double GetFilledArea()
This area is cached from the most recent call to CalculateFilledArea().
ISLAND_REMOVAL_MODE m_islandRemovalMode
void SetDoNotAllowVias(bool aEnable)
Handle a list of polygons defining a copper zone.
class ZONE, a copper pour area
void SetMinThickness(int aMinThickness)
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle() const
void SetIsFilled(bool isFilled)
void TransformSolidAreasShapesToPolygon(PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer, int aError=ARC_HIGH_DEF) const
Convert solid areas full shapes to polygon set (the full shape is the polygon area with a thick outli...
void SetHatchHoleMinArea(double aPct)
std::map< PCB_LAYER_ID, MD5_HASH > m_filledPolysHash
A hash value used in zone filling calculations to see if the filled areas are up to date.
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Convert a global vertex index —i.e., a number that globally identifies a vertex in a concatenated lis...
std::mutex m_lock
Lock used for multi-threaded filling on multi-layer zones.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
void SetFilledPolysList(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPolysList)
Set the list of filled polygons.
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_RawPolysList
void BuildHashValue(PCB_LAYER_ID aLayer)
Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash.
void Move(const wxPoint &offset) override
Move the outlines.
std::map< PCB_LAYER_ID, std::vector< SEG > > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
double GetHatchOrientation() const
void SetHatchSmoothingLevel(int aLevel)
unsigned int GetCornerRadius() const
std::vector< SEG > m_borderHatchLines
void SetLocalFlags(int aFlags)
int GetHatchBorderAlgorithm() const
void SetIsIsland(PCB_LAYER_ID aLayer, int aPolyIdx)
const ISLAND_REMOVAL_MODE GetIslandRemovalMode() const
void RemoveAllContours(void)
void SetPadConnection(ZONE_CONNECTION aPadConnection)
const std::vector< SEG > & FillSegments(PCB_LAYER_ID aLayer) const
bool AppendCorner(wxPoint aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
void SetMinIslandArea(long long int aArea)
int m_hatchBorderAlgorithm
void SetPosition(const wxPoint &aPos) override
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a segment defined by 2 corners.
wxPoint GetPosition() const override
bool m_isFilled
True when a zone was filled, false after deleting the filled areas.
FP_ZONE & operator=(const FP_ZONE &aOther)
bool GetGlobalIndex(VERTEX_INDEX aRelativeIndices, int &aGlobalIdx) const
Compute the global index of a vertex from the relative indices of polygon, contour and vertex.
void SetHatchBorderAlgorithm(int aAlgo)
BITMAPS
A list of all bitmap identifiers.
Information pertinent to a Pcbnew printed circuit board.
void SetDoNotAllowCopperPour(bool aEnable)
bool IsIsland(PCB_LAYER_ID aLayer, int aPolyIdx) const
Check if a given filled polygon is an insulated island.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
PCB_LAYER_ID
A quick note on layer IDs:
ISLAND_REMOVAL_MODE
Whether or not to remove isolated islands from a zone.
void SetHatchPitch(int aPitch)
Set the hatch pitch parameter for the zone.
Base class for iterating over all vertices in a given SHAPE_POLY_SET.
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Handle the component boundary box.
FP_ZONE(BOARD_ITEM_CONTAINER *aParent)
The main frame for Pcbnew.
void Mirror(const wxPoint &aMirrorRef, bool aMirrorLeftRight)
Mirror the outlines relative to a given horizontal axis the layer is not changed.
bool IsOnCopperLayer() const override
void SetHatchOrientation(double aStep)
bool m_doNotAllowCopperPour
A base class for most all the KiCad significant classes used in schematics and boards.
void SetFillFlag(PCB_LAYER_ID aLayer, bool aFlag)
SHAPE_POLY_SET & RawPolysList(PCB_LAYER_ID aLayer)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
static bool ClassOf(const EDA_ITEM *aItem)
void SetFillVersion(int aVersion)
int GetSelectedCorner() const
void SetThermalReliefGap(int aThermalReliefGap)
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
void TransformSmoothedOutlineToPolygon(SHAPE_POLY_SET &aCornerBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc, SHAPE_POLY_SET *aBoardOutline) const
Convert the outlines shape to a polygon with no holes inflated (optional) by max( aClearanceValue,...
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
bool IsConnected() const override
Not all ZONEs are really BOARD_CONNECTED_ITEMs....
long long int GetMinIslandArea() const
void SetNeedRefill(bool aNeedRefill)
double m_hatchHoleMinArea
double CalculateFilledArea()
Compute the area currently occupied by the zone fill.
void SetLocalClearance(int aClearance)
bool m_needRefill
False when a zone was refilled, true after changes in zone params.
void AddPolygon(std::vector< wxPoint > &aPolygon)
Add a polygon to the zone outline.
int GetThermalReliefSpokeWidth() const
Abstract interface for BOARD_ITEMs capable of storing other items inside.
EDA_MSG_PANEL items for displaying messages.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
ZONE & operator=(const ZONE &aOther)
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void SetRawPolysList(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPolysList)
Set the list of filled polygons.
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the zone shape to a closed polygon Used in filling zones calculations Circles and arcs are ap...
bool UnFill()
Removes the zone filling.
wxString GetZoneName() const
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
double m_hatchSmoothingValue
wxString GetClass() const override
int GetCornerSmoothingType() const
A specialization of ZONE for use in footprints.
int m_thermalReliefSpokeWidth
KICAD_T Type() const
Returns the type of object.
void SetDoNotAllowFootprints(bool aEnable)
bool GetFilledPolysUseThickness() const
void SetThermalReliefSpokeWidth(int aThermalReliefSpokeWidth)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.