KiCad PCB EDA Suite
MODULE_ZONE_CONTAINER Class Reference

MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER is living in a board MODULE_ZONE_CONTAINER is living in a footprint althougt the are similar, these items need a specific type to be easily managed in many functions using the type id in switches A few virtual methods are different. More...

#include <class_zone.h>

Inheritance diagram for MODULE_ZONE_CONTAINER:
ZONE_CONTAINER BOARD_CONNECTED_ITEM BOARD_ITEM EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 MODULE_ZONE_CONTAINER (BOARD_ITEM_CONTAINER *aParent)
 
 MODULE_ZONE_CONTAINER (const MODULE_ZONE_CONTAINER &aZone)
 
MODULE_ZONE_CONTAINERoperator= (const MODULE_ZONE_CONTAINER &aOther)
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
double ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
void InitDataFromSrcInCopyCtor (const ZONE_CONTAINER &aZone)
 Copy aZone data to me. More...
 
wxPoint GetPosition () const override
 
void SetPosition (const wxPoint &aPos) override
 
void SetPriority (unsigned aPriority)
 Function SetPriority. More...
 
unsigned GetPriority () const
 Function GetPriority. More...
 
void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
void SetLayerSet (LSET aLayerSet) override
 
virtual LSET GetLayerSet () const override
 Function GetLayerSet returns a std::bitset of all layers on which the item physically resides. More...
 
wxString GetZoneName () const
 
void SetZoneName (const wxString &aName)
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox (virtual) More...
 
const EDA_RECT GetCachedBoundingBox () const
 ONLY TO BE USED BY CLIENTS WHICH SET UP THE CACHE! More...
 
void CacheBoundingBox ()
 
int GetLocalClearance (wxString *aSource) const override
 Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system. More...
 
int GetLocalClearance () const
 
void SetLocalClearance (int aClearance)
 
bool IsOnCopperLayer () const override
 Function IsOnCopperLayer. More...
 
bool CommonLayerExists (const LSET aLayerSet) const
 Function CommonLayerExist Test if this zone shares a common layer with the given layer set. More...
 
virtual void SetLayer (PCB_LAYER_ID aLayer) override
 Function SetLayer sets the layer this item is on. More...
 
virtual PCB_LAYER_ID GetLayer () const override
 Function GetLayer returns the primary layer this item is on. More...
 
virtual bool IsOnLayer (PCB_LAYER_ID) const override
 Function IsOnLayer tests to see if this object is on the given layer. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns 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 (D_PAD *aPad, wxString *aSource=nullptr) const
 
void SetThermalReliefSpokeWidth (int aThermalReliefSpokeWidth)
 
int GetThermalReliefSpokeWidth () const
 
int GetThermalReliefSpokeWidth (D_PAD *aPad, wxString *aSource=nullptr) const
 
double CalculateFilledArea ()
 Compute the area currently occupied by the zone fill. More...
 
double GetFilledArea ()
 Get the area currently occupied by the zone fill. 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 (D_PAD *aPad, wxString *aSource=nullptr) const
 
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)
 
double GetHatchOrientation () const
 
void SetHatchOrientation (double 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)
 
void SetSelectedCorner (const wxPoint &aPosition, int aAccuracy)
 
int GetLocalFlags () const
 
void SetLocalFlags (int aFlags)
 
ZONE_SEGMENT_FILLFillSegments (PCB_LAYER_ID aLayer)
 
const ZONE_SEGMENT_FILLFillSegments (PCB_LAYER_ID aLayer) const
 
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) const override
 Function GetEffectiveShape Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes. More...
 
bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const override
 Function HitTest tests if a point is near an outline edge or a corner of this zone. More...
 
bool HitTest (const EDA_RECT &aRect, bool aContained=true, int aAccuracy=0) const override
 
bool HitTestFilledArea (PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy=0) const
 Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this zone. More...
 
bool HitTestCutout (const VECTOR2I &aRefPos, int *aOutlineIdx=nullptr, int *aHoleIdx=nullptr) const
 Tests if the given point is contained within a cutout of the zone. More...
 
bool HitTestCutout (const wxPoint &aRefPos, int *aOutlineIdx=nullptr, int *aHoleIdx=nullptr) const
 
void GetInteractingZones (PCB_LAYER_ID aLayer, std::vector< ZONE_CONTAINER * > *aZones) 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 &aCornerBuffer, int aError=ARC_HIGH_DEF) const
 Function TransformSolidAreasShapesToPolygon 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 &aCornerBuffer, int aClearance, SHAPE_POLY_SET *aBoardOutline) const
 Function TransformSmoothedOutlineToPolygon 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 TransformShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
 Function TransformShapeWithClearanceToPolygon Convert the zone shape to a closed polygon Used in filling zones calculations Circles and arcs are approximated by segments. More...
 
bool HitTestForCorner (const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
 Function HitTestForCorner tests if the given wxPoint is near a corner. More...
 
bool HitTestForCorner (const wxPoint &refPos, int aAccuracy) const
 Function HitTestForCorner tests if the given wxPoint is near a corner. More...
 
bool HitTestForEdge (const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
 Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners. More...
 
bool HitTestForEdge (const wxPoint &refPos, int aAccuracy) const
 Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners. More...
 
bool UnFill ()
 Function UnFill Removes the zone filling. More...
 
void Move (const wxPoint &offset) override
 Function Move Move the outlines. More...
 
void Move (const VECTOR2I &aMoveVector)
 
void MoveEdge (const wxPoint &offset, int aEdge)
 Function MoveEdge Move the outline Edge. More...
 
void Rotate (const wxPoint &aCentre, double aAngle) override
 Function Rotate Move the outlines. More...
 
void Rotate (const VECTOR2I &aRotCentre, double aAngle)
 
virtual void Flip (const wxPoint &aCentre, bool aFlipLeftRight) override
 Function Flip Flip this object, i.e. More...
 
void Flip (const VECTOR2I &aCentre, bool aFlipLeftRight)
 
void Mirror (const wxPoint &aMirrorRef, bool aMirrorLeftRight)
 Function Mirror Mirror the outlines , relative to a given horizontal axis the layer is not changed. More...
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
int GetNumCorners (void) const
 Access to m_Poly parameters. More...
 
SHAPE_POLY_SET::ITERATOR Iterate ()
 Function Iterate returns an iterator to visit all points of the zone's main outline without holes. More...
 
SHAPE_POLY_SET::ITERATOR IterateWithHoles ()
 Function IterateWithHoles returns an iterator to visit all points of the zone's main outline with holes. More...
 
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles () const
 Function CIterateWithHoles returns 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, wxPoint new_pos)
 
void NewHole ()
 Function NewHole creates a new hole on the zone; i.e., a new contour on the zone's outline. More...
 
bool AppendCorner (wxPoint 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_CONTAINER &aZoneToCompare)
 Function IsSame tests if 2 zones are equivalent: 2 zones are equivalent if they have same parameters and same outlines info, filling is not taken into account. More...
 
void ClearFilledPolysList ()
 Function ClearFilledPolysList clears the list of filled polygons. More...
 
bool HasFilledPolysForLayer (PCB_LAYER_ID aLayer) const
 
const SHAPE_POLY_SETGetFilledPolysList (PCB_LAYER_ID aLayer) const
 Function GetFilledPolysList returns a reference to the list of filled polygons. More...
 
void CacheTriangulation (PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
 (re)create a list of triangles that "fill" the solid areas. More...
 
void SetFilledPolysList (PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aPolysList)
 Function SetFilledPolysList sets the list of filled polygons. More...
 
void SetRawPolysList (PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aPolysList)
 Function SetFilledPolysList sets the list of filled polygons. More...
 
bool IsIsland (PCB_LAYER_ID aLayer, int aPolyIdx)
 Checks 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) const
 Function GetSmoothedPoly. More...
 
void SetCornerSmoothingType (int aType)
 
int GetCornerSmoothingType () const
 
void SetCornerRadius (unsigned int aRadius)
 
unsigned int GetCornerRadius () const
 
bool GetFilledPolysUseThickness () const
 
bool GetFilledPolysUseThickness (PCB_LAYER_ID aLayer) const
 
int GetFillVersion () const
 
void SetFillVersion (int aVersion)
 
void RemoveCutout (int aOutlineIdx, int aHoleIdx)
 Remove a cutout from the zone. More...
 
void AddPolygon (std::vector< wxPoint > &aPolygon)
 add a polygon to the zone outline if the zone outline is empty, this is the main outline else it is a hole inside the main outline More...
 
void AddPolygon (const SHAPE_LINE_CHAIN &aPolygon)
 
void SetFillSegments (PCB_LAYER_ID aLayer, const ZONE_SEGMENT_FILL &aSegments)
 
SHAPE_POLY_SETRawPolysList (PCB_LAYER_ID aLayer)
 
wxString GetSelectMenuText (EDA_UNITS aUnits) const override
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
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 aHatchStyle, int aHatchPitch, bool aRebuildHatch)
 Function SetBorderDisplayStyle sets all hatch parameters for the zone. More...
 
void SetHatchPitch (int aPitch)
 Function SetHatchPitch sets the hatch pitch parameter for the zone. More...
 
void UnHatchBorder ()
 Function UnHatchBorder clears the zone's hatch. More...
 
void HatchBorder ()
 Function HatchBorder computes 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
 
bool GetHV45 () const
 
void SetHV45 (bool aConstrain)
 
MD5_HASH GetHashValue (PCB_LAYER_ID aLayer)
 
void BuildHashValue (PCB_LAYER_ID aLayer)
 Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash. More...
 
virtual void SwapData (BOARD_ITEM *aImage) override
 Swap data between aItem and aImage. More...
 
bool IsConnected () const override
 

More...
 
NETINFO_ITEMGetNet () const
 Function GetNet Returns NET_INFO object for a given item. More...
 
void SetNet (NETINFO_ITEM *aNetInfo)
 Function SetNet Sets a NET_INFO object for the item. More...
 
int GetNetCode () const
 Function GetNetCode. More...
 
bool SetNetCode (int aNetCode, bool aNoAssert)
 Sets net using a net code. More...
 
void SetNetCode (int aNetCode)
 
wxString GetNetname () const
 Function GetNetname. More...
 
wxString GetNetnameMsg () const
 Function GetNetnameMsg. More...
 
wxString GetShortNetname () const
 Function GetShortNetname. More...
 
virtual int GetOwnClearance (PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
 Function GetClearance returns an item's "own" clearance in internal units. More...
 
virtual int GetLocalClearanceOverrides (wxString *aSource) const
 Function GetLocalClearanceOverrides returns any local clearance overrides set in the "classic" (ie: pre-rule) system. More...
 
NETCLASSGetNetClass () const
 Function GetNetClassPtr returns the NETCLASS for this item. More...
 
NETCLASSGetEffectiveNetclass () const
 Function GetEffectiveNetclass returns the NETCLASS for this item, or the default netclass if none is defined. More...
 
wxString GetNetClassName () const
 Function GetNetClassName returns a pointer to the netclass of the zone. More...
 
void SetLocalRatsnestVisible (bool aVisible)
 
bool GetLocalRatsnestVisible () const
 
void SetParentGroup (PCB_GROUP *aGroup)
 
PCB_GROUPGetParentGroup () const
 
int GetX () const
 
int GetY () const
 
virtual wxPoint GetCenter () const
 Function GetCenter() More...
 
void SetX (int aX)
 
void SetY (int aY)
 
BOARD_ITEM_CONTAINERGetParent () const
 
virtual BOARD_ITEMDuplicate () const
 Function Duplicate creates a copy of a BOARD_ITEM. More...
 
bool IsTrack () const
 Function IsTrack tests to see if this object is a track or via (or microvia). More...
 
virtual bool IsLocked () const
 Function IsLocked. More...
 
virtual void SetLocked (bool aLocked)
 Function SetLocked modifies 'lock' status for of the item. More...
 
void DeleteStructure ()
 Function DeleteStructure deletes this object after removing from its parent if it has one. More...
 
virtual BOARDGetBoard () const
 Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none. More...
 
wxString GetLayerName () const
 Function GetLayerName returns the name of the PCB layer on which the item resides. More...
 
KICAD_T Type () const
 Function Type() 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 IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag)
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag 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 wxPoint GetFocusPosition () const
 Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function Visit may be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws 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)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
static int GetDefaultHatchPitch ()
 Function GetDefaultHatchPitchMils. More...
 
static wxString ShowShape (PCB_SHAPE_TYPE_T aShape)
 Function ShowShape converts the enum PCB_SHAPE_TYPE_T integer value to a wxString. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs 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)
 Function Sort is a 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 wxPoint ZeroOffset
 A value of wxPoint(0,0) which can be passed to the Draw() functions. More...
 

Protected Member Functions

virtual wxString LayerMaskDescribe () const
 Helper function Return a string (to be shown to the user) describing a layer mask. More...
 
bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. 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
 
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: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => use a grid pattern as shape. More...
 
int m_hatchThickness
 
int m_hatchGap
 
double 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, ZONE_SEGMENT_FILLm_FillSegmList
 Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used. More...
 
std::map< PCB_LAYER_ID, SHAPE_POLY_SETm_FilledPolysList
 
std::map< PCB_LAYER_ID, SHAPE_POLY_SETm_RawPolysList
 
EDA_RECT m_bboxCache
 Temp variables used while filling. More...
 
std::map< PCB_LAYER_ID, bool > m_fillFlags
 
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...
 
bool m_hv45
 
double m_area
 
std::mutex m_lock
 Lock used for multi-threaded filling on multi-layer zones. More...
 
NETINFO_ITEMm_netinfo
 Stores all informations about the net that item belongs to. More...
 
PCB_LAYER_ID m_Layer
 
PCB_GROUPm_group
 
STATUS_FLAGS m_Status
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_Flags
 

Detailed Description

MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER is living in a board MODULE_ZONE_CONTAINER is living in a footprint althougt the are similar, these items need a specific type to be easily managed in many functions using the type id in switches A few virtual methods are different.

Definition at line 957 of file class_zone.h.

Constructor & Destructor Documentation

◆ MODULE_ZONE_CONTAINER() [1/2]

MODULE_ZONE_CONTAINER::MODULE_ZONE_CONTAINER ( BOARD_ITEM_CONTAINER aParent)

Definition at line 1297 of file class_zone.cpp.

1297  :
1298  ZONE_CONTAINER( aParent, true )
1299 {
1300  // in a footprint, net classes are not managed.
1301  // so set the net to NETINFO_LIST::ORPHANED_ITEM
1302  SetNetCode( -1, true );
1303 }
bool SetNetCode(int aNetCode, bool aNoAssert)
Sets net using a net code.
ZONE_CONTAINER(BOARD_ITEM_CONTAINER *parent, bool aInFP=false)
The ctor to build ZONE_CONTAINER, but comaptible with MODULE_ZONE_CONTAINER requirement.
Definition: class_zone.cpp:41

References BOARD_CONNECTED_ITEM::SetNetCode().

Referenced by Clone().

◆ MODULE_ZONE_CONTAINER() [2/2]

MODULE_ZONE_CONTAINER::MODULE_ZONE_CONTAINER ( const MODULE_ZONE_CONTAINER aZone)

Definition at line 1306 of file class_zone.cpp.

1307  : ZONE_CONTAINER( aZone.GetParent(), true )
1308 {
1309  InitDataFromSrcInCopyCtor( aZone );
1310 }
void InitDataFromSrcInCopyCtor(const ZONE_CONTAINER &aZone)
Copy aZone data to me.
Definition: class_zone.cpp:104
ZONE_CONTAINER(BOARD_ITEM_CONTAINER *parent, bool aInFP=false)
The ctor to build ZONE_CONTAINER, but comaptible with MODULE_ZONE_CONTAINER requirement.
Definition: class_zone.cpp:41
BOARD_ITEM_CONTAINER * GetParent() const

