KiCad PCB EDA Suite
FP_ZONE Class Reference

A specialization of ZONE for use in footprints. More...

#include <zone.h>

Inheritance diagram for FP_ZONE:
ZONE BOARD_CONNECTED_ITEM BOARD_ITEM EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 FP_ZONE (BOARD_ITEM_CONTAINER *aParent)
 
 FP_ZONE (const FP_ZONE &aZone)
 
FP_ZONEoperator= (const FP_ZONE &aOther)
 
EDA_ITEMClone () const override
 Create a duplicate of this item with linked list members set to NULL. More...
 
double ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 Return the level of detail (LOD) of the item. More...
 
bool IsConnected () const override
 Not all ZONEs are really BOARD_CONNECTED_ITEMs.... More...
 
void InitDataFromSrcInCopyCtor (const ZONE &aZone)
 Copy aZone data to me. More...
 
bool IsConflicting () const
 For rule areas which exclude footprints (and therefore participate in courtyard conflicts during move). More...
 
VECTOR2I GetPosition () const override
 
void SetPosition (const VECTOR2I &aPos) override
 
void SetAssignedPriority (unsigned aPriority)
 
unsigned GetAssignedPriority () const
 
bool HigherPriority (const ZONE *aOther) const
 
bool SameNet (const ZONE *aOther) const
 
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. More...
 
wxString GetFriendlyName () const override
 
void SetLayerSet (LSET aLayerSet) override
 
virtual LSET GetLayerSet () const override
 Return a std::bitset of all layers on which the item physically resides. More...
 
wxString GetZoneName () const
 
void SetZoneName (const wxString &aName)
 
bool Matches (const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
 Compare the item against the search criteria in aSearchData. More...
 
const BOX2I GetBoundingBox () const override
 
void CacheBoundingBox ()
 Used to preload the zone bounding box cache so we don't have to worry about mutex-locking it each time. More...
 
int GetLocalClearance (wxString *aSource) const override
 Return any local clearances set in the "classic" (ie: pre-rule) system. More...
 
int GetLocalClearance () const
 
void SetLocalClearance (int aClearance)
 
bool IsOnCopperLayer () const override
 
virtual void SetLayer (PCB_LAYER_ID aLayer) override
 Set the layer this item is on. More...
 
virtual PCB_LAYER_ID GetLayer () const override
 Return the primary layer this item is on. More...
 
PCB_LAYER_ID GetFirstLayer () const
 
virtual bool IsOnLayer (PCB_LAYER_ID) const override
 Test to see if this object is on the given layer. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the all the layers within the VIEW the object is painted on. More...
 
void SetFillMode (ZONE_FILL_MODE aFillMode)
 
ZONE_FILL_MODE GetFillMode () const
 
void SetThermalReliefGap (int aThermalReliefGap)
 
int GetThermalReliefGap () const
 
int GetThermalReliefGap (PAD *aPad, wxString *aSource=nullptr) const
 
void SetThermalReliefSpokeWidth (int aThermalReliefSpokeWidth)
 
int GetThermalReliefSpokeWidth () const
 
double CalculateFilledArea ()
 Compute the area currently occupied by the zone fill. More...
 
double CalculateOutlineArea ()
 Compute the area of the zone outline (not the filled area). More...
 
double GetFilledArea ()
 This area is cached from the most recent call to CalculateFilledArea(). More...
 
double GetOutlineArea ()
 This area is cached from the most recent call to CalculateOutlineArea(). More...
 
std::mutex & GetLock ()
 
int GetFillFlag (PCB_LAYER_ID aLayer)
 
void SetFillFlag (PCB_LAYER_ID aLayer, bool aFlag)
 
bool IsFilled () const
 
void SetIsFilled (bool isFilled)
 
bool NeedRefill () const
 
void SetNeedRefill (bool aNeedRefill)
 
ZONE_CONNECTION GetPadConnection () const
 
void SetPadConnection (ZONE_CONNECTION aPadConnection)
 
int GetMinThickness () const
 
void SetMinThickness (int aMinThickness)
 
int GetHatchThickness () const
 
void SetHatchThickness (int aThickness)
 
int GetHatchGap () const
 
void SetHatchGap (int aStep)
 
EDA_ANGLE GetHatchOrientation () const
 
void SetHatchOrientation (const EDA_ANGLE &aStep)
 
int GetHatchSmoothingLevel () const
 
void SetHatchSmoothingLevel (int aLevel)
 
double GetHatchSmoothingValue () const
 
void SetHatchSmoothingValue (double aValue)
 
double GetHatchHoleMinArea () const
 
void SetHatchHoleMinArea (double aPct)
 
int GetHatchBorderAlgorithm () const
 
void SetHatchBorderAlgorithm (int aAlgo)
 
int GetSelectedCorner () const
 
void SetSelectedCorner (int aCorner)
 
int GetLocalFlags () const
 
void SetLocalFlags (int aFlags)
 
SHAPE_POLY_SETOutline ()
 
const SHAPE_POLY_SETOutline () const
 
void SetOutline (SHAPE_POLY_SET *aOutline)
 
virtual std::shared_ptr< SHAPEGetEffectiveShape (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. More...
 
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. More...
 
bool HitTest (const BOX2I &aRect, bool aContained=true, int aAccuracy=0) const override
 Test if aRect intersects this item. More...
 
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. More...
 
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. More...
 
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 other parameters such as fillet radius. More...
 
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 outline) Used in 3D view Arcs (ends of segments) are approximated by segments. More...
 
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, the zone clearance) (holes are linked to external outline by overlapping segments) Used in filling zones calculations Circles (vias) and arcs (ends of tracks) are approximated by segments. More...
 
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 approximated by segments. More...
 