References ZONE_CONTAINER::InitDataFromSrcInCopyCtor().

Member Function Documentation

◆ AddPolygon() [1/2]

void ZONE_CONTAINER::AddPolygon ( std::vector< wxPoint > &  aPolygon)
inherited

add a polygon to the zone outline if the zone outline is empty, this is the main outline else it is a hole inside the main outline

Definition at line 814 of file class_zone.cpp.

815 {
816  if( aPolygon.empty() )
817  return;
818 
819  SHAPE_LINE_CHAIN outline;
820 
821  // Create an outline and populate it with the points of aPolygon
822  for( const wxPoint& pt : aPolygon)
823  outline.Append( pt );
824 
825  outline.SetClosed( true );
826 
827  AddPolygon( outline );
828 }
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
void SetClosed(bool aClosed)
Function SetClosed()
void AddPolygon(std::vector< wxPoint > &aPolygon)
add a polygon to the zone outline if the zone outline is empty, this is the main outline else it is a...
Definition: class_zone.cpp:814
SHAPE_LINE_CHAIN.

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

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

◆ AddPolygon() [2/2]

void ZONE_CONTAINER::AddPolygon ( const SHAPE_LINE_CHAIN aPolygon)
inherited

Definition at line 800 of file class_zone.cpp.

801 {
802  wxASSERT( aPolygon.IsClosed() );
803 
804  // Add the outline as a new polygon in the polygon set
805  if( m_Poly->OutlineCount() == 0 )
806  m_Poly->AddOutline( aPolygon );
807  else
808  m_Poly->AddHole( aPolygon );
809 
810  SetNeedRefill( true );
811 }
int OutlineCount() const
Returns the number of outlines in the set
bool IsClosed() const override
Function IsClosed()
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
int AddHole(const SHAPE_LINE_CHAIN &aHole, int aOutline=-1)
Adds a new hole to the given outline (default: last) and returns its index
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:218

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

◆ AppendCorner()

bool ZONE_CONTAINER::AppendCorner ( wxPoint  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 831 of file class_zone.cpp.

832 {
833  // Ensure the main outline exists:
834  if( m_Poly->OutlineCount() == 0 )
835  m_Poly->NewOutline();
836 
837  // If aHoleIdx >= 0, the corner musty be added to the hole, index aHoleIdx.
838  // (remember: the index of the first hole is 0)
839  // Return error if if does dot exist.
840  if( aHoleIdx >= m_Poly->HoleCount( 0 ) )
841  return false;
842 
843  m_Poly->Append( aPosition.x, aPosition.y, -1, aHoleIdx, aAllowDuplication );
844 
845  SetNeedRefill( true );
846 
847  return true;
848 }
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
int NewOutline()
Creates a new empty polygon in the set and returns its index
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:218

References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::HoleCount(), ZONE_CONTAINER::m_Poly, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), ZONE_CONTAINER::SetNeedRefill(), wxPoint::x, and wxPoint::y.