bool HitTestForCorner (const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
 Test if the given VECTOR2I is near a corner. More...
 
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. More...
 
bool UnFill ()
 Removes the zone filling. More...
 
void Move (const VECTOR2I &offset) override
 Move the outlines. More...
 
void MoveEdge (const VECTOR2I &offset, int aEdge)
 Move the outline Edge. More...
 
void Rotate (const VECTOR2I &aCentre, const EDA_ANGLE &aAngle) override
 Rotate the outlines. More...
 
virtual void Flip (const VECTOR2I &aCentre, bool aFlipLeftRight) override
 Flip this object, i.e. More...
 
void Mirror (const VECTOR2I &aMirrorRef, bool aMirrorLeftRight)
 Mirror the outlines relative to a given horizontal axis the layer is not changed. More...
 
wxString GetClass () const override
 
int GetNumCorners (void) const
 Access to m_Poly parameters. More...
 
SHAPE_POLY_SET::ITERATOR Iterate ()
 Return an iterator to visit all points of the zone's main outline without holes. More...
 
SHAPE_POLY_SET::ITERATOR IterateWithHoles ()
 Return an iterator to visit all points of the zone's main outline with holes. More...
 
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles () const
 Return an iterator to visit all points of the zone's main outline with holes. More...
 
void RemoveAllContours (void)
 
const VECTOR2IGetCornerPosition (int aCornerIndex) const
 
void SetCornerPosition (int aCornerIndex, const VECTOR2I &new_pos)
 
void NewHole ()
 Create a new hole on the zone; i.e., a new contour on the zone's outline. More...
 
bool AppendCorner (VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplication=false)
 Add a new corner to the zone outline (to the main outline or a hole) More...
 
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle () const
 
void SetHatchStyle (ZONE_BORDER_DISPLAY_STYLE aStyle)
 
bool IsSame (const ZONE &aZoneToCompare)
 Test if 2 zones are equivalent. More...
 
bool HasFilledPolysForLayer (PCB_LAYER_ID aLayer) const
 
const std::shared_ptr< SHAPE_POLY_SET > & GetFilledPolysList (PCB_LAYER_ID aLayer) const
 
SHAPE_POLY_SETGetFill (PCB_LAYER_ID aLayer)
 
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 OpenGL. More...
 
void SetFilledPolysList (PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPolysList)
 Set the list of filled polygons. More...
 
bool IsIsland (PCB_LAYER_ID aLayer, int aPolyIdx) const
 Check if a given filled polygon is an insulated island. More...
 
void SetIsIsland (PCB_LAYER_ID aLayer, int aPolyIdx)
 
bool BuildSmoothedPoly (SHAPE_POLY_SET &aSmoothedPoly, PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aBoardOutline, SHAPE_POLY_SET *aSmoothedPolyWithApron=nullptr) const
 
void SetCornerSmoothingType (int aType)
 
int GetCornerSmoothingType () const
 
void SetCornerRadius (unsigned int aRadius)
 
unsigned int GetCornerRadius () const
 
void RemoveCutout (int aOutlineIdx, int aHoleIdx)
 Remove a cutout from the zone. More...
 
void AddPolygon (std::vector< VECTOR2I > &aPolygon)
 Add a polygon to the zone outline. More...
 
void AddPolygon (const SHAPE_LINE_CHAIN &aPolygon)
 
wxString GetSelectMenuText (UNITS_PROVIDER *aUnitsProvider) const override
 Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
BITMAPS GetMenuImage () const override
 Return a pointer to an image to be used in menus. More...
 
bool IsTeardropArea () 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 TEARDROP_TYPE::TD_NONE. More...
 
TEARDROP_TYPE GetTeardropAreaType () const
 
bool GetIsRuleArea () const
 Accessors to parameters used in Rule Area zones: More...
 
bool GetDoNotAllowCopperPour () const
 
bool GetDoNotAllowVias () const
 
bool GetDoNotAllowTracks () const
 
bool GetDoNotAllowPads () const
 
bool GetDoNotAllowFootprints () const
 
void SetIsRuleArea (bool aEnable)
 
void SetDoNotAllowCopperPour (bool aEnable)
 
void SetDoNotAllowVias (bool aEnable)
 
void SetDoNotAllowTracks (bool aEnable)
 
void SetDoNotAllowPads (bool aEnable)
 
void SetDoNotAllowFootprints (bool aEnable)
 
const ISLAND_REMOVAL_MODE GetIslandRemovalMode () const
 
void SetIslandRemovalMode (ISLAND_REMOVAL_MODE aRemove)
 
long long int GetMinIslandArea () const
 
void SetMinIslandArea (long long int aArea)
 
int GetBorderHatchPitch () const
 HatchBorder related methods. More...
 
void SetBorderDisplayStyle (ZONE_BORDER_DISPLAY_STYLE aBorderHatchStyle, int aBorderHatchPitch, bool aRebuilBorderdHatch)
 Set all hatch parameters for the zone. More...
 
void SetBorderHatchPitch (int aPitch)
 Set the hatch pitch parameter for the zone. More...
 
void UnHatchBorder ()
 Clear the zone's hatch. More...
 
void HatchBorder ()
 Compute the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_borderHatchLines. More...
 
const std::vector< SEG > & GetHatchLines () const
 
void BuildHashValue (PCB_LAYER_ID aLayer)
 Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash. More...
 
MD5_HASH GetHashValue (PCB_LAYER_ID aLayer)
 
NETINFO_ITEMGetNet () const
 Return #NET_INFO object for a given item. More...
 
void SetNet (NETINFO_ITEM *aNetInfo)
 Set a NET_INFO object for the item. More...
 
int GetNetCode () const
 
bool SetNetCode (int aNetCode, bool aNoAssert)
 Set net using a net code. More...
 
void SetNetCode (int aNetCode)
 
wxString GetNetname () const
 
wxString GetNetnameMsg () const
 
wxString GetShortNetname () const
 
virtual int GetOwnClearance (PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
 Return an item's "own" clearance in internal units. More...
 
virtual int GetLocalClearanceOverrides (wxString *aSource) const
 Return any local clearance overrides set in the "classic" (ie: pre-rule) system. More...
 
virtual NETCLASSGetEffectiveNetClass () const
 Return the NETCLASS for this item. More...
 
wxString GetNetClassName () const
 Returns the name of the effective netclass. More...
 
void SetLocalRatsnestVisible (bool aVisible)
 
bool GetLocalRatsnestVisible () const
 
void SetParentGroup (PCB_GROUP *aGroup)
 
PCB_GROUPGetParentGroup () const
 
int GetX () const
 
int GetY () const
 
virtual VECTOR2I GetCenter () const
 This defaults to the center of the bounding box if not overridden. More...
 
void SetX (int aX)
 
void SetY (int aY)
 
virtual bool HasHole () const
 
virtual bool IsTented () const
 
virtual std::shared_ptr< SHAPE_SEGMENTGetEffectiveHoleShape () const
 
BOARD_ITEM_CONTAINERGetParent () const
 
BOARD_ITEM_CONTAINERGetParentFootprint () const
 
virtual bool HasLineStroke () const
 Check if this item has line stoke properties. More...
 
virtual STROKE_PARAMS GetStroke () const
 
virtual void SetStroke (const STROKE_PARAMS &aStroke)
 
virtual BOARD_ITEMDuplicate () const
 Create a copy of this BOARD_ITEM. More...
 
void SwapItemData (BOARD_ITEM *aImage)
 Swap data between aItem and aImage. More...
 
virtual bool IsKnockout () const
 
virtual void SetIsKnockout (bool aKnockout)
 
virtual bool IsLocked () const
 
virtual void SetLocked (bool aLocked)
 
void DeleteStructure ()
 Delete this object after removing from its parent if it has one. More...
 
virtual const BOARDGetBoard () const
 Return the BOARD in which this BOARD_ITEM resides, or NULL if none. More...
 
virtual BOARDGetBoard ()
 
wxString GetLayerName () const
 Return the name of the PCB layer on which the item resides. More...
 
KICAD_T Type () const
 Returns the type of object. More...
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsResized () const
 
bool IsBrightened () const
 
bool IsRollover () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (EDA_ITEM_FLAGS type) const
 
void SetState (EDA_ITEM_FLAGS type, bool state)
 
EDA_ITEM_FLAGS GetStatus () const
 
void SetStatus (EDA_ITEM_FLAGS aStatus)
 
void SetFlags (EDA_ITEM_FLAGS aMask)
 
void ClearFlags (EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
EDA_ITEM_FLAGS GetFlags () const
 
bool HasFlag (EDA_ITEM_FLAGS aFlag) const
 
EDA_ITEM_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool RenderAsBitmap (double aWorldScale) const
 
void SetIsShownAsBitmap (bool aBitmap)
 
bool IsShownAsBitmap () const
 
virtual bool IsType (const std::vector< KICAD_T > &aScanTypes) const
 Check whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual const VECTOR2I GetFocusPosition () const
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual VECTOR2I GetSortPosition () const
 Return the coordinates that should be used for sorting this element visually compared to other elements. More...
 
virtual INSPECT_RESULT Visit (INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
 May be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
wxString GetTypeDesc () const
 Return a translated description of the type for this EDA_ITEM for display in user facing messages. More...
 
virtual bool Replace (const EDA_SEARCH_DATA &aSearchData, void *aAuxData=nullptr)
 Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Override this method in any derived object that supports test find and replace. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
std::optional< T > Get (const wxString &aProperty) const
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
static int GetDefaultHatchPitch ()
 
template<class T >
static INSPECT_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const EDA_SEARCH_DATA &aSearchData, wxString &aText)
 Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

Static Public Attributes

static VECTOR2I ZeroOffset
 A value of wxPoint(0,0) which can be passed to the Draw() functions. More...
 

Protected Member Functions

bool Matches (const wxString &aText, const EDA_SEARCH_DATA &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 
virtual void swapData (BOARD_ITEM *aImage) override
 
virtual wxString layerMaskDescribe () const
 Return a string (to be shown to the user) describing a layer mask. More...
 

Protected Attributes

SHAPE_POLY_SETm_Poly
 Outline of the zone. More...
 
int m_cornerSmoothingType
 
unsigned int m_cornerRadius
 
wxString m_zoneName
 An optional unique name for this zone, used for identifying it in DRC checking. More...
 
LSET m_layerSet
 
unsigned m_priority
 
bool m_isRuleArea
 
TEARDROP_TYPE m_teardropType
 
bool m_doNotAllowCopperPour
 
bool m_doNotAllowVias
 
bool m_doNotAllowTracks
 
bool m_doNotAllowPads
 
bool m_doNotAllowFootprints
 
ZONE_CONNECTION m_PadConnection
 
int m_ZoneClearance
 
int m_ZoneMinThickness
 
int m_fillVersion
 
ISLAND_REMOVAL_MODE m_islandRemovalMode
 
long long int m_minIslandArea
 When island removal mode is set to AREA, islands below this area will be removed. More...
 
bool m_isFilled
 True when a zone was filled, false after deleting the filled areas. More...
 
bool m_needRefill
 False when a zone was refilled, true after changes in zone params. More...
 
int m_thermalReliefGap
 
int m_thermalReliefSpokeWidth
 
ZONE_FILL_MODE m_fillMode
 How to fill areas: More...
 
int m_hatchThickness
 
int m_hatchGap
 
EDA_ANGLE m_hatchOrientation
 
int m_hatchSmoothingLevel
 
double m_hatchSmoothingValue
 
double m_hatchHoleMinArea
 
int m_hatchBorderAlgorithm
 
SHAPE_POLY_SET::VERTEX_INDEXm_CornerSelection
 The index of the corner being moved or nullptr if no corner is selected. More...
 
int m_localFlgs
 
std::map< PCB_LAYER_ID, std::shared_ptr< SHAPE_POLY_SET > > m_FilledPolysList
 
LSET m_fillFlags
 Temp variables used while filling. More...
 
std::map< PCB_LAYER_ID, MD5_HASHm_filledPolysHash
 A hash value used in zone filling calculations to see if the filled areas are up to date. More...
 
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
 
int m_borderHatchPitch
 
std::vector< SEGm_borderHatchLines
 
std::map< PCB_LAYER_ID, std::set< int > > m_insulatedIslands
 For each layer, a set of insulated islands that were not removed. More...
 
double m_area
 
double m_outlinearea
 
std::mutex m_lock
 Lock used for multi-threaded filling on multi-layer zones. More...
 
NETINFO_ITEMm_netinfo
 Store all information about the net that item belongs to. More...
 
PCB_LAYER_ID m_layer
 
bool m_isKnockout
 
bool m_isLocked
 
PCB_GROUPm_group
 
EDA_ITEM_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
EDA_ITEM_FLAGS m_flags
 

Private Attributes

bool m_localRatsnestVisible
 
KICAD_T m_structType
 Run time identification, keep private so it can never be changed after a ctor sets it. More...
 
VIEW_ITEM_DATA * m_viewPrivData
 

Detailed Description

A specialization of ZONE for use in footprints.

Definition at line 909 of file zone.h.

Constructor & Destructor Documentation

◆ FP_ZONE() [1/2]

FP_ZONE::FP_ZONE ( BOARD_ITEM_CONTAINER aParent)

Definition at line 1256 of file zone.cpp.

1256 :
1257 ZONE( aParent, true )
1258{
1259 // in a footprint, net classes are not managed.
1260 // so set the net to NETINFO_LIST::ORPHANED_ITEM
1261 SetNetCode( -1, true );
1262}
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
ZONE(BOARD_ITEM_CONTAINER *parent, bool aInFP=false)
The ctor to build ZONE, but compatible with FP_ZONE requirement.
Definition: zone.cpp:43

References BOARD_CONNECTED_ITEM::SetNetCode().

Referenced by Clone().

◆ FP_ZONE() [2/2]

FP_ZONE::FP_ZONE ( const FP_ZONE aZone)

Definition at line 1265 of file zone.cpp.

1265 :
1266 ZONE( aZone )
1267{
1269}
void InitDataFromSrcInCopyCtor(const ZONE &aZone)
Copy aZone data to me.
Definition: zone.cpp:99

References ZONE::InitDataFromSrcInCopyCtor().

Member Function Documentation

◆ AddPolygon() [1/2]

void ZONE::AddPolygon ( const SHAPE_LINE_CHAIN aPolygon)
inherited

Definition at line 726 of file zone.cpp.

727{
728 wxASSERT( aPolygon.IsClosed() );
729
730 // Add the outline as a new polygon in the polygon set
731 if( m_Poly->OutlineCount() == 0 )
732 m_Poly->AddOutline( aPolygon );
733 else
734 m_Poly->AddHole( aPolygon );
735
736 SetNeedRefill( true );
737}
bool IsClosed() const override
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new hole to the given outline (default: last) and returns its index.
int AddHole(const SHAPE_LINE_CHAIN &aHole, int aOutline=-1)
Return the area of this poly set.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
void SetNeedRefill(bool aNeedRefill)
Definition: zone.h:246
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: zone.h:789

References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::AddOutline(), SHAPE_LINE_CHAIN::IsClosed(), ZONE::m_Poly, SHAPE_POLY_SET::OutlineCount(), and ZONE::SetNeedRefill().

◆ AddPolygon() [2/2]

void ZONE::AddPolygon ( std::vector< VECTOR2I > &  aPolygon)
inherited

Add a polygon to the zone outline.

If the zone outline is empty, this is the main outline. Otherwise it is a hole inside the main outline.

Definition at line 740 of file zone.cpp.

741{
742 if( aPolygon.empty() )
743 return;
744
745 SHAPE_LINE_CHAIN outline;
746
747 // Create an outline and populate it with the points of aPolygon
748 for( const VECTOR2I& pt : aPolygon )
749 outline.Append( pt );
750
751 outline.SetClosed( true );
752
753 AddPolygon( outline );
754}
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
void AddPolygon(std::vector< VECTOR2I > &aPolygon)
Add a polygon to the zone outline.
Definition: zone.cpp:740

References ZONE::AddPolygon(), SHAPE_LINE_CHAIN::Append(), and SHAPE_LINE_CHAIN::SetClosed().

Referenced by ZONE::AddPolygon(), CADSTAR_PCB_ARCHIVE_LOADER::getZoneFromCadstarShape(), and EAGLE_PLUGIN::loadPolygon().

◆ AppendCorner()

bool ZONE::AppendCorner ( VECTOR2I  aPosition,
int  aHoleIdx,
bool  aAllowDuplication = false 
)
inherited

Add a new corner to the zone outline (to the main outline or a hole)

Parameters
aPositionis the position of the new corner.
aHoleIdxis the index of the hole (-1 for the main outline, >= 0 for hole).
aAllowDuplicationis a flag to indicate whether it is allowed to add this corner even if it is duplicated.
Returns
true if the corner was added, false if error (aHoleIdx > hole count -1)

Definition at line 757 of file zone.cpp.

758{
759 // Ensure the main outline exists:
760 if( m_Poly->OutlineCount() == 0 )
762
763 // If aHoleIdx >= 0, the corner musty be added to the hole, index aHoleIdx.
764 // (remember: the index of the first hole is 0)
765 // Return error if it does not exist.
766 if( aHoleIdx >= m_Poly->HoleCount( 0 ) )
767 return false;
768
769 m_Poly->Append( aPosition.x, aPosition.y, -1, aHoleIdx, aAllowDuplication );
770
771 SetNeedRefill( true );
772
773 return true;
774}
int HoleCount(int aOutline) const
Return the reference to aIndex-th outline in the set.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...
int NewOutline()
Creates a new hole in a given outline.

References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::HoleCount(), ZONE::m_Poly, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), ZONE::SetNeedRefill(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOARD::AddArea(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), ALTIUM_PCB::ConvertFills6ToBoardItemWithNet(), TEST_BOARD_ITEM_FIXTURE::Instantiate(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::packageCircle(), and EAGLE_PLUGIN::packageRectangle().

◆ BuildHashValue()

void ZONE::BuildHashValue ( PCB_LAYER_ID  aLayer)
inherited

Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash.

Used in zone filling calculations, to know if m_FilledPolysList is up to date.

Definition at line 393 of file zone.cpp.

394{
395 if( !m_FilledPolysList.count( aLayer ) )
397 else
398 m_filledPolysHash[aLayer] = m_FilledPolysList.at( aLayer )->GetHash();
399}
MD5_HASH GetHash() const
std::map< PCB_LAYER_ID, std::shared_ptr< SHAPE_POLY_SET > > m_FilledPolysList
Definition: zone.h:883
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.
Definition: zone.h:889
static SHAPE_POLY_SET g_nullPoly
Definition: zone.cpp:381

References g_nullPoly, SHAPE_POLY_SET::GetHash(), ZONE::m_filledPolysHash, and ZONE::m_FilledPolysList.

Referenced by ZONE_FILLER::Fill().

◆ BuildSmoothedPoly()

bool ZONE::BuildSmoothedPoly ( SHAPE_POLY_SET aSmoothedPoly,
PCB_LAYER_ID  aLayer,
SHAPE_POLY_SET aBoardOutline,
SHAPE_POLY_SET aSmoothedPolyWithApron = nullptr 
) const
inherited

Definition at line 1066 of file zone.cpp.

1069{
1070 if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations will not like it ...
1071 return false;
1072
1073 // Processing of arc shapes in zones is not yet supported because Clipper can't do boolean
1074 // operations on them. The poly outline must be converted to segments first.
1076 flattened.ClearArcs();
1077
1078 if( GetIsRuleArea() )
1079 {
1080 // We like keepouts just the way they are....
1081 aSmoothedPoly = flattened;
1082 return true;
1083 }
1084
1085 const BOARD* board = GetBoard();
1086 int maxError = ARC_HIGH_DEF;
1087 bool keepExternalFillets = false;
1090
1091 if( IsTeardropArea() )
1092 {
1093 // We use teardrop shapes with no smoothing; these shapes are already optimized
1094 smooth_requested = false;
1095 }
1096
1097 if( board )
1098 {
1100
1101 maxError = bds.m_MaxError;
1102 keepExternalFillets = bds.m_ZoneKeepExternalFillets;
1103 }
1104
1105 auto smooth = [&]( SHAPE_POLY_SET& aPoly )
1106 {
1107
1108 if( !smooth_requested )
1109 return;
1110
1111 switch( m_cornerSmoothingType )
1112 {
1114 aPoly = aPoly.Chamfer( (int) m_cornerRadius );
1115 break;
1116
1118 {
1119 aPoly = aPoly.Fillet( (int) m_cornerRadius, maxError );
1120 break;
1121 }
1122
1123 default:
1124 break;
1125 }
1126 };
1127
1128 SHAPE_POLY_SET* maxExtents = &flattened;
1129 SHAPE_POLY_SET withFillets;
1130
1131 aSmoothedPoly = flattened;
1132
1133 // Should external fillets (that is, those applied to concave corners) be kept? While it
1134 // seems safer to never have copper extend outside the zone outline, 5.1.x and prior did
1135 // indeed fill them so we leave the mode available.
1136 if( keepExternalFillets && smooth_requested )
1137 {
1138 withFillets = flattened;
1139 smooth( withFillets );
1140 withFillets.BooleanAdd( flattened, SHAPE_POLY_SET::PM_FAST );
1141 maxExtents = &withFillets;
1142 }
1143
1144 // We now add in the areas of any same-net, intersecting zones. This keeps us from smoothing
1145 // corners at an intersection (which often produces undesired divots between the intersecting
1146 // zones -- see #2752).
1147 //
1148 // After smoothing, we'll subtract back out everything outside of our zone.
1149 std::vector<ZONE*> sameNetCollidingZones;
1150 std::vector<ZONE*> otherNetIntersectingZones;
1151 GetInteractingZones( aLayer, &sameNetCollidingZones, &otherNetIntersectingZones );
1152
1153 for( ZONE* sameNetZone : sameNetCollidingZones )
1154 {
1155 BOX2I sameNetBoundingBox = sameNetZone->GetBoundingBox();
1156 SHAPE_POLY_SET sameNetPoly = sameNetZone->Outline()->CloneDropTriangulation();
1157
1158 sameNetPoly.ClearArcs();
1159
1160 // Of course there's always a wrinkle. The same-net intersecting zone *might* get knocked
1161 // out along the border by a higher-priority, different-net zone. #12797
1162 for( ZONE* otherNetZone : otherNetIntersectingZones )
1163 {
1164 if( otherNetZone->HigherPriority( sameNetZone )
1165 && otherNetZone->GetBoundingBox().Intersects( sameNetBoundingBox ) )
1166 {
1167 sameNetPoly.BooleanSubtract( *otherNetZone->Outline(), SHAPE_POLY_SET::PM_FAST );
1168 }
1169 }
1170
1171 aSmoothedPoly.BooleanAdd( sameNetPoly, SHAPE_POLY_SET::PM_FAST );
1172 }
1173
1174 if( aBoardOutline )
1175 aSmoothedPoly.BooleanIntersection( *aBoardOutline, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
1176
1177 smooth( aSmoothedPoly );
1178
1179 if( aSmoothedPolyWithApron )
1180 {
1181 SHAPE_POLY_SET poly = maxExtents->CloneDropTriangulation();
1182 poly.Inflate( m_ZoneMinThickness, 64 );
1183 *aSmoothedPolyWithApron = aSmoothedPoly;
1184 aSmoothedPolyWithApron->BooleanIntersection( poly, SHAPE_POLY_SET::PM_FAST );
1185 }
1186
1187 aSmoothedPoly.BooleanIntersection( *maxExtents, SHAPE_POLY_SET::PM_FAST );
1188
1189 return true;
1190}
constexpr int ARC_HIGH_DEF
Definition: base_units.h:121
Container for design settings for a BOARD object.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:43
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:643
Represent a set of closed polygons.
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset intersection For aFastMode meaning, see function booleanOp.
void ClearArcs()
Appends a vertex at the end of the given outline/hole (default: the last outline)
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset difference For aFastMode meaning, see function booleanOp.
void Inflate(int aAmount, int aCircleSegCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
Perform outline inflation/deflation.
void BooleanIntersection(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset union between a and b, store the result in it self For aFastMode meaning,...
SHAPE_LINE_CHAIN & Outline(int aIndex)
SHAPE_POLY_SET CloneDropTriangulation() const
Creates a new empty polygon in the set and returns its index.
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
int m_cornerSmoothingType
Definition: zone.h:790
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: zone.h:697
int m_ZoneMinThickness
Definition: zone.h:826
bool IsTeardropArea() const
Definition: zone.h:681
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:1031
unsigned int m_cornerRadius
Definition: zone.h:791
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: zone.h:490

References ARC_HIGH_DEF, SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::BooleanIntersection(), SHAPE_POLY_SET::BooleanSubtract(), SHAPE_POLY_SET::ClearArcs(), SHAPE_POLY_SET::CloneDropTriangulation(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), ZONE::GetInteractingZones(), ZONE::GetIsRuleArea(), ZONE::GetNumCorners(), SHAPE_POLY_SET::Inflate(), ZONE::IsTeardropArea(), ZONE::m_cornerRadius, ZONE::m_cornerSmoothingType, BOARD_DESIGN_SETTINGS::m_MaxError, ZONE::m_Poly, BOARD_DESIGN_SETTINGS::m_ZoneKeepExternalFillets, ZONE::m_ZoneMinThickness, SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, ZONE_SETTINGS::SMOOTHING_CHAMFER, and ZONE_SETTINGS::SMOOTHING_FILLET.

Referenced by ZONE_FILLER::fillSingleZone(), and ZONE::TransformSmoothedOutlineToPolygon().

◆ CacheBoundingBox()

void ZONE::CacheBoundingBox ( )
inherited

Used to preload the zone bounding box cache so we don't have to worry about mutex-locking it each time.

Definition at line 342 of file zone.cpp.

343{
344 BOARD* board = GetBoard();
345 std::unordered_map<const ZONE*, BOX2I>& cache = board->m_ZoneBBoxCache;
346
347 auto cacheIter = cache.find( this );
348
349 if( cacheIter == cache.end() )
350 {
351 std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
352 cache[ this ] = m_Poly->BBox();
353 }
354}
std::unordered_map< const ZONE *, BOX2I > m_ZoneBBoxCache
Definition: board.h:1147
std::mutex m_CachesMutex
Definition: board.h:1138
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.

References SHAPE_POLY_SET::BBox(), BOARD_ITEM::GetBoard(), BOARD::m_CachesMutex, ZONE::m_Poly, and BOARD::m_ZoneBBoxCache.

◆ CacheTriangulation()

void ZONE::CacheTriangulation ( PCB_LAYER_ID  aLayer = UNDEFINED_LAYER)
inherited

Create a list of triangles that "fill" the solid areas used for instance to draw these solid areas on OpenGL.

Definition at line 1002 of file zone.cpp.

1003{
1004 if( aLayer == UNDEFINED_LAYER )
1005 {
1006 for( auto& [ layer, poly ] : m_FilledPolysList )
1007 poly->CacheTriangulation();
1008
1009 m_Poly->CacheTriangulation( false );
1010 }
1011 else
1012 {
1013 if( m_FilledPolysList.count( aLayer ) )
1014 m_FilledPolysList[ aLayer ]->CacheTriangulation();
1015 }
1016}
void CacheTriangulation(bool aPartition=true, bool aSimplify=false)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
@ UNDEFINED_LAYER
Definition: layer_ids.h:60

References SHAPE_POLY_SET::CacheTriangulation(), ZONE::m_FilledPolysList, ZONE::m_Poly, and UNDEFINED_LAYER.

Referenced by DRC_TEST_PROVIDER_SOLDER_MASK::buildRTrees(), and ZONE_FILLER::Fill().

◆ CalculateFilledArea()

double ZONE::CalculateFilledArea ( )
inherited

Compute the area currently occupied by the zone fill.

Returns
the currently filled area

Definition at line 1193 of file zone.cpp.

1194{
1195 m_area = 0.0;
1196
1197 // Iterate over each outline polygon in the zone and then iterate over
1198 // each hole it has to compute the total area.
1199 for( std::pair<const PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>>& pair : m_FilledPolysList )
1200 {
1201 std::shared_ptr<SHAPE_POLY_SET>& poly = pair.second;
1202
1203 for( int i = 0; i < poly->OutlineCount(); i++ )
1204 {
1205 m_area += poly->Outline( i ).Area();
1206
1207 for( int j = 0; j < poly->HoleCount( i ); j++ )
1208 m_area -= poly->Hole( i, j ).Area();
1209 }
1210 }
1211
1212 return m_area;
1213}
double m_area
Definition: zone.h:898
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59

References ZONE::m_area, and ZONE::m_FilledPolysList.

Referenced by TEARDROP_MANAGER::createTeardrop(), and ZONE_FILLER::Fill().

◆ CalculateOutlineArea()

double ZONE::CalculateOutlineArea ( )
inherited

Compute the area of the zone outline (not the filled area).

Returns
the currently calculated area

Definition at line 1216 of file zone.cpp.

1217{
1219 return m_outlinearea;
1220}
double Area()
Count the number of arc shapes present.
double m_outlinearea
Definition: zone.h:899
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:401

References std::abs(), SHAPE_POLY_SET::Area(), ZONE::m_outlinearea, and ZONE::m_Poly.

◆ CIterateWithHoles()

SHAPE_POLY_SET::CONST_ITERATOR ZONE::CIterateWithHoles ( ) const
inlineinherited

Return an iterator to visit all points of the zone's main outline with holes.

Returns
an iterator to visit the zone vertices with holes.

Definition at line 520 of file zone.h.

521 {
522 return m_Poly->CIterateWithHoles();
523 }
CONST_ITERATOR CIterateWithHoles(int aOutline) const

References SHAPE_POLY_SET::CIterateWithHoles(), and ZONE::m_Poly.

◆ ClassOf()

static bool ZONE::ClassOf ( const EDA_ITEM aItem)
inlinestaticinherited

Definition at line 74 of file zone.h.

75 {
76 return aItem && aItem->Type() == PCB_ZONE_T;
77 }
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:112

References PCB_ZONE_T, and EDA_ITEM::Type().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 122 of file eda_item.h.

void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:143
#define BRIGHTENED
item is drawn with a bright contour

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by SCH_EDIT_FRAME::FocusOnItem(), PCB_BASE_FRAME::FocusOnItems(), EE_SELECTION_TOOL::unhighlight(), PL_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().

◆ ClearEditFlags()

◆ ClearFlags()

void EDA_ITEM::ClearFlags ( EDA_ITEM_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 143 of file eda_item.h.

143{ m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:500

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), FOOTPRINT::BuildCourtyardCaches(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SYMBOL_EDITOR_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), PCB_TOOL_BASE::doInteractiveItemPlacement(), KIGFX::SCH_PAINTER::draw(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::Init(), EE_COLLECTOR::Inspect(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::RecombinePad(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), DRC_TEST_PROVIDER_DISALLOW::Run(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetIsShownAsBitmap(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and EE_SELECTION_TOOL::unhighlight().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 155 of file eda_item.h.

156 {
158 }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
#define SELECTED_BY_DRAG
Item was algorithmically selected as a dragged item.
#define DO_NOT_DRAW
Used to disable draw function.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
#define CANDIDATE
flag indicating that the structure is connected

References CANDIDATE, EDA_ITEM::ClearFlags(), DO_NOT_DRAW, IS_LINKED, SELECTED_BY_DRAG, and SKIP_STRUCT.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles(), and SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 143 of file view_item.h.

144 {
145 m_viewPrivData = nullptr;
146 }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:151

References KIGFX::VIEW_ITEM::m_viewPrivData.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Clone()

EDA_ITEM * FP_ZONE::Clone ( ) const
overridevirtual

Create a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented from ZONE.

Definition at line 1279 of file zone.cpp.

1280{
1281 return new FP_ZONE( *this );
1282}
FP_ZONE(BOARD_ITEM_CONTAINER *aParent)
Definition: zone.cpp:1256

References FP_ZONE().

◆ DeleteStructure()

void BOARD_ITEM::DeleteStructure ( )
inherited

Delete this object after removing from its parent if it has one.

Definition at line 150 of file board_item.cpp.

151{
153
154 if( parent )
155 parent->Remove( this );
156
157 delete this;
158}
Abstract interface for BOARD_ITEMs capable of storing other items inside.
virtual void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL)=0
Removes an item from the container.
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:163

References BOARD_ITEM::GetParent(), and BOARD_ITEM_CONTAINER::Remove().

Referenced by DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow().

◆ Duplicate()

BOARD_ITEM * BOARD_ITEM::Duplicate ( ) const
virtualinherited

Create a copy of this BOARD_ITEM.

Reimplemented in FOOTPRINT.

Definition at line 184 of file board_item.cpp.

185{
186 BOARD_ITEM* dupe = static_cast<BOARD_ITEM*>( Clone() );
187 const_cast<KIID&>( dupe->m_Uuid ) = KIID();
188
189 if( dupe->GetParentGroup() )
190 dupe->GetParentGroup()->AddItem( dupe );
191
192 return static_cast<BOARD_ITEM*>( dupe );
193}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:58
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:72
const KIID m_Uuid
Definition: eda_item.h:494
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:82
Definition: kiid.h:48
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Definition: pcb_group.cpp:80

References PCB_GROUP::AddItem(), EDA_ITEM::Clone(), BOARD_ITEM::GetParentGroup(), and EDA_ITEM::m_Uuid.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), PCB_GROUP::DeepDuplicate(), KIGFX::PCB_PAINTER::draw(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), FOOTPRINT::Duplicate(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), and ARRAY_CREATOR::Invoke().

◆ Flip()

void ZONE::Flip ( const VECTOR2I aCentre,
bool  aFlipLeftRight 
)
overridevirtualinherited

Flip this object, i.e.

change the board side for this object (like Mirror() but changes layer).

Parameters
aCentreis the rotation point.

Reimplemented from BOARD_ITEM.

Definition at line 692 of file zone.cpp.

693{
694 Mirror( aCentre, aFlipLeftRight );
695
696 SetLayerSet( FlipLayerMask( GetLayerSet(), GetBoard()->GetCopperLayerCount() ) );
697}
void Mirror(const VECTOR2I &aMirrorRef, bool aMirrorLeftRight)
Mirror the outlines relative to a given horizontal axis the layer is not changed.
Definition: zone.cpp:700
void SetLayerSet(LSET aLayerSet) override
Definition: zone.cpp:263
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: zone.h:122
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint.
Definition: lset.cpp:590

References FlipLayerMask(), BOARD_ITEM::GetBoard(), ZONE::GetLayerSet(), ZONE::Mirror(), and ZONE::SetLayerSet().

◆ Get() [1/3]

template<typename T >
std::optional< T > INSPECTABLE::Get ( const wxString &  aProperty) const
inlineinherited

Definition at line 104 of file inspectable.h.

105 {
107 TYPE_ID thisType = TYPE_HASH( *this );
108 PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
109 std::optional<T> ret;
110
111 if( prop )
112 {
113 const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114
115 if( object )
116 ret = prop->get<T>( object );
117 }
118
119 return ret;
120 }
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.
T get(const void *aObject) const
Definition: property.h:294
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:67
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:69
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
#define TYPE_HASH(x)
Definition: property.h:61
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:44

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [2/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 84 of file inspectable.h.

85 {
87 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
88 return object ? aProperty->getter( object ) : wxAny();
89 }
virtual wxAny getter(const void *aObject) const =0

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by BOOST_AUTO_TEST_CASE(), CLASS_D_DESC::CLASS_D_DESC(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [3/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 92 of file inspectable.h.

93 {
95 const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
96
97 if( !object )
98 throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" );
99
100 return aProperty->get<T>( object );
101 }

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetAssignedPriority()

◆ GetBoard() [1/2]

BOARD * BOARD_ITEM::GetBoard ( )
virtualinherited

Definition at line 57 of file board_item.cpp.

58{
59 if( Type() == PCB_T )
60 return static_cast<BOARD*>( this );
61
62 BOARD_ITEM* parent = GetParent();
63
64 if( parent )
65 return parent->GetBoard();
66
67 return nullptr;
68}
@ PCB_T
Definition: typeinfo.h:82

References BOARD_ITEM::GetBoard(), BOARD_ITEM::GetParent(), PCB_T, and EDA_ITEM::Type().

◆ GetBoard() [2/2]

const BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

Return the BOARD in which this BOARD_ITEM resides, or NULL if none.

Definition at line 43 of file board_item.cpp.

44{
45 if( Type() == PCB_T )
46 return static_cast<const BOARD*>( this );
47
48 BOARD_ITEM* parent = GetParent();
49
50 if( parent )
51 return parent->GetBoard();
52
53 return nullptr;
54}

References BOARD_ITEM::GetBoard(), BOARD_ITEM::GetParent(), PCB_T, and EDA_ITEM::Type().

Referenced by BOARD_ADAPTER::addShape(), FOOTPRINT::BuildCourtyardCaches(), PAD::BuildEffectivePolygon(), PAD::BuildEffectiveShapes(), ZONE::BuildSmoothedPoly(), ZONE::CacheBoundingBox(), collidesWithArea(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), enclosedByAreaFunc(), existsOnLayerFunc(), PAD::FlashLayer(), PCB_VIA::FlashLayer(), FP_SHAPE::Flip(), FP_TEXT::Flip(), FP_TEXTBOX::Flip(), PCB_DIMENSION_BASE::Flip(), PCB_SHAPE::Flip(), PCB_TARGET::Flip(), PCB_TEXT::Flip(), PCB_TEXTBOX::Flip(), PCB_TRACK::Flip(), PCB_ARC::Flip(), PCB_VIA::Flip(), ZONE::Flip(), PCB_PLUGIN::format(), fromToFunc(), BOARD_ITEM::GetBoard(), PCB_EXPR_CONTEXT::GetBoard(), NETINFO_ITEM::GetBoundingBox(), ZONE::GetBoundingBox(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), FOOTPRINT::GetCourtyard(), BOARD_CONNECTED_ITEM::GetEffectiveNetClass(), getFieldFunc(), ZONE::GetInteractingZones(), BOARD_ITEM::GetLayerName(), PCB_VIA::GetMinAnnulus(), NETINFO_ITEM::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), BOARD_CONNECTED_ITEM::GetOwnClearance(), PAD::GetOwnClearance(), ZONE::GetSelectMenuText(), PCB_MARKER::GetSeverity(), FP_TEXT::GetShownText(), FP_TEXTBOX::GetShownText(), PAD::GetSolderMaskExpansion(), PCB_VIA::GetSolderMaskExpansion(), PAD::GetSolderPasteMargin(), BOARD::GetTrackLength(), PCB_TRACK::GetWidthConstraint(), inDiffPairFunc(), ROUTER_TOOL::Init(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), BOARD_ITEM::IsLocked(), PCB_VIA::IsTented(), BOARD_ITEM::layerMaskDescribe(), PCB_VIA::layerMaskDescribe(), PAD::MergePrimitivesAsPolygon(), ZONE::Move(), DIALOG_TEXTBOX_PROPERTIES::onBorderChecked(), EAGLE_PLUGIN::packageWire(), padsNeedUpdate(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), BOARD::ResolveDRCExclusions(), FOOTPRINT::ResolveTextVar(), BOARD_CONNECTED_ITEM::SetNetCode(), TEARDROP_DIALOG::TEARDROP_DIALOG(), DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), ZONE::TransformSmoothedOutlineToPolygon(), BOARD::UpdateRatsnestExclusions(), FOOTPRINT::ViewBBox(), PAD::ViewBBox(), PCB_TRACK::ViewBBox(), PAD::ViewGetLOD(), PCB_BITMAP::ViewGetLOD(), and PCB_VIA::ViewGetLOD().

◆ GetBorderHatchPitch()

int ZONE::GetBorderHatchPitch ( ) const
inherited

HatchBorder related methods.

Returns
the zone hatch pitch in iu.

Definition at line 811 of file zone.cpp.

812{
813 return m_borderHatchPitch;
814}
int m_borderHatchPitch
Definition: zone.h:892

References ZONE::m_borderHatchPitch.

Referenced by PCB_PLUGIN::format(), and ZONE_SETTINGS::operator<<().

◆ GetBoundingBox()

const BOX2I ZONE::GetBoundingBox ( ) const
overridevirtualinherited
Returns
the bounding box of the zone outline.

Reimplemented from EDA_ITEM.

Definition at line 320 of file zone.cpp.

321{
322 if( const BOARD* board = GetBoard() )
323 {
324 std::unordered_map<const ZONE*, BOX2I>& cache = board->m_ZoneBBoxCache;
325 auto cacheIter = cache.find( this );
326
327 if( cacheIter != cache.end() )
328 return cacheIter->second;
329
330 BOX2I bbox = m_Poly->BBox();
331
332 std::unique_lock<std::mutex> cacheLock( const_cast<BOARD*>( board )->m_CachesMutex );
333 cache[ this ] = bbox;
334
335 return bbox;
336 }
337
338 return m_Poly->BBox();
339}

References SHAPE_POLY_SET::BBox(), BOARD_ITEM::GetBoard(), and ZONE::m_Poly.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), ZONE_FILLER::buildCopperItemClearances(), ZONE_FILLER::buildThermalSpokes(), collidesWithArea(), ZONE_FILLER::Fill(), ZONE_FILLER::fillNonCopperZone(), ZONE::GetInteractingZones(), ZONE::HitTest(), ZONE_FILLER::knockoutThermalReliefs(), ALTIUM_PCB::ParsePolygons6Data(), DRC_TEST_PROVIDER_DISALLOW::Run(), ZONE_FILLER::subtractHigherPriorityZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), and DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer().

◆ GetCenter()

virtual VECTOR2I BOARD_ITEM::GetCenter ( ) const
inlinevirtualinherited

This defaults to the center of the bounding box if not overridden.

Returns
center point of the item

Reimplemented in PAD, PCB_MARKER, PCB_SHAPE, and PCB_ARC.

Definition at line 93 of file board_item.h.

94 {
95 return GetBoundingBox().GetCenter();
96 }
const Vec GetCenter() const
Definition: box2.h:195
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:74

References EDA_ITEM::GetBoundingBox(), and BOX2< Vec >::GetCenter().

Referenced by PCB_GRID_HELPER::computeAnchors(), PCB_SELECTION_TOOL::FindItem(), and ALTIUM_PCB::HelperParseDimensions6Radial().

◆ GetClass()

wxString ZONE::GetClass ( ) const
inlineoverridevirtualinherited
Returns
the class name.

Implements EDA_ITEM.

Definition at line 482 of file zone.h.

483 {
484 return wxT( "ZONE" );
485 }

◆ GetCornerPosition()

const VECTOR2I & ZONE::GetCornerPosition ( int  aCornerIndex) const
inlineinherited

Definition at line 530 of file zone.h.

531 {
533
534 // Convert global to relative indices
535 if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
536 throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
537
538 return m_Poly->CVertex( index );
539 }
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...
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the aGlobalIndex-th vertex in the poly set.
Structure to hold the necessary information in order to index a vertex on a SHAPE_POLY_SET object: th...

References SHAPE_POLY_SET::CVertex(), SHAPE_POLY_SET::GetRelativeIndices(), and ZONE::m_Poly.

Referenced by ZONE::GetPosition().

◆ GetCornerRadius()

unsigned int ZONE::GetCornerRadius ( ) const
inlineinherited

Definition at line 652 of file zone.h.

652{ return m_cornerRadius; }

References ZONE::m_cornerRadius.

Referenced by KI_TEST::CheckFpZone(), PCB_PLUGIN::format(), ZONE_SETTINGS::operator<<(), and zonesNeedUpdate().

◆ GetCornerSmoothingType()

int ZONE::GetCornerSmoothingType ( ) const
inlineinherited

◆ GetDefaultHatchPitch()

◆ GetDoNotAllowCopperPour()

bool ZONE::GetDoNotAllowCopperPour ( ) const
inlineinherited

◆ GetDoNotAllowFootprints()

bool ZONE::GetDoNotAllowFootprints ( ) const
inlineinherited

◆ GetDoNotAllowPads()

bool ZONE::GetDoNotAllowPads ( ) const
inlineinherited

◆ GetDoNotAllowTracks()

bool ZONE::GetDoNotAllowTracks ( ) const
inlineinherited

◆ GetDoNotAllowVias()

bool ZONE::GetDoNotAllowVias ( ) const
inlineinherited

◆ GetEditFlags()

EDA_ITEM_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 147 of file eda_item.h.

148 {
149 constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_RESIZING | IS_DRAGGING
151
152 return m_flags & mask;
153 }
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_CHANGED
Item was edited, and modified.
#define IS_NEW
New item, just created.
#define IS_DRAGGING
Item being dragged.
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
#define STRUCT_DELETED
flag indication structures to be erased
#define IS_MOVING
Item being moved.
#define IS_RESIZING
Item being resized.

References IS_CHANGED, IS_DRAGGING, IS_MOVING, IS_NEW, IS_PASTED, IS_RESIZING, IS_WIRE_IMAGE, EDA_ITEM::m_flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_SYMBOL::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_IMAGE_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow().

◆ GetEffectiveHoleShape()

std::shared_ptr< SHAPE_SEGMENT > BOARD_ITEM::GetEffectiveHoleShape ( ) const
virtualinherited

Reimplemented in PAD, and PCB_VIA.

Definition at line 229 of file board_item.cpp.

230{
231 static std::shared_ptr<SHAPE_SEGMENT> slot;
232
234
235 return slot;
236}
virtual wxString GetClass() const =0
Return the class name.
#define UNIMPLEMENTED_FOR(type)
Definition: macros.h:120

References EDA_ITEM::GetClass(), and UNIMPLEMENTED_FOR.

Referenced by collidesWithArea(), DRAWING_TOOL::DrawVia(), DRC_RTREE::Insert(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), and PCB_CONTROL::UpdateMessagePanel().

◆ GetEffectiveNetClass()

NETCLASS * BOARD_CONNECTED_ITEM::GetEffectiveNetClass ( ) const
virtualinherited

Return the NETCLASS for this item.

Note
Do not return a std::shared_ptr from this. It is used heavily in DRC, and the std::shared_ptr stuff shows up large in performance profiling.

Definition at line 97 of file board_connected_item.cpp.

98{
100 return m_netinfo->GetNetClass();
101 else
102 return GetBoard()->GetDesignSettings().m_NetSettings->m_DefaultNetClass.get();
103}
NETINFO_ITEM * m_netinfo
Store all information about the net that item belongs to.
std::shared_ptr< NET_SETTINGS > m_NetSettings
NETCLASS * GetNetClass()
Definition: netinfo.h:111

References BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), NETINFO_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::m_netinfo, and BOARD_DESIGN_SETTINGS::m_NetSettings.

Referenced by PCB_VIA::GetDrillValue(), BOARD_INSPECTION_TOOL::getItemDescription(), PAD::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetClassName(), PCB_EXPR_NETCLASS_REF::GetValue(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ GetEffectiveShape()

std::shared_ptr< SHAPE > ZONE::GetEffectiveShape ( PCB_LAYER_ID  aLayer = UNDEFINED_LAYER,
FLASHING  aFlash = FLASHING::DEFAULT 
) const
overridevirtualinherited

Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.

This routine returns a COMPOUND shape (set of simple shapes which make up the pad for use with routing, collision determination, etc).

Note
This list can contain a SHAPE_SIMPLE (a simple single-outline non-intersecting polygon), but should never contain a SHAPE_POLY_SET (a complex polygon consisting of multiple outlines and/or holes).
Parameters
aLayerin case of items spanning multiple layers, only the shapes belonging to aLayer will be returned. Pass UNDEFINED_LAYER to return shapes for all layers.
aFlashoptional parameter allowing a caller to force the pad to be flashed (or not flashed) on the current layer (default is to honour the pad's setting and the current connections for the given layer).

Reimplemented from BOARD_ITEM.

Definition at line 1309 of file zone.cpp.

1310{
1311 if( m_FilledPolysList.find( aLayer ) == m_FilledPolysList.end() )
1312 return std::make_shared<SHAPE_NULL>();
1313 else
1314 return m_FilledPolysList.at( aLayer );
1315}

References ZONE::m_FilledPolysList.

◆ GetFill()

◆ GetFilledArea()

double ZONE::GetFilledArea ( )
inlineinherited

This area is cached from the most recent call to CalculateFilledArea().

Returns
the filled area

Definition at line 215 of file zone.h.

216 {
217 return m_area;
218 }

References ZONE::m_area.

◆ GetFilledPolysList()

◆ GetFillFlag()

int ZONE::GetFillFlag ( PCB_LAYER_ID  aLayer)
inlineinherited

Definition at line 235 of file zone.h.

236 {
237 return m_fillFlags.test( aLayer );
238 }
LSET m_fillFlags
Temp variables used while filling.
Definition: zone.h:886

References ZONE::m_fillFlags.

◆ GetFillMode()

ZONE_FILL_MODE ZONE::GetFillMode ( ) const
inlineinherited

Definition at line 174 of file zone.h.

174{ return m_fillMode; }
ZONE_FILL_MODE m_fillMode
How to fill areas:
Definition: zone.h:857

References ZONE::m_fillMode.

Referenced by KI_TEST::CheckFpZone(), ZONE_FILLER::fillCopperZone(), ZONE_FILLER::fillNonCopperZone(), PCB_PLUGIN::format(), ZONE::IsSame(), ZONE_SETTINGS::operator<<(), and zonesNeedUpdate().

◆ GetFirstLayer()

PCB_LAYER_ID ZONE::GetFirstLayer ( ) const
inherited

◆ GetFlags()

◆ GetFocusPosition()

virtual const VECTOR2I EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in BOARD, PCB_SHAPE, and PCB_TRACK.

Definition at line 258 of file eda_item.h.

258{ return GetPosition(); }
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:251

References EDA_ITEM::GetPosition().

Referenced by SCH_EDIT_FRAME::FocusOnItem().

◆ GetFriendlyName()

wxString ZONE::GetFriendlyName ( ) const
overridevirtualinherited

Reimplemented from EDA_ITEM.

Definition at line 653 of file zone.cpp.

654{
655 if( GetIsRuleArea() )
656 return _( "Rule Area" );
657 else if( IsTeardropArea() )
658 return _( "Teardrop Area" );
659 else if( IsOnCopperLayer() )
660 return _( "Copper Zone" );
661 else
662 return _( "Non-copper Zone" );
663}
bool IsOnCopperLayer() const override
Definition: zone.cpp:251
#define _(s)

References _, ZONE::GetIsRuleArea(), ZONE::IsOnCopperLayer(), and ZONE::IsTeardropArea().

Referenced by ZONE::GetMsgPanelInfo().

◆ GetHashValue()

MD5_HASH ZONE::GetHashValue ( PCB_LAYER_ID  aLayer)
inherited
Returns
the hash value previously calculated by BuildHashValue().

Definition at line 384 of file zone.cpp.

385{
386 if( !m_filledPolysHash.count( aLayer ) )
387 return g_nullPoly.GetHash();
388 else
389 return m_filledPolysHash.at( aLayer );
390}

References g_nullPoly, SHAPE_POLY_SET::GetHash(), and ZONE::m_filledPolysHash.

Referenced by ZONE_FILLER::Fill().

◆ GetHatchBorderAlgorithm()

int ZONE::GetHatchBorderAlgorithm ( ) const
inlineinherited

◆ GetHatchGap()

int ZONE::GetHatchGap ( ) const
inlineinherited

◆ GetHatchHoleMinArea()

double ZONE::GetHatchHoleMinArea ( ) const
inlineinherited

◆ GetHatchLines()

const std::vector< SEG > & ZONE::GetHatchLines ( ) const
inlineinherited

Definition at line 761 of file zone.h.

761{ return m_borderHatchLines; }
std::vector< SEG > m_borderHatchLines
Definition: zone.h:893

References ZONE::m_borderHatchLines.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ GetHatchOrientation()

EDA_ANGLE ZONE::GetHatchOrientation ( ) const
inlineinherited

◆ GetHatchSmoothingLevel()

int ZONE::GetHatchSmoothingLevel ( ) const
inlineinherited

◆ GetHatchSmoothingValue()

double ZONE::GetHatchSmoothingValue ( ) const
inlineinherited

◆ GetHatchStyle()

ZONE_BORDER_DISPLAY_STYLE ZONE::GetHatchStyle ( ) const
inlineinherited

Definition at line 580 of file zone.h.

580{ return m_borderStyle; }
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
Definition: zone.h:891

References ZONE::m_borderStyle.

Referenced by PCB_PLUGIN::format(), and ZONE_SETTINGS::operator<<().

◆ GetHatchThickness()

int ZONE::GetHatchThickness ( ) const
inlineinherited

◆ GetInteractingZones()

void ZONE::GetInteractingZones ( PCB_LAYER_ID  aLayer,
std::vector< ZONE * > *  aSameNetCollidingZones,
std::vector< ZONE * > *  aOtherNetIntersectingZones 
) const
inherited

Some intersecting zones, despite being on the same layer with the same net, cannot be merged due to other parameters such as fillet radius.

The copper pour will end up effectively merged though, so we need to do some calculations with them in mind.

Definition at line 1031 of file zone.cpp.

1033{
1034 int epsilon = pcbIUScale.mmToIU( 0.001 );
1035 BOX2I bbox = GetBoundingBox();
1036
1037 bbox.Inflate( epsilon );
1038
1039 for( ZONE* candidate : GetBoard()->Zones() )
1040 {
1041 if( candidate == this )
1042 continue;
1043
1044 if( !candidate->GetLayerSet().test( aLayer ) )
1045 continue;
1046
1047 if( candidate->GetIsRuleArea() || candidate->IsTeardropArea() )
1048 continue;
1049
1050 if( !candidate->GetBoundingBox().Intersects( bbox ) )
1051 continue;
1052
1053 if( candidate->GetNetCode() == GetNetCode() )
1054 {
1055 if( m_Poly->Collide( candidate->m_Poly ) )
1056 aSameNetCollidingZones->push_back( candidate );
1057 }
1058 else
1059 {
1060 aOtherNetIntersectingZones->push_back( candidate );
1061 }
1062 }
1063}
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:506
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
const BOX2I GetBoundingBox() const override
Definition: zone.cpp:320
constexpr int mmToIU(double mm) const
Definition: base_units.h:89

References SHAPE_POLY_SET::Collide(), BOARD_ITEM::GetBoard(), ZONE::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetNetCode(), BOX2< Vec >::Inflate(), ZONE::m_Poly, EDA_IU_SCALE::mmToIU(), and pcbIUScale.

Referenced by ZONE::BuildSmoothedPoly().

◆ GetIslandRemovalMode()

const ISLAND_REMOVAL_MODE ZONE::GetIslandRemovalMode ( ) const
inlineinherited

Definition at line 711 of file zone.h.

711{ return m_islandRemovalMode; }
ISLAND_REMOVAL_MODE m_islandRemovalMode
Definition: zone.h:829

References ZONE::m_islandRemovalMode.

Referenced by KI_TEST::CheckFpZone(), ZONE_FILLER::Fill(), PCB_PLUGIN::format(), ZONE_SETTINGS::operator<<(), and zonesNeedUpdate().

◆ GetIsRuleArea()

◆ GetLayer()

PCB_LAYER_ID ZONE::GetLayer ( ) const
overridevirtualinherited

Return the primary layer this item is on.

Reimplemented from BOARD_ITEM.

Definition at line 236 of file zone.cpp.

237{
238 return BOARD_ITEM::GetLayer();
239}
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:180

References BOARD_ITEM::GetLayer().

Referenced by DRAWING_TOOL::DrawZone(), ZONE_DESC::ZONE_DESC(), and BOARD_EDITOR_CONTROL::ZoneDuplicate().

◆ GetLayerName()

wxString BOARD_ITEM::GetLayerName ( ) const
inherited

Return the name of the PCB layer on which the item resides.

Returns
the layer name associated with this item.

Definition at line 94 of file board_item.cpp.

95{
96 const BOARD* board = GetBoard();
97
98 if( board )
99 return board->GetLayerName( m_layer );
100
101 // If no parent, return standard name
103}
PCB_LAYER_ID m_layer
Definition: board_item.h:329
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: board.h:696
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:413

References BOARD_ITEM::GetBoard(), BOARD::GetLayerName(), BOARD::GetStandardLayerName(), and BOARD_ITEM::m_layer.

Referenced by FP_TEXT::GetMsgPanelInfo(), FP_TEXTBOX::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), PCB_TARGET::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), FOOTPRINT_SEARCH_HANDLER::GetResultCell(), FP_SHAPE::GetSelectMenuText(), PCB_DIMENSION_BASE::GetSelectMenuText(), PCB_SHAPE::GetSelectMenuText(), PCB_TEXT::GetSelectMenuText(), PCB_TEXTBOX::GetSelectMenuText(), PCB_TRACK::GetSelectMenuText(), PCB_TEXT::GetShownText(), PCB_TEXTBOX::GetShownText(), and FOOTPRINT::ResolveTextVar().

◆ GetLayerSet()

◆ GetLocalClearance() [1/2]

int ZONE::GetLocalClearance ( ) const
inlineinherited

Definition at line 152 of file zone.h.

152{ return GetLocalClearance( nullptr ); }
int GetLocalClearance() const
Definition: zone.h:152

References ZONE::GetLocalClearance().

Referenced by ZONE::GetLocalClearance(), and ZONE_DESC::ZONE_DESC().

◆ GetLocalClearance() [2/2]

int ZONE::GetLocalClearance ( wxString *  aSource) const
overridevirtualinherited

Return any local clearances set in the "classic" (ie: pre-rule) system.

These are things like zone clearance which are NOT an override.

Parameters
aSource[out] optionally reports the source as a user-readable string
Returns
the clearance in internal units.

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 467 of file zone.cpp.

468{
469 if( m_isRuleArea )
470 return 0;
471
472 if( aSource )
473 *aSource = _( "zone" );
474
475 return m_ZoneClearance;
476}
int m_ZoneClearance
Definition: zone.h:825

References _, ZONE::m_isRuleArea, and ZONE::m_ZoneClearance.

Referenced by ZONE_FILLER::buildThermalSpokes(), CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities(), KI_TEST::CheckFpZone(), PCB_PLUGIN::format(), BOARD_INSPECTION_TOOL::InspectClearance(), ZONE_FILLER::knockoutThermalReliefs(), ZONE_SETTINGS::operator<<(), and zonesNeedUpdate().

◆ GetLocalClearanceOverrides()

virtual int BOARD_CONNECTED_ITEM::GetLocalClearanceOverrides ( wxString *  aSource) const
inlinevirtualinherited

Return any local clearance overrides set in the "classic" (ie: pre-rule) system.

Parameters
aSource[out] optionally reports the source as a user-readable string.
Returns
the clearance in internal units.

Reimplemented in PAD.

Definition at line 142 of file board_connected_item.h.

142{ return 0; }

Referenced by DRC_ENGINE::EvalRules().

◆ GetLocalFlags()

int ZONE::GetLocalFlags ( ) const
inlineinherited

Definition at line 309 of file zone.h.

309{ return m_localFlgs; }
int m_localFlgs
Definition: zone.h:873

References ZONE::m_localFlgs.

Referenced by ZONE::InitDataFromSrcInCopyCtor().

◆ GetLocalRatsnestVisible()

bool BOARD_CONNECTED_ITEM::GetLocalRatsnestVisible ( ) const
inlineinherited

◆ GetLock()

std::mutex & ZONE::GetLock ( )
inlineinherited

Definition at line 230 of file zone.h.

231 {
232 return m_lock;
233 }
std::mutex m_lock
Lock used for multi-threaded filling on multi-layer zones.
Definition: zone.h:902

References ZONE::m_lock.

Referenced by ZONE_FILLER::Fill().

◆ GetMenuImage()

BITMAPS ZONE::GetMenuImage ( ) const
overridevirtualinherited

Return a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 988 of file zone.cpp.

989{
990 return BITMAPS::add_zone;
991}

References add_zone.

◆ GetMinIslandArea()

long long int ZONE::GetMinIslandArea ( ) const
inlineinherited

Definition at line 714 of file zone.h.

714{ return m_minIslandArea; }
long long int m_minIslandArea
When island removal mode is set to AREA, islands below this area will be removed.
Definition: zone.h:835

References ZONE::m_minIslandArea.

Referenced by KI_TEST::CheckFpZone(), ZONE_FILLER::Fill(), PCB_PLUGIN::format(), ZONE_SETTINGS::operator<<(), and zonesNeedUpdate().

◆ GetMinThickness()

◆ GetMsgPanelInfo()

void ZONE::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtualinherited

Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 518 of file zone.cpp.

519{
520 wxString msg = GetFriendlyName();
521
522 // Display Cutout instead of Outline for holes inside a zone (i.e. when num contour !=0).
523 // Check whether the selected corner is in a hole; i.e., in any contour but the first one.
524 if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
525 msg << wxT( " " ) << _( "Cutout" );
526
527 aList.emplace_back( _( "Type" ), msg );
528
529 if( GetIsRuleArea() )
530 {
531 msg.Empty();
532
533 if( GetDoNotAllowVias() )
534 AccumulateDescription( msg, _( "No vias" ) );
535
536 if( GetDoNotAllowTracks() )
537 AccumulateDescription( msg, _( "No tracks" ) );
538
539 if( GetDoNotAllowPads() )
540 AccumulateDescription( msg, _( "No pads" ) );
541
543 AccumulateDescription( msg, _( "No copper zones" ) );
544
546 AccumulateDescription( msg, _( "No footprints" ) );
547
548 if( !msg.IsEmpty() )
549 aList.emplace_back( _( "Restrictions" ), msg );
550 }
551 else if( IsOnCopperLayer() )
552 {
553 if( aFrame->GetName() == PCB_EDIT_FRAME_NAME )
554 {
555 aList.emplace_back( _( "Net" ), UnescapeString( GetNetname() ) );
556
557 aList.emplace_back( _( "Resolved Netclass" ),
558 UnescapeString( GetEffectiveNetClass()->GetName() ) );
559 }
560
561 // Display priority level
562 aList.emplace_back( _( "Priority" ),
563 wxString::Format( wxT( "%d" ), GetAssignedPriority() ) );
564 }
565
566 if( aFrame->GetName() == PCB_EDIT_FRAME_NAME )
567 {
568 if( IsLocked() )
569 aList.emplace_back( _( "Status" ), _( "Locked" ) );
570 }
571
572 wxString layerDesc;
573 int count = 0;
574
575 for( PCB_LAYER_ID layer : m_layerSet.Seq() )
576 {
577 if( count == 0 )
578 layerDesc = GetBoard()->GetLayerName( layer );
579
580 count++;
581 }
582
583 if( count > 1 )
584 layerDesc.Printf( _( "%s and %d more" ), layerDesc, count - 1 );
585
586 aList.emplace_back( _( "Layer" ), layerDesc );
587
588 if( !m_zoneName.empty() )
589 aList.emplace_back( _( "Name" ), m_zoneName );
590
591 switch( m_fillMode )
592 {
593 case ZONE_FILL_MODE::POLYGONS: msg = _( "Solid" ); break;
594 case ZONE_FILL_MODE::HATCH_PATTERN: msg = _( "Hatched" ); break;
595 default: msg = _( "Unknown" ); break;
596 }
597
598 aList.emplace_back( _( "Fill Mode" ), msg );
599
600 aList.emplace_back( _( "Filled Area" ),
602
603 wxString source;
604 int clearance = GetOwnClearance( UNDEFINED_LAYER, &source );
605
606 if( !source.IsEmpty() )
607 {
608 aList.emplace_back( wxString::Format( _( "Min Clearance: %s" ),
609 aFrame->MessageTextFromValue( clearance ) ),
610 wxString::Format( _( "(from %s)" ),
611 source ) );
612 }
613
614 if( !m_FilledPolysList.empty() )
615 {
616 count = 0;
617
618 for( std::pair<const PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>>& ii: m_FilledPolysList )
619 count += ii.second->TotalVertices();
620
621 aList.emplace_back( _( "Corner Count" ), wxString::Format( wxT( "%d" ), count ) );
622 }
623}
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
virtual bool IsLocked() const
Definition: board_item.cpp:71
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: zone.h:871
bool GetDoNotAllowVias() const
Definition: zone.h:699
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
Definition: zone.h:794
bool GetDoNotAllowPads() const
Definition: zone.h:701
wxString GetFriendlyName() const override
Definition: zone.cpp:653
bool GetDoNotAllowTracks() const
Definition: zone.h:700
bool GetDoNotAllowFootprints() const
Definition: zone.h:702
bool GetDoNotAllowCopperPour() const
Definition: zone.h:698
unsigned GetAssignedPriority() const
Definition: zone.h:112
#define PCB_EDIT_FRAME_NAME
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
wxString UnescapeString(const wxString &aSource)
void AccumulateDescription(wxString &aDesc, const wxString &aItem)
Utility to build comma separated lists in messages.
Definition: string_utils.h:322

References _, AccumulateDescription(), AREA, Format(), ZONE::GetAssignedPriority(), BOARD_ITEM::GetBoard(), ZONE::GetDoNotAllowCopperPour(), ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), BOARD_CONNECTED_ITEM::GetEffectiveNetClass(), ZONE::GetFriendlyName(), ZONE::GetIsRuleArea(), BOARD::GetLayerName(), BOARD_CONNECTED_ITEM::GetNetname(), BOARD_CONNECTED_ITEM::GetOwnClearance(), HATCH_PATTERN, BOARD_ITEM::IsLocked(), ZONE::IsOnCopperLayer(), ZONE::m_area, SHAPE_POLY_SET::VERTEX_INDEX::m_contour, ZONE::m_CornerSelection, ZONE::m_FilledPolysList, ZONE::m_fillMode, ZONE::m_layerSet, ZONE::m_zoneName, UNITS_PROVIDER::MessageTextFromValue(), PCB_EDIT_FRAME_NAME, POLYGONS, LSET::Seq(), UNDEFINED_LAYER, and UnescapeString().

◆ GetNet()

◆ GetNetClassName()

wxString BOARD_CONNECTED_ITEM::GetNetClassName ( ) const
inherited

Returns the name of the effective netclass.

Primarily for the use of the property system.

Definition at line 106 of file board_connected_item.cpp.

107{
108 return GetEffectiveNetClass()->GetName();
109}
const wxString GetName() const
Definition: netclass.h:65

References BOARD_CONNECTED_ITEM::GetEffectiveNetClass(), and NETCLASS::GetName().

Referenced by BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and main().

◆ GetNetCode()

int BOARD_CONNECTED_ITEM::GetNetCode ( ) const
inherited
Returns
the net code.

Definition at line 89 of file board_connected_item.cpp.

90{
91 return m_netinfo ? m_netinfo->GetNetCode() : -1;
92}
int GetNetCode() const
Definition: netinfo.h:113

References NETINFO_ITEM::GetNetCode(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), ZONE_FILLER::buildCopperItemClearances(), KI_TEST::CheckFpPad(), KI_TEST::CheckFpZone(), connectedItemFilter(), CreateRoutesSection(), TEARDROP_MANAGER::createTeardrop(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::ExchangeFootprint(), PNS::NODE::FindItemByParent(), TEARDROP_MANAGER::findTouchingTrack(), PCB_PLUGIN::format(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), CONNECTIVITY_DATA::GetConnectedItems(), ZONE::GetInteractingZones(), PCB_TRACK::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), CONNECTIVITY_DATA::GetRatsnestForPad(), BOARD_INSPECTION_TOOL::highlightNet(), DIALOG_PAD_PROPERTIES::initValues(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectDRCError(), CONNECTIVITY_DATA::IsConnectedOnLayer(), ZONE::IsIsland(), ZONE::IsSame(), TEARDROP_MANAGER::isViaAndTrackInSameZone(), ZONE_FILLER::knockoutThermalReliefs(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), AR_AUTOPLACER::nearestPad(), ROUTER_TOOL::NeighboringSegmentFilter(), CN_ITEM::Net(), DIALOG_DRC::OnDRCItemSelected(), PCB_TRACK::cmp_tracks::operator()(), ZONE_SETTINGS::operator<<(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), process(), BOARD_EDITOR_CONTROL::RepairBoard(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), ZONE::SameNet(), PCB_SELECTION_CONDITIONS::sameNetFunc(), PCB_SELECTION_TOOL::selectNet(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncPad(), PNS_KICAD_IFACE_BASE::syncTrack(), PNS_KICAD_IFACE_BASE::syncVia(), DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones(), BOARD::TracksInNet(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), PCB_CONTROL::UpdateMessagePanel(), VIAPAD::VIAPAD(), PCB_TRACK::ViewGetLOD(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and BOARD_EDITOR_CONTROL::ZoneMerge().

◆ GetNetname()

◆ GetNetnameMsg()

wxString BOARD_CONNECTED_ITEM::GetNetnameMsg ( ) const
inherited
Returns
the full netname or "<no net>" in square braces, followed by "(Not Found)" if the netcode is undefined.

Definition at line 118 of file board_connected_item.cpp.

119{
120 if( !GetBoard() )
121 return wxT( "[** NO BOARD DEFINED **]" );
122
123 wxString netname = GetNetname();
124
125 if( !netname.length() )
126 return wxT( "[<no net>]" );
127 else if( GetNetCode() < 0 )
128 return wxT( "[" ) + UnescapeString( netname ) + wxT( "](" ) + _( "Not Found" ) + wxT( ")" );
129 else
130 return wxT( "[" ) + UnescapeString( netname ) + wxT( "]" );
131}

References _, BOARD_ITEM::GetBoard(), BOARD_CONNECTED_ITEM::GetNetCode(), BOARD_CONNECTED_ITEM::GetNetname(), and UnescapeString().

Referenced by PAD::GetSelectMenuText(), PCB_TRACK::GetSelectMenuText(), PCB_VIA::GetSelectMenuText(), and ZONE::GetSelectMenuText().

◆ GetNumCorners()

int ZONE::GetNumCorners ( void  ) const
inlineinherited

Access to m_Poly parameters.

Definition at line 490 of file zone.h.

491 {
492 return m_Poly->TotalVertices();
493 }
int TotalVertices() const
Delete aIdx-th polygon from the set.

References ZONE::m_Poly, and SHAPE_POLY_SET::TotalVertices().

Referenced by ZONE::BuildSmoothedPoly(), and PCB_PLUGIN::format().

◆ GetOutlineArea()

double ZONE::GetOutlineArea ( )
inlineinherited

This area is cached from the most recent call to CalculateOutlineArea().

Returns
the outline area

Definition at line 225 of file zone.h.

226 {
227 return m_outlinearea;
228 }

References ZONE::m_outlinearea.

Referenced by TEARDROP_MANAGER::setTeardropPriorities().

◆ GetOwnClearance()

int BOARD_CONNECTED_ITEM::GetOwnClearance ( PCB_LAYER_ID  aLayer,
wxString *  aSource = nullptr 
) const
virtualinherited

Return an item's "own" clearance in internal units.

Parameters
aLayerthe layer in question.
aSource[out] optionally reports the source as a user-readable string.
Returns
the clearance in internal units.

Reimplemented in PAD.

Definition at line 66 of file board_connected_item.cpp.

67{
68 DRC_CONSTRAINT constraint;
69
70 if( GetBoard() && GetBoard()->GetDesignSettings().m_DRCEngine )
71 {
73
74 constraint = bds.m_DRCEngine->EvalRules( CLEARANCE_CONSTRAINT, this, nullptr, aLayer );
75 }
76
77 if( constraint.Value().HasMin() )
78 {
79 if( aSource )
80 *aSource = constraint.GetName();
81
82 return constraint.Value().Min();
83 }
84
85 return 0;
86}
std::shared_ptr< DRC_ENGINE > m_DRCEngine
wxString GetName() const
Definition: drc_rule.h:147
MINOPTMAX< int > & Value()
Definition: drc_rule.h:140
T Min() const
Definition: minoptmax.h:33
bool HasMin() const
Definition: minoptmax.h:37
@ CLEARANCE_CONSTRAINT
Definition: drc_rule.h:46

References CLEARANCE_CONSTRAINT, BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), DRC_CONSTRAINT::GetName(), MINOPTMAX< T >::HasMin(), BOARD_DESIGN_SETTINGS::m_DRCEngine, MINOPTMAX< T >::Min(), and DRC_CONSTRAINT::Value().

Referenced by KIGFX::PCB_PAINTER::draw(), PCB_TRACK::GetMsgPanelInfo(), PCB_VIA::GetMsgPanelInfo(), and ZONE::GetMsgPanelInfo().

◆ GetPadConnection()

ZONE_CONNECTION ZONE::GetPadConnection ( ) const
inlineinherited

◆ GetParent()

BOARD_ITEM_CONTAINER * BOARD_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 163 of file board_item.h.

163{ return (BOARD_ITEM_CONTAINER*) m_parent; }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:498

References EDA_ITEM::m_parent.

Referenced by PCB_POINT_EDITOR::addCorner(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), PNS_KICAD_IFACE::Commit(), FOOTPRINT::CoverageRatio(), BOARD_ITEM::DeleteStructure(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), EDIT_TOOL::DragArcTrack(), KIGFX::PCB_PAINTER::draw(), EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::FilterCollectorForFreePads(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), PCB_PLUGIN::format(), FormatProbeItem(), BOARD_ITEM::GetBoard(), getClosestGroup(), BOARD_ITEM::GetParentFootprint(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), FP_TEXT::GetSelectMenuText(), FP_TEXTBOX::GetSelectMenuText(), FP_TEXT::GetShownText(), FP_TEXTBOX::GetShownText(), PCB_TEXT::GetShownText(), PCB_TEXTBOX::GetShownText(), ALTIUM_PCB::HelperShapeSetLocalCoord(), GENERAL_COLLECTOR::Inspect(), FP_SHAPE::IsParentFlipped(), FP_TEXT::IsParentFlipped(), PCB_SELECTION_TOOL::itemPassesFilter(), memberOfFunc(), EDIT_TOOL::MoveExact(), BRDITEMS_PLOTTER::PlotFootprintShape(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BOARD_COMMIT::Push(), PCB_PARSER::resolveGroups(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), PCB_SELECTION_TOOL::Selectable(), BOARD_ITEM::SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ViewGetLOD(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetParentFootprint()

◆ GetParentGroup()

◆ GetPosition()

VECTOR2I ZONE::GetPosition ( ) const
overridevirtualinherited
Returns
a VECTOR2I, position of the first point of the outline

Reimplemented from EDA_ITEM.

Definition at line 230 of file zone.cpp.

231{
232 return GetCornerPosition( 0 );
233}
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition: zone.h:530

References ZONE::GetCornerPosition().

Referenced by EAGLE_PLUGIN::loadPlain().

◆ GetSelectedCorner()

int ZONE::GetSelectedCorner ( ) const
inlineinherited

Definition at line 281 of file zone.h.

282 {
283 // Transform relative indices to global index
284 int globalIndex = -1;
285
287 m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
288
289 return globalIndex;
290 }
bool GetGlobalIndex(VERTEX_INDEX aRelativeIndices, int &aGlobalIdx) const
Compute the global index of a vertex from the relative indices of polygon, contour and vertex.

References SHAPE_POLY_SET::GetGlobalIndex(), ZONE::m_CornerSelection, and ZONE::m_Poly.

◆ GetSelectMenuText()

wxString ZONE::GetSelectMenuText ( UNITS_PROVIDER aUnitsProvider) const
overridevirtualinherited

Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 777 of file zone.cpp.

778{
779 wxString layerDesc;
780 int count = 0;
781
782 for( PCB_LAYER_ID layer : m_layerSet.Seq() )
783 {
784 if( count == 0 )
785 layerDesc = GetBoard()->GetLayerName( layer );
786
787 count++;
788 }
789
790 if( count > 1 )
791 layerDesc.Printf( _( "%s and %d more" ), layerDesc, count - 1 );
792
793 // Check whether the selected contour is a hole (contour index > 0)
794 if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
795 {
796 if( GetIsRuleArea() )
797 return wxString::Format( _( "Rule Area Cutout on %s" ), layerDesc );
798 else
799 return wxString::Format( _( "Zone Cutout on %s" ), layerDesc );
800 }
801 else
802 {
803 if( GetIsRuleArea() )
804 return wxString::Format( _( "Rule Area on %s" ), layerDesc );
805 else
806 return wxString::Format( _( "Zone %s on %s" ), GetNetnameMsg(), layerDesc );
807 }
808}
wxString GetNetnameMsg() const

References _, Format(), BOARD_ITEM::GetBoard(), ZONE::GetIsRuleArea(), BOARD::GetLayerName(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), SHAPE_POLY_SET::VERTEX_INDEX::m_contour, ZONE::m_CornerSelection, ZONE::m_layerSet, and LSET::Seq().

Referenced by DRC_ENGINE::EvalRules(), and PNS_KICAD_IFACE_BASE::syncZone().

◆ GetShortNetname()

wxString BOARD_CONNECTED_ITEM::GetShortNetname ( ) const
inherited
Returns
the short netname.

Definition at line 134 of file board_connected_item.cpp.

135{
136 return m_netinfo ? m_netinfo->GetShortNetname() : wxString();
137}
const wxString & GetShortNetname() const
Definition: netinfo.h:124

References NETINFO_ITEM::GetShortNetname(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by KIGFX::PCB_PAINTER::draw(), PAD::IsFreePad(), PAD::IsNoConnectPad(), and PCB_TRACK::ViewGetLOD().

◆ GetSortPosition()

virtual VECTOR2I EDA_ITEM::GetSortPosition ( ) const
inlinevirtualinherited

Return the coordinates that should be used for sorting this element visually compared to other elements.

For instance, for lines the midpoint might be a better sorting point than either end.

Returns
X,Y coordinate of the sort point

Reimplemented in SCH_LINE.

Definition at line 267 of file eda_item.h.

267{ return GetPosition(); }

References EDA_ITEM::GetPosition().

◆ GetState()

int EDA_ITEM::GetState ( EDA_ITEM_FLAGS  type) const
inlineinherited

Definition at line 126 of file eda_item.h.

127 {
128 return m_status & type;
129 }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:497

References EDA_ITEM::m_status.

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 139 of file eda_item.h.

139{ return m_status; }

References EDA_ITEM::m_status.

◆ GetStroke()

STROKE_PARAMS BOARD_ITEM::GetStroke ( ) const
virtualinherited

Reimplemented in PCB_SHAPE.

Definition at line 82 of file board_item.cpp.

83{
84 wxCHECK( false, STROKE_PARAMS( pcbIUScale.mmToIU( DEFAULT_LINE_WIDTH ) ) );
85}
#define DEFAULT_LINE_WIDTH
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88

References DEFAULT_LINE_WIDTH, EDA_IU_SCALE::mmToIU(), and pcbIUScale.

Referenced by CONVERT_TOOL::CreatePolys(), and PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog().

◆ GetTeardropAreaType()

TEARDROP_TYPE ZONE::GetTeardropAreaType ( ) const
inlineinherited
Returns
the type of the teardrop ( has meaning only if the zone is a teardrop area)

Definition at line 692 of file zone.h.

692{ return m_teardropType; }
TEARDROP_TYPE m_teardropType
Definition: zone.h:813

References ZONE::m_teardropType.

Referenced by KI_TEST::CheckFpZone(), PCB_PLUGIN::format(), and ZONE_SETTINGS::operator<<().

◆ GetThermalReliefGap() [1/2]

int ZONE::GetThermalReliefGap ( ) const
inlineinherited

◆ GetThermalReliefGap() [2/2]

int ZONE::GetThermalReliefGap ( PAD aPad,
wxString *  aSource = nullptr 
) const
inherited

Definition at line 357 of file zone.cpp.

358{
359 if( aPad->GetLocalThermalGapOverride() == 0 )
360 {
361 if( aSource )
362 *aSource = _( "zone" );
363
364 return m_thermalReliefGap;
365 }
366
367 return aPad->GetLocalThermalGapOverride( aSource );
368
369}
int GetLocalThermalGapOverride(wxString *aSource=nullptr) const
Definition: pad.cpp:934

References _, PAD::GetLocalThermalGapOverride(), and ZONE::m_thermalReliefGap.

◆ GetThermalReliefSpokeWidth()

int ZONE::GetThermalReliefSpokeWidth ( ) const
inlineinherited

◆ GetTypeDesc()

wxString EDA_ITEM::GetTypeDesc ( ) const
inherited

Return a translated description of the type for this EDA_ITEM for display in user facing messages.

Definition at line 301 of file eda_item.cpp.

302{
303 //@see EDA_ITEM_DESC for definition of ENUM_MAP<KICAD_T>
304 wxString typeDescr = ENUM_MAP<KICAD_T>::Instance().ToString( Type() );
305
306 return wxGetTranslation( typeDescr );
307}
static ENUM_MAP< T > & Instance()
Definition: property.h:546

References ENUM_MAP< T >::Instance(), and EDA_ITEM::Type().

Referenced by PCB_GROUP::AddItem(), EDIT_TOOL::doMoveSelection(), and EDA_ITEM::GetFriendlyName().

◆ GetX()

◆ GetY()

◆ GetZoneName()

◆ HasFilledPolysForLayer()

bool ZONE::HasFilledPolysForLayer ( PCB_LAYER_ID  aLayer) const
inlineinherited

Definition at line 594 of file zone.h.

595 {
596 return m_FilledPolysList.count( aLayer ) > 0;
597 }

References ZONE::m_FilledPolysList.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers(), and ALTIUM_PCB::ParseRegions6Data().

◆ HasFlag()

◆ HasHole()

◆ HasLineStroke()

virtual bool BOARD_ITEM::HasLineStroke ( ) const
inlinevirtualinherited

Check if this item has line stoke properties.

See also
STROKE_PARAMS

Reimplemented in PCB_SHAPE.

Definition at line 172 of file board_item.h.

172{ return false; }

◆ HatchBorder()

void ZONE::HatchBorder ( )
inherited

Compute the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_borderHatchLines.

Definition at line 852 of file zone.cpp.

853{
855
857 || m_borderHatchPitch == 0
858 || m_Poly->IsEmpty() )
859 {
860 return;
861 }
862
863 // define range for hatch lines
864 int min_x = m_Poly->CVertex( 0 ).x;
865 int max_x = m_Poly->CVertex( 0 ).x;
866 int min_y = m_Poly->CVertex( 0 ).y;
867 int max_y = m_Poly->CVertex( 0 ).y;
868
869 for( auto iterator = m_Poly->IterateWithHoles(); iterator; iterator++ )
870 {
871 if( iterator->x < min_x )
872 min_x = iterator->x;
873
874 if( iterator->x > max_x )
875 max_x = iterator->x;
876
877 if( iterator->y < min_y )
878 min_y = iterator->y;
879
880 if( iterator->y > max_y )
881 max_y = iterator->y;
882 }
883
884 // Calculate spacing between 2 hatch lines
885 int spacing;
886
888 spacing = m_borderHatchPitch;
889 else
890 spacing = m_borderHatchPitch * 2;
891
892 // set the "length" of hatch lines (the length on horizontal axis)
893 int hatch_line_len = m_borderHatchPitch;
894
895 // To have a better look, give a slope depending on the layer
896 int layer = GetFirstLayer();
897 int slope_flag = (layer & 1) ? 1 : -1; // 1 or -1
898 double slope = 0.707106 * slope_flag; // 45 degrees slope
899 int max_a, min_a;
900
901 if( slope_flag == 1 )
902 {
903 max_a = KiROUND( max_y - slope * min_x );
904 min_a = KiROUND( min_y - slope * max_x );
905 }
906 else
907 {
908 max_a = KiROUND( max_y - slope * max_x );
909 min_a = KiROUND( min_y - slope * min_x );
910 }
911
912 min_a = (min_a / spacing) * spacing;
913
914 // calculate an offset depending on layer number,
915 // for a better look of hatches on a multilayer board
916 int offset = (layer * 7) / 8;
917 min_a += offset;
918
919 // loop through hatch lines
920 std::vector<VECTOR2I> pointbuffer;
921 pointbuffer.reserve( 256 );
922
923 for( int a = min_a; a < max_a; a += spacing )
924 {
925 pointbuffer.clear();
926
927 // Iterate through all vertices
928 for( auto iterator = m_Poly->IterateSegmentsWithHoles(); iterator; iterator++ )
929 {
930 const SEG seg = *iterator;
931 double x, y;
932
933 if( FindLineSegmentIntersection( a, slope, seg.A.x, seg.A.y, seg.B.x, seg.B.y, x, y ) )
934 pointbuffer.emplace_back( KiROUND( x ), KiROUND( y ) );
935 }
936
937 // sort points in order of descending x (if more than 2) to
938 // ensure the starting point and the ending point of the same segment
939 // are stored one just after the other.
940 if( pointbuffer.size() > 2 )
941 sort( pointbuffer.begin(), pointbuffer.end(), sortEndsByDescendingX );
942
943 // creates lines or short segments inside the complex polygon
944 for( size_t ip = 0; ip + 1 < pointbuffer.size(); ip += 2 )
945 {
946 int dx = pointbuffer[ip + 1].x - pointbuffer[ip].x;
947
948 // Push only one line for diagonal hatch,
949 // or for small lines < twice the line length
950 // else push 2 small lines
952 || std::abs( dx ) < 2 * hatch_line_len )
953 {
954 m_borderHatchLines.emplace_back( SEG( pointbuffer[ip], pointbuffer[ ip + 1] ) );
955 }
956 else
957 {
958 double dy = pointbuffer[ip + 1].y - pointbuffer[ip].y;
959 slope = dy / dx;
960
961 if( dx > 0 )
962 dx = hatch_line_len;
963 else
964 dx = -hatch_line_len;
965
966 int x1 = KiROUND( pointbuffer[ip].x + dx );
967 int x2 = KiROUND( pointbuffer[ip + 1].x - dx );
968 int y1 = KiROUND( pointbuffer[ip].y + dx * slope );
969 int y2 = KiROUND( pointbuffer[ip + 1].y - dx * slope );
970
971 m_borderHatchLines.emplace_back( SEG( pointbuffer[ip].x, pointbuffer[ip].y,
972 x1, y1 ) );
973
974 m_borderHatchLines.emplace_back( SEG( pointbuffer[ip+1].x, pointbuffer[ip+1].y,
975 x2, y2 ) );
976 }
977 }
978 }
979}
Definition: seg.h:42
VECTOR2I A
Definition: seg.h:49
VECTOR2I B
Definition: seg.h:50
ITERATOR IterateWithHoles(int aOutline)
bool IsEmpty() const
SEGMENT_ITERATOR IterateSegmentsWithHoles()
Return an iterator object, for the aOutline-th outline in the set (with holes).
void UnHatchBorder()
Clear the zone's hatch.
Definition: zone.cpp:838
PCB_LAYER_ID GetFirstLayer() const
Definition: zone.cpp:242
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:85
bool sortEndsByDescendingX(const VECTOR2I &ref, const VECTOR2I &tst)
Definition: zone.cpp:846

References SEG::A, std::abs(), SEG::B, SHAPE_POLY_SET::CVertex(), DIAGONAL_EDGE, DIAGONAL_FULL, ZONE::GetFirstLayer(), SHAPE_POLY_SET::IsEmpty(), SHAPE_POLY_SET::IterateSegmentsWithHoles(), SHAPE_POLY_SET::IterateWithHoles(), KiROUND(), ZONE::m_borderHatchLines, ZONE::m_borderHatchPitch, ZONE::m_borderStyle, ZONE::m_Poly, NO_HATCH, sortEndsByDescendingX(), ZONE::UnHatchBorder(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PCB_POINT_EDITOR::addCorner(), CONVERT_TOOL::CreatePolys(), EDIT_TOOL::DeleteItems(), ZONE::Mirror(), ZONE::Move(), ZONE::MoveEdge(), ZONE::Rotate(), ZONE::SetBorderDisplayStyle(), and PCB_POINT_EDITOR::updateItem().

◆ HigherPriority()

bool ZONE::HigherPriority ( const ZONE aOther) const
inherited

Definition at line 183 of file zone.cpp.

184{
185 // Teardrops are always higher priority than regular zones, so if one zone is a teardrop
186 // and the other is not, then return higher priority as the teardrop
188 ^ ( aOther->m_teardropType == TEARDROP_TYPE::TD_NONE ) )
189 {
190 return static_cast<int>( m_teardropType ) > static_cast<int>( aOther->m_teardropType );
191 }
192
193 if( m_priority != aOther->m_priority )
194 return m_priority > aOther->m_priority;
195
196 return m_Uuid > aOther->m_Uuid;
197}

References ZONE::m_priority, ZONE::m_teardropType, EDA_ITEM::m_Uuid, and TD_NONE.

Referenced by ZONE_FILLER::Fill().

◆ HitTest() [1/2]

bool ZONE::HitTest ( const BOX2I aRect,
bool  aContained = true,
int  aAccuracy = 0 
) const
overridevirtualinherited

Test if aRect intersects this item.

Parameters
aRectA reference to a BOX2I object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented from EDA_ITEM.

Definition at line 426 of file zone.cpp.

427{
428 // Calculate bounding box for zone
429 BOX2I bbox = GetBoundingBox();
430 bbox.Normalize();
431
432 BOX2I arect = aRect;
433 arect.Normalize();
434 arect.Inflate( aAccuracy );
435
436 if( aContained )
437 {
438 return arect.Contains( bbox );
439 }
440 else
441 {
442 // Fast test: if aBox is outside the polygon bounding box, rectangles cannot intersect
443 if( !arect.Intersects( bbox ) )
444 return false;
445
446 int count = m_Poly->TotalVertices();
447
448 for( int ii = 0; ii < count; ii++ )
449 {
450 VECTOR2I vertex = m_Poly->CVertex( ii );
451 VECTOR2I vertexNext = m_Poly->CVertex( ( ii + 1 ) % count );
452
453 // Test if the point is within the rect
454 if( arect.Contains( vertex ) )
455 return true;
456
457 // Test if this edge intersects the rect
458 if( arect.Intersects( vertex, vertexNext ) )
459 return true;
460 }
461
462 return false;
463 }
464}
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
Definition: box2.h:119
bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:269
bool Contains(const Vec &aPoint) const
Definition: box2.h:141

References BOX2< Vec >::Contains(), SHAPE_POLY_SET::CVertex(), ZONE::GetBoundingBox(), BOX2< Vec >::Inflate(), BOX2< Vec >::Intersects(), ZONE::m_Poly, BOX2< Vec >::Normalize(), and SHAPE_POLY_SET::TotalVertices().

◆ HitTest() [2/2]

bool ZONE::HitTest ( const VECTOR2I aPosition,
int  aAccuracy = 0 
) const
overridevirtualinherited

Test if a point is near an outline edge or a corner of this zone.

Parameters
aPositionthe VECTOR2I to test
Returns
true if a hit, else false

Reimplemented from EDA_ITEM.

Definition at line 402 of file zone.cpp.

403{
404 // When looking for an "exact" hit aAccuracy will be 0 which works poorly for very thin
405 // lines. Give it a floor.
406 int accuracy = std::max( aAccuracy, pcbIUScale.mmToIU( 0.1 ) );
407
408 return HitTestForCorner( aPosition, accuracy * 2 ) || HitTestForEdge( aPosition, accuracy );
409}
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:412
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:419

References ZONE::HitTestForCorner(), ZONE::HitTestForEdge(), EDA_IU_SCALE::mmToIU(), and pcbIUScale.

◆ HitTestCutout()

bool ZONE::HitTestCutout ( const VECTOR2I aRefPos,
int *  aOutlineIdx = nullptr,
int *  aHoleIdx = nullptr 
) const
inherited

Test if the given point is contained within a cutout of the zone.

Parameters
aRefPosis the point to test
aOutlineIdxis the index of the outline containing the cutout
aHoleIdxis the index of the hole
Returns
true if aRefPos is inside a zone cutout

Definition at line 493 of file zone.cpp.

494{
495 // Iterate over each outline polygon in the zone and then iterate over
496 // each hole it has to see if the point is in it.
497 for( int i = 0; i < m_Poly->OutlineCount(); i++ )
498 {
499 for( int j = 0; j < m_Poly->HoleCount( i ); j++ )
500 {
501 if( m_Poly->Hole( i, j ).PointInside( aRefPos ) )
502 {
503 if( aOutlineIdx )
504 *aOutlineIdx = i;
505
506 if( aHoleIdx )
507 *aHoleIdx = j;
508
509 return true;
510 }
511 }
512 }
513
514 return false;
515}
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Check if point aP lies inside a polygon (any type) defined by the line chain.
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Return the aIndex-th subpolygon in the set.

References SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), ZONE::m_Poly, SHAPE_POLY_SET::OutlineCount(), and SHAPE_LINE_CHAIN_BASE::PointInside().

Referenced by EDIT_TOOL::DeleteItems().

◆ HitTestFilledArea()

bool ZONE::HitTestFilledArea ( PCB_LAYER_ID  aLayer,
const VECTOR2I aRefPos,
int  aAccuracy = 0 
) const
inherited

Test if the given VECTOR2I is within the bounds of a filled area of this zone.

Parameters
aLayeris the layer to test on
aRefPosA VECTOR2I to test
aAccuracyExpand the distance by which the areas are expanded for the hittest
Returns
true if a hit, else false

Definition at line 479 of file zone.cpp.

480{
481 // Rule areas have no filled area, but it's generally nice to treat their interior as if it were
482 // filled so that people don't have to select them by their outline (which is min-width)
483 if( GetIsRuleArea() )
484 return m_Poly->Contains( aRefPos, -1, aAccuracy );
485
486 if( !m_FilledPolysList.count( aLayer ) )
487 return false;
488
489 return m_FilledPolysList.at( aLayer )->Contains( aRefPos, -1, aAccuracy );
490}
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, int aAccuracy=0, bool aUseBBoxCaches=false) const
Return true if a given subpolygon contains the point aP.

References SHAPE_POLY_SET::Contains(), ZONE::GetIsRuleArea(), ZONE::m_FilledPolysList, and ZONE::m_Poly.

Referenced by CN_ANCHOR::ConnectedItemsCount(), GENERAL_COLLECTOR::Inspect(), and CN_ANCHOR::IsDangling().

◆ HitTestForCorner()

bool ZONE::HitTestForCorner ( const VECTOR2I refPos,
int  aAccuracy,
SHAPE_POLY_SET::VERTEX_INDEX aCornerHit = nullptr 
) const
inherited

Test if the given VECTOR2I is near a corner.

Parameters
refPosis the VECTOR2I to test.
aAccuracyincrease the item bounding box by this amount.
aCornerHit[out, optional] is the index of the closest vertex found when return value is true
Returns
true if some corner was found to be closer to refPos than aClearance; false otherwise.

Definition at line 412 of file zone.cpp.

414{
415 return m_Poly->CollideVertex( VECTOR2I( refPos ), aCornerHit, aAccuracy );
416}
bool CollideVertex(const VECTOR2I &aPoint, VERTEX_INDEX *aClosestVertex=nullptr, int aClearance=0) const
Check whether aPoint collides with any vertex of any of the contours of the polygon.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

References SHAPE_POLY_SET::CollideVertex(), and ZONE::m_Poly.

Referenced by ZONE::HitTest(), GENERAL_COLLECTOR::Inspect(), and PCB_SELECTION_TOOL::Main().

◆ HitTestForEdge()

bool ZONE::HitTestForEdge ( const VECTOR2I refPos,
int  aAccuracy,
SHAPE_POLY_SET::VERTEX_INDEX aCornerHit = nullptr 
) const
inherited

Test if the given VECTOR2I is near a segment defined by 2 corners.

Parameters
refPosis the VECTOR2I to test.
aAccuracyincrease the item bounding box by this amount.
aCornerHit[out, optional] is the index of the closest vertex found when return value is true.
Returns
true if some edge was found to be closer to refPos than aClearance.

Definition at line 419 of file zone.cpp.

421{
422 return m_Poly->CollideEdge( VECTOR2I( refPos ), aCornerHit, aAccuracy );
423}
bool CollideEdge(const VECTOR2I &aPoint, VERTEX_INDEX *aClosestVertex=nullptr, int aClearance=0) const
Check whether aPoint collides with any edge of any of the contours of the polygon.

References SHAPE_POLY_SET::CollideEdge(), and ZONE::m_Poly.

Referenced by PCB_SELECTION_TOOL::GuessSelectionCandidates(), ZONE::HitTest(), PCB_SELECTION_TOOL::hitTestDistance(), GENERAL_COLLECTOR::Inspect(), and PCB_SELECTION_TOOL::Main().

◆ InitDataFromSrcInCopyCtor()

void ZONE::InitDataFromSrcInCopyCtor ( const ZONE aZone)
inherited

Copy aZone data to me.

Definition at line 99 of file zone.cpp.

100{
101 // members are expected non initialize in this.
102 // InitDataFromSrcInCopyCtor() is expected to be called only from a copy constructor.
103
104 // Copy only useful EDA_ITEM flags:
105 m_flags = aZone.m_flags;
107
108 // Replace the outlines for aZone outlines.
109 delete m_Poly;
110 m_Poly = new SHAPE_POLY_SET( *aZone.m_Poly );
111
114 m_zoneName = aZone.m_zoneName;
115 m_priority = aZone.m_priority;
117 SetLayerSet( aZone.GetLayerSet() );
118
124
126 m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
131
132 m_isFilled = aZone.m_isFilled;
135
138
139 m_fillMode = aZone.m_fillMode; // solid vs. hatched
141 m_hatchGap = aZone.m_hatchGap;
147
148 // For corner moving, corner index to drag, or nullptr if no selection
149 delete m_CornerSelection;
150 m_CornerSelection = nullptr;
151
152 for( PCB_LAYER_ID layer : aZone.GetLayerSet().Seq() )
153 {
154 std::shared_ptr<SHAPE_POLY_SET> fill = aZone.m_FilledPolysList.at( layer );
155
156 if( fill )
157 m_FilledPolysList[layer] = std::make_shared<SHAPE_POLY_SET>( *fill );
158 else
159 m_FilledPolysList[layer] = std::make_shared<SHAPE_POLY_SET>();
160
161 m_filledPolysHash[layer] = aZone.m_filledPolysHash.at( layer );
162 m_insulatedIslands[layer] = aZone.m_insulatedIslands.at( layer );
163 }
164
168
169 SetLocalFlags( aZone.GetLocalFlags() );
170
171 m_netinfo = aZone.m_netinfo;
172 m_area = aZone.m_area;
174}
bool m_forceVisible
Definition: eda_item.h:499
void SetLocalFlags(int aFlags)
Definition: zone.h:310
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:896
int GetLocalFlags() const
Definition: zone.h:309
bool m_needRefill
False when a zone was refilled, true after changes in zone params.
Definition: zone.h:845
int m_fillVersion
Definition: zone.h:827
bool m_isFilled
True when a zone was filled, false after deleting the filled areas.
Definition: zone.h:838

References ZONE::GetLayerSet(), ZONE::GetLocalFlags(), ZONE::m_area, ZONE::m_borderHatchLines, ZONE::m_borderHatchPitch, ZONE::m_borderStyle, ZONE::m_cornerRadius, ZONE::m_CornerSelection, ZONE::m_cornerSmoothingType, ZONE::m_doNotAllowCopperPour, ZONE::m_doNotAllowFootprints, ZONE::m_doNotAllowPads, ZONE::m_doNotAllowTracks, ZONE::m_doNotAllowVias, ZONE::m_filledPolysHash, ZONE::m_FilledPolysList, ZONE::m_fillMode, ZONE::m_fillVersion, EDA_ITEM::m_flags, EDA_ITEM::m_forceVisible, ZONE::m_hatchBorderAlgorithm, ZONE::m_hatchGap, ZONE::m_hatchHoleMinArea, ZONE::m_hatchOrientation, ZONE::m_hatchSmoothingLevel, ZONE::m_hatchSmoothingValue, ZONE::m_hatchThickness, ZONE::m_insulatedIslands, ZONE::m_isFilled, ZONE::m_islandRemovalMode, ZONE::m_isRuleArea, ZONE::m_minIslandArea, ZONE::m_needRefill, BOARD_CONNECTED_ITEM::m_netinfo, ZONE::m_outlinearea, ZONE::m_PadConnection, ZONE::m_Poly, ZONE::m_priority, ZONE::m_teardropType, ZONE::m_thermalReliefGap, ZONE::m_thermalReliefSpokeWidth, ZONE::m_ZoneClearance, ZONE::m_ZoneMinThickness, ZONE::m_zoneName, LSET::Seq(), ZONE::SetLayerSet(), and ZONE::SetLocalFlags().

Referenced by FP_ZONE(), ZONE::operator=(), CLIPBOARD_IO::SaveSelection(), and ZONE::ZONE().

◆ IsBrightened()

◆ IsConflicting()

bool ZONE::IsConflicting ( ) const
inherited

For rule areas which exclude footprints (and therefore participate in courtyard conflicts during move).

Definition at line 224 of file zone.cpp.

225{
226 return HasFlag( COURTYARD_CONFLICT );
227}
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
Definition: eda_item.h:145
#define COURTYARD_CONFLICT
temporary set when moving footprints having courtyard overlapping

References COURTYARD_CONFLICT, and EDA_ITEM::HasFlag().

Referenced by ZONE::ViewGetLayers().

◆ IsConnected()

bool ZONE::IsConnected ( ) const
inlineoverridevirtualinherited

Not all ZONEs are really BOARD_CONNECTED_ITEMs....

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 82 of file zone.h.

83 {
84 return !GetIsRuleArea();
85 }

References ZONE::GetIsRuleArea().

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 105 of file eda_item.h.

105{ return m_flags & IS_DRAGGING; }

References IS_DRAGGING, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 108 of file eda_item.h.

108{ return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered

References ENTERED, and EDA_ITEM::m_flags.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ IsFilled()

bool ZONE::IsFilled ( ) const
inlineinherited

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 203 of file eda_item.h.

203{ return m_forceVisible; }

References EDA_ITEM::m_forceVisible.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_FIELD::Print().

◆ IsIsland()

bool ZONE::IsIsland ( PCB_LAYER_ID  aLayer,
int  aPolyIdx 
) const
inherited

Check if a given filled polygon is an insulated island.

Parameters
aLayeris the layer to test
aPolyIdxis an index into m_FilledPolysList[aLayer]
Returns
true if the given polygon is insulated (i.e. has no net connection)

Definition at line 1019 of file zone.cpp.

1020{
1021 if( GetNetCode() < 1 )
1022 return true;
1023
1024 if( !m_insulatedIslands.count( aLayer ) )
1025 return false;
1026
1027 return m_insulatedIslands.at( aLayer ).count( aPolyIdx );
1028}

References BOARD_CONNECTED_ITEM::GetNetCode(), and ZONE::m_insulatedIslands.

Referenced by PCB_PLUGIN::format().

◆ IsKnockout()

◆ IsLocked()

bool BOARD_ITEM::IsLocked ( ) const
virtualinherited

Reimplemented in FOOTPRINT, and PAD.

Definition at line 71 of file board_item.cpp.

72{
73 if( GetParentGroup() )
74 return GetParentGroup()->IsLocked();
75
76 const BOARD* board = GetBoard();
77
78 return board && board->GetBoardUse() != BOARD_USE::FPHOLDER && m_isLocked;
79}
bool m_isLocked
Definition: board_item.h:332
BOARD_USE GetBoardUse() const
Get what the board use is.
Definition: board.h:284

References FPHOLDER, BOARD_ITEM::GetBoard(), BOARD::GetBoardUse(), BOARD_ITEM::GetParentGroup(), BOARD_ITEM::IsLocked(), and BOARD_ITEM::m_isLocked.

Referenced by BOARD_ITEM_DESC::BOARD_ITEM_DESC(), KI_TEST::CheckFpShape(), KI_TEST::CheckFpText(), KI_TEST::CheckFpZone(), PCB_CONTROL::DeleteItemCursor(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), EDIT_TOOL::DragArcTrack(), EDIT_TOOL::FilletTracks(), PCB_PLUGIN::format(), DSN::SPECCTRA_DB::FromSESSION(), PCB_GROUP::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), FP_TEXTBOX::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfoBase_Common(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), GROUP_TOOL::Group(), ROUTER_TOOL::InlineDrag(), GENERAL_COLLECTOR::Inspect(), BOARD_ITEM::IsLocked(), PAD::IsLocked(), PCB_SELECTION_TOOL::itemPassesFilter(), CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromShapes(), TRACKS_CLEANER::mergeCollinearSegments(), BOARD_EDITOR_CONTROL::modifyLockSelected(), PCB_POINT_EDITOR::OnSelectionChange(), ZONE_SETTINGS::operator<<(), processTextItem(), PCB_SELECTION_TOOL::RequestSelection(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncTrack(), PNS_KICAD_IFACE_BASE::syncVia(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow(), BOARD_ITEM::ViewGetLayers(), PCB_TRACK::ViewGetLayers(), and PCB_VIA::ViewGetLayers().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 102 of file eda_item.h.

102{ return m_flags & IS_CHANGED; }

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsOnCopperLayer()

bool ZONE::IsOnCopperLayer ( ) const
overridevirtualinherited
Returns
true if this zone is on a copper layer, false if on a technical layer.

Reimplemented from BOARD_ITEM.

Definition at line 251 of file zone.cpp.

252{
253 return ( m_layerSet & LSET::AllCuMask() ).count() > 0;
254}
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773

References LSET::AllCuMask(), and ZONE::m_layerSet.

Referenced by ZONE_FILLER::Fill(), ZONE_FILLER::fillSingleZone(), PCB_PLUGIN::format(), ZONE::GetFriendlyName(), ZONE::GetMsgPanelInfo(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), BRDITEMS_PLOTTER::PlotFilledAreas(), DRC_TEST_PROVIDER_DISALLOW::Run(), and BOARD_EDITOR_CONTROL::ZoneDuplicate().

◆ IsOnLayer()

bool ZONE::IsOnLayer ( PCB_LAYER_ID  aLayer) const
overridevirtualinherited

Test to see if this object is on the given layer.

Virtual so objects like PAD, which reside on multiple layers can do their own form of testing.

Parameters
aLayerThe layer to test for.
Returns
true if on given layer, else false.

Reimplemented from BOARD_ITEM.

Definition at line 314 of file zone.cpp.

315{
316 return m_layerSet.test( aLayer );
317}

References ZONE::m_layerSet.

Referenced by DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees(), KIGFX::PCB_PAINTER::draw(), BOARD_INSPECTION_TOOL::InspectClearance(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented in LIB_TEXTBOX, SCH_FIELD, SCH_LABEL, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 422 of file eda_item.h.

422{ return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 109 of file eda_item.h.

109{ return m_flags & IS_RESIZING; }

References IS_RESIZING, and EDA_ITEM::m_flags.

◆ IsRollover()

bool EDA_ITEM::IsRollover ( ) const
inlineinherited

Definition at line 112 of file eda_item.h.

113 {
114 return ( m_flags & ( IS_ROLLOVER | IS_MOVING ) ) == IS_ROLLOVER;
115 }
#define IS_ROLLOVER
Rollover active. Used for hyperlink highlighting.

References IS_MOVING, IS_ROLLOVER, and EDA_ITEM::m_flags.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ IsSame()

bool ZONE::IsSame ( const ZONE aZoneToCompare)
inherited

Test if 2 zones are equivalent.

Function IsSame test is 2 zones are equivalent: 2 zones are equivalent if they have same parameters and same outlines info relative to filling is not take in account.

Zones are equivalent if they have same parameters and same outline info.

Note
Filling is not taken into account.
Parameters
aZoneToCompareis the zone to compare with "this"
aZoneToCompare= zone to compare with "this"

Definition at line 54 of file zones_functions_for_undo_redo.cpp.

55{
56 // compare basic parameters:
57 if( GetLayerSet() != aZoneToCompare.GetLayerSet() )
58 return false;
59
60 if( GetNetCode() != aZoneToCompare.GetNetCode() )
61 return false;
62
63 if( GetAssignedPriority() != aZoneToCompare.GetAssignedPriority() )
64 return false;
65
66 // Compare zone specific parameters
67 if( GetIsRuleArea() != aZoneToCompare.GetIsRuleArea() )
68 return false;
69
70 if( GetIsRuleArea() )
71 {
72 if( GetDoNotAllowCopperPour() != aZoneToCompare.GetDoNotAllowCopperPour() )
73 return false;
74
75 if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() )
76 return false;
77
78 if( GetDoNotAllowTracks() != aZoneToCompare.GetDoNotAllowTracks() )
79 return false;
80
81 if( GetDoNotAllowPads() != aZoneToCompare.GetDoNotAllowPads() )
82 return false;
83
84 if( GetDoNotAllowFootprints() != aZoneToCompare.GetDoNotAllowFootprints() )
85 return false;
86 }
87
88 if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
89 return false;
90
91 if( m_ZoneMinThickness != aZoneToCompare.GetMinThickness() )
92 return false;
93
94 if( m_fillMode != aZoneToCompare.GetFillMode() )
95 return false;
96
97 if( m_PadConnection != aZoneToCompare.m_PadConnection )
98 return false;
99
100 if( m_thermalReliefGap != aZoneToCompare.m_thermalReliefGap )
101 return false;
102
104 return false;
105
106 if( m_zoneName != aZoneToCompare.m_zoneName )
107 return false;
108
109 if( m_islandRemovalMode != aZoneToCompare.m_islandRemovalMode )
110 return false;
111
112 if( m_minIslandArea != aZoneToCompare.m_minIslandArea )
113 return false;
114
115
116 // Compare outlines
117 wxASSERT( m_Poly ); // m_Poly == NULL Should never happen
118 wxASSERT( aZoneToCompare.Outline() );
119
120 if( Outline() != aZoneToCompare.Outline() ) // Compare vector
121 return false;
122
123 return true;
124}
SHAPE_POLY_SET * Outline()
Definition: zone.h:312
int GetMinThickness() const
Definition: zone.h:251
ZONE_FILL_MODE GetFillMode() const
Definition: zone.h:174

References ZONE::GetAssignedPriority(), ZONE::GetDoNotAllowCopperPour(), ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), ZONE::GetFillMode(), ZONE::GetIsRuleArea(), ZONE::GetLayerSet(), ZONE::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE::m_fillMode, ZONE::m_islandRemovalMode, ZONE::m_minIslandArea, ZONE::m_PadConnection, ZONE::m_Poly, ZONE::m_thermalReliefGap, ZONE::m_thermalReliefSpokeWidth, ZONE::m_ZoneClearance, ZONE::m_ZoneMinThickness, ZONE::m_zoneName, and ZONE::Outline().

Referenced by UpdateCopyOfZonesList().

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 107 of file eda_item.h.

107{ return m_flags & SELECTED; }

References EDA_ITEM::m_flags, and SELECTED.

Referenced by ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), SCH_EDIT_TOOL::ChangeTextType(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), EDIT_TOOL::doMoveSelection(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), DS_PROXY_UNDO_ITEM::DS_PROXY_UNDO_ITEM(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_PAINTER::getLineWidth(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), DIALOG_CHANGE_SYMBOLS::isMatch(), SCH_SCREEN::MarkConnections(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), KIGFX::SCH_PAINTER::nonCached(), SCH_MOVE_TOOL::orthoLineDrag(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), BOARD_COMMIT::Push(), EE_SELECTION_TOOL::RebuildSelection(), PCB_SELECTION_TOOL::RebuildSelection(), RENDER_3D_OPENGL::renderFootprint(), SCH_EDIT_TOOL::Rotate(), EE_TOOL_BASE< T >::saveCopyInUndoList(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), KIGFX::SCH_PAINTER::setDeviceColors(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), GERBVIEW_SELECTION_TOOL::unselect(), HIERARCHY_NAVIG_PANEL::UpdateHierarchySelection(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ IsShownAsBitmap()

bool EDA_ITEM::IsShownAsBitmap ( ) const
inlineinherited

Definition at line 175 of file eda_item.h.

175{ return m_flags & IS_SHOWN_AS_BITMAP; }
#define IS_SHOWN_AS_BITMAP

References IS_SHOWN_AS_BITMAP, and EDA_ITEM::m_flags.

◆ IsTeardropArea()

bool ZONE::IsTeardropArea ( ) const
inlineinherited

◆ IsTented()

virtual bool BOARD_ITEM::IsTented ( ) const
inlinevirtualinherited

Reimplemented in PCB_VIA.

Definition at line 133 of file board_item.h.

134 {
135 return false;
136 }

Referenced by BOARD_INSPECTION_TOOL::InspectClearance(), and DRC_TEST_PROVIDER_SILK_CLEARANCE::Run().

◆ IsType()

virtual bool EDA_ITEM::IsType ( const std::vector< KICAD_T > &  aScanTypes) const
inlinevirtualinherited

Check whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Reimplemented in SCH_FIELD, SCH_ITEM, SCH_LABEL_BASE, SCH_LINE, FP_SHAPE, FP_TEXT, FP_TEXTBOX, PAD, PCB_DIMENSION_BASE, PCB_SHAPE, PCB_TEXT, PCB_TEXTBOX, and PCB_VIA.

Definition at line 183 of file eda_item.h.

184 {
185 for( KICAD_T scanType : aScanTypes )
186 {
187 if( scanType == SCH_LOCATE_ANY_T || scanType == m_structType )
188 return true;
189 }
190
191 return false;
192 }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:507
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_LOCATE_ANY_T
Definition: typeinfo.h:183

References EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by SCH_EDIT_TOOL::AutoplaceFields(), ROUTER_TOOL::CanInlineDrag(), DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES(), SCH_FIELD::GetCanonicalName(), KIGFX::SCH_PAINTER::getLineWidth(), SCH_FIELD::GetName(), KIGFX::SCH_PAINTER::getRenderColor(), SCH_FIELD::GetShownText(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), SCH_ITEM::IsType(), FP_TEXT::IsType(), FP_TEXTBOX::IsType(), PAD::IsType(), PCB_DIMENSION_BASE::IsType(), PCB_SHAPE::IsType(), PCB_TEXT::IsType(), PCB_TEXTBOX::IsType(), PCB_VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), CONVERT_TOOL::makePolysFromChainedSegs(), EE_SELECTION_TOOL::RequestSelection(), SCH_FIELD::SetId(), SCH_BASE_FRAME::UpdateItem(), and EDA_ITEM::Visit().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 106 of file eda_item.h.

106{ return m_flags & IS_WIRE_IMAGE; }

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ Iterate()

SHAPE_POLY_SET::ITERATOR ZONE::Iterate ( )
inlineinherited

Return an iterator to visit all points of the zone's main outline without holes.

Returns
an iterator to visit the zone vertices without holes.

Definition at line 500 of file zone.h.

501 {
502 return m_Poly->Iterate();
503 }
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Return an object to iterate through the points of the polygons between aFirst and aLast.

References SHAPE_POLY_SET::Iterate(), and ZONE::m_Poly.

◆ IterateForward() [1/2]

template<class T >
static INSPECT_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  scanTypes 
)
inlinestaticinherited

This changes first parameter to avoid the DList and use the main queue instead.

Definition at line 304 of file eda_item.h.

306 {
307 for( const auto& it : aList )
308 {
309 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
310 testData,
311 scanTypes ) == INSPECT_RESULT::QUIT )
312 {
314 }
315 }
316
318 }
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:91

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

template<class T >
static INSPECT_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const std::vector< KICAD_T > &  scanTypes 
)
inlinestaticinherited

Change first parameter to avoid the DList and use std::vector instead.

Definition at line 324 of file eda_item.h.

326 {
327 for( const auto& it : aList )
328 {
329 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
330 testData,
331 scanTypes ) == INSPECT_RESULT::QUIT )
332 {
334 }
335 }
336
338 }

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ IterateWithHoles()

SHAPE_POLY_SET::ITERATOR ZONE::IterateWithHoles ( )
inlineinherited

Return an iterator to visit all points of the zone's main outline with holes.

Returns
an iterator to visit the zone vertices with holes.

Definition at line 510 of file zone.h.

511 {
512 return m_Poly->IterateWithHoles();
513 }

References SHAPE_POLY_SET::IterateWithHoles(), and ZONE::m_Poly.

Referenced by DSN::SPECCTRA_DB::makeIMAGE().

◆ layerMaskDescribe()

wxString BOARD_ITEM::layerMaskDescribe ( ) const
protectedvirtualinherited

Return a string (to be shown to the user) describing a layer mask.

Reimplemented in PCB_VIA.

Definition at line 106 of file board_item.cpp.

107{
108 const BOARD* board = GetBoard();
109 LSET layers = GetLayerSet();
110
111 // Try to be smart and useful. Check all copper first.
112 if( layers[F_Cu] && layers[B_Cu] )
113 return _( "all copper layers" );
114
115 LSET copperLayers = layers & board->GetEnabledLayers().AllCuMask();
116 LSET techLayers = layers & board->GetEnabledLayers().AllTechMask();
117
118 for( LSET testLayers : { copperLayers, techLayers, layers } )
119 {
120 for( int bit = PCBNEW_LAYER_ID_START; bit < PCB_LAYER_ID_COUNT; ++bit )
121 {
122 if( testLayers[ bit ] )
123 {
124 wxString layerInfo = board->GetLayerName( static_cast<PCB_LAYER_ID>( bit ) );
125
126 if( testLayers.count() > 1 )
127 layerInfo << wxS( " " ) + _( "and others" );
128
129 return layerInfo;
130 }
131 }
132 }
133
134 // No copper, no technicals: no layer
135 return _( "no layers" );
136}
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
Definition: board_item.h:185
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:526
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:841
@ PCBNEW_LAYER_ID_START
Definition: layer_ids.h:63
@ B_Cu
Definition: layer_ids.h:95
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
@ F_Cu
Definition: layer_ids.h:64

References _, LSET::AllCuMask(), LSET::AllTechMask(), B_Cu, F_Cu, BOARD_ITEM::GetBoard(), BOARD::GetEnabledLayers(), BOARD::GetLayerName(), BOARD_ITEM::GetLayerSet(), PCB_LAYER_ID_COUNT, and PCBNEW_LAYER_ID_START.

Referenced by PAD::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), and PAD::GetSelectMenuText().

◆ Matches() [1/2]

bool ZONE::Matches ( const EDA_SEARCH_DATA aSearchData,
void *  aAuxData 
) const
inlineoverridevirtualinherited

Compare the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented from EDA_ITEM.

Definition at line 127 of file zone.h.

128 {
129 return BOARD_ITEM::Matches( GetZoneName(), aSearchData );
130 }
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition: eda_item.h:384
wxString GetZoneName() const
Definition: zone.h:124

References ZONE::GetZoneName(), and EDA_ITEM::Matches().

Referenced by DIALOG_FIND::search(), and ZONE_SEARCH_HANDLER::Search().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
const EDA_SEARCH_DATA aSearchData 
) const
protectedinherited

Compare aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 117 of file eda_item.cpp.

118{
119 wxString text = aText;
120 wxString searchText = aSearchData.findString;
121
122 // Don't match if searching for replaceable item and the item doesn't support text replace.
123 if( aSearchData.searchAndReplace && !IsReplaceable() )
124 return false;
125
126 if( !aSearchData.matchCase )
127 {
128 text.MakeUpper();
129 searchText.MakeUpper();
130 }
131
133 {
134 int ii = 0;
135
136 while( ii < (int) text.length() )
137 {
138 int next = text.find( searchText, ii );
139
140 if( next == wxNOT_FOUND )
141 return false;
142
143 ii = next;
144 next += searchText.length();
145
146 bool startOK = ( ii == 0 || !wxIsalnum( text.GetChar( ii - 1 ) ) );
147 bool endOK = ( next == (int) text.length() || !wxIsalnum( text.GetChar( next ) ) );
148
149 if( startOK && endOK )
150 return true;
151 else
152 ii++;
153 }
154
155 return false;
156 }
157 else if( aSearchData.matchMode == EDA_SEARCH_MATCH_MODE::WILDCARD )
158 {
159 return text.Matches( searchText );
160 }
161 else
162 {
163 return text.Find( searchText ) != wxNOT_FOUND;
164 }
165}
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:422
CITER next(CITER it)
Definition: ptree.cpp:126
EDA_SEARCH_MATCH_MODE matchMode

References EDA_SEARCH_DATA::findString, EDA_ITEM::IsReplaceable(), EDA_SEARCH_DATA::matchCase, EDA_SEARCH_DATA::matchMode, next(), EDA_SEARCH_DATA::searchAndReplace, text, WHOLEWORD, and WILDCARD.

◆ Mirror()

void ZONE::Mirror ( const VECTOR2I aMirrorRef,
bool  aMirrorLeftRight 
)
inherited

Mirror the outlines relative to a given horizontal axis the layer is not changed.

Parameters
aMirrorRefis axis position
aMirrorLeftRightmirror across Y axis (otherwise mirror across X)

Definition at line 700 of file zone.cpp.

701{
702 m_Poly->Mirror( aMirrorLeftRight, !aMirrorLeftRight, aMirrorRef );
703
704 HatchBorder();
705
706 for( std::pair<const PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>>& pair : m_FilledPolysList )
707 pair.second->Mirror( aMirrorLeftRight, !aMirrorLeftRight, aMirrorRef );
708}
void Mirror(bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 })
Mirror the line points about y or x (or both)
void HatchBorder()
Compute the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_bor...
Definition: zone.cpp:852

References ZONE::HatchBorder(), ZONE::m_FilledPolysList, ZONE::m_Poly, and SHAPE_POLY_SET::Mirror().

Referenced by ZONE::Flip().

◆ Move()

void ZONE::Move ( const VECTOR2I offset)
overridevirtualinherited

Move the outlines.

Parameters
offsetis moving vector

Reimplemented from BOARD_ITEM.

Definition at line 626 of file zone.cpp.

627{
628 /* move outlines */
629 m_Poly->Move( offset );
630
631 HatchBorder();
632
633 /* move fills */
634 for( std::pair<const PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>>& pair : m_FilledPolysList )
635 pair.second->Move( offset );
636
637 /*
638 * move boundingbox cache
639 *
640 * While the cache will get nuked at the conclusion of the operation, we use it for some
641 * things (such as drawing the parent group) during the move.
642 */
643 if( GetBoard() )
644 {
645 auto it = GetBoard()->m_ZoneBBoxCache.find( this );
646
647 if( it != GetBoard()->m_ZoneBBoxCache.end() )
648 it->second.Move( offset );
649 }
650}
void Move(const VECTOR2I &aVector) override

References BOARD_ITEM::GetBoard(), ZONE::HatchBorder(), ZONE::m_FilledPolysList, ZONE::m_Poly, BOARD::m_ZoneBBoxCache, and SHAPE_POLY_SET::Move().

◆ MoveEdge()

void ZONE::MoveEdge ( const VECTOR2I offset,
int  aEdge 
)
inherited

Move the outline Edge.

Parameters
offsetis moving vector
aEdgeis start point of the outline edge

Definition at line 666 of file zone.cpp.

667{
668 int next_corner;
669
670 if( m_Poly->GetNeighbourIndexes( aEdge, nullptr, &next_corner ) )
671 {
672 m_Poly->SetVertex( aEdge, m_Poly->CVertex( aEdge ) + VECTOR2I( offset ) );
673 m_Poly->SetVertex( next_corner, m_Poly->CVertex( next_corner ) + VECTOR2I( offset ) );
674 HatchBorder();
675
676 SetNeedRefill( true );
677 }
678}
void SetVertex(const VERTEX_INDEX &aIndex, const VECTOR2I &aPos)
Accessor function to set the position of a specific point.
bool GetNeighbourIndexes(int aGlobalIndex, int *aPrevious, int *aNext)
Return the global indexes of the previous and the next corner of the aGlobalIndex-th corner of a cont...

References SHAPE_POLY_SET::CVertex(), SHAPE_POLY_SET::GetNeighbourIndexes(), ZONE::HatchBorder(), ZONE::m_Poly, ZONE::SetNeedRefill(), and SHAPE_POLY_SET::SetVertex().

◆ NeedRefill()

bool ZONE::NeedRefill ( ) const
inlineinherited

Definition at line 245 of file zone.h.

245{ return m_needRefill; }

References ZONE::m_needRefill.

◆ NewHole()

void ZONE::NewHole ( )
inlineinherited

Create a new hole on the zone; i.e., a new contour on the zone's outline.

Definition at line 564 of file zone.h.

565 {
566 m_Poly->NewHole();
567 }
int NewHole(int aOutline=-1)
Adds a new outline to the set and returns its index.

References ZONE::m_Poly, and SHAPE_POLY_SET::NewHole().

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageCircle().

◆ operator<()

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 231 of file eda_item.cpp.

232{
233 wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
234 GetClass() ) );
235
236 return false;
237}

References Format(), and EDA_ITEM::GetClass().

◆ operator=()

FP_ZONE & FP_ZONE::operator= ( const FP_ZONE aOther)

Definition at line 1272 of file zone.cpp.

1273{
1274 ZONE::operator=( aOther );
1275 return *this;
1276}
ZONE & operator=(const ZONE &aOther)
Definition: zone.cpp:82

References ZONE::operator=().

◆ Outline() [1/2]

◆ Outline() [2/2]

const SHAPE_POLY_SET * ZONE::Outline ( ) const
inlineinherited

Definition at line 313 of file zone.h.

313{ return m_Poly; }

References ZONE::m_Poly.

◆ RemoveAllContours()

void ZONE::RemoveAllContours ( void  )
inlineinherited

Definition at line 525 of file zone.h.

526 {
528 }

References ZONE::m_Poly, and SHAPE_POLY_SET::RemoveAllContours().

◆ RemoveCutout()

void ZONE::RemoveCutout ( int  aOutlineIdx,
int  aHoleIdx 
)
inherited

Remove a cutout from the zone.

Parameters
aOutlineIdxis the zone outline the hole belongs to
aHoleIdxis the hole in the outline to remove

Definition at line 711 of file zone.cpp.

712{
713 // Ensure the requested cutout is valid
714 if( m_Poly->OutlineCount() < aOutlineIdx || m_Poly->HoleCount( aOutlineIdx ) < aHoleIdx )
715 return;
716
717 SHAPE_POLY_SET cutPoly( m_Poly->Hole( aOutlineIdx, aHoleIdx ) );
718
719 // Add the cutout back to the zone
721
722 SetNeedRefill( true );
723}

References SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), ZONE::m_Poly, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_FAST, and ZONE::SetNeedRefill().