Referenced by BOARD::AddArea(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packageRectangle(), ALTIUM_PCB::ParseFills6Data(), ALTIUM_PCB::ParsePolygons6Data(), and ALTIUM_PCB::ParseShapeBasedRegions6Data().

◆ BuildHashValue()

void ZONE_CONTAINER::BuildHashValue ( PCB_LAYER_ID  aLayer)
inlineinherited

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 816 of file class_zone.h.

817  {
818  if( !m_FilledPolysList.count( aLayer ) )
819  return;
820 
821  m_filledPolysHash[aLayer] = m_FilledPolysList.at( aLayer ).GetHash();
822  }
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: class_zone.h:931
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References ZONE_CONTAINER::m_filledPolysHash, and ZONE_CONTAINER::m_FilledPolysList.

◆ BuildSmoothedPoly()

bool ZONE_CONTAINER::BuildSmoothedPoly ( SHAPE_POLY_SET aSmoothedPoly,
PCB_LAYER_ID  aLayer,
SHAPE_POLY_SET aBoardOutline 
) const
inherited

Function GetSmoothedPoly.

Definition at line 1164 of file class_zone.cpp.

1166 {
1167  if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations will not like it ...
1168  return false;
1169 
1170  if( GetIsRuleArea() )
1171  {
1172  // We like keepouts just the way they are....
1173  aSmoothedPoly = *m_Poly;
1174  return true;
1175  }
1176 
1177  BOARD* board = GetBoard();
1178  int maxError = ARC_HIGH_DEF;
1179  bool keepExternalFillets = false;
1180 
1181  if( board )
1182  {
1183  maxError = board->GetDesignSettings().m_MaxError;
1184  keepExternalFillets = board->GetDesignSettings().m_ZoneKeepExternalFillets;
1185  }
1186 
1187  auto smooth = [&]( SHAPE_POLY_SET& aPoly )
1188  {
1189  switch( m_cornerSmoothingType )
1190  {
1192  aPoly = aPoly.Chamfer( (int) m_cornerRadius );
1193  break;
1194 
1196  {
1197  aPoly = aPoly.Fillet( (int) m_cornerRadius, maxError );
1198  break;
1199  }
1200 
1201  default:
1202  break;
1203  }
1204  };
1205 
1206  std::vector<ZONE_CONTAINER*> interactingZones;
1207  GetInteractingZones( aLayer, &interactingZones );
1208 
1209  SHAPE_POLY_SET* maxExtents = m_Poly;
1210  SHAPE_POLY_SET withFillets;
1211 
1212  aSmoothedPoly = *m_Poly;
1213 
1214  // Should external fillets (that is, those applied to concave corners) be kept? While it
1215  // seems safer to never have copper extend outside the zone outline, 5.1.x and prior did
1216  // indeed fill them so we leave the mode available.
1217  if( keepExternalFillets )
1218  {
1219  withFillets = *m_Poly;
1220  smooth( withFillets );
1221  withFillets.BooleanAdd( *m_Poly, SHAPE_POLY_SET::PM_FAST );
1222  maxExtents = &withFillets;
1223  }
1224 
1225  for( ZONE_CONTAINER* zone : interactingZones )
1226  aSmoothedPoly.BooleanAdd( *zone->Outline(), SHAPE_POLY_SET::PM_FAST );
1227 
1228  if( !GetIsRuleArea() && aBoardOutline )
1229  aSmoothedPoly.BooleanIntersection( *aBoardOutline, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
1230 
1231  smooth( aSmoothedPoly );
1232 
1233  aSmoothedPoly.BooleanIntersection( *maxExtents, SHAPE_POLY_SET::PM_FAST );
1234 
1235  return true;
1236 }
void GetInteractingZones(PCB_LAYER_ID aLayer, std::vector< ZONE_CONTAINER * > *aZones) const
Some intersecting zones, despite being on the same layer with the same net, cannot be merged due to o...
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:61
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset union For aFastMode meaning, see function booleanOp
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: class_board.h:557
SHAPE_POLY_SET.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
int m_cornerSmoothingType
Definition: class_zone.h:834
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: class_zone.h:506
void BooleanIntersection(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset intersection For aFastMode meaning, see function booleanOp
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: class_zone.h:728
unsigned int m_cornerRadius
Definition: class_zone.h:835
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:186

References SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::BooleanIntersection(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), ZONE_CONTAINER::GetInteractingZones(), ZONE_CONTAINER::GetIsRuleArea(), ZONE_CONTAINER::GetNumCorners(), ZONE_CONTAINER::m_cornerRadius, ZONE_CONTAINER::m_cornerSmoothingType, BOARD_DESIGN_SETTINGS::m_MaxError, ZONE_CONTAINER::m_Poly, BOARD_DESIGN_SETTINGS::m_ZoneKeepExternalFillets, 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(), PNS_KICAD_IFACE_BASE::syncZone(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZones(), and ZONE_CONTAINER::TransformSmoothedOutlineToPolygon().

◆ CacheBoundingBox()

void ZONE_CONTAINER::CacheBoundingBox ( )
inlineinherited

Definition at line 126 of file class_zone.h.

const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox (virtual)
Definition: class_zone.cpp:318
EDA_RECT m_bboxCache
Temp variables used while filling.
Definition: class_zone.h:927

References ZONE_CONTAINER::GetBoundingBox(), and ZONE_CONTAINER::m_bboxCache.

◆ CacheTriangulation()

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

(re)create a list of triangles that "fill" the solid areas.

used for instance to draw these solid areas on opengl

Definition at line 1106 of file class_zone.cpp.

1107 {
1108  if( aLayer == UNDEFINED_LAYER )
1109  {
1110  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
1111  pair.second.CacheTriangulation();
1112  }
1113  else
1114  {
1115  if( m_FilledPolysList.count( aLayer ) )
1117  }
1118 }
void CacheTriangulation(PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
(re)create a list of triangles that "fill" the solid areas.
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References ZONE_CONTAINER::m_FilledPolysList, and UNDEFINED_LAYER.

◆ CalculateFilledArea()

double ZONE_CONTAINER::CalculateFilledArea ( )
inherited

Compute the area currently occupied by the zone fill.

Returns
the currently filled area

Definition at line 1239 of file class_zone.cpp.

1240 {
1241  m_area = 0.0;
1242 
1243  // Iterate over each outline polygon in the zone and then iterate over
1244  // each hole it has to compute the total area.
1245  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
1246  {
1247  SHAPE_POLY_SET& poly = pair.second;
1248 
1249  for( int i = 0; i < poly.OutlineCount(); i++ )
1250  {
1251  m_area += poly.Outline( i ).Area();
1252 
1253  for( int j = 0; j < poly.HoleCount( i ); j++ )
1254  m_area -= poly.Hole( i, j ).Area();
1255  }
1256  }
1257 
1258  return m_area;
1259 }
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Returns the reference to aHole-th hole in the aIndex-th outline
SHAPE_POLY_SET.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References SHAPE_LINE_CHAIN::Area(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), ZONE_CONTAINER::m_area, ZONE_CONTAINER::m_FilledPolysList, SHAPE_POLY_SET::Outline(), and SHAPE_POLY_SET::OutlineCount().

◆ CIterateWithHoles()

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

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

Returns
SHAPE_POLY_SET::ITERATOR - an iterator to visit the zone vertices with holes.

Definition at line 536 of file class_zone.h.

537  {
538  return m_Poly->CIterateWithHoles();
539  }
CONST_ITERATOR CIterateWithHoles(int aOutline) const
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833

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

◆ ClassOf()

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

Definition at line 80 of file class_zone.h.

81  {
82  return aItem && aItem->Type() == PCB_ZONE_AREA_T;
83  }
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:106
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References PCB_ZONE_AREA_T, and EDA_ITEM::Type().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearEditFlags()

◆ ClearFilledPolysList()

void ZONE_CONTAINER::ClearFilledPolysList ( )
inlineinherited

Function ClearFilledPolysList clears the list of filled polygons.

Definition at line 610 of file class_zone.h.

611  {
612  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
613  {
614  m_insulatedIslands[pair.first].clear();
615  pair.second.RemoveAllContours();
616  }
617  }
std::map< PCB_LAYER_ID, std::set< int > > m_insulatedIslands
For each layer, a set of insulated islands that were not removed.
Definition: class_zone.h:938
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References ZONE_CONTAINER::m_FilledPolysList, and ZONE_CONTAINER::m_insulatedIslands.

Referenced by POINT_EDITOR::updateItem().

◆ ClearFlags()

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

Definition at line 221 of file eda_item.h.

221 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Definition: eda_item.h:164

References EDA_ITEM::m_Flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), LIB_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), EE_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::narrowSelection(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), LIB_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), SCH_EDIT_FRAME::RecomputeIntersheetsRefs(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::RollbackPartFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 233 of file eda_item.h.

234  {
236  DO_NOT_DRAW );
237  }
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: eda_item.h:113
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: eda_item.h:102
#define CANDIDATE
flag indicating that the structure is connected
Definition: eda_item.h:115
#define DO_NOT_DRAW
Used to disable draw function.
Definition: eda_item.h:117
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: eda_item.h:110
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:221
#define ENDPOINT
ends. (Used to support dragging.)
Definition: eda_item.h:111
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: eda_item.h:116

References CANDIDATE, EDA_ITEM::ClearFlags(), DO_NOT_DRAW, ENDPOINT, IS_LINKED, SKIP_STRUCT, STARTPOINT, and TEMP_SELECTED.

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 154 of file view_item.h.

155  {
157  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:162
#define NULL

References KIGFX::VIEW_ITEM::m_viewPrivData, and NULL.

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

◆ Clone()

EDA_ITEM * MODULE_ZONE_CONTAINER::Clone ( ) const
overridevirtual

Function Clone creates 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_CONTAINER.

Definition at line 1320 of file class_zone.cpp.

1321 {
1322  return new MODULE_ZONE_CONTAINER( *this );
1323 }
MODULE_ZONE_CONTAINER(BOARD_ITEM_CONTAINER *aParent)

References MODULE_ZONE_CONTAINER().

◆ CommonLayerExists()

bool ZONE_CONTAINER::CommonLayerExists ( const LSET  aLayerSet) const
inherited

Function CommonLayerExist Test if this zone shares a common layer with the given layer set.

Definition at line 226 of file class_zone.cpp.

227 {
228  LSET common = GetLayerSet() & aLayerSet;
229 
230  return common.count() > 0;
231 }
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
Definition: class_zone.cpp:287
LSET is a set of PCB_LAYER_IDs.

References ZONE_CONTAINER::GetLayerSet().

◆ DeleteStructure()

void BOARD_ITEM::DeleteStructure ( )
inherited

Function DeleteStructure deletes this object after removing from its parent if it has one.

Definition at line 113 of file class_board_item.cpp.

114 {
115  auto parent = GetParent();
116 
117  if( parent )
118  parent->Remove( this );
119 
120  delete this;
121 }
BOARD_ITEM_CONTAINER * GetParent() const

References BOARD_ITEM::GetParent().

Referenced by BOARD::PadDelete(), and DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow().

◆ Duplicate()

virtual BOARD_ITEM* BOARD_ITEM::Duplicate ( ) const
inlinevirtualinherited

Function Duplicate creates a copy of a BOARD_ITEM.

Reimplemented in MODULE.

Definition at line 220 of file class_board_item.h.

221  {
222  EDA_ITEM* dupe = Clone();
223  const_cast<KIID&>( dupe->m_Uuid ) = KIID();
224 
225  return static_cast<BOARD_ITEM*>( dupe );
226  }
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
Definition: common.h:70
const KIID m_Uuid
Definition: eda_item.h:150
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:147

References EDA_ITEM::Clone(), and EDA_ITEM::m_Uuid.

Referenced by PCB_GROUP::DeepDuplicate(), EDIT_TOOL::Duplicate(), and ARRAY_CREATOR::Invoke().

◆ FillSegments() [1/2]

ZONE_SEGMENT_FILL& ZONE_CONTAINER::FillSegments ( PCB_LAYER_ID  aLayer)
inlineinherited

Definition at line 288 of file class_zone.h.

289  {
290  wxASSERT( m_FillSegmList.count( aLayer ) );
291  return m_FillSegmList.at( aLayer );
292  }
std::map< PCB_LAYER_ID, ZONE_SEGMENT_FILL > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:913

References ZONE_CONTAINER::m_FillSegmList.

Referenced by PCB_IO::format().

◆ FillSegments() [2/2]

const ZONE_SEGMENT_FILL& ZONE_CONTAINER::FillSegments ( PCB_LAYER_ID  aLayer) const
inlineinherited

Definition at line 294 of file class_zone.h.

295  {
296  wxASSERT( m_FillSegmList.count( aLayer ) );
297  return m_FillSegmList.at( aLayer );
298  }
std::map< PCB_LAYER_ID, ZONE_SEGMENT_FILL > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:913

References ZONE_CONTAINER::m_FillSegmList.

◆ Flip() [1/2]

void BOARD_ITEM::Flip ( const VECTOR2I aCentre,
bool  aFlipLeftRight 
)
inlineinherited

Definition at line 336 of file class_board_item.h.

337  {
338  Flip( wxPoint( aCentre.x, aCentre.y ), aFlipLeftRight );
339  }
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight)
Function Flip Flip this object, i.e.

References BOARD_ITEM::Flip(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Flip() [2/2]

void ZONE_CONTAINER::Flip ( const wxPoint aCentre,
bool  aFlipLeftRight 
)
overridevirtualinherited

Function Flip Flip this object, i.e.

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

Parameters
aCentre- the rotation point.

Reimplemented from BOARD_ITEM.

Definition at line 728 of file class_zone.cpp.

729 {
730  Mirror( aCentre, aFlipLeftRight );
731  int copperLayerCount = GetBoard()->GetCopperLayerCount();
732 
733  if( GetIsRuleArea() )
734  SetLayerSet( FlipLayerMask( GetLayerSet(), copperLayerCount ) );
735  else
736  SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
737 }
void Mirror(const wxPoint &aMirrorRef, bool aMirrorLeftRight)
Function Mirror Mirror the outlines , relative to a given horizontal axis the layer is not changed.
Definition: class_zone.cpp:740
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint.
Definition: lset.cpp:566
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Definition: lset.cpp:520
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:214
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
Definition: class_zone.cpp:287
void SetLayerSet(LSET aLayerSet) override
Definition: class_zone.cpp:242
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Function SetLayer sets the layer this item is on.
Definition: class_zone.cpp:234
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: class_zone.h:728
int GetCopperLayerCount() const

References FlipLayer(), FlipLayerMask(), BOARD_ITEM::GetBoard(), BOARD::GetCopperLayerCount(), ZONE_CONTAINER::GetIsRuleArea(), ZONE_CONTAINER::GetLayer(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::Mirror(), ZONE_CONTAINER::SetLayer(), and ZONE_CONTAINER::SetLayerSet().

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 84 of file inspectable.h.

85  {
87  TYPE_ID thisType = TYPE_HASH( *this );
88  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
89  return object ? aProperty->getter( object ) : wxAny();
90  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual wxAny getter(void *aObject) const =0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

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

◆ Get() [2/3]

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

Definition at line 93 of file inspectable.h.

94  {
96  TYPE_ID thisType = TYPE_HASH( *this );
97  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
98  return object ? aProperty->get<T>( object ) : T();
99  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ Get() [3/3]

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

Definition at line 102 of file inspectable.h.

103  {
105  TYPE_ID thisType = TYPE_HASH( *this );
106  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
107  boost::optional<T> ret;
108 
109  if( prop )
110  {
111  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
112 
113  if( object )
114  ret = prop->get<T>( object );
115  }
116 
117  return ret;
118  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ GetBoard()

BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.

Definition at line 46 of file class_board_item.cpp.

47 {
48  if( Type() == PCB_T )
49  return (BOARD*) this;
50 
51  BOARD_ITEM* parent = GetParent();
52 
53  if( parent )
54  return parent->GetBoard();
55 
56  return NULL;
57 }
Definition: typeinfo.h:85
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
#define NULL
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:186
BOARD_ITEM_CONTAINER * GetParent() const
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

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

Referenced by D_PAD::BuildEffectiveShapes(), ZONE_CONTAINER::BuildSmoothedPoly(), KIGFX::PCB_PAINTER::draw(), exprFromTo(), VIA::FlashLayer(), D_PAD::FlashLayer(), PCB_TEXT::Flip(), TRACK::Flip(), ARC::Flip(), VIA::Flip(), ZONE_CONTAINER::Flip(), BOARD_ITEM::GetBoard(), MODULE::GetBoundingBox(), MODULE::GetBoundingPoly(), BOARD_CONNECTED_ITEM::GetEffectiveNetclass(), ZONE_CONTAINER::GetInteractingZones(), BOARD_ITEM::GetLayerName(), VIA::GetMinAnnulus(), PCB_DRAW_PANEL_GAL::GetMsgPanelInfo(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), BOARD_CONNECTED_ITEM::GetOwnClearance(), ZONE_CONTAINER::GetSelectMenuText(), FP_TEXT::GetShownText(), D_PAD::GetSolderMaskMargin(), D_PAD::GetSolderPasteMargin(), BOARD::GetTrackLength(), TRACK::GetWidthConstraints(), insideArea(), insideCourtyard(), isDiffPair(), BOARD_ITEM::LayerMaskDescribe(), VIA::LayerMaskDescribe(), D_PAD::MergePrimitivesAsPolygon(), EAGLE_PLUGIN::packageWire(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), BOARD::ResolveDRCExclusions(), BOARD_CONNECTED_ITEM::SetNetCode(), setupDummyPadForHole(), ZONE_CONTAINER::TransformSmoothedOutlineToPolygon(), ZONE_CONTAINER::TransformSolidAreasShapesToPolygon(), MODULE::ViewBBox(), and D_PAD::ViewGetLOD().

◆ GetBorderHatchPitch()

int ZONE_CONTAINER::GetBorderHatchPitch ( ) const
inherited

HatchBorder related methods.

Function GetBorderHatchPitch

Returns
int - the zone hatch pitch in iu.

Definition at line 882 of file class_zone.cpp.

883 {
884  return m_borderHatchPitch;
885 }
int m_borderHatchPitch
Definition: class_zone.h:934

References ZONE_CONTAINER::m_borderHatchPitch.

Referenced by PCB_IO::format().

◆ GetBoundingBox()

const EDA_RECT ZONE_CONTAINER::GetBoundingBox ( ) const
overridevirtualinherited

Function GetBoundingBox (virtual)

Returns
an EDA_RECT that is the bounding box of the zone outline

Reimplemented from EDA_ITEM.

Definition at line 318 of file class_zone.cpp.

319 {
320  auto bb = m_Poly->BBox();
321 
322  EDA_RECT ret( (wxPoint) bb.GetOrigin(), wxSize( bb.GetWidth(), bb.GetHeight() ) );
323 
324  return ret;
325 }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const BOX2I BBox(int aClearance=0) const override
Function BBox()

References SHAPE_POLY_SET::BBox(), and ZONE_CONTAINER::m_Poly.

Referenced by ZONE_CONTAINER::CacheBoundingBox(), ZONE_CONTAINER::HitTest(), and ALTIUM_PCB::ParsePolygons6Data().

◆ GetCachedBoundingBox()

const EDA_RECT ZONE_CONTAINER::GetCachedBoundingBox ( ) const
inlineinherited

ONLY TO BE USED BY CLIENTS WHICH SET UP THE CACHE!

Definition at line 125 of file class_zone.h.

125 { return m_bboxCache; }
EDA_RECT m_bboxCache
Temp variables used while filling.
Definition: class_zone.h:927

References ZONE_CONTAINER::m_bboxCache.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), ZONE_FILLER::buildCopperItemClearances(), ZONE_FILLER::buildThermalSpokes(), ZONE_FILLER::Fill(), and hasThermalConnection().

◆ GetCenter()

virtual wxPoint BOARD_ITEM::GetCenter ( ) const
inlinevirtualinherited

Function GetCenter()

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

Returns
centre point of the item

Reimplemented in ARC, D_PAD, PCB_SHAPE, and MARKER_PCB.

Definition at line 129 of file class_board_item.h.

130  {
131  return GetBoundingBox().GetCenter();
132  }
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: eda_item.cpp:89
const wxPoint GetCenter() const
Definition: eda_rect.h:117

References EDA_ITEM::GetBoundingBox(), and EDA_RECT::GetCenter().

Referenced by ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), and ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically().

◆ GetClass()

wxString ZONE_CONTAINER::GetClass ( ) const
inlineoverridevirtualinherited

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 499 of file class_zone.h.

500  {
501  return wxT( "ZONE_CONTAINER" );
502  }

◆ GetCornerPosition()

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

Definition at line 546 of file class_zone.h.

547  {
549 
550  // Convert global to relative indices
551  if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
552  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
553 
554  return m_Poly->CVertex( index );
555  }
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
Struct VERTEX_INDEX.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Function GetRelativeIndices.

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

Referenced by ZONE_CONTAINER::GetPosition().

◆ GetCornerRadius()

unsigned int ZONE_CONTAINER::GetCornerRadius ( ) const
inlineinherited

Definition at line 683 of file class_zone.h.

683 { return m_cornerRadius; }
unsigned int m_cornerRadius
Definition: class_zone.h:835

References ZONE_CONTAINER::m_cornerRadius.

Referenced by PCB_IO::format(), ZONE_SETTINGS::operator<<(), and BOARD::TestAreaIntersections().

◆ GetCornerSmoothingType()

int ZONE_CONTAINER::GetCornerSmoothingType ( ) const
inlineinherited

◆ GetDefaultHatchPitch()

◆ GetDoNotAllowCopperPour()

bool ZONE_CONTAINER::GetDoNotAllowCopperPour ( ) const
inlineinherited

◆ GetDoNotAllowFootprints()

bool ZONE_CONTAINER::GetDoNotAllowFootprints ( ) const
inlineinherited

◆ GetDoNotAllowPads()

bool ZONE_CONTAINER::GetDoNotAllowPads ( ) const
inlineinherited

◆ GetDoNotAllowTracks()

◆ GetDoNotAllowVias()

bool ZONE_CONTAINER::GetDoNotAllowVias ( ) const
inlineinherited

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 225 of file eda_item.h.

226  {
227  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
229 
230  return m_Flags & mask;
231  }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:106
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:114
#define IS_MOVED
Item being moved.
Definition: eda_item.h:104
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:107
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:118
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:109
STATUS_FLAGS m_Flags
Definition: eda_item.h:164
#define IS_NEW
New item, just created.
Definition: eda_item.h:105

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, 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(), LIB_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_COMPONENT::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), PAD_TOOL::recombinePad(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), and SCH_EDIT_FRAME::TrimWire().

◆ GetEffectiveNetclass()

NETCLASS * BOARD_CONNECTED_ITEM::GetEffectiveNetclass ( ) const
inherited

Function GetEffectiveNetclass returns the NETCLASS for this item, or the default netclass if none is defined.

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 66 of file board_connected_item.cpp.

67 {
68  // NB: we must check the net first, as when it is 0 GetNetClass() will return the
69  // orphaned net netclass, not the default netclass.
70  if( m_netinfo->GetNet() == 0 )
72  else
73  return GetNetClass();
74 }
NETCLASS * GetNetClass() const
Function GetNetClassPtr returns the NETCLASS for this item.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: class_board.h:557
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
int GetNet() const
Function GetNet.
Definition: netinfo.h:223
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
NETCLASS * GetDefault() const
Function GetDefault.

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

◆ GetEffectiveShape()

std::shared_ptr< SHAPE > ZONE_CONTAINER::GetEffectiveShape ( PCB_LAYER_ID  aLayer = UNDEFINED_LAYER) const
overridevirtualinherited

Function GetEffectiveShape 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 fod use with routing, collision determiniation, etc).

Note that 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.

Reimplemented from BOARD_ITEM.

Definition at line 1350 of file class_zone.cpp.

1351 {
1352  std::shared_ptr<SHAPE> shape;
1353 
1354  if( m_FilledPolysList.find( aLayer ) == m_FilledPolysList.end() )
1355  {
1356  shape.reset( new SHAPE_NULL );
1357  }
1358  else
1359  {
1360  shape.reset( m_FilledPolysList.at( aLayer ).Clone() );
1361  }
1362 
1363  return shape;
1364 }
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References ZONE_CONTAINER::m_FilledPolysList.

◆ GetFilledArea()

double ZONE_CONTAINER::GetFilledArea ( )
inlineinherited

Get the area currently occupied by the zone fill.

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

Returns
the filled area

Definition at line 198 of file class_zone.h.

199  {
200  return m_area;
201  }

References ZONE_CONTAINER::m_area.

◆ GetFilledPolysList()

const SHAPE_POLY_SET& ZONE_CONTAINER::GetFilledPolysList ( PCB_LAYER_ID  aLayer) const
inlineinherited

Function GetFilledPolysList returns a reference to the list of filled polygons.

Returns
Reference to the list of filled polygons.

Definition at line 629 of file class_zone.h.

630  {
631  wxASSERT( m_FilledPolysList.count( aLayer ) );
632  return m_FilledPolysList.at( aLayer );
633  }
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References ZONE_CONTAINER::m_FilledPolysList.

Referenced by CN_LIST::Add(), BOARD_ADAPTER::AddSolidAreasShapesToContainer(), CN_ZONE_LAYER::CN_ZONE_LAYER(), KIGFX::PCB_PAINTER::draw(), CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands(), PCB_IO::format(), and ALTIUM_PCB::ParseRegions6Data().

◆ GetFilledPolysUseThickness() [1/2]

◆ GetFilledPolysUseThickness() [2/2]

bool ZONE_CONTAINER::GetFilledPolysUseThickness ( PCB_LAYER_ID  aLayer) const
inherited

Definition at line 366 of file class_zone.cpp.

367 {
368  if( ADVANCED_CFG::GetCfg().m_DebugZoneFiller && LSET::InternalCuMask().Contains( aLayer ) )
369  return false;
370 
372 }
bool GetFilledPolysUseThickness() const
Definition: class_zone.h:685
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Definition: lset.cpp:709
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers of advanced config.

References ADVANCED_CFG::GetCfg(), ZONE_CONTAINER::GetFilledPolysUseThickness(), and LSET::InternalCuMask().

◆ GetFillFlag()

int ZONE_CONTAINER::GetFillFlag ( PCB_LAYER_ID  aLayer)
inlineinherited

Definition at line 208 of file class_zone.h.

209  {
210  return m_fillFlags.count( aLayer ) ? m_fillFlags[ aLayer ] : false;
211  }
std::map< PCB_LAYER_ID, bool > m_fillFlags
Definition: class_zone.h:928

References ZONE_CONTAINER::m_fillFlags.

◆ GetFillMode()

ZONE_FILL_MODE ZONE_CONTAINER::GetFillMode ( ) const
inlineinherited

Definition at line 163 of file class_zone.h.

163 { return m_fillMode; }
ZONE_FILL_MODE m_fillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:892

References ZONE_CONTAINER::m_fillMode.

Referenced by ZONE_FILLER::computeRawFilledArea(), ZONE_FILLER::fillSingleZone(), PCB_IO::format(), ZONE_CONTAINER::IsSame(), and ZONE_SETTINGS::operator<<().

◆ GetFillVersion()

int ZONE_CONTAINER::GetFillVersion ( ) const
inlineinherited

Definition at line 688 of file class_zone.h.

688 { return m_fillVersion; }

References ZONE_CONTAINER::m_fillVersion.

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Function GetFocusPosition similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in PCB_SHAPE, and TRACK.

Definition at line 333 of file eda_item.h.

333 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:325

References EDA_ITEM::GetPosition().

Referenced by PCB_BASE_FRAME::FocusOnItem(), and SCH_EDIT_FRAME::FocusOnItem().

◆ GetHashValue()

MD5_HASH ZONE_CONTAINER::GetHashValue ( PCB_LAYER_ID  aLayer)
inlineinherited
Returns
the hash value previously calculated by BuildHashValue(). used in zone filling calculations

Definition at line 804 of file class_zone.h.

805  {
806  if( !m_filledPolysHash.count( aLayer ) )
807  return MD5_HASH();
808 
809  return m_filledPolysHash.at( aLayer );
810  }
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: class_zone.h:931

References ZONE_CONTAINER::m_filledPolysHash.

◆ GetHatchBorderAlgorithm()

int ZONE_CONTAINER::GetHatchBorderAlgorithm ( ) const
inlineinherited

◆ GetHatchGap()

int ZONE_CONTAINER::GetHatchGap ( ) const
inlineinherited

◆ GetHatchHoleMinArea()

double ZONE_CONTAINER::GetHatchHoleMinArea ( ) const
inlineinherited

◆ GetHatchLines()

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

Definition at line 796 of file class_zone.h.

796 { return m_borderHatchLines; }
std::vector< SEG > m_borderHatchLines
Definition: class_zone.h:935

References ZONE_CONTAINER::m_borderHatchLines.

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

◆ GetHatchOrientation()

double ZONE_CONTAINER::GetHatchOrientation ( ) const
inlineinherited

◆ GetHatchSmoothingLevel()

int ZONE_CONTAINER::GetHatchSmoothingLevel ( ) const
inlineinherited

◆ GetHatchSmoothingValue()

double ZONE_CONTAINER::GetHatchSmoothingValue ( ) const
inlineinherited

◆ GetHatchStyle()

ZONE_BORDER_DISPLAY_STYLE ZONE_CONTAINER::GetHatchStyle ( ) const
inlineinherited

Definition at line 594 of file class_zone.h.

594 { return m_borderStyle; }
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
Definition: class_zone.h:933

References ZONE_CONTAINER::m_borderStyle.

Referenced by PCB_IO::format(), BOARD::NormalizeAreaPolygon(), and ZONE_SETTINGS::operator<<().

◆ GetHatchThickness()

int ZONE_CONTAINER::GetHatchThickness ( ) const
inlineinherited

◆ GetHV45()

bool ZONE_CONTAINER::GetHV45 ( ) const
inlineinherited

Definition at line 798 of file class_zone.h.

798 { return m_hv45; }

References ZONE_CONTAINER::m_hv45.

Referenced by DRAWING_TOOL::DrawZone(), and ZONE_SETTINGS::operator<<().

◆ GetInteractingZones()

void ZONE_CONTAINER::GetInteractingZones ( PCB_LAYER_ID  aLayer,
std::vector< ZONE_CONTAINER * > *  aZones 
) 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 1133 of file class_zone.cpp.

1135 {
1136  int epsilon = Millimeter2iu( 0.001 );
1137 
1138  for( ZONE_CONTAINER* candidate : GetBoard()->Zones() )
1139  {
1140  if( candidate == this )
1141  continue;
1142 
1143  if( !candidate->GetLayerSet().test( aLayer ) )
1144  continue;
1145 
1146  if( candidate->GetIsRuleArea() )
1147  continue;
1148 
1149  if( candidate->GetNetCode() != GetNetCode() )
1150  continue;
1151 
1152  for( auto iter = m_Poly->CIterate(); iter; iter++ )
1153  {
1154  if( candidate->m_Poly->Collide( iter.Get(), epsilon ) )
1155  {
1156  aZones->push_back( candidate );
1157  break;
1158  }
1159  }
1160  }
1161 }
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:61
int GetNetCode() const
Function GetNetCode.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
CONST_ITERATOR CIterate(int aFirst, int aLast, bool aIterateHoles=false) const
static constexpr int Millimeter2iu(double mm)

References SHAPE_POLY_SET::CIterate(), BOARD_ITEM::GetBoard(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::m_Poly, and Millimeter2iu().

Referenced by ZONE_CONTAINER::BuildSmoothedPoly().

◆ GetIslandRemovalMode()

const ISLAND_REMOVAL_MODE ZONE_CONTAINER::GetIslandRemovalMode ( ) const
inlineinherited

Definition at line 742 of file class_zone.h.

742 { return m_islandRemovalMode; }
ISLAND_REMOVAL_MODE m_islandRemovalMode
Definition: class_zone.h:867

References ZONE_CONTAINER::m_islandRemovalMode.

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

◆ GetIsRuleArea()

◆ GetLayer()

PCB_LAYER_ID ZONE_CONTAINER::GetLayer ( ) const
overridevirtualinherited

◆ GetLayerName()

wxString BOARD_ITEM::GetLayerName ( ) const
inherited

Function GetLayerName returns the name of the PCB layer on which the item resides.

Returns
wxString containing the layer name associated with this item.

Definition at line 60 of file class_board_item.cpp.

61 {
62  BOARD* board = GetBoard();
63 
64  if( board )
65  return board->GetLayerName( m_Layer );
66 
67  // If no parent, return standard name
69 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
PCB_LAYER_ID m_Layer
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:186
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: class_board.h:643

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

Referenced by PCB_TEXT::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), DIMENSION::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), LEADER::GetMsgPanelInfo(), PCB_TEXT::GetSelectMenuText(), FP_SHAPE::GetSelectMenuText(), TRACK::GetSelectMenuText(), DIMENSION::GetSelectMenuText(), PCB_SHAPE::GetSelectMenuText(), PCB_TEXT::GetShownText(), TEXT_MOD_GRID_TABLE::GetValue(), and MODULE::ResolveTextVar().

◆ GetLayerSet()

LSET ZONE_CONTAINER::GetLayerSet ( ) const
overridevirtualinherited

◆ GetLocalClearance() [1/2]

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

Function GetLocalClearance returns 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
int - the clearance in internal units.

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 469 of file class_zone.cpp.

470 {
471  if( m_isRuleArea )
472  return 0;
473 
474  if( aSource )
475  *aSource = _( "zone" );
476 
477  return m_ZoneClearance;
478 }
#define _(s)
Definition: 3d_actions.cpp:33

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

Referenced by ZONE_FILLER::buildCopperItemClearances(), ZONE_FILLER::buildThermalSpokes(), PCB_IO::format(), ZONE_SETTINGS::operator<<(), PCB_INSPECTION_TOOL::reportZoneConnection(), and BOARD::TestAreaIntersections().

◆ GetLocalClearance() [2/2]

int ZONE_CONTAINER::GetLocalClearance ( ) const
inlineinherited

Definition at line 137 of file class_zone.h.

137 { return GetLocalClearance( nullptr ); }
int GetLocalClearance() const
Definition: class_zone.h:137

References ZONE_CONTAINER::GetLocalClearance().

Referenced by ZONE_CONTAINER::GetLocalClearance(), and ZONE_CONTAINER_DESC::ZONE_CONTAINER_DESC().

◆ GetLocalClearanceOverrides()

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

Function GetLocalClearanceOverrides returns 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
int - the clearance in internal units.

Reimplemented in D_PAD.

Definition at line 160 of file board_connected_item.h.

160 { return 0; }

Referenced by DRC_ENGINE::EvalRulesForItems().

◆ GetLocalFlags()

int ZONE_CONTAINER::GetLocalFlags ( ) const
inlineinherited

◆ GetLocalRatsnestVisible()

bool BOARD_CONNECTED_ITEM::GetLocalRatsnestVisible ( ) const
inlineinherited

◆ GetLock()

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

Definition at line 203 of file class_zone.h.

204  {
205  return m_lock;
206  }
std::mutex m_lock
Lock used for multi-threaded filling on multi-layer zones.
Definition: class_zone.h:945

References ZONE_CONTAINER::m_lock.

Referenced by ZONE_FILLER::Fill().

◆ GetMenuImage()

BITMAP_DEF ZONE_CONTAINER::GetMenuImage ( ) const
overridevirtualinherited

Function GetMenuImage returns 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 1092 of file class_zone.cpp.

1093 {
1094  return add_zone_xpm;
1095 }
const BITMAP_OPAQUE add_zone_xpm[1]
Definition: add_zone.cpp:59

References add_zone_xpm.

◆ GetMinIslandArea()

long long int ZONE_CONTAINER::GetMinIslandArea ( ) const
inlineinherited

Definition at line 746 of file class_zone.h.

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

References ZONE_CONTAINER::m_minIslandArea.

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

◆ GetMinThickness()

◆ GetMsgPanelInfo()

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

Function GetMsgPanelInfo populates 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 522 of file class_zone.cpp.

523 {
524  EDA_UNITS units = aFrame->GetUserUnits();
525  wxString msg, msg2;
526 
527  if( GetIsRuleArea() )
528  msg = _( "Rule Area" );
529  else if( IsOnCopperLayer() )
530  msg = _( "Copper Zone" );
531  else
532  msg = _( "Non-copper Zone" );
533 
534  // Display Cutout instead of Outline for holes inside a zone (i.e. when num contour !=0).
535  // Check whether the selected corner is in a hole; i.e., in any contour but the first one.
536  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
537  msg << wxT( " " ) << _( "Cutout" );
538 
539  aList.emplace_back( _( "Type" ), msg, DARKCYAN );
540 
541  if( GetIsRuleArea() )
542  {
543  msg.Empty();
544 
545  if( GetDoNotAllowVias() )
546  AccumulateDescription( msg, _( "No vias" ) );
547 
548  if( GetDoNotAllowTracks() )
549  AccumulateDescription( msg, _( "No tracks" ) );
550 
551  if( GetDoNotAllowPads() )
552  AccumulateDescription( msg, _( "No pads" ) );
553 
555  AccumulateDescription( msg, _( "No copper zones" ) );
556 
558  AccumulateDescription( msg, _( "No footprints" ) );
559 
560  if( !msg.IsEmpty() )
561  aList.emplace_back( MSG_PANEL_ITEM( _( "Restrictions" ), msg, RED ) );
562  }
563  else if( IsOnCopperLayer() )
564  {
565  if( GetNetCode() >= 0 )
566  {
567  NETINFO_ITEM* net = GetNet();
568  NETCLASS* netclass = nullptr;
569 
570  if( net )
571  {
572  if( net->GetNet() )
573  netclass = GetNetClass();
574  else
575  netclass = GetBoard()->GetDesignSettings().GetDefault();
576 
577  msg = UnescapeString( net->GetNetname() );
578  }
579  else
580  {
581  msg = wxT( "<no name>" );
582  }
583 
584  aList.emplace_back( _( "Net" ), msg, RED );
585 
586  if( netclass )
587  aList.emplace_back( _( "NetClass" ), netclass->GetName(), DARKMAGENTA );
588  }
589 
590  // Display priority level
591  msg.Printf( wxT( "%d" ), GetPriority() );
592  aList.emplace_back( _( "Priority" ), msg, BLUE );
593  }
594 
595  wxString layerDesc;
596  int count = 0;
597 
598  for( PCB_LAYER_ID layer : m_layerSet.Seq() )
599  {
600  if( count == 0 )
601  layerDesc = GetBoard()->GetLayerName( layer );
602 
603  count++;
604  }
605 
606  if( count > 1 )
607  layerDesc.Printf( _( "%s and %d more" ), layerDesc, count - 1 );
608 
609  aList.emplace_back( _( "Layer" ), layerDesc, DARKGREEN );
610 
611  if( !m_zoneName.empty() )
612  aList.emplace_back( _( "Name" ), m_zoneName, DARKMAGENTA );
613 
614  switch( m_fillMode )
615  {
616  case ZONE_FILL_MODE::POLYGONS: msg = _( "Solid" ); break;
617  case ZONE_FILL_MODE::HATCH_PATTERN: msg = _( "Hatched" ); break;
618  default: msg = _( "Unknown" ); break;
619  }
620 
621  aList.emplace_back( _( "Fill Mode" ), msg, BROWN );
622 
623  msg = MessageTextFromValue( units, m_area, true, EDA_DATA_TYPE::AREA );
624  aList.emplace_back( _( "Filled Area" ), msg, BLUE );
625 
626  wxString source;
627  int clearance = GetOwnClearance( GetLayer(), &source );
628 
629  msg.Printf( _( "Min Clearance: %s" ), MessageTextFromValue( units, clearance ) );
630  msg2.Printf( _( "(from %s)" ), source );
631  aList.emplace_back( msg, msg2, BLACK );
632 
633  // Useful for statistics, especially when zones are complex the number of hatches
634  // and filled polygons can explain the display and DRC calculation time:
635  msg.Printf( wxT( "%d" ), (int) m_borderHatchLines.size() );
636  aList.emplace_back( MSG_PANEL_ITEM( _( "HatchBorder Lines" ), msg, BLUE ) );
637 
638  PCB_LAYER_ID layer = m_Layer;
639 
640  // NOTE: This brings in dependence on PCB_EDIT_FRAME to the qa tests, which isn't ideal.
641  // TODO: Figure out a way for items to know the active layer without the whole edit frame?
642 #if 0
643  if( PCB_EDIT_FRAME* pcbframe = dynamic_cast<PCB_EDIT_FRAME*>( aFrame ) )
644  if( m_FilledPolysList.count( pcbframe->GetActiveLayer() ) )
645  layer = pcbframe->GetActiveLayer();
646 #endif
647 
648  if( !GetIsRuleArea() )
649  {
650  auto layer_it = m_FilledPolysList.find( layer );
651 
652  if( layer_it == m_FilledPolysList.end() )
653  layer_it = m_FilledPolysList.begin();
654 
655  if( layer_it != m_FilledPolysList.end() )
656  {
657  msg.Printf( wxT( "%d" ), layer_it->second.TotalVertices() );
658  aList.emplace_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) );
659  }
660  }
661 }
EDA_UNITS
Definition: common.h:200
bool GetDoNotAllowPads() const
Definition: class_zone.h:732
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Definition: base_units.cpp:122
std::vector< SEG > m_borderHatchLines
Definition: class_zone.h:935
int GetNetCode() const
Function GetNetCode.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
NETINFO_ITEM * GetNet() const
Function GetNet Returns NET_INFO object for a given item.
const wxString & GetName() const
Definition: netclass.h:96
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:906
NETCLASS * GetNetClass() const
Function GetNetClassPtr returns the NETCLASS for this item.
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:214
Definition: color4d.h:62
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: class_board.h:557
Definition: color4d.h:45
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:410
bool GetDoNotAllowVias() const
Definition: class_zone.h:730
PCB_LAYER_ID m_Layer
void AccumulateDescription(wxString &aDesc, const wxString &aItem)
Utility to build comma separated lists in messages.
Definition: kicad_string.h:295
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
Definition: class_zone.h:838
PCB_LAYER_ID
A quick note on layer IDs:
NETCLASS handles a collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:49
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:729
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:231
Definition: color4d.h:60
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: class_zone.h:728
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
Definition: color4d.h:57
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:106
int GetNet() const
Function GetNet.
Definition: netinfo.h:223
#define _(s)
Definition: 3d_actions.cpp:33
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:151
NETCLASS * GetDefault() const
Function GetDefault.
PCB_EDIT_FRAME is the main frame for Pcbnew.
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Function GetClearance returns an item's "own" clearance in internal units.
bool GetDoNotAllowTracks() const
Definition: class_zone.h:731
bool GetDoNotAllowFootprints() const
Definition: class_zone.h:733
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:54
ZONE_FILL_MODE m_fillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:892
bool IsOnCopperLayer() const override
Function IsOnCopperLayer.
Definition: class_zone.cpp:220
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References _, AccumulateDescription(), AREA, BLACK, BLUE, BROWN, DARKCYAN, DARKGREEN, DARKMAGENTA, BOARD_ITEM::GetBoard(), BOARD_DESIGN_SETTINGS::GetDefault(), BOARD::GetDesignSettings(), ZONE_CONTAINER::GetDoNotAllowCopperPour(), ZONE_CONTAINER::GetDoNotAllowFootprints(), ZONE_CONTAINER::GetDoNotAllowPads(), ZONE_CONTAINER::GetDoNotAllowTracks(), ZONE_CONTAINER::GetDoNotAllowVias(), ZONE_CONTAINER::GetIsRuleArea(), ZONE_CONTAINER::GetLayer(), BOARD::GetLayerName(), NETCLASS::GetName(), BOARD_CONNECTED_ITEM::GetNet(), NETINFO_ITEM::GetNet(), BOARD_CONNECTED_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetCode(), NETINFO_ITEM::GetNetname(), BOARD_CONNECTED_ITEM::GetOwnClearance(), ZONE_CONTAINER::GetPriority(), EDA_BASE_FRAME::GetUserUnits(), HATCH_PATTERN, ZONE_CONTAINER::IsOnCopperLayer(), ZONE_CONTAINER::m_area, ZONE_CONTAINER::m_borderHatchLines, SHAPE_POLY_SET::VERTEX_INDEX::m_contour, ZONE_CONTAINER::m_CornerSelection, ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_fillMode, BOARD_ITEM::m_Layer, ZONE_CONTAINER::m_layerSet, ZONE_CONTAINER::m_zoneName, MessageTextFromValue(), POLYGONS, RED, LSET::Seq(), and UnescapeString().

◆ GetNet()

NETINFO_ITEM* BOARD_CONNECTED_ITEM::GetNet ( ) const
inlineinherited

◆ GetNetClass()

NETCLASS * BOARD_CONNECTED_ITEM::GetNetClass ( ) const
inherited

Function GetNetClassPtr returns 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 106 of file board_connected_item.cpp.

107 {
108  NETCLASS* netclass = m_netinfo->GetNetClass();
109 
110  if( netclass )
111  return netclass;
112  else
113  return GetBoard()->GetDesignSettings().GetDefault();
114 }
NETCLASS * GetNetClass()
Function GetNetClass.
Definition: netinfo.h:128
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: class_board.h:557
NETCLASS handles a collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:49
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
NETCLASS * GetDefault() const
Function GetDefault.

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

Referenced by VIA::GetDrillValue(), BOARD_CONNECTED_ITEM::GetEffectiveNetclass(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), and DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

◆ GetNetClassName()

wxString BOARD_CONNECTED_ITEM::GetNetClassName ( ) const
inherited

Function GetNetClassName returns a pointer to the netclass of the zone.

If the net is not found (can happen when a netlist is reread, and the net name does not exist, return the default net class (should not return a null pointer).

Returns
the Net Class name of this item

Definition at line 117 of file board_connected_item.cpp.

118 {
119  return m_netinfo->GetClassName();
120 }
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
wxString GetClassName() const
Function GetClassName returns the class name.
Definition: netinfo.h:137

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

Referenced by BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), D_PAD::GetMsgPanelInfo(), main(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ GetNetCode()

int BOARD_CONNECTED_ITEM::GetNetCode ( ) const
inlineinherited

Function GetNetCode.

Returns
int - the net code.

Definition at line 99 of file board_connected_item.h.

100  {
101  return m_netinfo ? m_netinfo->GetNet() : -1;
102  }
int GetNet() const
Function GetNet.
Definition: netinfo.h:223
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

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

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), ZONE_FILLER::buildCopperItemClearances(), BOARD::CombineAllAreasInNet(), connectedItemFilter(), CreateRoutesSection(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::doPadToPadsDrc(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::doTrackDrc(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), ZONE_FILLER::Fill(), PNS::NODE::FindItemByParent(), PCB_IO::format(), DSN::SPECCTRA_DB::FromBOARD(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), CONNECTIVITY_DATA::GetConnectedItems(), ZONE_CONTAINER::GetInteractingZones(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), hash_eda(), hasThermalConnection(), PCB_INSPECTION_TOOL::highlightNet(), DIALOG_PAD_PROPERTIES::initValues(), PCB_INSPECTION_TOOL::InspectClearance(), CONNECTIVITY_DATA::IsConnectedOnLayer(), ZONE_CONTAINER::IsIsland(), ZONE_CONTAINER::IsSame(), DSN::SPECCTRA_DB::makeIMAGE(), AR_AUTOPLACER::nearestPad(), ROUTER_TOOL::NeighboringSegmentFilter(), CN_ITEM::Net(), BOARD::NormalizeAreaPolygon(), BOARD::OnAreaPolygonModified(), TRACK::cmp_tracks::operator()(), ZONE_SETTINGS::operator<<(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), process(), PCB_EDITOR_CONTROL::RepairBoard(), PCB_SELECTION_CONDITIONS::sameNetFunc(), SaveCopyOfZones(), SELECTION_TOOL::selectNet(), setupDummyPadForHole(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncPad(), PNS_KICAD_IFACE_BASE::syncTrack(), PNS_KICAD_IFACE_BASE::syncVia(), BOARD::TestAreaIntersections(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZones(), BOARD::TracksInNet(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ GetNetname()

wxString BOARD_CONNECTED_ITEM::GetNetname ( ) const
inlineinherited

◆ GetNetnameMsg()

wxString BOARD_CONNECTED_ITEM::GetNetnameMsg ( ) const
inherited

Function GetNetnameMsg.

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

Definition at line 123 of file board_connected_item.cpp.

124 {
125  if( !GetBoard() )
126  return wxT( "[** NO BOARD DEFINED **]" );
127 
128  wxString netname = GetNetname();
129 
130  if( !netname.length() )
131  return wxT( "[<no net>]" );
132  else if( GetNetCode() < 0 )
133  return wxT( "[" + UnescapeString( netname ) + "](" + _( "Not Found" ) + ")" );
134  else
135  return wxT( "[" + UnescapeString( netname ) + "]" );
136 }
int GetNetCode() const
Function GetNetCode.
wxString GetNetname() const
Function GetNetname.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
#define _(s)
Definition: 3d_actions.cpp:33
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:151

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

Referenced by TRACK::GetSelectMenuText(), VIA::GetSelectMenuText(), and ZONE_CONTAINER::GetSelectMenuText().

◆ GetNumCorners()

int ZONE_CONTAINER::GetNumCorners ( void  ) const
inlineinherited

Access to m_Poly parameters.

Definition at line 506 of file class_zone.h.

507  {
508  return m_Poly->TotalVertices();
509  }
int TotalVertices() const
Returns total number of vertices stored in the set.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833

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

Referenced by ZONE_CONTAINER::BuildSmoothedPoly(), and PCB_IO::format().

◆ GetOwnClearance()

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

Function GetClearance returns 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
int - the clearance in internal units.

Definition at line 80 of file board_connected_item.cpp.

81 {
82  DRC_CONSTRAINT constraint;
83 
84  if( GetBoard() && GetBoard()->GetDesignSettings().m_DRCEngine )
85  {
87 
88  constraint = bds.m_DRCEngine->EvalRulesForItems( DRC_CONSTRAINT_TYPE_CLEARANCE, this,
89  nullptr, aLayer );
90  }
91 
92  if( constraint.Value().HasMin() )
93  {
94  if( aSource )
95  *aSource = constraint.GetName();
96 
97  return constraint.Value().Min();
98  }
99 
100  return 0;
101 }
bool HasMin() const
Definition: minoptmax.h:35
MINOPTMAX< int > & Value()
Definition: drc_rule.h:121
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: class_board.h:557
T Min() const
Definition: minoptmax.h:31
wxString GetName() const
Definition: drc_rule.h:126
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.

References DRC_CONSTRAINT_TYPE_CLEARANCE, 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(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), and TRACK::ViewBBox().

◆ GetPadConnection() [1/2]

ZONE_CONNECTION ZONE_CONTAINER::GetPadConnection ( D_PAD aPad,
wxString *  aSource = nullptr 
) const
inherited

Definition at line 769 of file class_zone.cpp.

770 {
772  {
773  if( aSource )
774  *aSource = _( "zone" );
775 
776  return m_PadConnection;
777  }
778  else
779  {
780  return aPad->GetEffectiveZoneConnection( aSource );
781  }
782 }
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:862
#define NULL
ZONE_CONNECTION GetEffectiveZoneConnection(wxString *aSource=nullptr) const
Return the zone connection in effect (either locally overridden or overridden in the parent module).
Definition: class_pad.cpp:747
#define _(s)
Definition: 3d_actions.cpp:33

References _, D_PAD::GetEffectiveZoneConnection(), INHERITED, ZONE_CONTAINER::m_PadConnection, and NULL.

Referenced by ZONE_FILLER::buildCopperItemClearances(), PCB_IO::format(), hasThermalConnection(), ZONE_SETTINGS::operator<<(), PCB_INSPECTION_TOOL::reportZoneConnection(), and BOARD::TestAreaIntersections().

◆ GetPadConnection() [2/2]

ZONE_CONNECTION ZONE_CONTAINER::GetPadConnection ( ) const
inlineinherited

Definition at line 221 of file class_zone.h.

221 { return m_PadConnection; }
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:862

References ZONE_CONTAINER::m_PadConnection.

Referenced by ZONE_CONTAINER_DESC::ZONE_CONTAINER_DESC().

◆ GetParent()

BOARD_ITEM_CONTAINER* BOARD_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 184 of file class_board_item.h.

184 { return (BOARD_ITEM_CONTAINER*) m_Parent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: eda_item.h:162
Abstract interface for BOARD_ITEMs capable of storing other items inside.

References EDA_ITEM::m_Parent.

Referenced by POINT_EDITOR::addCorner(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), 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(), KIGFX::PCB_PAINTER::draw(), EDIT_TOOL::Duplicate(), EditToolSelectionFilter(), PCB_IO::format(), FormatProbeItem(), BOARD_ITEM::GetBoard(), MARKER_PCB::GetColorLayer(), FP_SHAPE::GetMsgPanelInfo(), FP_TEXT::GetSelectMenuText(), PCB_TEXT::GetShownText(), FP_TEXT::GetShownText(), SELECTION_TOOL::GuessSelectionCandidates(), GENERAL_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), FP_SHAPE::IsParentFlipped(), FP_TEXT::IsParentFlipped(), LEGACY_PLUGIN::loadMODULE_TEXT(), memberOf(), ALTIUM_PCB::ParseTexts6Data(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BOARD_COMMIT::Push(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperDrawItem(), PCB_GROUP::TopLevelGroup(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), MARKER_PCB::ViewGetLayers(), ViewGetLOD(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and PCB_GROUP::WithinScope().

◆ GetParentGroup()

◆ GetPosition()

wxPoint ZONE_CONTAINER::GetPosition ( ) const
overridevirtualinherited
Returns
a wxPoint, position of the first point of the outline

Reimplemented from EDA_ITEM.

Definition at line 208 of file class_zone.cpp.

209 {
210  return (wxPoint) GetCornerPosition( 0 );
211 }
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition: class_zone.h:546

References ZONE_CONTAINER::GetCornerPosition().

Referenced by EAGLE_PLUGIN::loadPlain().

◆ GetPriority()

◆ GetSelectedCorner()

int ZONE_CONTAINER::GetSelectedCorner ( ) const
inlineinherited

Definition at line 254 of file class_zone.h.

255  {
256  // Transform relative indices to global index
257  int globalIndex = -1;
258 
259  if( m_CornerSelection )
260  m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
261 
262  return globalIndex;
263  }
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:906
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
bool GetGlobalIndex(VERTEX_INDEX aRelativeIndices, int &aGlobalIdx)
Function GetGlobalIndex computes the global index of a vertex from the relative indices of polygon,...

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

◆ GetSelectMenuText()

wxString ZONE_CONTAINER::GetSelectMenuText ( EDA_UNITS  aUnits) const
overridevirtualinherited

Function GetSelectMenuText returns 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 851 of file class_zone.cpp.

852 {
853  wxString text;
854 
855  // Check whether the selected contour is a hole (contour index > 0)
856  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
857  text << wxT( " " ) << _( "(Cutout)" );
858 
859  if( GetIsRuleArea() )
860  text << wxT( " " ) << _( "(Rule Area)" );
861  else
862  text << GetNetnameMsg();
863 
864  wxString layerDesc;
865  int count = 0;
866 
867  for( PCB_LAYER_ID layer : m_layerSet.Seq() )
868  {
869  if( count == 0 )
870  layerDesc = GetBoard()->GetLayerName( layer );
871 
872  count++;
873  }
874 
875  if( count > 1 )
876  layerDesc.Printf( _( "%s and %d more" ), layerDesc, count - 1 );
877 
878  return wxString::Format( _( "Zone Outline %s on %s" ), text, layerDesc );
879 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:906
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:410
PCB_LAYER_ID
A quick note on layer IDs:
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: class_zone.h:728
wxString GetNetnameMsg() const
Function GetNetnameMsg.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
#define _(s)
Definition: 3d_actions.cpp:33

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

Referenced by PNS_KICAD_IFACE_BASE::syncZone().

◆ GetShortNetname()

wxString BOARD_CONNECTED_ITEM::GetShortNetname ( ) const
inlineinherited

Function GetShortNetname.

Returns
wxString - the short netname

Definition at line 140 of file board_connected_item.h.

141  {
142  return m_netinfo->GetShortNetname();
143  }
const wxString & GetShortNetname() const
Function GetShortNetname.
Definition: netinfo.h:237
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

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

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

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 204 of file eda_item.h.

205  {
206  return m_Status & type;
207  }
STATUS_FLAGS m_Status
Definition: eda_item.h:161

References EDA_ITEM::m_Status.

Referenced by TRACK::GetMsgPanelInfoBase_Common(), and TRACK::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 217 of file eda_item.h.

217 { return m_Status; }
STATUS_FLAGS m_Status
Definition: eda_item.h:161

References EDA_ITEM::m_Status.

◆ GetThermalReliefGap() [1/2]

◆ GetThermalReliefGap() [2/2]

int ZONE_CONTAINER::GetThermalReliefGap ( D_PAD aPad,
wxString *  aSource = nullptr 
) const
inherited

Definition at line 328 of file class_zone.cpp.

329 {
330  if( aPad->GetEffectiveThermalGap() == 0 )
331  {
332  if( aSource )
333  *aSource = _( "zone" );
334 
335  return m_thermalReliefGap;
336  }
337 
338  return aPad->GetEffectiveThermalGap( aSource );
339 
340 }
int m_thermalReliefGap
Definition: class_zone.h:884
#define _(s)
Definition: 3d_actions.cpp:33
int GetEffectiveThermalGap(wxString *aSource=nullptr) const
Return the effective thermal gap having resolved any inheritance.
Definition: class_pad.cpp:787

References _, D_PAD::GetEffectiveThermalGap(), and ZONE_CONTAINER::m_thermalReliefGap.

◆ GetThermalReliefSpokeWidth() [1/2]

int ZONE_CONTAINER::GetThermalReliefSpokeWidth ( ) const
inlineinherited

◆ GetThermalReliefSpokeWidth() [2/2]

int ZONE_CONTAINER::GetThermalReliefSpokeWidth ( D_PAD aPad,
wxString *  aSource = nullptr 
) const
inherited

Definition at line 343 of file class_zone.cpp.

344 {
345  if( aPad->GetEffectiveThermalSpokeWidth() == 0 )
346  {
347  if( aSource )
348  *aSource = _( "zone" );
349 
351  }
352 
353  return aPad->GetEffectiveThermalSpokeWidth( aSource );
354 }
int m_thermalReliefSpokeWidth
Definition: class_zone.h:885
#define _(s)
Definition: 3d_actions.cpp:33
int GetEffectiveThermalSpokeWidth(wxString *aSource=nullptr) const
Return the effective thermal spoke width having resolved any inheritance.
Definition: class_pad.cpp:768

References _, D_PAD::GetEffectiveThermalSpokeWidth(), and ZONE_CONTAINER::m_thermalReliefSpokeWidth.

◆ GetX()

int BOARD_ITEM::GetX ( ) const
inlineinherited

◆ GetY()

int BOARD_ITEM::GetY ( ) const
inlineinherited

◆ GetZoneName()

wxString ZONE_CONTAINER::GetZoneName ( ) const
inlineinherited

Definition at line 113 of file class_zone.h.

113 { return m_zoneName; }
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
Definition: class_zone.h:838

References ZONE_CONTAINER::m_zoneName.

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

◆ HasFilledPolysForLayer()

bool ZONE_CONTAINER::HasFilledPolysForLayer ( PCB_LAYER_ID  aLayer) const
inlineinherited

Definition at line 619 of file class_zone.h.

620  {
621  return m_FilledPolysList.count( aLayer ) > 0;
622  }
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References ZONE_CONTAINER::m_FilledPolysList.

◆ HasFlag()

◆ HatchBorder()

void ZONE_CONTAINER::HatchBorder ( )
inherited

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

Definition at line 919 of file class_zone.cpp.

920 {
921  UnHatchBorder();
922 
924  || m_borderHatchPitch == 0
925  || m_Poly->IsEmpty() )
926  {
927  return;
928  }
929 
930  // define range for hatch lines
931  int min_x = m_Poly->CVertex( 0 ).x;
932  int max_x = m_Poly->CVertex( 0 ).x;
933  int min_y = m_Poly->CVertex( 0 ).y;
934  int max_y = m_Poly->CVertex( 0 ).y;
935 
936  for( auto iterator = m_Poly->IterateWithHoles(); iterator; iterator++ )
937  {
938  if( iterator->x < min_x )
939  min_x = iterator->x;
940 
941  if( iterator->x > max_x )
942  max_x = iterator->x;
943 
944  if( iterator->y < min_y )
945  min_y = iterator->y;
946 
947  if( iterator->y > max_y )
948  max_y = iterator->y;
949  }
950 
951  // Calculate spacing between 2 hatch lines
952  int spacing;
953 
955  spacing = m_borderHatchPitch;
956  else
957  spacing = m_borderHatchPitch * 2;
958 
959  // set the "length" of hatch lines (the length on horizontal axis)
960  int hatch_line_len = m_borderHatchPitch;
961 
962  // To have a better look, give a slope depending on the layer
963  LAYER_NUM layer = GetLayer();
964  int slope_flag = (layer & 1) ? 1 : -1; // 1 or -1
965  double slope = 0.707106 * slope_flag; // 45 degrees slope
966  int max_a, min_a;
967 
968  if( slope_flag == 1 )
969  {
970  max_a = KiROUND( max_y - slope * min_x );
971  min_a = KiROUND( min_y - slope * max_x );
972  }
973  else
974  {
975  max_a = KiROUND( max_y - slope * max_x );
976  min_a = KiROUND( min_y - slope * min_x );
977  }
978 
979  min_a = (min_a / spacing) * spacing;
980 
981  // calculate an offset depending on layer number,
982  // for a better look of hatches on a multilayer board
983  int offset = (layer * 7) / 8;
984  min_a += offset;
985 
986  // loop through hatch lines
987  #define MAXPTS 200 // Usually we store only few values per one hatch line
988  // depending on the complexity of the zone outline
989 
990  static std::vector<VECTOR2I> pointbuffer;
991  pointbuffer.clear();
992  pointbuffer.reserve( MAXPTS + 2 );
993 
994  for( int a = min_a; a < max_a; a += spacing )
995  {
996  // get intersection points for this hatch line
997 
998  // Note: because we should have an even number of intersections with the
999  // current hatch line and the zone outline (a closed polygon,
1000  // or a set of closed polygons), if an odd count is found
1001  // we skip this line (should not occur)
1002  pointbuffer.clear();
1003 
1004  // Iterate through all vertices
1005  for( auto iterator = m_Poly->IterateSegmentsWithHoles(); iterator; iterator++ )
1006  {
1007  double x, y, x2, y2;
1008  int ok;
1009 
1010  SEG segment = *iterator;
1011 
1012  ok = FindLineSegmentIntersection( a, slope,
1013  segment.A.x, segment.A.y,
1014  segment.B.x, segment.B.y,
1015  &x, &y, &x2, &y2 );
1016 
1017  if( ok )
1018  {
1019  VECTOR2I point( KiROUND( x ), KiROUND( y ) );
1020  pointbuffer.push_back( point );
1021  }
1022 
1023  if( ok == 2 )
1024  {
1025  VECTOR2I point( KiROUND( x2 ), KiROUND( y2 ) );
1026  pointbuffer.push_back( point );
1027  }
1028 
1029  if( pointbuffer.size() >= MAXPTS ) // overflow
1030  {
1031  wxASSERT( 0 );
1032  break;
1033  }
1034  }
1035 
1036  // ensure we have found an even intersection points count
1037  // because intersections are the ends of segments
1038  // inside the polygon(s) and a segment has 2 ends.
1039  // if not, this is a strange case (a bug ?) so skip this hatch
1040  if( pointbuffer.size() % 2 != 0 )
1041  continue;
1042 
1043  // sort points in order of descending x (if more than 2) to
1044  // ensure the starting point and the ending point of the same segment
1045  // are stored one just after the other.
1046  if( pointbuffer.size() > 2 )
1047  sort( pointbuffer.begin(), pointbuffer.end(), sortEndsByDescendingX );
1048 
1049  // creates lines or short segments inside the complex polygon
1050  for( unsigned ip = 0; ip < pointbuffer.size(); ip += 2 )
1051  {
1052  int dx = pointbuffer[ip + 1].x - pointbuffer[ip].x;
1053 
1054  // Push only one line for diagonal hatch,
1055  // or for small lines < twice the line length
1056  // else push 2 small lines
1058  || std::abs( dx ) < 2 * hatch_line_len )
1059  {
1060  m_borderHatchLines.emplace_back( SEG( pointbuffer[ip], pointbuffer[ ip + 1] ) );
1061  }
1062  else
1063  {
1064  double dy = pointbuffer[ip + 1].y - pointbuffer[ip].y;
1065  slope = dy / dx;
1066 
1067  if( dx > 0 )
1068  dx = hatch_line_len;
1069  else
1070  dx = -hatch_line_len;
1071 
1072  int x1 = KiROUND( pointbuffer[ip].x + dx );
1073  int x2 = KiROUND( pointbuffer[ip + 1].x - dx );
1074  int y1 = KiROUND( pointbuffer[ip].y + dx * slope );
1075  int y2 = KiROUND( pointbuffer[ip + 1].y - dx * slope );
1076 
1077  m_borderHatchLines.emplace_back( SEG( pointbuffer[ip].x, pointbuffer[ip].y, x1, y1 ) );
1078 
1079  m_borderHatchLines.emplace_back( SEG( pointbuffer[ip+1].x, pointbuffer[ip+1].y, x2, y2 ) );
1080  }
1081  }
1082  }
1083 }
std::vector< SEG > m_borderHatchLines
Definition: class_zone.h:935
SEGMENT_ITERATOR IterateSegmentsWithHoles()
Returns an iterator object, for all outlines in the set (with holes)
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:214
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
Definition: class_zone.h:933
#define MAXPTS
bool sortEndsByDescendingX(const VECTOR2I &ref, const VECTOR2I &tst)
Definition: class_zone.cpp:913
ITERATOR IterateWithHoles(int aOutline)
Function IterateWithHoles.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
void UnHatchBorder()
Function UnHatchBorder clears the zone's hatch.
Definition: class_zone.cpp:905
int LAYER_NUM
This can be replaced with int and removed.
Definition: seg.h:39
VECTOR2I A
Definition: seg.h:47
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:68
int m_borderHatchPitch
Definition: class_zone.h:934
VECTOR2I B
Definition: seg.h:48

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

Referenced by BOARD::CombineAreas(), CONVERT_TOOL::LinesToPoly(), ZONE_CONTAINER::Mirror(), ZONE_CONTAINER::Move(), ZONE_CONTAINER::MoveEdge(), BOARD::NormalizeAreaPolygon(), EDIT_TOOL::Remove(), ZONE_CONTAINER::Rotate(), ZONE_CONTAINER::SetBorderDisplayStyle(), and POINT_EDITOR::updateItem().

◆ HitTest() [1/2]

bool ZONE_CONTAINER::HitTest ( const wxPoint aPosition,
int  aAccuracy = 0 
) const
overridevirtualinherited

Function HitTest tests if a point is near an outline edge or a corner of this zone.

Parameters
aPositionthe wxPoint to test
Returns
bool - true if a hit, else false

Reimplemented from EDA_ITEM.

Definition at line 375 of file class_zone.cpp.

376 {
377  // Normally accuracy is zoom-relative, but for the generic HitTest we just use
378  // a fixed (small) value.
379  int accuracy = std::max( aAccuracy, Millimeter2iu( 0.1 ) );
380 
381  return HitTestForCorner( aPosition, accuracy * 2 ) || HitTestForEdge( aPosition, accuracy );
382 }
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:400
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.
Definition: class_zone.cpp:414
static constexpr int Millimeter2iu(double mm)

References ZONE_CONTAINER::HitTestForCorner(), ZONE_CONTAINER::HitTestForEdge(), and Millimeter2iu().

◆ HitTest() [2/2]

bool ZONE_CONTAINER::HitTest ( const EDA_RECT aRect,
bool  aContained = true,
int  aAccuracy = 0 
) const
overridevirtualinherited

Parameters
aRectA reference to a EDA_RECT 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 428 of file class_zone.cpp.

429 {
430  // Calculate bounding box for zone
431  EDA_RECT bbox = GetBoundingBox();
432  bbox.Normalize();
433 
434  EDA_RECT arect = aRect;
435  arect.Normalize();
436  arect.Inflate( aAccuracy );
437 
438  if( aContained )
439  {
440  return arect.Contains( bbox );
441  }
442  else
443  {
444  // Fast test: if aBox is outside the polygon bounding box, rectangles cannot intersect
445  if( !arect.Intersects( bbox ) )
446  return false;
447 
448  int count = m_Poly->TotalVertices();
449 
450  for( int ii = 0; ii < count; ii++ )
451  {
452  auto vertex = m_Poly->CVertex( ii );
453  auto vertexNext = m_Poly->CVertex( ( ii + 1 ) % count );
454 
455  // Test if the point is within the rect
456  if( arect.Contains( ( wxPoint ) vertex ) )
457  return true;
458 
459  // Test if this edge intersects the rect
460  if( arect.Intersects( ( wxPoint ) vertex, ( wxPoint ) vertexNext ) )
461  return true;
462  }
463 
464  return false;
465  }
466 }
int TotalVertices() const
Returns total number of vertices stored in the set.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox (virtual)
Definition: class_zone.cpp:318
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
bool Contains(const wxPoint &aPoint) const
Function Contains.
Definition: eda_rect.cpp:57
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
void Normalize()
Function Normalize ensures that the height ant width are positive.
Definition: eda_rect.cpp:35
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
Definition: eda_rect.cpp:150
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363

References EDA_RECT::Contains(), SHAPE_POLY_SET::CVertex(), ZONE_CONTAINER::GetBoundingBox(), EDA_RECT::Inflate(), EDA_RECT::Intersects(), ZONE_CONTAINER::m_Poly, EDA_RECT::Normalize(), and SHAPE_POLY_SET::TotalVertices().

◆ HitTestCutout() [1/2]

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

Tests 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 497 of file class_zone.cpp.

498 {
499  // Iterate over each outline polygon in the zone and then iterate over
500  // each hole it has to see if the point is in it.
501  for( int i = 0; i < m_Poly->OutlineCount(); i++ )
502  {
503  for( int j = 0; j < m_Poly->HoleCount( i ); j++ )
504  {
505  if( m_Poly->Hole( i, j ).PointInside( aRefPos ) )
506  {
507  if( aOutlineIdx )
508  *aOutlineIdx = i;
509 
510  if( aHoleIdx )
511  *aHoleIdx = j;
512 
513  return true;
514  }
515  }
516  }
517 
518  return false;
519 }
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Returns the reference to aHole-th hole in the aIndex-th outline
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Function PointInside()
int HoleCount(int aOutline) const
Returns the number of holes in a given outline

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

Referenced by ZONE_CONTAINER::HitTestCutout(), and EDIT_TOOL::Remove().

◆ HitTestCutout() [2/2]

bool ZONE_CONTAINER::HitTestCutout ( const wxPoint aRefPos,
int *  aOutlineIdx = nullptr,
int *  aHoleIdx = nullptr 
) const
inlineinherited

Definition at line 337 of file class_zone.h.

339  {
340  return HitTestCutout( VECTOR2I( aRefPos.x, aRefPos.y ), aOutlineIdx, aHoleIdx );
341  }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
bool HitTestCutout(const VECTOR2I &aRefPos, int *aOutlineIdx=nullptr, int *aHoleIdx=nullptr) const
Tests if the given point is contained within a cutout of the zone.
Definition: class_zone.cpp:497

References ZONE_CONTAINER::HitTestCutout(), wxPoint::x, and wxPoint::y.

◆ HitTestFilledArea()

bool ZONE_CONTAINER::HitTestFilledArea ( PCB_LAYER_ID  aLayer,
const wxPoint aRefPos,
int  aAccuracy = 0 
) const
inherited

Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this zone.

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

Definition at line 481 of file class_zone.cpp.

483 {
484  // Rule areas have no filled area, but it's generally nice to treat their interior as if it were
485  // filled so that people don't have to select them by their outline (which is min-width)
486  if( GetIsRuleArea() )
487  return m_Poly->Contains( VECTOR2I( aRefPos.x, aRefPos.y ), -1, aAccuracy );
488 
489  if( !m_FilledPolysList.count( aLayer ) )
490  return false;
491 
492  return m_FilledPolysList.at( aLayer ).Contains( VECTOR2I( aRefPos.x, aRefPos.y ), -1,
493  aAccuracy );
494 }
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, int aAccuracy=0, bool aUseBBoxCaches=false) const
Returns true if a given subpolygon contains the point aP.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: class_zone.h:728
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

References SHAPE_POLY_SET::Contains(), ZONE_CONTAINER::GetIsRuleArea(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_Poly, wxPoint::x, and wxPoint::y.

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

◆ HitTestForCorner() [1/2]

bool ZONE_CONTAINER::HitTestForCorner ( const wxPoint refPos,
int  aAccuracy,
SHAPE_POLY_SET::VERTEX_INDEX aCornerHit 
) const
inherited

Function HitTestForCorner tests if the given wxPoint is near a corner.

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

Definition at line 400 of file class_zone.cpp.

402 {
403  return m_Poly->CollideVertex( VECTOR2I( refPos ), aCornerHit, aAccuracy );
404 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
bool CollideVertex(const VECTOR2I &aPoint, VERTEX_INDEX &aClosestVertex, int aClearance=0) const
Function CollideVertex Checks whether aPoint collides with any vertex of any of the contours of the p...

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

Referenced by ZONE_CONTAINER::HitTest(), ZONE_CONTAINER::HitTestForCorner(), GENERAL_COLLECTOR::Inspect(), and ZONE_CONTAINER::SetSelectedCorner().

◆ HitTestForCorner() [2/2]

bool ZONE_CONTAINER::HitTestForCorner ( const wxPoint refPos,
int  aAccuracy 
) const
inherited

Function HitTestForCorner tests if the given wxPoint is near a corner.

Parameters
refPosis the wxPoint to test.
aAccuracyincrease the item bounding box by this amount.
Returns
bool - true if some corner was found to be closer to refPos than aClearance; false otherwise.

Definition at line 407 of file class_zone.cpp.

408 {
410  return HitTestForCorner( refPos, aAccuracy, dummy );
411 }
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:400
Struct VERTEX_INDEX.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.

References dummy(), and ZONE_CONTAINER::HitTestForCorner().

◆ HitTestForEdge() [1/2]

bool ZONE_CONTAINER::HitTestForEdge ( const wxPoint refPos,
int  aAccuracy,
SHAPE_POLY_SET::VERTEX_INDEX aCornerHit 
) const
inherited

Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.

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

Definition at line 414 of file class_zone.cpp.

416 {
417  return m_Poly->CollideEdge( VECTOR2I( refPos ), aCornerHit, aAccuracy );
418 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
bool CollideEdge(const VECTOR2I &aPoint, VERTEX_INDEX &aClosestVertex, int aClearance=0) const
Function CollideEdge Checks whether aPoint collides with any edge of any of the contours of the polyg...

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

Referenced by ZONE_CONTAINER::HitTest(), ZONE_CONTAINER::HitTestForEdge(), GENERAL_COLLECTOR::Inspect(), and ZONE_CONTAINER::SetSelectedCorner().

◆ HitTestForEdge() [2/2]

bool ZONE_CONTAINER::HitTestForEdge ( const wxPoint refPos,
int  aAccuracy 
) const
inherited

Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.

Parameters
refPosis the wxPoint to test.
aAccuracyincrease the item bounding box by this amount.
Returns
bool - true if some edge was found to be closer to refPos than aClearance.

Definition at line 421 of file class_zone.cpp.

422 {
424  return HitTestForEdge( refPos, aAccuracy, dummy );
425 }
Struct VERTEX_INDEX.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.
Definition: class_zone.cpp:414

References dummy(), and ZONE_CONTAINER::HitTestForEdge().

◆ InitDataFromSrcInCopyCtor()

void ZONE_CONTAINER::InitDataFromSrcInCopyCtor ( const ZONE_CONTAINER aZone)
inherited

Copy aZone data to me.

Definition at line 104 of file class_zone.cpp.

105 {
106  // members are expected non initialize in this.
107  // InitDataFromSrcInCopyCtor() is expected to be called
108  // only from a copy constructor.
109 
110  // Copy only useful EDA_ITEM flags:
111  m_Flags = aZone.m_Flags;
113 
114  // Replace the outlines for aZone outlines.
115  delete m_Poly;
116  m_Poly = new SHAPE_POLY_SET( *aZone.m_Poly );
117 
120  m_zoneName = aZone.m_zoneName;
121  SetLayerSet( aZone.GetLayerSet() );
122  m_priority = aZone.m_priority;
123  m_isRuleArea = aZone.m_isRuleArea;
124 
130 
132  m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
137 
138  m_isFilled = aZone.m_isFilled;
139  m_needRefill = aZone.m_needRefill;
140 
143 
144  m_fillMode = aZone.m_fillMode; // solid vs. hatched
146  m_hatchGap = aZone.m_hatchGap;
152 
153  // For corner moving, corner index to drag, or nullptr if no selection
154  delete m_CornerSelection;
155  m_CornerSelection = nullptr;
156 
157  for( PCB_LAYER_ID layer : aZone.GetLayerSet().Seq() )
158  {
159  m_FilledPolysList[layer] = aZone.m_FilledPolysList.at( layer );
160  m_RawPolysList[layer] = aZone.m_RawPolysList.at( layer );
161  m_filledPolysHash[layer] = aZone.m_filledPolysHash.at( layer );
162  m_FillSegmList[layer] = aZone.m_FillSegmList.at( layer ); // vector <> copy
163  m_insulatedIslands[layer] = aZone.m_insulatedIslands.at( layer );
164  }
165 
169 
170  SetLocalFlags( aZone.GetLocalFlags() );
171 
172  m_netinfo = aZone.m_netinfo;
173 
174  m_hv45 = aZone.m_hv45;
175  m_area = aZone.m_area;
176 }
bool m_isFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:876
int m_hatchBorderAlgorithm
Definition: class_zone.h:902
std::vector< SEG > m_borderHatchLines
Definition: class_zone.h:935
double m_hatchSmoothingValue
Definition: class_zone.h:900
ISLAND_REMOVAL_MODE m_islandRemovalMode
Definition: class_zone.h:867
bool m_doNotAllowPads
Definition: class_zone.h:859
bool m_doNotAllowTracks
Definition: class_zone.h:858
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:906
int m_thermalReliefGap
Definition: class_zone.h:884
long long int m_minIslandArea
When island removal mode is set to AREA, islands below this area will be removed.
Definition: class_zone.h:873
int m_thermalReliefSpokeWidth
Definition: class_zone.h:885
std::map< PCB_LAYER_ID, std::set< int > > m_insulatedIslands
For each layer, a set of insulated islands that were not removed.
Definition: class_zone.h:938
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:410
bool m_doNotAllowFootprints
Definition: class_zone.h:860
ZONE_BORDER_DISPLAY_STYLE m_borderStyle
Definition: class_zone.h:933
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:862
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
Definition: class_zone.cpp:287
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
Definition: class_zone.h:838
PCB_LAYER_ID
A quick note on layer IDs:
double m_hatchOrientation
Definition: class_zone.h:895
void SetLayerSet(LSET aLayerSet) override
Definition: class_zone.cpp:242
SHAPE_POLY_SET.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
unsigned m_priority
Definition: class_zone.h:846
bool m_doNotAllowVias
Definition: class_zone.h:857
int m_cornerSmoothingType
Definition: class_zone.h:834
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_RawPolysList
Definition: class_zone.h:924
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: class_zone.h:931
double m_hatchHoleMinArea
Definition: class_zone.h:901
unsigned int m_cornerRadius
Definition: class_zone.h:835
bool m_doNotAllowCopperPour
Definition: class_zone.h:856
std::map< PCB_LAYER_ID, ZONE_SEGMENT_FILL > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:913
int m_ZoneMinThickness
Definition: class_zone.h:864
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
STATUS_FLAGS m_Flags
Definition: eda_item.h:164
void SetLocalFlags(int aFlags)
Definition: class_zone.h:286
bool m_needRefill
False when a zone was refilled, true after changes in zone params.
Definition: class_zone.h:882
int m_hatchSmoothingLevel
Definition: class_zone.h:896
ZONE_FILL_MODE m_fillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:892
int m_hatchThickness
Definition: class_zone.h:893
bool m_forceVisible
Definition: eda_item.h:163
int GetLocalFlags() const
Definition: class_zone.h:285
int m_borderHatchPitch
Definition: class_zone.h:934
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923

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

Referenced by MODULE_ZONE_CONTAINER(), ZONE_CONTAINER::operator=(), CLIPBOARD_IO::SaveSelection(), and ZONE_CONTAINER::ZONE_CONTAINER().

◆ IsBrightened()

◆ IsConnected()

bool BOARD_CONNECTED_ITEM::IsConnected ( ) const
inlineoverridevirtualinherited

Reimplemented from BOARD_ITEM.

Definition at line 72 of file board_connected_item.h.

73  {
74  return true;
75  }

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 189 of file eda_item.h.

189 { return m_Flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:107
STATUS_FLAGS m_Flags
Definition: eda_item.h:164

References IS_DRAGGED, and EDA_ITEM::m_Flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), and KIGFX::SCH_PAINTER::setDeviceColors().

◆ IsFilled()

bool ZONE_CONTAINER::IsFilled ( ) const
inlineinherited

Definition at line 214 of file class_zone.h.

214 { return m_isFilled; }
bool m_isFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:876

References ZONE_CONTAINER::m_isFilled.

Referenced by PCB_EDIT_FRAME::Edit_Zone_Params(), and PCB_IO::format().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 274 of file eda_item.h.

274 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:163

References EDA_ITEM::m_forceVisible.

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

◆ IsIsland()

bool ZONE_CONTAINER::IsIsland ( PCB_LAYER_ID  aLayer,
int  aPolyIdx 
)
inherited

Checks if a given filled polygon is an insulated island.

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

Definition at line 1121 of file class_zone.cpp.

1122 {
1123  if( GetNetCode() < 1 )
1124  return true;
1125 
1126  if( !m_insulatedIslands.count( aLayer ) )
1127  return false;
1128 
1129  return m_insulatedIslands.at( aLayer ).count( aPolyIdx );
1130 }
int GetNetCode() const
Function GetNetCode.
std::map< PCB_LAYER_ID, std::set< int > > m_insulatedIslands
For each layer, a set of insulated islands that were not removed.
Definition: class_zone.h:938

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

Referenced by PCB_IO::format().

◆ IsLocked()

virtual bool BOARD_ITEM::IsLocked ( ) const
inlinevirtualinherited

Function IsLocked.

Returns
bool - true if the object is locked, else false

Reimplemented in MODULE, and TRACK.

Definition at line 265 of file class_board_item.h.

266  {
267  // only footprints & TRACKs can be locked at this time.
268  return false;
269  }

Referenced by BOARD_ITEM_DESC::BOARD_ITEM_DESC(), PCBNEW_CONTROL::DeleteItemCursor(), EditToolSelectionFilter(), GENERAL_COLLECTOR::Inspect(), SELECTION_TOOL::itemPassesFilter(), and PCB_EDITOR_CONTROL::modifyLockSelected().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 186 of file eda_item.h.

186 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: eda_item.h:101
STATUS_FLAGS m_Flags
Definition: eda_item.h:164

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsOnCopperLayer()

bool ZONE_CONTAINER::IsOnCopperLayer ( ) const
overridevirtualinherited

Function IsOnCopperLayer.

Returns
true if this zone is on a copper layer, false if on a technical layer

Reimplemented from BOARD_ITEM.

Definition at line 220 of file class_zone.cpp.

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

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

Referenced by ZONE_FILLER::fillSingleZone(), ZONE_CONTAINER::GetMsgPanelInfo(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), and BRDITEMS_PLOTTER::PlotFilledAreas().

◆ IsOnLayer()

bool ZONE_CONTAINER::IsOnLayer ( PCB_LAYER_ID  aLayer) const
overridevirtualinherited

Function IsOnLayer tests to see if this object is on the given layer.

Is virtual so objects like D_PAD, which reside on multiple layers can do their own form of testing.

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

Reimplemented from BOARD_ITEM.

Definition at line 312 of file class_zone.cpp.

313 {
314  return m_layerSet.test( aLayer );
315 }

References ZONE_CONTAINER::m_layerSet.

Referenced by KIGFX::PCB_PAINTER::draw(), DSN::SPECCTRA_DB::FromBOARD(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZones().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

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 SCH_COMPONENT, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 490 of file eda_item.h.

490 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 192 of file eda_item.h.

192 { return m_Flags & IS_RESIZED; }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:106
STATUS_FLAGS m_Flags
Definition: eda_item.h:164

References IS_RESIZED, and EDA_ITEM::m_Flags.

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

◆ IsSame()

bool ZONE_CONTAINER::IsSame ( const ZONE_CONTAINER aZoneToCompare)
inherited

Function IsSame tests if 2 zones are equivalent: 2 zones are equivalent if they have same parameters and same outlines info, filling is not taken into account.

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.

Parameters
aZoneToCompare= zone to compare with "this"

Definition at line 61 of file zones_functions_for_undo_redo.cpp.

62 {
63  // compare basic parameters:
64  if( GetLayerSet() != aZoneToCompare.GetLayerSet() )
65  return false;
66 
67  if( GetNetCode() != aZoneToCompare.GetNetCode() )
68  return false;
69 
70  if( GetPriority() != aZoneToCompare.GetPriority() )
71  return false;
72 
73  // Compare zone specific parameters
74  if( GetIsRuleArea() != aZoneToCompare.GetIsRuleArea() )
75  return false;
76 
77  if( GetIsRuleArea() )
78  {
79  if( GetDoNotAllowCopperPour() != aZoneToCompare.GetDoNotAllowCopperPour() )
80  return false;
81 
82  if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() )
83  return false;
84 
85  if( GetDoNotAllowTracks() != aZoneToCompare.GetDoNotAllowTracks() )
86  return false;
87 
88  if( GetDoNotAllowPads() != aZoneToCompare.GetDoNotAllowPads() )
89  return false;
90 
91  if( GetDoNotAllowFootprints() != aZoneToCompare.GetDoNotAllowFootprints() )
92  return false;
93  }
94 
95  if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
96  return false;
97 
98  if( m_ZoneMinThickness != aZoneToCompare.GetMinThickness() )
99  return false;
100 
101  if( m_fillMode != aZoneToCompare.GetFillMode() )
102  return false;
103 
104  if( m_PadConnection != aZoneToCompare.m_PadConnection )
105  return false;
106 
107  if( m_thermalReliefGap != aZoneToCompare.m_thermalReliefGap )
108  return false;
109 
111  return false;
112 
113  if( m_zoneName != aZoneToCompare.m_zoneName )
114  return false;
115 
116  if( m_islandRemovalMode != aZoneToCompare.m_islandRemovalMode )
117  return false;
118 
119  if( m_minIslandArea != aZoneToCompare.m_minIslandArea )
120  return false;
121 
122 
123  // Compare outlines
124  wxASSERT( m_Poly ); // m_Poly == NULL Should never happen
125  wxASSERT( aZoneToCompare.Outline() );
126 
127  if( Outline() != aZoneToCompare.Outline() ) // Compare vector
128  return false;
129 
130  return true;
131 }
bool GetDoNotAllowPads() const
Definition: class_zone.h:732
int GetNetCode() const
Function GetNetCode.
ISLAND_REMOVAL_MODE m_islandRemovalMode
Definition: class_zone.h:867
int m_thermalReliefGap
Definition: class_zone.h:884
SHAPE_POLY_SET * Outline()
Definition: class_zone.h:300
long long int m_minIslandArea
When island removal mode is set to AREA, islands below this area will be removed.
Definition: class_zone.h:873
int m_thermalReliefSpokeWidth
Definition: class_zone.h:885
bool GetDoNotAllowVias() const
Definition: class_zone.h:730
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:862
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
Definition: class_zone.cpp:287
wxString m_zoneName
An optional unique name for this zone, used for identifying it in DRC checking.
Definition: class_zone.h:838
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:163
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:729
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: class_zone.h:728
int m_ZoneMinThickness
Definition: class_zone.h:864
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:106
int GetMinThickness() const
Definition: class_zone.h:224
bool GetDoNotAllowTracks() const
Definition: class_zone.h:731
bool GetDoNotAllowFootprints() const
Definition: class_zone.h:733
ZONE_FILL_MODE m_fillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:892

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

Referenced by UpdateCopyOfZonesList().

◆ IsSelected()

◆ IsTrack()

bool BOARD_ITEM::IsTrack ( ) const
inlineinherited

Function IsTrack tests to see if this object is a track or via (or microvia).

form of testing.

Returns
bool - true if a track or via, else false.

Definition at line 256 of file class_board_item.h.

257  {
258  return ( Type() == PCB_TRACE_T ) || ( Type() == PCB_VIA_T );
259  }
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181

References PCB_TRACE_T, PCB_VIA_T, and EDA_ITEM::Type().

◆ IsType()

virtual bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[]) const
inlinevirtualinherited

Function IsType Checks 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 VIA, SCH_LABEL, DIMENSION, D_PAD, PCB_SHAPE, SCH_FIELD, FP_TEXT, SCH_LINE, FP_SHAPE, and PCB_TEXT.

Definition at line 250 of file eda_item.h.

251  {
252  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
253  return true;
254 
255  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
256  {
257  if( m_StructType == *p )
258  return true;
259  }
260 
261  return false;
262  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: eda_item.h:158
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78

References EOT, EDA_ITEM::m_StructType, and SCH_LOCATE_ANY_T.

Referenced by SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), PCB_TEXT::IsType(), FP_SHAPE::IsType(), SCH_LINE::IsType(), FP_TEXT::IsType(), SCH_FIELD::IsType(), PCB_SHAPE::IsType(), D_PAD::IsType(), DIMENSION::IsType(), SCH_LABEL::IsType(), VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 190 of file eda_item.h.

190 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:109
STATUS_FLAGS m_Flags
Definition: eda_item.h:164

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ Iterate()

SHAPE_POLY_SET::ITERATOR ZONE_CONTAINER::Iterate ( )
inlineinherited

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

Returns
SHAPE_POLY_SET::ITERATOR - an iterator to visit the zone vertices without holes.

Definition at line 516 of file class_zone.h.

517  {
518  return m_Poly->Iterate();
519  }
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Function Iterate returns an object to iterate through the points of the polygons between aFirst and a...
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833

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

◆ IterateForward() [1/2]

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

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

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

Definition at line 372 of file eda_item.h.

376  {
377  for( auto it : aList )
378  {
379  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
381  return SEARCH_RESULT::QUIT;
382  }
383 
385  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Definition: eda_item.cpp:107

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

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

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

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use std::vector instead

Definition at line 393 of file eda_item.h.

395  {
396  for( auto it : aList )
397  {
398  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
400  return SEARCH_RESULT::QUIT;
401  }
402 
404  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Definition: eda_item.cpp:107

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

◆ IterateWithHoles()

SHAPE_POLY_SET::ITERATOR ZONE_CONTAINER::IterateWithHoles ( )
inlineinherited

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

Returns
SHAPE_POLY_SET::ITERATOR - an iterator to visit the zone vertices with holes.

Definition at line 526 of file class_zone.h.

527  {
528  return m_Poly->IterateWithHoles();
529  }
ITERATOR IterateWithHoles(int aOutline)
Function IterateWithHoles.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833

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

Referenced by PCB_IO::format(), and DSN::SPECCTRA_DB::FromBOARD().

◆ LayerMaskDescribe()

wxString BOARD_ITEM::LayerMaskDescribe ( ) const
protectedvirtualinherited

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

The BOARD is needed because layer names are (somewhat) customizable

Reimplemented in VIA.

Definition at line 72 of file class_board_item.cpp.

73 {
74  BOARD* board = GetBoard();
75  LSET layers = GetLayerSet();
76 
77  // Try to be smart and useful. Check all copper first.
78  if( layers[F_Cu] && layers[B_Cu] )
79  return _( "all copper layers" );
80 
81  LSET copperLayers = layers & board->GetEnabledLayers().AllCuMask();
82  LSET techLayers = layers & board->GetEnabledLayers().AllTechMask();
83 
84  for( LSET testLayers : { copperLayers, techLayers, layers } )
85  {
86  for( int bit = PCBNEW_LAYER_ID_START; bit < PCB_LAYER_ID_COUNT; ++bit )
87  {
88  if( testLayers[ bit ] )
89  {
90  wxString layerInfo = board->GetLayerName( static_cast<PCB_LAYER_ID>( bit ) );
91 
92  if( testLayers.count() > 1 )
93  layerInfo << wxS( " " ) + _( "and others" );
94 
95  return layerInfo;
96  }
97  }
98  }
99 
100  // No copper, no technicals: no layer
101  return _( "no layers" );
102 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:749
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings Returns a bit-mask of all t...
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:819
LSET is a set of PCB_LAYER_IDs.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:186
#define _(s)
Definition: 3d_actions.cpp:33
virtual LSET GetLayerSet() const
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.

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 TRACK::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), and D_PAD::GetSelectMenuText().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData 
)
inlinevirtualinherited

Function Matches compares 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 in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, SCH_PIN, SCH_MARKER, MARKER_PCB, FP_TEXT, and PCB_TEXT.

Definition at line 446 of file eda_item.h.

447  {
448  return false;
449  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), PCB_TEXT::Matches(), FP_TEXT::Matches(), MARKER_PCB::Matches(), SCH_MARKER::Matches(), SCH_PIN::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

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

Function Matches compares 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 132 of file eda_item.cpp.

133 {
134  wxString text = aText;
135  wxString searchText = aSearchData.GetFindString();
136 
137  // Don't match if searching for replaceable item and the item doesn't support text replace.
138  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
139  return false;
140 
141  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
142  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
143 
144  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
145  {
146  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
147  return text.Matches( searchText );
148 
149  return text.MakeUpper().Matches( searchText.MakeUpper() );
150  }
151 
152  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
153  return aText.Find( searchText ) != wxNOT_FOUND;
154 
155  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
156 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: eda_item.h:490

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, and EDA_ITEM::IsReplaceable().

◆ Mirror()

void ZONE_CONTAINER::Mirror ( const wxPoint aMirrorRef,
bool  aMirrorLeftRight 
)
inherited

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

Parameters
aMirrorRef= axis position
aMirrorLeftRightmirror across Y axis (otherwise mirror across X)

Definition at line 740 of file class_zone.cpp.

741 {
742  // ZONE_CONTAINERs mirror about the x-axis (why?!?)
743  m_Poly->Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
744 
745  HatchBorder();
746 
747  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
748  pair.second.Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
749 
750  for( std::pair<const PCB_LAYER_ID, ZONE_SEGMENT_FILL>& pair : m_FillSegmList )
751  {
752  for( SEG& seg : pair.second )
753  {
754  if( aMirrorLeftRight )
755  {
756  MIRROR( seg.A.x, aMirrorRef.x );
757  MIRROR( seg.B.x, aMirrorRef.x );
758  }
759  else
760  {
761  MIRROR( seg.A.y, aMirrorRef.y );
762  MIRROR( seg.B.y, aMirrorRef.y );
763  }
764  }
765  }
766 }
void HatchBorder()
Function HatchBorder computes the hatch lines depending on the hatch parameters and stores it in the ...
Definition: class_zone.cpp:919
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
void Mirror(bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 })
Mirrors the line points about y or x (or both)
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:142
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
Definition: seg.h:39
std::map< PCB_LAYER_ID, ZONE_SEGMENT_FILL > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:913
VECTOR2I A
Definition: seg.h:47
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923
VECTOR2I B
Definition: seg.h:48

References SEG::A, SEG::B, ZONE_CONTAINER::HatchBorder(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, MIRROR(), SHAPE_POLY_SET::Mirror(), wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

Referenced by ZONE_CONTAINER::Flip(), and EDIT_TOOL::Mirror().

◆ Move() [1/2]

void BOARD_ITEM::Move ( const VECTOR2I aMoveVector)
inlineinherited

Definition at line 304 of file class_board_item.h.

305  {
306  Move( wxPoint( aMoveVector.x, aMoveVector.y ) );
307  }
virtual void Move(const wxPoint &aMoveVector)
Function Move move this object.

References BOARD_ITEM::Move(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Move() [2/2]

void ZONE_CONTAINER::Move ( const wxPoint offset)
overridevirtualinherited

Function Move Move the outlines.

Parameters
offset= moving vector

Reimplemented from BOARD_ITEM.

Definition at line 666 of file class_zone.cpp.

667 {
668  /* move outlines */
669  m_Poly->Move( offset );
670 
671  HatchBorder();
672 
673  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
674  pair.second.Move( offset );
675 
676  for( std::pair<const PCB_LAYER_ID, ZONE_SEGMENT_FILL>& pair : m_FillSegmList )
677  {
678  for( SEG& seg : pair.second )
679  {
680  seg.A += VECTOR2I( offset );
681  seg.B += VECTOR2I( offset );
682  }
683  }
684 }
void HatchBorder()
Function HatchBorder computes the hatch lines depending on the hatch parameters and stores it in the ...
Definition: class_zone.cpp:919
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
void Move(const VECTOR2I &aVector) override
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
Definition: seg.h:39
std::map< PCB_LAYER_ID, ZONE_SEGMENT_FILL > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:913
VECTOR2I A
Definition: seg.h:47
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923
VECTOR2I B
Definition: seg.h:48

References SEG::A, SEG::B, ZONE_CONTAINER::HatchBorder(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, and SHAPE_POLY_SET::Move().

◆ MoveEdge()

void ZONE_CONTAINER::MoveEdge ( const wxPoint offset,
int  aEdge 
)
inherited

Function MoveEdge Move the outline Edge.

Parameters
offset= moving vector
aEdge= start point of the outline edge

Definition at line 687 of file class_zone.cpp.

688 {
689  int next_corner;
690 
691  if( m_Poly->GetNeighbourIndexes( aEdge, nullptr, &next_corner ) )
692  {
693  m_Poly->SetVertex( aEdge, m_Poly->CVertex( aEdge ) + VECTOR2I( offset ) );
694  m_Poly->SetVertex( next_corner, m_Poly->CVertex( next_corner ) + VECTOR2I( offset ) );
695  HatchBorder();
696 
697  SetNeedRefill( true );
698  }
699 }
void HatchBorder()
Function HatchBorder computes the hatch lines depending on the hatch parameters and stores it in the ...
Definition: class_zone.cpp:919
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
bool GetNeighbourIndexes(int aGlobalIndex, int *aPrevious, int *aNext)
Returns the global indexes of the previous and the next corner of the aGlobalIndex-th corner of a con...
void SetVertex(const VERTEX_INDEX &aIndex, const VECTOR2I &aPos)
Function SetVertex Accessor function to set the position of a specific point.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:218

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

◆ NeedRefill()

bool ZONE_CONTAINER::NeedRefill ( ) const
inlineinherited

Definition at line 217 of file class_zone.h.

217 { return m_needRefill; }
bool m_needRefill
False when a zone was refilled, true after changes in zone params.
Definition: class_zone.h:882

References ZONE_CONTAINER::m_needRefill.

◆ NewHole()

void ZONE_CONTAINER::NewHole ( )
inlineinherited

Function NewHole creates a new hole on the zone; i.e., a new contour on the zone's outline.

Definition at line 579 of file class_zone.h.

580  {
581  m_Poly->NewHole();
582  }
int NewHole(int aOutline=-1)
Creates a new hole in a given outline
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833

References ZONE_CONTAINER::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 185 of file eda_item.cpp.

186 {
187  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
188  GetClass() ) );
189 
190  return false;
191 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201

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

◆ operator=()

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

Definition at line 1313 of file class_zone.cpp.

1314 {
1315  ZONE_CONTAINER::operator=( aOther );
1316  return *this;
1317 }
ZONE_CONTAINER & operator=(const ZONE_CONTAINER &aOther)
Definition: class_zone.cpp:87

References ZONE_CONTAINER::operator=().

◆ Outline() [1/2]

◆ Outline() [2/2]

const SHAPE_POLY_SET* ZONE_CONTAINER::Outline ( ) const
inlineinherited

Definition at line 301 of file class_zone.h.

301 { return const_cast< SHAPE_POLY_SET* >( m_Poly ); }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833

References ZONE_CONTAINER::m_Poly.

◆ RawPolysList()

SHAPE_POLY_SET& ZONE_CONTAINER::RawPolysList ( PCB_LAYER_ID  aLayer)
inlineinherited

Definition at line 713 of file class_zone.h.

714  {
715  wxASSERT( m_RawPolysList.count( aLayer ) );
716  return m_RawPolysList.at( aLayer );
717  }
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_RawPolysList
Definition: class_zone.h:924

References ZONE_CONTAINER::m_RawPolysList.

◆ RemoveAllContours()

void ZONE_CONTAINER::RemoveAllContours ( void  )
inlineinherited

Definition at line 541 of file class_zone.h.

542  {
544  }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.

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

◆ RemoveCutout()

void ZONE_CONTAINER::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 785 of file class_zone.cpp.

786 {
787  // Ensure the requested cutout is valid
788  if( m_Poly->OutlineCount() < aOutlineIdx || m_Poly->HoleCount( aOutlineIdx ) < aHoleIdx )
789  return;
790 
791  SHAPE_POLY_SET cutPoly( m_Poly->Hole( aOutlineIdx, aHoleIdx ) );
792 
793  // Add the cutout back to the zone
795 
796  SetNeedRefill( true );
797 }
int OutlineCount() const
Returns the number of outlines in the set
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset union For aFastMode meaning, see function booleanOp
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Returns the reference to aHole-th hole in the aIndex-th outline
SHAPE_POLY_SET.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:218

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

Referenced by EDIT_TOOL::Remove().

◆ Replace() [1/2]

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

Helper function used in search and replace dialog Function Replace performs 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 159 of file eda_item.cpp.

160 {
161  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
162 
163  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
164  aSearchData.GetFindString() :
165  aSearchData.GetFindString().Upper() );
166 
167  if( result == wxNOT_FOUND )
168  return false;
169 
170  wxString prefix = aText.Left( result );
171  wxString suffix;
172 
173  if( aSearchData.GetFindString().length() + result < aText.length() )
174  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
175 
176  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
177  aText, prefix, aSearchData.GetReplaceString(), suffix );
178 
179  aText = prefix + aSearchData.GetReplaceString() + suffix;
180 
181  return true;
182 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.

References traceFindReplace.

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

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
inlinevirtualinherited

Function Replace performs 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 SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, and SCH_PIN.

Definition at line 478 of file eda_item.h.

478 { return false; }

◆ Rotate() [1/2]

void BOARD_ITEM::Rotate ( const VECTOR2I aRotCentre,
double  aAngle 
)
inlineinherited

Definition at line 320 of file class_board_item.h.

321  {
322  Rotate( wxPoint( aRotCentre.x, aRotCentre.y ), aAngle );
323  }
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Function Rotate Rotate this object.

References BOARD_ITEM::Rotate(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Rotate() [2/2]

void ZONE_CONTAINER::Rotate ( const wxPoint aCentre,
double  aAngle 
)
overridevirtualinherited

Function Rotate Move the outlines.

Parameters
aCentre= rot centre
aAngle= in 0.1 degree

Reimplemented from BOARD_ITEM.

Definition at line 702 of file class_zone.cpp.

703 {
704  aAngle = -DECIDEG2RAD( aAngle );
705 
706  m_Poly->Rotate( aAngle, VECTOR2I( aCentre ) );
707  HatchBorder();
708 
709  /* rotate filled areas: */
710  for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
711  pair.second.Rotate( aAngle, VECTOR2I( aCentre ) );
712 
713  for( std::pair<const PCB_LAYER_ID, ZONE_SEGMENT_FILL>& pair : m_FillSegmList )
714  {
715  for( SEG& seg : pair.second )
716  {
717  wxPoint a( seg.A );
718  RotatePoint( &a, aCentre, aAngle );
719  seg.A = a;
720  wxPoint b( seg.B );
721  RotatePoint( &b, aCentre, aAngle );
722  seg.B = a;
723  }
724  }
725 }
void HatchBorder()
Function HatchBorder computes the hatch lines depending on the hatch parameters and stores it in the ...
Definition: class_zone.cpp:919
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Function Rotate rotates all vertices by a given angle.
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:833
Definition: seg.h:39
std::map< PCB_LAYER_ID, ZONE_SEGMENT_FILL > m_FillSegmList
Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:913
VECTOR2I A
Definition: seg.h:47
double DECIDEG2RAD(double deg)
Definition: trigo.h:224
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_FilledPolysList
Definition: class_zone.h:923
VECTOR2I B
Definition: seg.h:48

References SEG::A, SEG::B, DECIDEG2RAD(), ZONE_CONTAINER::HatchBorder(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, SHAPE_POLY_SET::Rotate(), and RotatePoint().

Referenced by EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::packageRectangle(), and ALTIUM_PCB::ParseFills6Data().

◆ Set() [1/3]

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

Definition at line 40 of file inspectable.h.

41  {
43  TYPE_ID thisType = TYPE_HASH( *this );
44  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
45 
46  if( object )
47  aProperty->setter( object, aValue );
48 
49  return object != nullptr;
50  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ Set() [2/3]

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

Definition at line 53 of file inspectable.h.

54  {
56  TYPE_ID thisType = TYPE_HASH( *this );
57  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
58 
59  if( object )
60  aProperty->set<T>( object, aValue );
61 
62  return object != nullptr;
63  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

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

◆ Set() [3/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  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.