Referenced by EDIT_TOOL::DeleteItems().

◆ RenderAsBitmap()

virtual bool EDA_ITEM::RenderAsBitmap ( double  aWorldScale) const
inlinevirtualinherited

Reimplemented in SCH_ITEM.

Definition at line 165 of file eda_item.h.

165{ return false; }

◆ Replace() [1/2]

virtual bool EDA_ITEM::Replace ( const EDA_SEARCH_DATA aSearchData,
void *  aAuxData = nullptr 
)
inlinevirtualinherited

Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented in LIB_TEXTBOX, SCH_LABEL_BASE, SCH_PIN, SCH_TEXT, SCH_TEXTBOX, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 411 of file eda_item.h.

412 {
413 return false;
414 }

◆ Replace() [2/2]

bool EDA_ITEM::Replace ( const EDA_SEARCH_DATA aSearchData,
wxString &  aText 
)
staticinherited

Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 168 of file eda_item.cpp.

169{
170 wxString text = aText;
171 wxString searchText = aSearchData.findString;
172 wxString result;
173 bool replaced = false;
174
175 if( !aSearchData.matchCase )
176 {
177 text = text.Upper();
178 searchText = searchText.Upper();
179 }
180
181 int ii = 0;
182
183 while( ii < (int) text.length() )
184 {
185 int next = text.find( searchText, ii );
186
187 if( next == wxNOT_FOUND )
188 {
189 result += aText.Mid( ii, wxString::npos );
190 break;
191 }
192
193 if( next > ii )
194 result += aText.Mid( ii, next - ii );
195
196 ii = next;
197 next += searchText.length();
198
199 bool startOK;
200 bool endOK;
201
203 {
204 startOK = ( ii == 0 || !wxIsalnum( text.GetChar( ii - 1 ) ) );
205 endOK = ( next == (int) text.length() || !wxIsalnum( text.GetChar( next ) ) );
206 }
207 else
208 {
209 startOK = true;
210 endOK = true;
211 }
212
213 if( startOK && endOK )
214 {
215 result += aSearchData.replaceString;
216 replaced = true;
217 ii = next;
218 }
219 else
220 {
221 result += aText.GetChar( ii );
222 ii++;
223 }
224 }
225
226 aText = result;
227 return replaced;
228}
wxString replaceString

References EDA_SEARCH_DATA::findString, EDA_SEARCH_DATA::matchCase, EDA_SEARCH_DATA::matchMode, next(), EDA_SEARCH_DATA::replaceString, text, and WHOLEWORD.

Referenced by EDA_TEXT::Replace(), SCH_FIELD::Replace(), SCH_EDITOR_CONTROL::ReplaceAll(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Rotate()

void ZONE::Rotate ( const VECTOR2I aCentre,
const EDA_ANGLE aAngle 
)
overridevirtualinherited

Rotate the outlines.

Parameters
aCentreis rot centre

Reimplemented from BOARD_ITEM.

Definition at line 681 of file zone.cpp.

682{
683 m_Poly->Rotate( aAngle, VECTOR2I( aCentre ) );
684 HatchBorder();
685
686 /* rotate filled areas: */
687 for( std::pair<const PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>>& pair : m_FilledPolysList )
688 pair.second->Rotate( aAngle, aCentre );
689}
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.

References ZONE::HatchBorder(), ZONE::m_FilledPolysList, ZONE::m_Poly, and SHAPE_POLY_SET::Rotate().

Referenced by ALTIUM_PCB::ConvertFills6ToBoardItemWithNet(), EAGLE_PLUGIN::loadPlain(), DSN::SPECCTRA_DB::makeIMAGE(), and EAGLE_PLUGIN::packageRectangle().

◆ SameNet()

bool ZONE::SameNet ( const ZONE aOther) const
inherited

Definition at line 200 of file zone.cpp.

201{
202 return GetNetCode() == aOther->GetNetCode();
203}

References BOARD_CONNECTED_ITEM::GetNetCode().

◆ Set() [1/3]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 66 of file inspectable.h.

67 {
69 TYPE_ID thisType = TYPE_HASH( *this );
70 PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71 void* object = nullptr;
72
73 if( prop )
74 {
75 object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76
77 if( object )
78 prop->set<T>( object, aValue );
79 }
80
81 return object != nullptr;
82 }
void set(void *aObject, T aValue)
Definition: property.h:275

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [2/3]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 54 of file inspectable.h.

55 {
57 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
58
59 if( object )
60 aProperty->set<T>( object, aValue );
61
62 return object != nullptr;
63 }

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/3]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 42 of file inspectable.h.

43 {
45 void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
46
47 if( object )
48 aProperty->setter( object, aValue );
49
50 return object != nullptr;
51 }
virtual void setter(void *aObject, wxAny &aValue)=0

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by PCB_PROPERTIES_PANEL::valueChanged().

◆ SetAssignedPriority()

◆ SetBorderDisplayStyle()

void ZONE::SetBorderDisplayStyle ( ZONE_BORDER_DISPLAY_STYLE  aBorderHatchStyle,
int  aBorderHatchPitch,
bool  aRebuilBorderdHatch 
)
inherited

Set all hatch parameters for the zone.

Parameters
aBorderHatchStyleis the style of the hatch, specified as one of HATCH_STYLE possible values.
aBorderHatchPitchis the hatch pitch in iu.
aRebuildBorderHatchis a flag to indicate whether to re-hatch after having set the previous parameters.

Definition at line 817 of file zone.cpp.

819{
820 aBorderHatchPitch = std::max( aBorderHatchPitch,
822 aBorderHatchPitch = std::min( aBorderHatchPitch,
824 SetBorderHatchPitch( aBorderHatchPitch );
825 m_borderStyle = aBorderHatchStyle;
826
827 if( aRebuildBorderHatch )
828 HatchBorder();
829}
void SetBorderHatchPitch(int aPitch)
Set the hatch pitch parameter for the zone.
Definition: zone.cpp:832
#define ZONE_BORDER_HATCH_MINDIST_MM
Definition: zones.h:40
#define ZONE_BORDER_HATCH_MAXDIST_MM
Definition: zones.h:41

References ZONE::HatchBorder(), ZONE::m_borderStyle, EDA_IU_SCALE::mmToIU(), pcbIUScale, ZONE::SetBorderHatchPitch(), ZONE_BORDER_HATCH_MAXDIST_MM, and ZONE_BORDER_HATCH_MINDIST_MM.

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), ALTIUM_PCB::ConvertFills6ToBoardItemWithNet(), ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem(), ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItem(), ZONE_SETTINGS::ExportSetting(), ALTIUM_PCB::HelperPcpShapeAsBoardKeepoutRegion(), ALTIUM_PCB::HelperPcpShapeAsFootprintKeepoutRegion(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), and ALTIUM_PCB::ParsePolygons6Data().

◆ SetBorderHatchPitch()

void ZONE::SetBorderHatchPitch ( int  aPitch)
inherited

Set the hatch pitch parameter for the zone.

Parameters
aPitchis the hatch pitch in iu.

Definition at line 832 of file zone.cpp.

833{
834 m_borderHatchPitch = aPitch;
835}

References ZONE::m_borderHatchPitch.

Referenced by ZONE::SetBorderDisplayStyle().

◆ SetBrightened()

◆ SetCornerPosition()

void ZONE::SetCornerPosition ( int  aCornerIndex,
const VECTOR2I new_pos 
)
inlineinherited

Definition at line 541 of file zone.h.

542 {
543 SHAPE_POLY_SET::VERTEX_INDEX relativeIndices;
544
545 // Convert global to relative indices
546 if( m_Poly->GetRelativeIndices( aCornerIndex, &relativeIndices ) )
547 {
548 if( m_Poly->CVertex( relativeIndices ).x != new_pos.x
549 || m_Poly->CVertex( relativeIndices ).y != new_pos.y )
550 {
551 SetNeedRefill( true );
552 m_Poly->SetVertex( relativeIndices, new_pos );
553 }
554 }
555 else
556 {
557 throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
558 }
559 }

References SHAPE_POLY_SET::CVertex(), SHAPE_POLY_SET::GetRelativeIndices(), ZONE::m_Poly, ZONE::SetNeedRefill(), SHAPE_POLY_SET::SetVertex(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ SetCornerRadius()

void ZONE::SetCornerRadius ( unsigned int  aRadius)
inherited

Definition at line 372 of file zone.cpp.

373{
374 if( m_cornerRadius != aRadius )
375 SetNeedRefill( true );
376
377 m_cornerRadius = aRadius;
378}

References ZONE::m_cornerRadius, and ZONE::SetNeedRefill().

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetCornerSmoothingType()

void ZONE::SetCornerSmoothingType ( int  aType)
inlineinherited

Definition at line 646 of file zone.h.

646{ m_cornerSmoothingType = aType; };

References ZONE::m_cornerSmoothingType.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetDoNotAllowCopperPour()

◆ SetDoNotAllowFootprints()

◆ SetDoNotAllowPads()

◆ SetDoNotAllowTracks()

◆ SetDoNotAllowVias()

◆ SetFilledPolysList()

void ZONE::SetFilledPolysList ( PCB_LAYER_ID  aLayer,
const SHAPE_POLY_SET aPolysList 
)
inlineinherited

Set the list of filled polygons.

Definition at line 623 of file zone.h.

624 {
625 m_FilledPolysList[aLayer] = std::make_shared<SHAPE_POLY_SET>( aPolysList );
626 }

References ZONE::m_FilledPolysList.

Referenced by ZONE_FILLER::Fill(), CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers(), and ALTIUM_PCB::ParseRegions6Data().

◆ SetFillFlag()

void ZONE::SetFillFlag ( PCB_LAYER_ID  aLayer,
bool  aFlag 
)
inlineinherited

Definition at line 240 of file zone.h.

240{ m_fillFlags.set( aLayer, aFlag ); }

References ZONE::m_fillFlags.

Referenced by DRC_TEST_PROVIDER_SOLDER_MASK::buildRTrees(), and ZONE_FILLER::Fill().

◆ SetFillMode()

◆ SetFlags()

void EDA_ITEM::SetFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 142 of file eda_item.h.

142{ m_flags |= aMask; }

References EDA_ITEM::m_flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddFootprintToBoard(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_ALTIUM_PLUGIN::AddTextBox(), SCH_MOVE_TOOL::AlignElements(), PCB_CONTROL::AppendBoard(), FOOTPRINT::BuildCourtyardCaches(), SCH_EDIT_TOOL::ChangeTextType(), GRAPHICS_CLEANER::cleanupShapes(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), SCH_DRAWING_TOOLS::createSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::EnterGroup(), PAD_TOOL::explodePad(), SCH_MOVE_TOOL::getConnectedDragItems(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), EE_COLLECTOR::Inspect(), CONVERT_TOOL::makePolysFromChainedSegs(), CONVERT_TOOL::makePolysFromClosedGraphics(), CONVERT_TOOL::makePolysFromOpenGraphics(), SCH_SCREEN::MarkConnections(), TRACKS_CLEANER::mergeCollinearSegments(), SCH_MOVE_TOOL::moveItem(), SYMBOL_EDITOR_MOVE_TOOL::moveItem(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_MOVE_TOOL::orthoLineDrag(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseHarnessPort(), SCH_ALTIUM_PLUGIN::ParseJunction(), SCH_ALTIUM_PLUGIN::ParseLabel(), SCH_ALTIUM_PLUGIN::ParseLine(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseNoERC(), SCH_ALTIUM_PLUGIN::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseSignalHarness(), SCH_ALTIUM_PLUGIN::ParseWire(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), SCH_SYMBOL::Plot(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_SELECTION_TOOL::RebuildSelection(), BOARD::Remove(), FOOTPRINT::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_TOOL::Rotate(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::SelectAll(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetIsShownAsBitmap(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 201 of file eda_item.h.

201{ m_forceVisible = aEnable; }

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetHatchBorderAlgorithm()

void ZONE::SetHatchBorderAlgorithm ( int  aAlgo)
inlineinherited

Definition at line 279 of file zone.h.

279{ m_hatchBorderAlgorithm = aAlgo; }

References ZONE::m_hatchBorderAlgorithm.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchGap()

void ZONE::SetHatchGap ( int  aStep)
inlineinherited

◆ SetHatchHoleMinArea()

void ZONE::SetHatchHoleMinArea ( double  aPct)
inlineinherited

Definition at line 276 of file zone.h.

276{ m_hatchHoleMinArea = aPct; }

References ZONE::m_hatchHoleMinArea.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchOrientation()

void ZONE::SetHatchOrientation ( const EDA_ANGLE aStep)
inlineinherited

◆ SetHatchSmoothingLevel()

void ZONE::SetHatchSmoothingLevel ( int  aLevel)
inlineinherited

Definition at line 270 of file zone.h.

270{ m_hatchSmoothingLevel = aLevel; }

References ZONE::m_hatchSmoothingLevel.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchSmoothingValue()

void ZONE::SetHatchSmoothingValue ( double  aValue)
inlineinherited

Definition at line 273 of file zone.h.

273{ m_hatchSmoothingValue = aValue; }

References ZONE::m_hatchSmoothingValue.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchStyle()

void ZONE::SetHatchStyle ( ZONE_BORDER_DISPLAY_STYLE  aStyle)
inlineinherited

◆ SetHatchThickness()

void ZONE::SetHatchThickness ( int  aThickness)
inlineinherited

◆ SetIsFilled()

void ZONE::SetIsFilled ( bool  isFilled)
inlineinherited

◆ SetIsIsland()

void ZONE::SetIsIsland ( PCB_LAYER_ID  aLayer,
int  aPolyIdx 
)
inlineinherited

Definition at line 637 of file zone.h.

638 {
639 m_insulatedIslands[aLayer].insert( aPolyIdx );
640 }

References ZONE::m_insulatedIslands.

Referenced by ZONE_FILLER::Fill().

◆ SetIsKnockout()

virtual void BOARD_ITEM::SetIsKnockout ( bool  aKnockout)
inlinevirtualinherited

Definition at line 251 of file board_item.h.

251{ m_isKnockout = aKnockout; }

References BOARD_ITEM::m_isKnockout.

Referenced by PCB_TEXT_DESC::PCB_TEXT_DESC().

◆ SetIslandRemovalMode()

void ZONE::SetIslandRemovalMode ( ISLAND_REMOVAL_MODE  aRemove)
inlineinherited

◆ SetIsRuleArea()

◆ SetIsShownAsBitmap()

void EDA_ITEM::SetIsShownAsBitmap ( bool  aBitmap)
inlineinherited

Definition at line 167 of file eda_item.h.

168 {
169 if( aBitmap )
171 else
173 }

References EDA_ITEM::ClearFlags(), IS_SHOWN_AS_BITMAP, and EDA_ITEM::SetFlags().

◆ SetLayer()

void ZONE::SetLayer ( PCB_LAYER_ID  aLayer)
overridevirtualinherited

Set the layer this item is on.

This method is virtual because some items (in fact: class DIMENSION) have a slightly different initialization.

Parameters
aLayerThe layer number.

Reimplemented from BOARD_ITEM.

Definition at line 257 of file zone.cpp.

258{
259 SetLayerSet( LSET( aLayer ) );
260}

References ZONE::SetLayerSet().

Referenced by BOARD::AddArea(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), TEARDROP_MANAGER::createTeardrop(), CADSTAR_PCB_ARCHIVE_LOADER::loadAreas(), CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates(), FABMASTER::loadZone(), PlotSolderMaskLayer(), setKeepoutSettingsToZone(), and ZONE_DESC::ZONE_DESC().

◆ SetLayerSet()

void ZONE::SetLayerSet ( LSET  aLayerSet)
overridevirtualinherited

Reimplemented from BOARD_ITEM.

Definition at line 263 of file zone.cpp.

264{
265 if( aLayerSet.count() == 0 )
266 return;
267
268 if( m_layerSet != aLayerSet )
269 {
270 SetNeedRefill( true );
271
272 UnFill();
273
274 m_FilledPolysList.clear();
275 m_filledPolysHash.clear();
276 m_insulatedIslands.clear();
277
278 for( PCB_LAYER_ID layer : aLayerSet.Seq() )
279 {
280 m_FilledPolysList[layer] = std::make_shared<SHAPE_POLY_SET>();
281 m_filledPolysHash[layer] = {};
282 m_insulatedIslands[layer] = {};
283 }
284 }
285
286 m_layerSet = aLayerSet;
287}
bool UnFill()
Removes the zone filling.
Definition: zone.cpp:206

References ZONE::m_filledPolysHash, ZONE::m_FilledPolysList, ZONE::m_insulatedIslands, ZONE::m_layerSet, LSET::Seq(), ZONE::SetNeedRefill(), and ZONE::UnFill().

Referenced by BOARD::BOARD(), ZONE_SETTINGS::ExportSetting(), ZONE::Flip(), ALTIUM_PCB::HelperSetZoneLayers(), ZONE::InitDataFromSrcInCopyCtor(), CADSTAR_PCB_ARCHIVE_LOADER::loadAreas(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas(), FABMASTER::loadZone(), setKeepoutSettingsToZone(), and ZONE::SetLayer().

◆ SetLocalClearance()

◆ SetLocalFlags()

void ZONE::SetLocalFlags ( int  aFlags)
inlineinherited

Definition at line 310 of file zone.h.

310{ m_localFlgs = aFlags; }

References ZONE::m_localFlgs.

Referenced by ZONE::InitDataFromSrcInCopyCtor(), and ZONE::ZONE().

◆ SetLocalRatsnestVisible()

void BOARD_CONNECTED_ITEM::SetLocalRatsnestVisible ( bool  aVisible)
inlineinherited

Definition at line 166 of file board_connected_item.h.

167 {
168 m_localRatsnestVisible = aVisible;
169 }

References BOARD_CONNECTED_ITEM::m_localRatsnestVisible.

◆ SetLocked()

◆ SetMinIslandArea()

void ZONE::SetMinIslandArea ( long long int  aArea)
inlineinherited

Definition at line 715 of file zone.h.

715{ m_minIslandArea = aArea; }

References ZONE::m_minIslandArea.

Referenced by ZONE_SETTINGS::ExportSetting(), and CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates().

◆ SetMinThickness()

void ZONE::SetMinThickness ( int  aMinThickness)
inlineinherited

◆ SetModified()

◆ SetNeedRefill()

◆ SetNet()

◆ SetNetCode() [1/2]

void BOARD_CONNECTED_ITEM::SetNetCode ( int  aNetCode)
inlineinherited

Definition at line 106 of file board_connected_item.h.

107 {
108 SetNetCode( aNetCode, false );
109 }

References BOARD_CONNECTED_ITEM::SetNetCode().

◆ SetNetCode() [2/2]

bool BOARD_CONNECTED_ITEM::SetNetCode ( int  aNetCode,
bool  aNoAssert 
)
inherited

Set net using a net code.

Note
Pads not on copper layers will have their net code always set to 0 (not connected).
Parameters
aNetCodeis a net code for the new net. It has to exist in NETINFO_LIST held by BOARD.
aNoAssertif true, do not assert that the net exists. Otherwise, item is assigned to the unconnected net.
Returns
true on success, false if the net did not exist

Definition at line 44 of file board_connected_item.cpp.

45{
46 if( !IsOnCopperLayer() )
47 aNetCode = 0;
48
49 // if aNetCode < 0 (typically NETINFO_LIST::FORCE_ORPHANED) or no parent board,
50 // set the m_netinfo to the dummy NETINFO_LIST::ORPHANED
51
52 BOARD* board = GetBoard();
53
54 if( ( aNetCode >= 0 ) && board )
55 m_netinfo = board->FindNet( aNetCode );
56 else
58
59 if( !aNoAssert )
60 wxASSERT( m_netinfo );
61
62 return ( m_netinfo != nullptr );
63}
virtual bool IsOnCopperLayer() const
Definition: board_item.h:123
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1417
static NETINFO_ITEM * OrphanedItem()
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString,...
Definition: netinfo.h:381

References BOARD::FindNet(), BOARD_ITEM::GetBoard(), BOARD_ITEM::IsOnCopperLayer(), BOARD_CONNECTED_ITEM::m_netinfo, and NETINFO_LIST::OrphanedItem().

Referenced by BOARD::AddArea(), PNS_KICAD_IFACE::AddItem(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertFills6ToBoardItemWithNet(), ALTIUM_PCB::ConvertTracks6ToBoardItemOnLayer(), TEARDROP_MANAGER::createTeardrop(), PCB_EDIT_FRAME::Edit_Zone_Params(), ZONE_SETTINGS::ExportSetting(), FOOTPRINT::FOOTPRINT(), FP_ZONE(), ROUTER_TOOL::handleLayerSwitch(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), DSN::SPECCTRA_DB::makeTRACK(), CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromShapes(), FOOTPRINT::operator=(), ALTIUM_PCB::ParsePolygons6Data(), BOARD_CONNECTED_ITEM::SetNetCode(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::transferDataToPad(), PNS_KICAD_IFACE::UpdateItem(), and ROUTER_TOOL::updateSizesAfterLayerSwitch().

◆ SetOutline()

void ZONE::SetOutline ( SHAPE_POLY_SET aOutline)
inlineinherited

Definition at line 315 of file zone.h.

315{ m_Poly = aOutline; }

References ZONE::m_Poly.

Referenced by FABMASTER::loadZone().

◆ SetPadConnection()

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in LIB_SYMBOL, and PCB_DIMENSION_BASE.

Definition at line 100 of file eda_item.h.

100{ m_parent = aParent; }

References EDA_ITEM::m_parent.

Referenced by BOARD::Add(), FOOTPRINT::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewFootprint(), SCH_SHEET::AddPin(), PAD::AddPrimitive(), PAD::AddPrimitiveAnnotationBox(), PAD::AddPrimitiveArc(), PAD::AddPrimitiveCircle(), PAD::AddPrimitiveCurve(), PAD::AddPrimitivePoly(), PAD::AddPrimitiveRect(), PAD::AddPrimitiveSegment(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SCH_SCREEN::Append(), LIB_FIELD::Copy(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_SYMBOL::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_PLUGIN::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), LIB_SYMBOL::LIB_SYMBOL(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), LIB_SYMBOL::operator=(), FOOTPRINT::operator=(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PCB_CONTROL::Paste(), pasteFootprintItemsToFootprintEditor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BACK_ANNOTATE::processNetNameChange(), BOARD_COMMIT::Push(), SCH_LIB_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::saveCopyInUndoList(), SaveCopyOfZones(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET_PIN::SCH_SHEET_PIN(), LIB_SYMBOL::SetFields(), PCB_DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_LABEL_BASE::SwapData(), SCH_SHEET::SwapData(), SCH_SYMBOL::SwapData(), BOARD_ITEM::SwapItemData(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetParentGroup()

◆ SetPosition()

void ZONE::SetPosition ( const VECTOR2I aPos)
inlineoverridevirtualinherited

◆ SetSelected()

◆ SetSelectedCorner()

void ZONE::SetSelectedCorner ( int  aCorner)
inlineinherited

Definition at line 292 of file zone.h.

293 {
294 SHAPE_POLY_SET::VERTEX_INDEX selectedCorner;
295
296 // If the global index of the corner is correct, assign it to m_CornerSelection
297 if( m_Poly->GetRelativeIndices( aCorner, &selectedCorner ) )
298 {
299 if( m_CornerSelection == nullptr )
301
302 *m_CornerSelection = selectedCorner;
303 }
304 else
305 throw( std::out_of_range( "aCorner-th vertex does not exist" ) );
306 }

References SHAPE_POLY_SET::GetRelativeIndices(), ZONE::m_CornerSelection, and ZONE::m_Poly.

◆ SetState()

void EDA_ITEM::SetState ( EDA_ITEM_FLAGS  type,
bool  state 
)
inlineinherited

Definition at line 131 of file eda_item.h.

132 {
133 if( state )
134 m_status |= type; // state = ON or OFF
135 else
136 m_status &= ~type;
137 }

References EDA_ITEM::m_status.

Referenced by LEGACY_PLUGIN::loadTrackList(), and TRACKS_CLEANER::mergeCollinearSegments().

◆ SetStatus()

void EDA_ITEM::SetStatus ( EDA_ITEM_FLAGS  aStatus)
inlineinherited

Definition at line 140 of file eda_item.h.

140{ m_status = aStatus; }

References EDA_ITEM::m_status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetStroke()

void BOARD_ITEM::SetStroke ( const STROKE_PARAMS aStroke)
virtualinherited

Reimplemented in PCB_SHAPE.

Definition at line 88 of file board_item.cpp.

89{
90 wxCHECK( false, /* void */ );
91}

◆ SetTeardropAreaType()

void ZONE::SetTeardropAreaType ( TEARDROP_TYPE  aType)
inlineinherited

Set the type of teardrop if the zone is a teardrop area for non teardrop area, the type must be TEARDROP_TYPE::TD_NONE.

Definition at line 687 of file zone.h.

687{ m_teardropType = aType; }

References ZONE::m_teardropType.

Referenced by TEARDROP_MANAGER::createTeardrop(), and ZONE_SETTINGS::ExportSetting().

◆ SetThermalReliefGap()

void ZONE::SetThermalReliefGap ( int  aThermalReliefGap)
inlineinherited

◆ SetThermalReliefSpokeWidth()

void ZONE::SetThermalReliefSpokeWidth ( int  aThermalReliefSpokeWidth)
inlineinherited

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 117 of file eda_item.h.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ SetX()

void BOARD_ITEM::SetX ( int  aX)
inlineinherited

Definition at line 98 of file board_item.h.

99 {
100 VECTOR2I p( aX, GetY() );
101 SetPosition( p );
102 }
int GetY() const
Definition: board_item.h:82
virtual void SetPosition(const VECTOR2I &aPos)
Definition: eda_item.h:252

References BOARD_ITEM::GetY(), and EDA_ITEM::SetPosition().

Referenced by BOARD_ITEM_DESC::BOARD_ITEM_DESC(), and TRACK_VIA_DESC::TRACK_VIA_DESC().

◆ SetY()

void BOARD_ITEM::SetY ( int  aY)
inlineinherited

Definition at line 104 of file board_item.h.

105 {
106 VECTOR2I p( GetX(), aY );
107 SetPosition( p );
108 }
int GetX() const
Definition: board_item.h:76

References BOARD_ITEM::GetX(), and EDA_ITEM::SetPosition().

Referenced by BOARD_ITEM_DESC::BOARD_ITEM_DESC(), and TRACK_VIA_DESC::TRACK_VIA_DESC().

◆ SetZoneName()

◆ Sort()

static bool EDA_ITEM::Sort ( const EDA_ITEM aLeft,