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

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...
 
unsigned int ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
const 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)
 
virtual LSET GetLayerSet () const override
 Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segment or VIA physically resides. More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox (virtual) More...
 
int GetLocalClearance (wxString *aSource=nullptr) const override
 Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system. More...
 
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 (D_PAD *aPad=NULL) const
 
void SetThermalReliefCopperBridge (int aThermalReliefCopperBridge)
 
int GetThermalReliefCopperBridge (D_PAD *aPad=NULL) 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...
 
bool IsFilled () const
 
void SetIsFilled (bool isFilled)
 
bool NeedRefill () const
 
void SetNeedRefill (bool aNeedRefill)
 
int GetZoneClearance () const
 
void SetZoneClearance (int aZoneClearance)
 
ZONE_CONNECTION GetPadConnection (D_PAD *aPad=NULL) const
 
void SetPadConnection (ZONE_CONNECTION aPadConnection)
 
int GetMinThickness () const
 
void SetMinThickness (int aMinThickness)
 
int GetHatchFillTypeThickness () const
 
void SetHatchFillTypeThickness (int aThickness)
 
int GetHatchFillTypeGap () const
 
void SetHatchFillTypeGap (int aStep)
 
double GetHatchFillTypeOrientation () const
 
void SetHatchFillTypeOrientation (double aStep)
 
int GetHatchFillTypeSmoothingLevel () const
 
void SetHatchFillTypeSmoothingLevel (int aLevel)
 
double GetHatchFillTypeSmoothingValue () const
 
void SetHatchFillTypeSmoothingValue (double aValue)
 
int GetSelectedCorner () const
 
void SetSelectedCorner (int aCorner)
 
void SetSelectedCorner (const wxPoint &aPosition, int aAccuracy)
 
int GetLocalFlags () const
 
void SetLocalFlags (int aFlags)
 
ZONE_SEGMENT_FILLFillSegments ()
 
const ZONE_SEGMENT_FILLFillSegments () const
 
SHAPE_POLY_SETOutline ()
 
const SHAPE_POLY_SETOutline () const
 
void SetOutline (SHAPE_POLY_SET *aOutline)
 
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 (const wxPoint &aRefPos) 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 GetColinearCorners (BOARD *aBoard, std::set< VECTOR2I > &colinearCorners)
 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 TransformSolidAreasShapesToPolygonSet (SHAPE_POLY_SET &aCornerBuffer, int aError=ARC_HIGH_DEF) const
 Function TransformSolidAreasShapesToPolygonSet 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 TransformOutlinesShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, int aMinClearanceValue, std::set< VECTOR2I > *aPreserveCorners=nullptr) const
 Function TransformOutlinesShapeWithClearanceToPolygon 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, int aClearanceValue, int aError=ARC_HIGH_DEF, 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 &centre, double angle) 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_HATCH_STYLE GetHatchStyle () const
 
void SetHatchStyle (ZONE_HATCH_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...
 
const SHAPE_POLY_SETGetFilledPolysList () const
 Function GetFilledPolysList returns a reference to the list of filled polygons. More...
 
void CacheTriangulation ()
 (re)create a list of triangles that "fill" the solid areas. More...
 
void SetFilledPolysList (SHAPE_POLY_SET &aPolysList)
 Function SetFilledPolysList sets the list of filled polygons. More...
 
void SetRawPolysList (SHAPE_POLY_SET &aPolysList)
 Function SetFilledPolysList sets the list of filled polygons. More...
 
bool BuildSmoothedPoly (SHAPE_POLY_SET &aSmoothedPoly, std::set< VECTOR2I > *aPreserveCorners) const
 Function GetSmoothedPoly returns a pointer to the corner-smoothed version of m_Poly. More...
 
void SetCornerSmoothingType (int aType)
 
int GetCornerSmoothingType () const
 
void SetCornerRadius (unsigned int aRadius)
 
unsigned int GetCornerRadius () const
 
bool GetFilledPolysUseThickness () const
 
void SetFilledPolysUseThickness (bool aOption)
 
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 (const ZONE_SEGMENT_FILL &aSegments)
 
SHAPE_POLY_SETRawPolysList ()
 
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 GetIsKeepout () const
 Accessors to parameters used in Keepout zones: More...
 
bool GetDoNotAllowCopperPour () const
 
bool GetDoNotAllowVias () const
 
bool GetDoNotAllowTracks () const
 
bool GetDoNotAllowPads () const
 
bool GetDoNotAllowFootprints () const
 
int GetKeepouts (std::map< int, wxString > *aSources=nullptr) const
 Return a bitset of flags for keepouts. More...
 
void SetIsKeepout (bool aEnable)
 
void SetDoNotAllowCopperPour (bool aEnable)
 
void SetDoNotAllowVias (bool aEnable)
 
void SetDoNotAllowTracks (bool aEnable)
 
void SetDoNotAllowPads (bool aEnable)
 
void SetDoNotAllowFootprints (bool aEnable)
 
int GetHatchPitch () const
 Hatch related methods. More...
 
void SetHatch (ZONE_HATCH_STYLE aHatchStyle, int aHatchPitch, bool aRebuildHatch)
 Function SetHatch sets all hatch parameters for the zone. More...
 
void SetHatchPitch (int aPitch)
 Function SetHatchPitch sets the hatch pitch parameter for the zone. More...
 
void UnHatch ()
 Function UnHatch clears the zone's hatch. More...
 
void Hatch ()
 Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_HatchLines. More...
 
const std::vector< SEG > & GetHatchLines () const
 
bool GetHV45 () const
 
void SetHV45 (bool aConstrain)
 
MD5_HASH GetHashValue ()
 
void BuildHashValue ()
 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=false)
 Sets net using a net code. More...
 
const wxString & GetNetname () const
 Function GetNetname. More...
 
wxString GetNetnameMsg () const
 Function GetNetnameMsg. More...
 
const wxString & GetShortNetname () const
 Function GetShortNetname. More...
 
virtual int GetClearance (BOARD_ITEM *aItem=nullptr, wxString *aSource=nullptr) const
 Function GetClearance returns the clearance in internal units. More...
 
virtual bool GetRuleClearance (BOARD_ITEM *aItem, int *aClearance, wxString *aSource) const
 Function GetRuleClearance returns any rule-based clearance. More...
 
virtual int GetLocalClearanceOverrides (wxString *aSource=nullptr) 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
 
virtual const wxPoint GetCenter () const
 Function GetCenter() More...
 
BOARD_ITEM_CONTAINERGetParent () const
 
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 IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
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 ()
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
static int GetDefaultHatchPitch ()
 Function GetDefaultHatchPitchMils. More...
 
static wxString ShowShape (STROKE_T aShape)
 Function ShowShape converts the enum STROKE_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

void initDataFromSrcInCopyCtor (const ZONE_CONTAINER &aZone)
 Copy aZone data to me members are expected non initialize in this. More...
 
bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Static Protected Member Functions

static wxString LayerMaskDescribe (const BOARD *aBoard, LSET aMask)
 Helper function Return a string (to be shown to the user) describing a layer mask. More...
 

Protected Attributes

SHAPE_POLY_SETm_Poly
 Outline of the zone. More...
 
int m_cornerSmoothingType
 
unsigned int m_cornerRadius
 
LSET m_layerSet
 
unsigned m_priority
 
bool m_isKeepout
 
bool m_doNotAllowCopperPour
 
bool m_doNotAllowVias
 
bool m_doNotAllowTracks
 
bool m_doNotAllowPads
 
bool m_doNotAllowFootprints
 
ZONE_CONNECTION m_PadConnection
 
int m_ZoneClearance
 Clearance value in internal units. More...
 
int m_ZoneMinThickness
 Minimum thickness value in filled areas. More...
 
bool m_FilledPolysUseThickness
 outline of filled polygons have thickness. 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
 Width of the copper bridge in thermal reliefs. More...
 
int m_ThermalReliefCopperBridge
 
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_HatchFillTypeThickness
 Grid style shape: thickness of lines (if 0 -> solid shape) More...
 
int m_HatchFillTypeGap
 Grid style shape: dist between center of lines (grid size) (0 -> solid shape) More...
 
double m_HatchFillTypeOrientation
 Grid style shape: orientation in degrees of the grid lines. More...
 
int m_HatchFillTypeSmoothingLevel
 Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet, >= 2 = arc. More...
 
double m_HatchFillTypeSmoothingValue
 Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap and the chamfer size. More...
 
SHAPE_POLY_SET::VERTEX_INDEXm_CornerSelection
 The index of the corner being moved or nullptr if no corner is selected. More...
 
int m_localFlgs
 Variable used in polygon calculations. More...
 
ZONE_SEGMENT_FILL m_FillSegmList
 Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used. More...
 
SHAPE_POLY_SET m_FilledPolysList
 
SHAPE_POLY_SET m_RawPolysList
 
MD5_HASH m_filledPolysHash
 
ZONE_HATCH_STYLE m_hatchStyle
 
int m_hatchPitch
 
std::vector< SEGm_HatchLines
 
std::vector< int > m_insulatedIslands
 
bool m_hv45
 
double m_area
 
NETINFO_ITEMm_netinfo
 Stores all informations about the net that item belongs to. More...
 
PCB_LAYER_ID m_Layer
 
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 875 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 1229 of file class_zone.cpp.

1229  :
1230  ZONE_CONTAINER( aParent, true )
1231 {
1232  // in a footprint, net classes are not managed.
1233  // so set the net to NETINFO_LIST::ORPHANED_ITEM
1234  SetNetCode( -1, true );
1235 }
ZONE_CONTAINER(BOARD_ITEM_CONTAINER *parent, bool aInModule=false)
The ctor to build ZONE_CONTAINER, but comaptible with MODULE_ZONE_CONTAINER requirement.
Definition: class_zone.cpp:49
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Sets net using a net code.

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

1239  : ZONE_CONTAINER( aZone.GetParent(), true )
1240 {
1241  initDataFromSrcInCopyCtor( aZone );
1242 }
ZONE_CONTAINER(BOARD_ITEM_CONTAINER *parent, bool aInModule=false)
The ctor to build ZONE_CONTAINER, but comaptible with MODULE_ZONE_CONTAINER requirement.
Definition: class_zone.cpp:49
void initDataFromSrcInCopyCtor(const ZONE_CONTAINER &aZone)
Copy aZone data to me members are expected non initialize in this.
Definition: class_zone.cpp:134
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 809 of file class_zone.cpp.

810 {
811  if( aPolygon.empty() )
812  return;
813 
814  SHAPE_LINE_CHAIN outline;
815 
816  // Create an outline and populate it with the points of aPolygon
817  for( const wxPoint& pt : aPolygon)
818  outline.Append( pt );
819 
820  outline.SetClosed( true );
821 
822  AddPolygon( outline );
823 }
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:809
SHAPE_LINE_CHAIN.

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

Referenced by EAGLE_PLUGIN::loadPolygon().

◆ AddPolygon() [2/2]

void ZONE_CONTAINER::AddPolygon ( const SHAPE_LINE_CHAIN aPolygon)
inherited

Definition at line 795 of file class_zone.cpp.

796 {
797  wxASSERT( aPolygon.IsClosed() );
798 
799  // Add the outline as a new polygon in the polygon set
800  if( m_Poly->OutlineCount() == 0 )
801  m_Poly->AddOutline( aPolygon );
802  else
803  m_Poly->AddHole( aPolygon );
804 
805  SetNeedRefill( true );
806 }
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
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
bool IsClosed() const
Function IsClosed()
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:179

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

827 {
828  // Ensure the main outline exists:
829  if( m_Poly->OutlineCount() == 0 )
830  m_Poly->NewOutline();
831 
832  // If aHoleIdx >= 0, the corner musty be added to the hole, index aHoleIdx.
833  // (remember: the index of the first hole is 0)
834  // Return error if if does dot exist.
835  if( aHoleIdx >= m_Poly->HoleCount( 0 ) )
836  return false;
837 
838  m_Poly->Append( aPosition.x, aPosition.y, -1, aHoleIdx, aAllowDuplication );
839 
840  SetNeedRefill( true );
841 
842  return true;
843 }
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
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:179

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 PCAD2KICAD::PCB_POLYGON::AddToBoard(), BOARD::InsertArea(), EAGLE_PLUGIN::loadPlain(), ALTIUM_PCB::ParseFills6Data(), ALTIUM_PCB::ParsePolygons6Data(), and ALTIUM_PCB::ParseShapeBasedRegions6Data().

◆ BuildHashValue()

void ZONE_CONTAINER::BuildHashValue ( )
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 745 of file class_zone.h.

MD5_HASH GetHash() const
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851
MD5_HASH m_filledPolysHash
Definition: class_zone.h:853

References SHAPE_POLY_SET::GetHash(), ZONE_CONTAINER::m_filledPolysHash, and ZONE_CONTAINER::m_FilledPolysList.

◆ BuildSmoothedPoly()

bool ZONE_CONTAINER::BuildSmoothedPoly ( SHAPE_POLY_SET aSmoothedPoly,
std::set< VECTOR2I > *  aPreserveCorners 
) const
inherited

Function GetSmoothedPoly returns a pointer to the corner-smoothed version of m_Poly.

Parameters
aPreserveCorners- set of corners which should /not/ be smoothed
Returns
SHAPE_POLY_SET* - pointer to the polygon.

Definition at line 1136 of file class_zone.cpp.

1138 {
1139  if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations do not like it ...
1140  return false;
1141 
1142  // Make a smoothed polygon out of the user-drawn polygon if required
1143  switch( m_cornerSmoothingType )
1144  {
1146  aSmoothedPoly = m_Poly->Chamfer( m_cornerRadius, aPreserveCorners );
1147  break;
1148 
1150  {
1151  auto board = GetBoard();
1152  int maxError = ARC_HIGH_DEF;
1153 
1154  if( board )
1155  maxError = board->GetDesignSettings().m_MaxError;
1156 
1157  aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, maxError, aPreserveCorners );
1158  break;
1159  }
1160  default:
1161  // Acute angles between adjacent edges can create issues in calculations,
1162  // in inflate/deflate outlines transforms, especially when the angle is very small.
1163  // We can avoid issues by creating a very small chamfer which remove acute angles,
1164  // or left it without chamfer and use only CPOLYGONS_LIST::InflateOutline to create
1165  // clearance areas
1166  aSmoothedPoly = m_Poly->Chamfer( Millimeter2iu( 0.0 ), aPreserveCorners );
1167  break;
1168  }
1169 
1170  return true;
1171 };
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
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:763
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: class_zone.h:454
unsigned int m_cornerRadius
Definition: class_zone.h:764
SHAPE_POLY_SET Fillet(int aRadius, int aErrorMax, std::set< VECTOR2I > *aPreserveCorners=nullptr)
Function Fillet returns a filleted version of the polygon set.
SHAPE_POLY_SET Chamfer(int aDistance, std::set< VECTOR2I > *aPreserveCorners=nullptr)
Function Chamfer returns a chamfered version of the polygon set.

References SHAPE_POLY_SET::Chamfer(), SHAPE_POLY_SET::Fillet(), BOARD_ITEM::GetBoard(), ZONE_CONTAINER::GetNumCorners(), ZONE_CONTAINER::m_cornerRadius, ZONE_CONTAINER::m_cornerSmoothingType, ZONE_CONTAINER::m_Poly, ZONE_SETTINGS::SMOOTHING_CHAMFER, and ZONE_SETTINGS::SMOOTHING_FILLET.

Referenced by ZONE_FILLER::fillSingleZone(), PNS_KICAD_IFACE_BASE::syncZone(), DRC::testZones(), and ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon().

◆ CacheTriangulation()

void ZONE_CONTAINER::CacheTriangulation ( )
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 1082 of file class_zone.cpp.

1083 {
1085 }
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851

References SHAPE_POLY_SET::CacheTriangulation(), and ZONE_CONTAINER::m_FilledPolysList.

◆ CalculateFilledArea()

double ZONE_CONTAINER::CalculateFilledArea ( )
inherited

Compute the area currently occupied by the zone fill.

Returns
the currently filled area

Definition at line 1174 of file class_zone.cpp.

1175 {
1176  m_area = 0.0;
1177 
1178  // Iterate over each outline polygon in the zone and then iterate over
1179  // each hole it has to compute the total area.
1180  for( int i = 0; i < m_FilledPolysList.OutlineCount(); i++ )
1181  {
1183 
1184  for( int j = 0; j < m_FilledPolysList.HoleCount( i ); j++ )
1185  {
1186  m_area -= m_FilledPolysList.Hole( i, j ).Area();
1187  }
1188  }
1189 
1190  return m_area;
1191 }
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_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
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851
double Area() const

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

485  {
486  return m_Poly->CIterateWithHoles();
487  }
CONST_ITERATOR CIterateWithHoles(int aOutline) const
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762

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

◆ ClassOf()

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

Definition at line 79 of file class_zone.h.

80  {
81  return aItem && aItem->Type() == PCB_ZONE_AREA_T;
82  }
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:102
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

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

566  {
568  }
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.

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

Referenced by POINT_EDITOR::updateItem().

◆ ClearFlags()

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

Definition at line 240 of file base_struct.h.

240 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References EDA_ITEM::m_Flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_COMPONENT::ClearAllHighlightFlags(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearHighlighted(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), KIGFX::SCH_VIEW::HighlightItem(), FOOTPRINT_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), 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_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(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearHighlighted()

void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 218 of file base_struct.h.

218 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:139
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:240

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 252 of file base_struct.h.

253  {
255  DO_NOT_DRAW | FLAG0 | FLAG1 | BUSY );
256  }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:114
#define FLAG1
Pcbnew: flag used in local computations.
Definition: base_struct.h:133
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:125
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:128
#define BUSY
Pcbnew: flag indicating that the structure has.
Definition: base_struct.h:137
#define CANDIDATE
flag indicating that the structure is connected
Definition: base_struct.h:127
#define FLAG0
Pcbnew: flag used in local computations.
Definition: base_struct.h:134
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:123
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:240
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:129
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:122

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

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 153 of file view_item.h.

154  {
156  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:161
#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 1252 of file class_zone.cpp.

1253 {
1254  return new MODULE_ZONE_CONTAINER( *this );
1255 }
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 238 of file class_zone.cpp.

239 {
240  LSET common = GetLayerSet() & aLayerSet;
241 
242  return common.count() > 0;
243 }
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:283
LSET is a set of PCB_LAYER_IDs.

References ZONE_CONTAINER::GetLayerSet().

Referenced by ZONE_FILLER::buildCopperItemClearances(), DRC_KEEPOUT_TESTER::checkFootprints(), and DRC_KEEPOUT_TESTER::checkPads().

◆ DeleteStructure()

void BOARD_ITEM::DeleteStructure ( )
inherited

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

Definition at line 121 of file class_board_item.cpp.

122 {
123  auto parent = GetParent();
124 
125  if( parent )
126  parent->Remove( this );
127 
128  delete this;
129 }
BOARD_ITEM_CONTAINER * GetParent() const

References BOARD_ITEM::GetParent().

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

◆ Duplicate()

BOARD_ITEM* BOARD_ITEM::Duplicate ( ) const
inlineinherited

Function Duplicate creates a copy of a BOARD_ITEM.

Definition at line 153 of file class_board_item.h.

154  {
155  EDA_ITEM* dupe = Clone();
156  const_cast<KIID&>( dupe->m_Uuid ) = KIID();
157 
158  return static_cast<BOARD_ITEM*>( dupe );
159  }
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: common.h:68
const KIID m_Uuid
Definition: base_struct.h:166
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:163

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

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), EDIT_TOOL::Duplicate(), GPCB_PLUGIN::FootprintLoad(), PCB_IO::FootprintLoad(), PCB_IO::FootprintSave(), BOARD::InsertArea(), ARRAY_CREATOR::Invoke(), and FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD().

◆ FillSegments() [1/2]

ZONE_SEGMENT_FILL& ZONE_CONTAINER::FillSegments ( )
inlineinherited

Definition at line 249 of file class_zone.h.

249 { return m_FillSegmList; }
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:841

References ZONE_CONTAINER::m_FillSegmList.

Referenced by PCB_IO::format().

◆ FillSegments() [2/2]

const ZONE_SEGMENT_FILL& ZONE_CONTAINER::FillSegments ( ) const
inlineinherited

Definition at line 250 of file class_zone.h.

250 { return m_FillSegmList; }
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:841

References ZONE_CONTAINER::m_FillSegmList.

◆ Flip() [1/2]

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

Definition at line 269 of file class_board_item.h.

270  {
271  Flip( wxPoint( aCentre.x, aCentre.y ), aFlipLeftRight );
272  }
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 734 of file class_zone.cpp.

735 {
736  Mirror( aCentre, aFlipLeftRight );
737  int copperLayerCount = GetBoard()->GetCopperLayerCount();
738 
739  if( GetIsKeepout() )
740  SetLayerSet( FlipLayerMask( GetLayerSet(), copperLayerCount ) );
741  else
742  SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
743 }
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:746
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask,...
Definition: lset.cpp:531
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:485
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:219
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:283
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:254
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:246
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661
int GetCopperLayerCount() const
Function GetCopperLayerCount.

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

◆ 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 54 of file class_board_item.cpp.

55 {
56  if( Type() == PCB_T )
57  return (BOARD*) this;
58 
59  BOARD_ITEM* parent = GetParent();
60 
61  if( parent )
62  return parent->GetBoard();
63 
64  return NULL;
65 }
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.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
BOARD_ITEM_CONTAINER * GetParent() const
KICAD_T Type() const
Function Type()
Definition: base_struct.h:197

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

Referenced by ZONE_CONTAINER::BuildSmoothedPoly(), DRC::checkClearancePadToPad(), DRC::checkClearanceSegmToPad(), TEXTE_PCB::Flip(), TRACK::Flip(), ARC::Flip(), VIA::Flip(), ZONE_CONTAINER::Flip(), BOARD_ITEM::GetBoard(), MODULE::GetBoundingPoly(), BOARD_CONNECTED_ITEM::GetClearance(), BOARD_CONNECTED_ITEM::GetEffectiveNetclass(), BOARD_ITEM::GetLayerName(), VIA::GetMinAnnulus(), PCB_DRAW_PANEL_GAL::GetMsgPanelInfo(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), GetRule(), VIA::GetSelectMenuText(), D_PAD::GetSelectMenuText(), D_PAD::GetSolderMaskMargin(), D_PAD::GetSolderPasteMargin(), BOARD::GetTrackLength(), TRACK::GetWidthConstraints(), D_PAD::HitTest(), D_PAD::MergePrimitivesAsPolygon(), EAGLE_PLUGIN::packageWire(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), BOARD_CONNECTED_ITEM::SetNet(), BOARD_CONNECTED_ITEM::SetNetCode(), ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon(), ZONE_CONTAINER::TransformSolidAreasShapesToPolygonSet(), MODULE::ViewBBox(), and D_PAD::ViewGetLOD().

◆ 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 325 of file class_zone.cpp.

326 {
327  auto bb = m_Poly->BBox();
328 
329  EDA_RECT ret( (wxPoint) bb.GetOrigin(), wxSize( bb.GetWidth(), bb.GetHeight() ) );
330 
331  return ret;
332 }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
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_FILLER::buildCopperItemClearances(), ZONE_FILLER::buildThermalSpokes(), hasThermalConnection(), ZONE_CONTAINER::HitTest(), and ALTIUM_PCB::ParsePolygons6Data().

◆ GetCenter()

virtual const wxPoint BOARD_ITEM::GetCenter ( ) const
inlinevirtualinherited

Function GetCenter()

This defaults to the same point as returned by GetPosition(), unless overridden

Returns
centre point of the item

Reimplemented in DRAWSEGMENT.

Definition at line 92 of file class_board_item.h.

92 { return GetPosition(); }
virtual const wxPoint GetPosition() const
Definition: base_struct.h:344

References EDA_ITEM::GetPosition().

Referenced by BOARD_ADAPTER::createNewTrack(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), KIGFX::PCB_PAINTER::draw(), export_vrml_tracks(), PlotStandardLayer(), PNS_KICAD_IFACE_BASE::syncArc(), and TRACK::TransformShapeWithClearanceToPolygon().

◆ GetClass()

wxString ZONE_CONTAINER::GetClass ( ) const
inlineoverridevirtualinherited

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 447 of file class_zone.h.

448  {
449  return wxT( "ZONE_CONTAINER" );
450  }

◆ GetClearance()

int BOARD_CONNECTED_ITEM::GetClearance ( BOARD_ITEM aItem = nullptr,
wxString *  aSource = nullptr 
) const
virtualinherited

Function GetClearance returns the clearance in internal units.

If aItem is not NULL then the returned clearance is the greater of this object's NETCLASS clearance and aItem's NETCLASS clearance. If aItem is NULL, then this objects clearance is returned.

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

Definition at line 94 of file board_connected_item.cpp.

95 {
96  BOARD* board = GetBoard();
97  int clearance = 0;
98  wxString source;
99  wxString* localSource = aSource ? &source : nullptr;
100  BOARD_CONNECTED_ITEM* second = dynamic_cast<BOARD_CONNECTED_ITEM*>( aItem );
101 
102  // No clearance if "this" is not (yet) linked to a board therefore no available netclass
103  if( !board )
104  return clearance;
105 
106  // LEVEL 1: local overrides (pad, footprint, etc.)
107  //
108  if( GetLocalClearanceOverrides() > clearance )
109  clearance = GetLocalClearanceOverrides( localSource );
110 
111  if( second && second->GetLocalClearanceOverrides() > clearance )
112  clearance = second->GetLocalClearanceOverrides( localSource );
113 
114  if( clearance )
115  {
116  if( aSource )
117  *aSource = *localSource;
118 
119  return clearance;
120  }
121 
122  // LEVEL 2: Rules
123  //
124  if( GetRuleClearance( aItem, &clearance, aSource ) )
125  return clearance;
126 
127  // LEVEL 3: Accumulated local settings, netclass settings, & board design settings
128  //
130  NETCLASS* netclass = GetEffectiveNetclass();
131  NETCLASS* secondNetclass = second ? second->GetEffectiveNetclass() : nullptr;
132 
133  if( bds.m_MinClearance > clearance )
134  {
135  if( aSource )
136  *aSource = _( "board minimum" );
137 
138  clearance = bds.m_MinClearance;
139  }
140 
141  if( netclass && netclass->GetClearance() > clearance )
142  clearance = netclass->GetClearance( aSource );
143 
144  if( secondNetclass && secondNetclass->GetClearance() > clearance )
145  clearance = secondNetclass->GetClearance( aSource );
146 
147  if( aItem && aItem->GetLayer() == Edge_Cuts && bds.m_CopperEdgeClearance > clearance )
148  {
149  if( aSource )
150  *aSource = _( "board edge" );
151 
152  clearance = bds.m_CopperEdgeClearance;
153  }
154 
155  if( GetLocalClearance() > clearance )
156  clearance = GetLocalClearance( aSource );
157 
158  if( second && second->GetLocalClearance() > clearance )
159  clearance = second->GetLocalClearance( aSource );
160 
161  return clearance;
162 }
virtual int GetLocalClearance(wxString *aSource=nullptr) const
Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
int GetClearance(wxString *aSource=nullptr) const
Definition: netclass.h:162
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
NETCLASS handles a collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:55
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual int GetLocalClearanceOverrides(wxString *aSource=nullptr) const
Function GetLocalClearanceOverrides returns any local clearance overrides set in the "classic" (ie: p...
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
#define _(s)
Definition: 3d_actions.cpp:33
NETCLASS * GetEffectiveNetclass() const
Function GetEffectiveNetclass returns the NETCLASS for this item, or the default netclass if none is ...
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
virtual bool GetRuleClearance(BOARD_ITEM *aItem, int *aClearance, wxString *aSource) const
Function GetRuleClearance returns any rule-based clearance.
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.

References _, Edge_Cuts, BOARD_ITEM::GetBoard(), NETCLASS::GetClearance(), BOARD::GetDesignSettings(), BOARD_CONNECTED_ITEM::GetEffectiveNetclass(), BOARD_ITEM::GetLayer(), BOARD_CONNECTED_ITEM::GetLocalClearance(), BOARD_CONNECTED_ITEM::GetLocalClearanceOverrides(), BOARD_CONNECTED_ITEM::GetRuleClearance(), BOARD_DESIGN_SETTINGS::m_CopperEdgeClearance, and BOARD_DESIGN_SETTINGS::m_MinClearance.

Referenced by GERBER_JOBFILE_WRITER::addJSONDesignRules(), ZONE_FILLER::buildCopperItemClearances(), DRC::doPadToPadsDrc(), DRC::doTrackDrc(), KIGFX::PCB_PAINTER::draw(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), DRC::testZones(), and TRACK::ViewBBox().

◆ GetColinearCorners()

void ZONE_CONTAINER::GetColinearCorners ( BOARD aBoard,
std::set< VECTOR2I > &  colinearCorners 
)
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 want to keep the corners of such intersections sharp.

Definition at line 1093 of file class_zone.cpp.

1094 {
1095  int epsilon = Millimeter2iu( 0.001 );
1096 
1097  // Things get messy when zone of different nets intersect. To do it right we'd need to
1098  // run our colinear test with the final filled regions rather than the outline regions.
1099  // However, since there's no order dependance the only way to do that is to iterate
1100  // through successive zone fills until the results are no longer changing -- and that's
1101  // not going to happen. So we punt and ignore any "messy" corners.
1102  std::set<VECTOR2I> colinearCorners;
1103  std::set<VECTOR2I> messyCorners;
1104 
1105  for( ZONE_CONTAINER* candidate : aBoard->Zones() )
1106  {
1107  if( candidate == this )
1108  continue;
1109 
1110  if( candidate->GetLayerSet() != GetLayerSet() )
1111  continue;
1112 
1113  if( candidate->GetIsKeepout() != GetIsKeepout() )
1114  continue;
1115 
1116  for( auto iter = m_Poly->CIterate(); iter; iter++ )
1117  {
1118  if( candidate->m_Poly->Collide( iter.Get(), epsilon ) )
1119  {
1120  if( candidate->GetNetCode() == GetNetCode() )
1121  colinearCorners.insert( VECTOR2I( iter.Get() ) );
1122  else
1123  messyCorners.insert( VECTOR2I( iter.Get() ) );
1124  }
1125  }
1126  }
1127 
1128  for( VECTOR2I corner : colinearCorners )
1129  {
1130  if( messyCorners.count( corner ) == 0 )
1131  aCorners.insert( corner );
1132  }
1133 }
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
int GetNetCode() const
Function GetNetCode.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:283
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
CONST_ITERATOR CIterate(int aFirst, int aLast, bool aIterateHoles=false) const
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661
ZONE_CONTAINERS & Zones()
Definition: class_board.h:270

References SHAPE_POLY_SET::CIterate(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::m_Poly, and BOARD::Zones().

Referenced by ZONE_FILLER::fillSingleZone(), PNS_KICAD_IFACE_BASE::syncZone(), and DRC::testZones().

◆ GetCornerPosition()

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

Definition at line 494 of file class_zone.h.

495  {
497 
498  // Convert global to relative indices
499  if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
500  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
501 
502  return m_Poly->CVertex( index );
503  }
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:762
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

◆ GetCornerSmoothingType()

int ZONE_CONTAINER::GetCornerSmoothingType ( ) const
inlineinherited

◆ GetDefaultHatchPitch()

int ZONE_CONTAINER::GetDefaultHatchPitch ( )
staticinherited

◆ 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 244 of file base_struct.h.

245  {
246  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
248 
249  return m_Flags & mask;
250  }
#define IS_NEW
New item, just created.
Definition: base_struct.h:117
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
#define STRUCT_DELETED
flag indication structures to be erased
Definition: base_struct.h:126
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: base_struct.h:130
#define IS_MOVED
Item being moved.
Definition: base_struct.h:116

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::ChangeShape(), SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_COMPONENT::GetMsgPanelInfo(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_EDIT_PIN::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::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 75 of file board_connected_item.cpp.

76 {
77  // NB: we must check the net first, as when it is 0 GetNetClass() will return the
78  // orphaned net netclass, not the default netclass.
79  if( m_netinfo->GetNet() == 0 )
81  else
82  return GetNetClass();
83 }
NETCLASS * GetNetClass() const
Function GetNetClassPtr returns the NETCLASS for this item.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
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.

Referenced by BOARD_CONNECTED_ITEM::GetClearance().

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

171  {
172  return m_area;
173  }

References ZONE_CONTAINER::m_area.

◆ GetFilledPolysList()

const SHAPE_POLY_SET& ZONE_CONTAINER::GetFilledPolysList ( ) const
inlineinherited

◆ GetFilledPolysUseThickness()

bool ZONE_CONTAINER::GetFilledPolysUseThickness ( ) const
inlineinherited

◆ GetFillMode()

ZONE_FILL_MODE ZONE_CONTAINER::GetFillMode ( ) const
inlineinherited

Definition at line 143 of file class_zone.h.

143 { 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:813

References ZONE_CONTAINER::m_FillMode.

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

◆ 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 TRACK.

Definition at line 351 of file base_struct.h.

351 { return GetPosition(); }
virtual const wxPoint GetPosition() const
Definition: base_struct.h:344

References EDA_ITEM::GetPosition().

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

◆ GetHashValue()

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

Definition at line 739 of file class_zone.h.

739 { return m_filledPolysHash; }
MD5_HASH m_filledPolysHash
Definition: class_zone.h:853

References ZONE_CONTAINER::m_filledPolysHash.

◆ GetHatchFillTypeGap()

int ZONE_CONTAINER::GetHatchFillTypeGap ( ) const
inlineinherited

Definition at line 203 of file class_zone.h.

203 { return m_HatchFillTypeGap; }
int m_HatchFillTypeGap
Grid style shape: dist between center of lines (grid size) (0 -> solid shape)
Definition: class_zone.h:819

References ZONE_CONTAINER::m_HatchFillTypeGap.

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

◆ GetHatchFillTypeOrientation()

double ZONE_CONTAINER::GetHatchFillTypeOrientation ( ) const
inlineinherited

Definition at line 206 of file class_zone.h.

206 { return m_HatchFillTypeOrientation; }
double m_HatchFillTypeOrientation
Grid style shape: orientation in degrees of the grid lines.
Definition: class_zone.h:822

References ZONE_CONTAINER::m_HatchFillTypeOrientation.

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

◆ GetHatchFillTypeSmoothingLevel()

int ZONE_CONTAINER::GetHatchFillTypeSmoothingLevel ( ) const
inlineinherited

Definition at line 209 of file class_zone.h.

int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: class_zone.h:826

References ZONE_CONTAINER::m_HatchFillTypeSmoothingLevel.

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

◆ GetHatchFillTypeSmoothingValue()

double ZONE_CONTAINER::GetHatchFillTypeSmoothingValue ( ) const
inlineinherited

Definition at line 212 of file class_zone.h.

double m_HatchFillTypeSmoothingValue
Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap ...
Definition: class_zone.h:830

References ZONE_CONTAINER::m_HatchFillTypeSmoothingValue.

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

◆ GetHatchFillTypeThickness()

int ZONE_CONTAINER::GetHatchFillTypeThickness ( ) const
inlineinherited

Definition at line 200 of file class_zone.h.

200 { return m_HatchFillTypeThickness; }
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: class_zone.h:816

References ZONE_CONTAINER::m_HatchFillTypeThickness.

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

◆ GetHatchLines()

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

Definition at line 731 of file class_zone.h.

731 { return m_HatchLines; }
std::vector< SEG > m_HatchLines
Definition: class_zone.h:858

References ZONE_CONTAINER::m_HatchLines.

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

◆ GetHatchPitch()

int ZONE_CONTAINER::GetHatchPitch ( ) const
inherited

Hatch related methods.

Function GetHatchPitch

Returns
int - the zone hatch pitch in iu.

Definition at line 863 of file class_zone.cpp.

864 {
865  return m_hatchPitch;
866 }

References ZONE_CONTAINER::m_hatchPitch.

Referenced by PCB_IO::format(), and ZONE_CONTAINER::operator=().

◆ GetHatchStyle()

ZONE_HATCH_STYLE ZONE_CONTAINER::GetHatchStyle ( ) const
inlineinherited

Definition at line 542 of file class_zone.h.

543  {
544  return m_hatchStyle;
545  }
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:856

References ZONE_CONTAINER::m_hatchStyle.

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

◆ GetHV45()

bool ZONE_CONTAINER::GetHV45 ( ) const
inlineinherited

Definition at line 733 of file class_zone.h.

733 { return m_hv45; }

References ZONE_CONTAINER::m_hv45.

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

◆ GetIsKeepout()

◆ GetKeepouts()

int ZONE_CONTAINER::GetKeepouts ( std::map< int, wxString > *  aSources = nullptr) const
inherited

Return a bitset of flags for keepouts.

Includes both those set via the GUI and those set via DRC rules. @aSources indicates the source ("zone properties" or rule name) of each flag.

Returns
a bitset of DISALLOW_* flags.

Definition at line 353 of file class_zone.cpp.

354 {
355  wxString source;
356  int keepouts = 0;
357 
358  auto setFlag = [&]( int aFlag )
359  {
360  keepouts |= aFlag;
361 
362  if( aSources )
363  (*aSources)[ aFlag ] = source;
364  };
365 
366  if( m_isKeepout )
367  {
368  if( aSources )
369  source = _( "zone properties" );
370 
371  if( m_doNotAllowTracks )
372  setFlag( DISALLOW_TRACKS );
373 
374  if( m_doNotAllowVias )
375  setFlag( DISALLOW_VIAS );
376 
377  if( m_doNotAllowPads )
378  setFlag( DISALLOW_PADS );
379 
381  setFlag( DISALLOW_FOOTPRINTS );
382 
384  setFlag( DISALLOW_ZONES );
385  }
386 
387  DRC_RULE* rule = GetRule( this, nullptr, DISALLOW_CONSTRAINT );
388 
389  if( rule )
390  {
391  if( aSources )
392  source = wxString::Format( _( "'%s' rule" ), rule->m_Name );
393 
394  if( ( rule->m_DisallowFlags & DISALLOW_VIAS ) > 0 )
395  setFlag( DISALLOW_VIAS );
396 
397  if( ( rule->m_DisallowFlags & DISALLOW_MICRO_VIAS ) > 0 )
398  setFlag( DISALLOW_MICRO_VIAS );
399 
400  if( ( rule->m_DisallowFlags & DISALLOW_BB_VIAS ) > 0 )
401  setFlag( DISALLOW_BB_VIAS );
402 
403  if( ( rule->m_DisallowFlags & DISALLOW_TRACKS ) > 0 )
404  setFlag( DISALLOW_TRACKS );
405 
406  if( ( rule->m_DisallowFlags & DISALLOW_PADS ) > 0 )
407  setFlag( DISALLOW_PADS );
408 
409  if( ( rule->m_DisallowFlags & DISALLOW_ZONES ) > 0 )
410  setFlag( DISALLOW_ZONES );
411 
412  if( ( rule->m_DisallowFlags & DISALLOW_TEXTS ) > 0 )
413  setFlag( DISALLOW_TEXTS );
414 
415  if( ( rule->m_DisallowFlags & DISALLOW_GRAPHICS ) > 0 )
416  setFlag( DISALLOW_GRAPHICS );
417 
418  if( ( rule->m_DisallowFlags & DISALLOW_HOLES ) > 0 )
419  setFlag( DISALLOW_HOLES );
420 
421  if( ( rule->m_DisallowFlags & DISALLOW_FOOTPRINTS ) > 0 )
422  setFlag( DISALLOW_FOOTPRINTS );
423  }
424 
425  return keepouts;
426 }
#define DISALLOW_TRACKS
Definition: drc_rule.h:44
#define DISALLOW_TEXTS
Definition: drc_rule.h:47
bool m_doNotAllowPads
Definition: class_zone.h:785
bool m_doNotAllowTracks
Definition: class_zone.h:784
wxString m_Name
Definition: drc_rule.h:73
#define DISALLOW_MICRO_VIAS
Definition: drc_rule.h:42
#define DISALLOW_HOLES
Definition: drc_rule.h:49
int m_DisallowFlags
Definition: drc_rule.h:75
#define DISALLOW_PADS
Definition: drc_rule.h:45
bool m_doNotAllowFootprints
Definition: class_zone.h:786
#define DISALLOW_GRAPHICS
Definition: drc_rule.h:48
DRC_RULE * GetRule(const BOARD_ITEM *aItem, const BOARD_ITEM *bItem, int aConstraint)
Definition: drc_rule.cpp:67
#define DISALLOW_CONSTRAINT
Definition: drc_rule.h:39
#define DISALLOW_FOOTPRINTS
Definition: drc_rule.h:50
bool m_doNotAllowVias
Definition: class_zone.h:783
#define DISALLOW_VIAS
Definition: drc_rule.h:41
bool m_doNotAllowCopperPour
Definition: class_zone.h:782
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:205
#define _(s)
Definition: 3d_actions.cpp:33
#define DISALLOW_BB_VIAS
Definition: drc_rule.h:43
#define DISALLOW_ZONES
Definition: drc_rule.h:46

References _, DISALLOW_BB_VIAS, DISALLOW_CONSTRAINT, DISALLOW_FOOTPRINTS, DISALLOW_GRAPHICS, DISALLOW_HOLES, DISALLOW_MICRO_VIAS, DISALLOW_PADS, DISALLOW_TEXTS, DISALLOW_TRACKS, DISALLOW_VIAS, DISALLOW_ZONES, Format(), GetRule(), DRC_RULE::m_DisallowFlags, ZONE_CONTAINER::m_doNotAllowCopperPour, ZONE_CONTAINER::m_doNotAllowFootprints, ZONE_CONTAINER::m_doNotAllowPads, ZONE_CONTAINER::m_doNotAllowTracks, ZONE_CONTAINER::m_doNotAllowVias, ZONE_CONTAINER::m_isKeepout, and DRC_RULE::m_Name.

◆ GetLayer()

◆ 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 68 of file class_board_item.cpp.

69 {
70  BOARD* board = GetBoard();
71 
72  if( board )
73  return board->GetLayerName( m_Layer );
74 
75  // If no parent, return standard name
77 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
PCB_LAYER_ID m_Layer
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Function GetStandardLayerName returns an "English Standard" name of a PCB layer when given aLayerNumb...
Definition: class_board.h:640

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

Referenced by PCB_IO::format(), PCB_IO::formatLayer(), TEXTE_PCB::GetMsgPanelInfo(), TEXTE_MODULE::GetMsgPanelInfo(), DRAWSEGMENT::GetMsgPanelInfo(), TEXTE_PCB::GetSelectMenuText(), EDGE_MODULE::GetSelectMenuText(), TRACK::GetSelectMenuText(), TEXTE_MODULE::GetSelectMenuText(), DIMENSION::GetSelectMenuText(), DRAWSEGMENT::GetSelectMenuText(), MODULE::GetSelectMenuText(), ZONE_CONTAINER::GetSelectMenuText(), TEXTE_PCB::GetShownText(), TEXT_MOD_GRID_TABLE::GetValue(), MODULE::ResolveTextVar(), and DRC::testDisabledLayers().

◆ GetLayerSet()

LSET ZONE_CONTAINER::GetLayerSet ( ) const
overridevirtualinherited

Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segment or VIA physically resides.

Returns
int - a layer mask, see layers_id_colors_visibility.h.

Reimplemented from BOARD_ITEM.

Definition at line 283 of file class_zone.cpp.

284 {
285  // TODO - Enable multi-layer zones for all zone types
286  // not just keepout zones
287  if( GetIsKeepout() )
288  {
289  return m_layerSet;
290  }
291  else
292  {
293  return LSET( m_Layer );
294  }
295 }
PCB_LAYER_ID m_Layer
LSET is a set of PCB_LAYER_IDs.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661

References ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::m_Layer, and ZONE_CONTAINER::m_layerSet.

Referenced by ZONE_CONTAINER::CommonLayerExists(), ZONE_CONTAINER::Flip(), PCB_IO::format(), ZONE_CONTAINER::GetColinearCorners(), ZONE_CONTAINER::initDataFromSrcInCopyCtor(), ZONE_SETTINGS::operator<<(), ZONE_CONTAINER::operator=(), PNS_KICAD_IFACE_BASE::syncZone(), and BOARD::TestAreaIntersections().

◆ GetLocalClearance()

int ZONE_CONTAINER::GetLocalClearance ( wxString *  aSource = nullptr) 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 537 of file class_zone.cpp.

538 {
539  if( m_isKeepout )
540  return 0;
541 
542  if( aSource )
543  *aSource = _( "zone" );
544 
545  return m_ZoneClearance;
546 }
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:789
#define _(s)
Definition: 3d_actions.cpp:33

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

Referenced by ZONE_FILLER::buildCopperItemClearances(), and BOARD::TestAreaIntersections().

◆ GetLocalClearanceOverrides()

virtual int BOARD_CONNECTED_ITEM::GetLocalClearanceOverrides ( wxString *  aSource = nullptr) 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 181 of file board_connected_item.h.

181 { return 0; }

Referenced by BOARD_CONNECTED_ITEM::GetClearance().

◆ GetLocalFlags()

int ZONE_CONTAINER::GetLocalFlags ( ) const
inlineinherited

Definition at line 246 of file class_zone.h.

246 { return m_localFlgs; }
int m_localFlgs
Variable used in polygon calculations.
Definition: class_zone.h:836

References ZONE_CONTAINER::m_localFlgs.

Referenced by BOARD::CombineAllAreasInNet(), and ZONE_CONTAINER::initDataFromSrcInCopyCtor().

◆ GetLocalRatsnestVisible()

bool BOARD_CONNECTED_ITEM::GetLocalRatsnestVisible ( ) const
inlineinherited

◆ 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 1068 of file class_zone.cpp.

1069 {
1070  return add_zone_xpm;
1071 }
const BITMAP_OPAQUE add_zone_xpm[1]
Definition: add_zone.cpp:74

References add_zone_xpm.

◆ 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 580 of file class_zone.cpp.

581 {
582  EDA_UNITS units = aFrame->GetUserUnits();
583  wxString msg, msg2;
584 
585  if( GetIsKeepout() )
586  msg = _( "Keepout Area" );
587  else if( IsOnCopperLayer() )
588  msg = _( "Copper Zone" );
589  else
590  msg = _( "Non-copper Zone" );
591 
592  // Display Cutout instead of Outline for holes inside a zone
593  // i.e. when num contour !=0
594  // Check whether the selected corner is in a hole; i.e., in any contour but the first one.
595  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
596  msg << wxT( " " ) << _( "Cutout" );
597 
598  aList.emplace_back( _( "Type" ), msg, DARKCYAN );
599 
600  if( GetIsKeepout() )
601  {
602  msg.Empty();
603 
604  if( GetDoNotAllowVias() )
605  AccumulateDescription( msg, _( "No vias" ) );
606 
607  if( GetDoNotAllowTracks() )
608  AccumulateDescription( msg, _( "No tracks" ) );
609 
610  if( GetDoNotAllowPads() )
611  AccumulateDescription( msg, _( "No pads" ) );
612 
614  AccumulateDescription( msg, _( "No copper zones" ) );
615 
617  AccumulateDescription( msg, _( "No footprints" ) );
618 
619  aList.emplace_back( MSG_PANEL_ITEM( _( "Keepout" ), msg, RED ) );
620  }
621  else if( IsOnCopperLayer() )
622  {
623  if( GetNetCode() >= 0 )
624  {
625  NETINFO_ITEM* net = GetNet();
626  NETCLASS* netclass = nullptr;
627 
628  if( net )
629  {
630  if( net->GetNet() )
631  netclass = GetNetClass();
632  else
633  netclass = GetBoard()->GetDesignSettings().GetDefault();
634 
635  msg = UnescapeString( net->GetNetname() );
636  }
637  else
638  {
639  msg = wxT( "<no name>" );
640  }
641 
642  aList.emplace_back( _( "Net" ), msg, RED );
643 
644  if( netclass )
645  aList.emplace_back( _( "NetClass" ), netclass->GetName(), DARKMAGENTA );
646  }
647 
648  // Display priority level
649  msg.Printf( wxT( "%d" ), GetPriority() );
650  aList.emplace_back( _( "Priority" ), msg, BLUE );
651  }
652 
653  aList.emplace_back( _( "Layer" ), LayerMaskDescribe( GetBoard(), m_layerSet ), DARKGREEN );
654 
655  switch( m_FillMode )
656  {
657  case ZONE_FILL_MODE::POLYGONS: msg = _( "Solid" ); break;
658  case ZONE_FILL_MODE::HATCH_PATTERN: msg = _( "Hatched" ); break;
659  default: msg = _( "Unknown" ); break;
660  }
661 
662  aList.emplace_back( _( "Fill Mode" ), msg, BROWN );
663 
664  msg = MessageTextFromValue( units, m_area, false, EDA_DATA_TYPE::AREA );
665  aList.emplace_back( _( "Filled Area" ), msg, BLUE );
666 
667  wxString source;
668  int clearance = GetClearance( nullptr, &source );
669 
670  msg.Printf( _( "Min Clearance: %s" ), MessageTextFromValue( units, clearance, true ) );
671  msg2.Printf( _( "(from %s)" ), source );
672  aList.emplace_back( msg, msg2, BLACK );
673 }
Definition: colors.h:57
EDA_UNITS
Definition: common.h:196
bool GetDoNotAllowPads() const
Definition: class_zone.h:665
int GetNetCode() const
Function GetNetCode.
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:833
NETCLASS * GetNetClass() const
Function GetNetClassPtr returns the NETCLASS for this item.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
static wxString LayerMaskDescribe(const BOARD *aBoard, LSET aMask)
Helper function Return a string (to be shown to the user) describing a layer mask.
bool GetDoNotAllowVias() const
Definition: class_zone.h:663
NETCLASS handles a collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:55
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:662
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:231
Definition: colors.h:60
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661
virtual int GetClearance(BOARD_ITEM *aItem=nullptr, wxString *aSource=nullptr) const
Function GetClearance returns the clearance in internal units.
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
void AccumulateDescription(wxString &aDesc, const wxString &aItem)
Utility to build comma separated lists in messages.
Definition: macros.h:126
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
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:813
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:100
int GetNet() const
Function GetNet.
Definition: netinfo.h:223
#define _(s)
Definition: 3d_actions.cpp:33
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:131
NETCLASS * GetDefault() const
Function GetDefault.
bool GetDoNotAllowTracks() const
Definition: class_zone.h:664
bool GetDoNotAllowFootprints() const
Definition: class_zone.h:666
Definition: colors.h:45
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
bool IsOnCopperLayer() const override
Function IsOnCopperLayer.
Definition: class_zone.cpp:225
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
Definition: colors.h:62

References _, AccumulateDescription(), AREA, BLACK, BLUE, BROWN, DARKCYAN, DARKGREEN, DARKMAGENTA, BOARD_ITEM::GetBoard(), BOARD_CONNECTED_ITEM::GetClearance(), BOARD_DESIGN_SETTINGS::GetDefault(), BOARD::GetDesignSettings(), ZONE_CONTAINER::GetDoNotAllowCopperPour(), ZONE_CONTAINER::GetDoNotAllowFootprints(), ZONE_CONTAINER::GetDoNotAllowPads(), ZONE_CONTAINER::GetDoNotAllowTracks(), ZONE_CONTAINER::GetDoNotAllowVias(), ZONE_CONTAINER::GetIsKeepout(), NETCLASS::GetName(), BOARD_CONNECTED_ITEM::GetNet(), NETINFO_ITEM::GetNet(), BOARD_CONNECTED_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetCode(), NETINFO_ITEM::GetNetname(), ZONE_CONTAINER::GetPriority(), EDA_BASE_FRAME::GetUserUnits(), HATCH_PATTERN, ZONE_CONTAINER::IsOnCopperLayer(), BOARD_ITEM::LayerMaskDescribe(), ZONE_CONTAINER::m_area, SHAPE_POLY_SET::VERTEX_INDEX::m_contour, ZONE_CONTAINER::m_CornerSelection, ZONE_CONTAINER::m_FillMode, ZONE_CONTAINER::m_layerSet, MessageTextFromValue(), POLYGONS, RED, and UnescapeString().

◆ GetNet()

NETINFO_ITEM* BOARD_CONNECTED_ITEM::GetNet ( ) const
inlineinherited

Function GetNet Returns NET_INFO object for a given item.

Definition at line 81 of file board_connected_item.h.

82  {
83  return m_netinfo;
84  }
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

References BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by PNS_PCBNEW_RULE_RESOLVER::DpNetPair(), DRAWING_TOOL::DrawVia(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD::SetAreasNetCodesFromNetNames(), and PCB_EDIT_FRAME::SetTrackSegmentWidth().

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

186 {
187  NETCLASS* netclass = m_netinfo->GetNetClass();
188 
189  if( netclass )
190  return netclass;
191  else
192  return GetBoard()->GetDesignSettings().GetDefault();
193 }
NETCLASS * GetNetClass()
Function GetNetClass.
Definition: netinfo.h:128
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
NETCLASS handles a collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:55
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(), ROUTER_TOOL::prepareInteractive(), 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 196 of file board_connected_item.cpp.

197 {
198  return m_netinfo->GetClassName();
199 }
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 D_PAD::GetMsgPanelInfo(), 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 100 of file board_connected_item.h.

101  {
102  return m_netinfo ? m_netinfo->GetNet() : -1;
103  }
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::buildCopperItemClearances(), BOARD::CombineAllAreasInNet(), connectedItemFilter(), CreateRoutesSection(), DRC::doPadToPadsDrc(), DRC::doTrackDrc(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::Exchange_Module(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PNS::NODE::FindItemByParent(), PCB_IO::format(), DSN::SPECCTRA_DB::FromBOARD(), ZONE_CONTAINER::GetColinearCorners(), CONNECTIVITY_DATA::GetConnectedItems(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), hash_eda(), hasThermalConnection(), DIALOG_PAD_PROPERTIES::initValues(), ZONE_CONTAINER::IsSame(), DSN::SPECCTRA_DB::makeIMAGE(), AR_AUTOPLACER::nearestPad(), CONNECTIVITY_DATA::NearestUnconnectedTargets(), ROUTER_TOOL::NeighboringSegmentFilter(), CN_ITEM::Net(), BOARD::NormalizeAreaPolygon(), BOARD::OnAreaPolygonModified(), ZONE_SETTINGS::operator<<(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), process(), PCB_SELECTION_CONDITIONS::sameNetFunc(), SaveCopyOfZones(), SELECTION_TOOL::selectNet(), BOARD::SetAreasNetCodesFromNetNames(), setupDummyPadForHole(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncPad(), PNS_KICAD_IFACE_BASE::syncTrack(), PNS_KICAD_IFACE_BASE::syncVia(), BOARD::TestAreaIntersections(), DRC::testZones(), BOARD::TracksInNet(), NETINFO_MAPPING::Update(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ GetNetname()

const wxString& BOARD_CONNECTED_ITEM::GetNetname ( ) const
inlineinherited

Function GetNetname.

Returns
wxString - the full netname

Definition at line 120 of file board_connected_item.h.

121  {
122  return m_netinfo->GetNetname();
123  }
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:231
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

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

Referenced by KIGFX::PCB_PAINTER::draw(), PCB_IO::format(), DSN::SPECCTRA_DB::FromBOARD(), D_PAD::GetMsgPanelInfo(), BOARD_NETLIST_UPDATER::getNetname(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), CN_CLUSTER::OriginNetName(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPad(), PlotStandardLayer(), and BOARD_NETLIST_UPDATER::updateCopperZoneNets().

◆ GetNetnameMsg()

wxString BOARD_CONNECTED_ITEM::GetNetnameMsg ( ) const
inlineinherited

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 130 of file board_connected_item.h.

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

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

455  {
456  return m_Poly->TotalVertices();
457  }
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:762

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

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

◆ GetPadConnection()

ZONE_CONNECTION ZONE_CONTAINER::GetPadConnection ( D_PAD aPad = NULL) const
inherited

Definition at line 771 of file class_zone.cpp.

772 {
773  if( aPad == NULL || aPad->GetZoneConnection() == ZONE_CONNECTION::INHERITED )
774  return m_PadConnection;
775  else
776  return aPad->GetZoneConnection();
777 }
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:788
#define NULL
ZONE_CONNECTION GetZoneConnection() const
Definition: class_pad.cpp:738

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

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

◆ GetParent()

BOARD_ITEM_CONTAINER* BOARD_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 119 of file class_board_item.h.

119 { return (BOARD_ITEM_CONTAINER*) m_Parent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:178
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(), EDGE_MODULE::GetMsgPanelInfo(), EDGE_MODULE::GetSelectMenuText(), TEXTE_MODULE::GetSelectMenuText(), TEXTE_PCB::GetShownText(), TEXTE_MODULE::GetShownText(), SELECTION_TOOL::GuessSelectionCandidates(), GENERAL_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), EDGE_MODULE::IsParentFlipped(), TEXTE_MODULE::IsParentFlipped(), LEGACY_PLUGIN::loadMODULE_TEXT(), ALTIUM_PCB::ParseTexts6Data(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintTextItem(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), SwapItemData(), DRC::testCopperDrawItem(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), MARKER_PCB::ViewGetLayers(), ViewGetLOD(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetPosition()

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

Reimplemented from EDA_ITEM.

Definition at line 213 of file class_zone.cpp.

214 {
215  return (wxPoint) GetCornerPosition( 0 );
216 }
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition: class_zone.h:494

References ZONE_CONTAINER::GetCornerPosition().

Referenced by EAGLE_PLUGIN::loadPlain(), PNS_KICAD_IFACE_BASE::syncZone(), and DRC::testZones().

◆ GetPriority()

unsigned ZONE_CONTAINER::GetPriority ( ) const
inlineinherited

◆ GetRuleClearance()

bool BOARD_CONNECTED_ITEM::GetRuleClearance ( BOARD_ITEM aItem,
int *  aClearance,
wxString *  aSource 
) const
virtualinherited

Function GetRuleClearance returns any rule-based clearance.

Parameters
aClearance[out] the clearance value in internal units
aSource[out] reports the source as a user-readable string
Returns
true if a rule was fired

Definition at line 165 of file board_connected_item.cpp.

167 {
168  DRC_RULE* rule = GetRule( this, aItem, CLEARANCE_CONSTRAINT );
169 
170  if( rule )
171  {
172  if( aSource )
173  *aSource = wxString::Format( _( "'%s' rule clearance" ), rule->m_Name );
174 
175  *aClearance = rule->m_Clearance.Min;
176  return true;
177  }
178 
179  return false;
180 }
wxString m_Name
Definition: drc_rule.h:73
#define CLEARANCE_CONSTRAINT
Definition: drc_rule.h:35
DRC_RULE * GetRule(const BOARD_ITEM *aItem, const BOARD_ITEM *bItem, int aConstraint)
Definition: drc_rule.cpp:67
MINOPTMAX m_Clearance
Definition: drc_rule.h:79
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:205
#define _(s)
Definition: 3d_actions.cpp:33

References _, CLEARANCE_CONSTRAINT, Format(), GetRule(), DRC_RULE::m_Clearance, DRC_RULE::m_Name, and DRC_RULE::MINOPTMAX::Min.

Referenced by DRC::doTrackDrc(), and BOARD_CONNECTED_ITEM::GetClearance().

◆ GetSelectedCorner()

int ZONE_CONTAINER::GetSelectedCorner ( ) const
inlineinherited

Definition at line 215 of file class_zone.h.

216  {
217  // Transform relative indices to global index
218  int globalIndex = -1;
219 
220  if( m_CornerSelection )
221  m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
222 
223  return globalIndex;
224  }
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:833
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
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 846 of file class_zone.cpp.

847 {
848  wxString text;
849 
850  // Check whether the selected contour is a hole (contour index > 0)
851  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
852  text << wxT( " " ) << _( "(Cutout)" );
853 
854  if( GetIsKeepout() )
855  text << wxT( " " ) << _( "(Keepout)" );
856  else
857  text << GetNetnameMsg();
858 
859  return wxString::Format( _( "Zone Outline %s on %s" ), text, GetLayerName() );
860 }
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:833
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661
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:205
#define _(s)
Definition: 3d_actions.cpp:33
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.

References _, Format(), ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::GetLayerName(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), SHAPE_POLY_SET::VERTEX_INDEX::m_contour, and ZONE_CONTAINER::m_CornerSelection.

Referenced by PNS_KICAD_IFACE_BASE::syncZone().

◆ GetShortNetname()

const wxString& BOARD_CONNECTED_ITEM::GetShortNetname ( ) const
inlineinherited

Function GetShortNetname.

Returns
wxString - the short netname

Definition at line 149 of file board_connected_item.h.

150  {
151  return m_netinfo->GetShortNetname();
152  }
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 223 of file base_struct.h.

224  {
225  return m_Status & type;
226  }
STATUS_FLAGS m_Status
Definition: base_struct.h:177

References EDA_ITEM::m_Status.

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

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 236 of file base_struct.h.

236 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:177

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ GetThermalReliefCopperBridge()

int ZONE_CONTAINER::GetThermalReliefCopperBridge ( D_PAD aPad = NULL) const
inherited

Definition at line 344 of file class_zone.cpp.

345 {
346  if( aPad == NULL || aPad->GetThermalWidth() == 0 )
348  else
349  return aPad->GetThermalWidth();
350 }
int m_ThermalReliefCopperBridge
Definition: class_zone.h:806
#define NULL
int GetThermalWidth() const
Definition: class_pad.cpp:749

References D_PAD::GetThermalWidth(), ZONE_CONTAINER::m_ThermalReliefCopperBridge, and NULL.

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

◆ GetThermalReliefGap()

int ZONE_CONTAINER::GetThermalReliefGap ( D_PAD aPad = NULL) const
inherited

Definition at line 335 of file class_zone.cpp.

336 {
337  if( aPad == NULL || aPad->GetThermalGap() == 0 )
338  return m_ThermalReliefGap;
339  else
340  return aPad->GetThermalGap();
341 }
int GetThermalGap() const
Definition: class_pad.cpp:760
#define NULL
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:803

References D_PAD::GetThermalGap(), ZONE_CONTAINER::m_ThermalReliefGap, and NULL.

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

◆ GetZoneClearance()

int ZONE_CONTAINER::GetZoneClearance ( ) const
inlineinherited

Definition at line 181 of file class_zone.h.

181 { return m_ZoneClearance; }
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:789

References ZONE_CONTAINER::m_ZoneClearance.

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

◆ HasFlag()

◆ Hatch()

void ZONE_CONTAINER::Hatch ( )
inherited

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

Definition at line 899 of file class_zone.cpp.

900 {
901  UnHatch();
902 
904  return;
905 
906  // define range for hatch lines
907  int min_x = m_Poly->CVertex( 0 ).x;
908  int max_x = m_Poly->CVertex( 0 ).x;
909  int min_y = m_Poly->CVertex( 0 ).y;
910  int max_y = m_Poly->CVertex( 0 ).y;
911 
912  for( auto iterator = m_Poly->IterateWithHoles(); iterator; iterator++ )
913  {
914  if( iterator->x < min_x )
915  min_x = iterator->x;
916 
917  if( iterator->x > max_x )
918  max_x = iterator->x;
919 
920  if( iterator->y < min_y )
921  min_y = iterator->y;
922 
923  if( iterator->y > max_y )
924  max_y = iterator->y;
925  }
926 
927  // Calculate spacing between 2 hatch lines
928  int spacing;
929 
931  spacing = m_hatchPitch;
932  else
933  spacing = m_hatchPitch * 2;
934 
935  // set the "length" of hatch lines (the length on horizontal axis)
936  int hatch_line_len = m_hatchPitch;
937 
938  // To have a better look, give a slope depending on the layer
939  LAYER_NUM layer = GetLayer();
940  int slope_flag = (layer & 1) ? 1 : -1; // 1 or -1
941  double slope = 0.707106 * slope_flag; // 45 degrees slope
942  int max_a, min_a;
943 
944  if( slope_flag == 1 )
945  {
946  max_a = KiROUND( max_y - slope * min_x );
947  min_a = KiROUND( min_y - slope * max_x );
948  }
949  else
950  {
951  max_a = KiROUND( max_y - slope * max_x );
952  min_a = KiROUND( min_y - slope * min_x );
953  }
954 
955  min_a = (min_a / spacing) * spacing;
956 
957  // calculate an offset depending on layer number,
958  // for a better look of hatches on a multilayer board
959  int offset = (layer * 7) / 8;
960  min_a += offset;
961 
962  // loop through hatch lines
963  #define MAXPTS 200 // Usually we store only few values per one hatch line
964  // depending on the complexity of the zone outline
965 
966  static std::vector<VECTOR2I> pointbuffer;
967  pointbuffer.clear();
968  pointbuffer.reserve( MAXPTS + 2 );
969 
970  for( int a = min_a; a < max_a; a += spacing )
971  {
972  // get intersection points for this hatch line
973 
974  // Note: because we should have an even number of intersections with the
975  // current hatch line and the zone outline (a closed polygon,
976  // or a set of closed polygons), if an odd count is found
977  // we skip this line (should not occur)
978  pointbuffer.clear();
979 
980  // Iterate through all vertices
981  for( auto iterator = m_Poly->IterateSegmentsWithHoles(); iterator; iterator++ )
982  {
983  double x, y, x2, y2;
984  int ok;
985 
986  SEG segment = *iterator;
987 
988  ok = FindLineSegmentIntersection( a, slope,
989  segment.A.x, segment.A.y,
990  segment.B.x, segment.B.y,
991  &x, &y, &x2, &y2 );
992 
993  if( ok )
994  {
995  VECTOR2I point( KiROUND( x ), KiROUND( y ) );
996  pointbuffer.push_back( point );
997  }
998 
999  if( ok == 2 )
1000  {
1001  VECTOR2I point( KiROUND( x2 ), KiROUND( y2 ) );
1002  pointbuffer.push_back( point );
1003  }
1004 
1005  if( pointbuffer.size() >= MAXPTS ) // overflow
1006  {
1007  wxASSERT( 0 );
1008  break;
1009  }
1010  }
1011 
1012  // ensure we have found an even intersection points count
1013  // because intersections are the ends of segments
1014  // inside the polygon(s) and a segment has 2 ends.
1015  // if not, this is a strange case (a bug ?) so skip this hatch
1016  if( pointbuffer.size() % 2 != 0 )
1017  continue;
1018 
1019  // sort points in order of descending x (if more than 2) to
1020  // ensure the starting point and the ending point of the same segment
1021  // are stored one just after the other.
1022  if( pointbuffer.size() > 2 )
1023  sort( pointbuffer.begin(), pointbuffer.end(), sortEndsByDescendingX );
1024 
1025  // creates lines or short segments inside the complex polygon
1026  for( unsigned ip = 0; ip < pointbuffer.size(); ip += 2 )
1027  {
1028  int dx = pointbuffer[ip + 1].x - pointbuffer[ip].x;
1029 
1030  // Push only one line for diagonal hatch,
1031  // or for small lines < twice the line length
1032  // else push 2 small lines
1034  || std::abs( dx ) < 2 * hatch_line_len )
1035  {
1036  m_HatchLines.emplace_back( SEG( pointbuffer[ip], pointbuffer[ip + 1] ) );
1037  }
1038  else
1039  {
1040  double dy = pointbuffer[ip + 1].y - pointbuffer[ip].y;
1041  slope = dy / dx;
1042 
1043  if( dx > 0 )
1044  dx = hatch_line_len;
1045  else
1046  dx = -hatch_line_len;
1047 
1048  int x1 = KiROUND( pointbuffer[ip].x + dx );
1049  int x2 = KiROUND( pointbuffer[ip + 1].x - dx );
1050  int y1 = KiROUND( pointbuffer[ip].y + dx * slope );
1051  int y2 = KiROUND( pointbuffer[ip + 1].y - dx * slope );
1052 
1053  m_HatchLines.emplace_back( SEG( pointbuffer[ip].x, pointbuffer[ip].y, x1, y1 ) );
1054 
1055  m_HatchLines.emplace_back( SEG( pointbuffer[ip+1].x, pointbuffer[ip+1].y, x2, y2 ) );
1056  }
1057  }
1058  }
1059 }
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:219
#define MAXPTS
bool sortEndsByDescendingX(const VECTOR2I &ref, const VECTOR2I &tst)
Definition: class_zone.cpp:893
std::vector< SEG > m_HatchLines
Definition: class_zone.h:858
ITERATOR IterateWithHoles(int aOutline)
Function IterateWithHoles.
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:856
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
Definition: seg.h:39
void UnHatch()
Function UnHatch clears the zone's hatch.
Definition: class_zone.cpp:885
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:61
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_HatchLines, ZONE_CONTAINER::m_hatchPitch, ZONE_CONTAINER::m_hatchStyle, ZONE_CONTAINER::m_Poly, MAXPTS, NO_HATCH, sortEndsByDescendingX(), ZONE_CONTAINER::UnHatch(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOARD::CombineAreas(), ZONE_CONTAINER::Mirror(), ZONE_CONTAINER::Move(), ZONE_CONTAINER::MoveEdge(), BOARD::NormalizeAreaPolygon(), ZONE_CONTAINER::Rotate(), ZONE_CONTAINER::SetHatch(), 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 438 of file class_zone.cpp.

439 {
440  // Normally accuracy is zoom-relative, but for the generic HitTest we just use
441  // a fixed (small) value.
442  int accuracy = std::max( aAccuracy, Millimeter2iu( 0.1 ) );
443 
444  return HitTestForCorner( aPosition, accuracy * 2 ) || HitTestForEdge( aPosition, accuracy );
445 }
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:463
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:477

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

◆ 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 491 of file class_zone.cpp.

492 {
493  // Calculate bounding box for zone
494  EDA_RECT bbox = GetBoundingBox();
495  bbox.Normalize();
496 
497  EDA_RECT arect = aRect;
498  arect.Normalize();
499  arect.Inflate( aAccuracy );
500 
501  if( aContained )
502  {
503  return arect.Contains( bbox );
504  }
505  else // Test for intersection between aBox and the polygon
506  // For a polygon, using its bounding box has no sense here
507  {
508  // Fast test: if aBox is outside the polygon bounding box, rectangles cannot intersect
509  if( !arect.Intersects( bbox ) )
510  return false;
511 
512  int count = m_Poly->TotalVertices();
513 
514  for( int ii = 0; ii < count; ii++ )
515  {
516  auto vertex = m_Poly->CVertex( ii );
517  auto vertexNext = m_Poly->CVertex( ( ii + 1 ) % count );
518 
519  // Test if the point is within the rect
520  if( arect.Contains( ( wxPoint ) vertex ) )
521  {
522  return true;
523  }
524 
525  // Test if this edge intersects the rect
526  if( arect.Intersects( ( wxPoint ) vertex, ( wxPoint ) vertexNext ) )
527  {
528  return true;
529  }
530  }
531 
532  return false;
533  }
534 }
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:325
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.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
void Normalize()
Function Normalize ensures that the height ant width are positive.
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.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

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

556 {
557  // Iterate over each outline polygon in the zone and then iterate over
558  // each hole it has to see if the point is in it.
559  for( int i = 0; i < m_Poly->OutlineCount(); i++ )
560  {
561  for( int j = 0; j < m_Poly->HoleCount( i ); j++ )
562  {
563  if( m_Poly->Hole( i, j ).PointInside( aRefPos ) )
564  {
565  if( aOutlineIdx )
566  *aOutlineIdx = i;
567 
568  if( aHoleIdx )
569  *aHoleIdx = j;
570 
571  return true;
572  }
573  }
574  }
575 
576  return false;
577 }
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:762
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Function PointInside()

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

Referenced by ZONE_CONTAINER::HitTestCutout().

◆ HitTestCutout() [2/2]

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

Definition at line 284 of file class_zone.h.

286  {
287  return HitTestCutout( VECTOR2I( aRefPos.x, aRefPos.y ), aOutlineIdx, aHoleIdx );
288  }
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:555

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

◆ HitTestFilledArea()

bool ZONE_CONTAINER::HitTestFilledArea ( const wxPoint aRefPos) const
inherited

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

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

Definition at line 549 of file class_zone.cpp.

550 {
551  return m_FilledPolysList.Contains( VECTOR2I( aRefPos.x, aRefPos.y ) );
552 }
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_FilledPolysList
Definition: class_zone.h:851

References SHAPE_POLY_SET::Contains(), ZONE_CONTAINER::m_FilledPolysList, 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 463 of file class_zone.cpp.

465 {
466  return m_Poly->CollideVertex( VECTOR2I( refPos ), aCornerHit, aAccuracy );
467 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
bool CollideVertex(const VECTOR2I &aPoint, VERTEX_INDEX &aClosestVertex, int aClearance=0)
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 470 of file class_zone.cpp.

471 {
473  return HitTestForCorner( refPos, aAccuracy, dummy );
474 }
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:463
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 477 of file class_zone.cpp.

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

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

485 {
487  return HitTestForEdge( refPos, aAccuracy, dummy );
488 }
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:477

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

◆ initDataFromSrcInCopyCtor()

void ZONE_CONTAINER::initDataFromSrcInCopyCtor ( const ZONE_CONTAINER aZone)
protectedinherited

Copy aZone data to me members are expected non initialize in this.

copyDataFromSrc() is expected to be called only from a copy constructor.

Definition at line 134 of file class_zone.cpp.

135 {
136  // members are expected non initialize in this.
137  // initDataFromSrcInCopyCtor() is expected to be called
138  // only from a copy constructor.
139 
140  // Copy only useful EDA_ITEM flags:
141  m_Flags = aZone.m_Flags;
143 
144  m_isKeepout = aZone.m_isKeepout;
145  SetLayerSet( aZone.GetLayerSet() );
146 
147  m_Poly = new SHAPE_POLY_SET( *aZone.m_Poly );
148 
149  // For corner moving, corner index to drag, or nullptr if no selection
150  m_CornerSelection = nullptr;
151  m_IsFilled = aZone.m_IsFilled;
152  m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
155  m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons)
156  m_hv45 = aZone.m_hv45;
157  m_priority = aZone.m_priority;
162  m_FillSegmList = aZone.m_FillSegmList; // vector <> copy
163 
169 
172 
173  m_hatchStyle = aZone.m_hatchStyle;
174  m_hatchPitch = aZone.m_hatchPitch;
175  m_HatchLines = aZone.m_HatchLines;
176 
182 
183  SetLocalFlags( aZone.GetLocalFlags() );
184 
185  // Now zone type and layer are set, transfer net info
186  // (has meaning only for copper zones)
187  m_netinfo = aZone.m_netinfo;
188 
189  m_area = aZone.m_area;
190 
191  SetNeedRefill( aZone.NeedRefill() );
192 }
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:789
bool m_doNotAllowPads
Definition: class_zone.h:785
bool m_doNotAllowTracks
Definition: class_zone.h:784
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:833
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:841
bool m_doNotAllowFootprints
Definition: class_zone.h:786
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:788
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:283
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:254
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: class_zone.h:826
int m_ThermalReliefCopperBridge
Definition: class_zone.h:806
std::vector< SEG > m_HatchLines
Definition: class_zone.h:858
SHAPE_POLY_SET.
double m_HatchFillTypeOrientation
Grid style shape: orientation in degrees of the grid lines.
Definition: class_zone.h:822
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:794
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:856
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
unsigned m_priority
Definition: class_zone.h:772
bool m_doNotAllowVias
Definition: class_zone.h:783
int m_cornerSmoothingType
Definition: class_zone.h:763
double m_HatchFillTypeSmoothingValue
Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap ...
Definition: class_zone.h:830
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851
unsigned int m_cornerRadius
Definition: class_zone.h:764
bool NeedRefill() const
Definition: class_zone.h:178
bool m_doNotAllowCopperPour
Definition: class_zone.h:782
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:803
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:790
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:813
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: class_zone.h:816
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
void SetLocalFlags(int aFlags)
Definition: class_zone.h:247
int m_HatchFillTypeGap
Grid style shape: dist between center of lines (grid size) (0 -> solid shape)
Definition: class_zone.h:819
bool m_forceVisible
Definition: base_struct.h:179
int GetLocalFlags() const
Definition: class_zone.h:246
bool m_FilledPolysUseThickness
outline of filled polygons have thickness.
Definition: class_zone.h:791
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:179

References SHAPE_POLY_SET::Append(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::GetLocalFlags(), ZONE_CONTAINER::m_area, 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_FilledPolysList, ZONE_CONTAINER::m_FilledPolysUseThickness, ZONE_CONTAINER::m_FillMode, ZONE_CONTAINER::m_FillSegmList, EDA_ITEM::m_Flags, EDA_ITEM::m_forceVisible, ZONE_CONTAINER::m_HatchFillTypeGap, ZONE_CONTAINER::m_HatchFillTypeOrientation, ZONE_CONTAINER::m_HatchFillTypeSmoothingLevel, ZONE_CONTAINER::m_HatchFillTypeSmoothingValue, ZONE_CONTAINER::m_HatchFillTypeThickness, ZONE_CONTAINER::m_HatchLines, ZONE_CONTAINER::m_hatchPitch, ZONE_CONTAINER::m_hatchStyle, ZONE_CONTAINER::m_hv45, ZONE_CONTAINER::m_IsFilled, ZONE_CONTAINER::m_isKeepout, BOARD_CONNECTED_ITEM::m_netinfo, ZONE_CONTAINER::m_PadConnection, ZONE_CONTAINER::m_Poly, ZONE_CONTAINER::m_priority, ZONE_CONTAINER::m_ThermalReliefCopperBridge, ZONE_CONTAINER::m_ThermalReliefGap, ZONE_CONTAINER::m_ZoneClearance, ZONE_CONTAINER::m_ZoneMinThickness, ZONE_CONTAINER::NeedRefill(), ZONE_CONTAINER::SetLayerSet(), ZONE_CONTAINER::SetLocalFlags(), and ZONE_CONTAINER::SetNeedRefill().

Referenced by MODULE_ZONE_CONTAINER(), and ZONE_CONTAINER::ZONE_CONTAINER().

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

◆ 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 205 of file base_struct.h.

205 { return m_Flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:119
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References IS_DRAGGED, and EDA_ITEM::m_Flags.

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

◆ IsFilled()

bool ZONE_CONTAINER::IsFilled ( ) const
inlineinherited

Definition at line 175 of file class_zone.h.

175 { return m_IsFilled; }
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:794

References ZONE_CONTAINER::m_IsFilled.

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

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 293 of file base_struct.h.

293 { return m_forceVisible; }
bool m_forceVisible
Definition: base_struct.h:179

References EDA_ITEM::m_forceVisible.

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

◆ IsHighlighted()

bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 209 of file base_struct.h.

209 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:139
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References HIGHLIGHTED, and EDA_ITEM::m_Flags.

Referenced by SCH_COMPONENT::ClearAllHighlightFlags(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and KIGFX::SCH_VIEW::HighlightItem().

◆ 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 198 of file class_board_item.h.

199  {
200  // only MODULEs & TRACKs can be locked at this time.
201  return false;
202  }

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

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 202 of file base_struct.h.

202 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:113
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

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

226 {
227  if( GetIsKeepout() )
228  {
229  return ( m_layerSet & LSET::AllCuMask() ).count() > 0;
230  }
231  else
232  {
233  return IsCopperLayer( GetLayer() );
234  }
235 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:712
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:219
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.

References LSET::AllCuMask(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayer(), IsCopperLayer(), and ZONE_CONTAINER::m_layerSet.

Referenced by GERBER_JOBFILE_WRITER::addJSONDesignRules(), BOARD_NETLIST_UPDATER::cacheCopperZoneConnections(), ZONE_FILLER::fillSingleZone(), ZONE_CONTAINER::GetMsgPanelInfo(), BRDITEMS_PLOTTER::PlotFilledAreas(), BOARD::SetAreasNetCodesFromNetNames(), DRC::testZones(), and BOARD_NETLIST_UPDATER::updateCopperZoneNets().

◆ 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 316 of file class_zone.cpp.

317 {
318  if( GetIsKeepout() )
319  return m_layerSet.test( aLayer );
320 
321  return BOARD_ITEM::IsOnLayer( aLayer );
322 }
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Function IsOnLayer tests to see if this object is on the given layer.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661

References ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::IsOnLayer(), and ZONE_CONTAINER::m_layerSet.

Referenced by DRC_KEEPOUT_TESTER::checkTracksAndVias(), BOARD_ADAPTER::createLayers(), KIGFX::PCB_PAINTER::draw(), and DSN::SPECCTRA_DB::FromBOARD().

◆ 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 508 of file base_struct.h.

508 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 208 of file base_struct.h.

208 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:180
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:118

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 62 of file zones_functions_for_undo_redo.cpp.

63 {
64  // compare basic parameters:
65  if( GetLayer() != aZoneToCompare.GetLayer() )
66  return false;
67 
68  if( GetNetCode() != aZoneToCompare.GetNetCode() )
69  return false;
70 
71  if( GetPriority() != aZoneToCompare.GetPriority() )
72  return false;
73 
74  // Compare zone specific parameters
75  if( GetIsKeepout() != aZoneToCompare.GetIsKeepout() )
76  return false;
77 
78  if( GetIsKeepout() )
79  {
80  if( GetDoNotAllowCopperPour() != aZoneToCompare.GetDoNotAllowCopperPour() )
81  return false;
82 
83  if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() )
84  return false;
85 
86  if( GetDoNotAllowTracks() != aZoneToCompare.GetDoNotAllowTracks() )
87  return false;
88 
89  if( GetDoNotAllowPads() != aZoneToCompare.GetDoNotAllowPads() )
90  return false;
91 
92  if( GetDoNotAllowFootprints() != aZoneToCompare.GetDoNotAllowFootprints() )
93  return false;
94  }
95 
96  if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
97  return false;
98 
99  if( m_ZoneMinThickness != aZoneToCompare.GetMinThickness() )
100  return false;
101 
102  if( m_FillMode != aZoneToCompare.GetFillMode() )
103  return false;
104 
105  if( m_PadConnection != aZoneToCompare.m_PadConnection )
106  return false;
107 
108  if( m_ThermalReliefGap != aZoneToCompare.m_ThermalReliefGap )
109  return false;
110 
112  return false;
113 
114 
115  // Compare outlines
116  wxASSERT( m_Poly ); // m_Poly == NULL Should never happen
117  wxASSERT( aZoneToCompare.Outline() );
118 
119  if( Outline() != aZoneToCompare.Outline() ) // Compare vector
120  return false;
121 
122  return true;
123 }
bool GetDoNotAllowPads() const
Definition: class_zone.h:665
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:789
int GetNetCode() const
Function GetNetCode.
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:219
SHAPE_POLY_SET * Outline()
Definition: class_zone.h:252
bool GetDoNotAllowVias() const
Definition: class_zone.h:663
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:788
int m_ThermalReliefCopperBridge
Definition: class_zone.h:806
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:143
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:662
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:803
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:790
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:813
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:100
int GetMinThickness() const
Definition: class_zone.h:191
bool GetDoNotAllowTracks() const
Definition: class_zone.h:664
bool GetDoNotAllowFootprints() const
Definition: class_zone.h:666

References ZONE_CONTAINER::GetDoNotAllowCopperPour(), ZONE_CONTAINER::GetDoNotAllowFootprints(), ZONE_CONTAINER::GetDoNotAllowPads(), ZONE_CONTAINER::GetDoNotAllowTracks(), ZONE_CONTAINER::GetDoNotAllowVias(), ZONE_CONTAINER::GetFillMode(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayer(), ZONE_CONTAINER::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::GetPriority(), ZONE_CONTAINER::m_FillMode, ZONE_CONTAINER::m_PadConnection, ZONE_CONTAINER::m_Poly, ZONE_CONTAINER::m_ThermalReliefCopperBridge, ZONE_CONTAINER::m_ThermalReliefGap, ZONE_CONTAINER::m_ZoneClearance, ZONE_CONTAINER::m_ZoneMinThickness, 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 189 of file class_board_item.h.

190  {
191  return ( Type() == PCB_TRACE_T ) || ( Type() == PCB_VIA_T );
192  }
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: base_struct.h:197

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 SCH_LABEL, VIA, D_PAD, DIMENSION, DRAWSEGMENT, TEXTE_MODULE, SCH_FIELD, SCH_LINE, EDGE_MODULE, and TEXTE_PCB.

Definition at line 269 of file base_struct.h.

270  {
271  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
272  return true;
273 
274  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
275  {
276  if( m_StructType == *p )
277  return true;
278  }
279 
280  return false;
281  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:174
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 GetRule(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), TEXTE_PCB::IsType(), EDGE_MODULE::IsType(), SCH_LINE::IsType(), SCH_FIELD::IsType(), TEXTE_MODULE::IsType(), DRAWSEGMENT::IsType(), DIMENSION::IsType(), D_PAD::IsType(), VIA::IsType(), SCH_LABEL::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 206 of file base_struct.h.

206 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:121
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

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

465  {
466  return m_Poly->Iterate();
467  }
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:762

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 390 of file base_struct.h.

394  {
395  for( auto it : aList )
396  {
397  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
399  return SEARCH_RESULT::QUIT;
400  }
401 
403  }
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...

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

Referenced by GERBER_FILE_IMAGE::Visit(), and BOARD::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 411 of file base_struct.h.

413  {
414  for( auto it : aList )
415  {
416  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
418  return SEARCH_RESULT::QUIT;
419  }
420 
422  }
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...

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

475  {
476  return m_Poly->IterateWithHoles();
477  }
ITERATOR IterateWithHoles(int aOutline)
Function IterateWithHoles.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762

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 BOARD aBoard,
LSET  aMask 
)
staticprotectedinherited

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

Definition at line 80 of file class_board_item.cpp.

81 {
82  // Try to be smart and useful. Check all copper first.
83  if( aMask[F_Cu] && aMask[B_Cu] )
84  return _( "All copper layers" );
85 
86  // Check for copper.
87  auto layer = aBoard->GetEnabledLayers().AllCuMask() & aMask;
88 
89  for( int i = 0; i < 2; i++ )
90  {
91  for( int bit = PCBNEW_LAYER_ID_START; bit < PCB_LAYER_ID_COUNT; ++bit )
92  {
93  if( layer[ bit ] )
94  {
95  wxString layerInfo = aBoard->GetLayerName( static_cast<PCB_LAYER_ID>( bit ) );
96 
97  if( aMask.count() > 1 )
98  layerInfo << _( " and others" );
99 
100  return layerInfo;
101  }
102  }
103 
104  // No copper; check for technicals.
105  layer = aBoard->GetEnabledLayers().AllTechMask() & aMask;
106  }
107 
108  // No copper, no technicals: no layer
109  return _( "no layers" );
110 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:712
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
static LSET AllTechMask()
Function AllTechMask returns a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:782
#define _(s)
Definition: 3d_actions.cpp:33

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

Referenced by ZONE_CONTAINER::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, LIB_PIN, SCH_PIN, TEXTE_MODULE, SCH_MARKER, MARKER_PCB, and TEXTE_PCB.

Definition at line 464 of file base_struct.h.

465  {
466  return false;
467  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), TEXTE_PCB::Matches(), MARKER_PCB::Matches(), SCH_MARKER::Matches(), TEXTE_MODULE::Matches(), LIB_PIN::Matches(), SCH_FIELD::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ 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 143 of file base_struct.cpp.

144 {
145  wxString text = aText;
146  wxString searchText = aSearchData.GetFindString();
147 
148  // Don't match if searching for replaceable item and the item doesn't support text replace.
149  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
150  return false;
151 
152  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
153  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
154 
155  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
156  {
157  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
158  return text.Matches( searchText );
159 
160  return text.MakeUpper().Matches( searchText.MakeUpper() );
161  }
162 
163  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
164  return aText.Find( searchText ) != wxNOT_FOUND;
165 
166  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
167 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:508

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

747 {
748  // ZONE_CONTAINERs mirror about the x-axis (why?!?)
749  m_Poly->Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
750 
751  Hatch();
752 
753  m_FilledPolysList.Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
754 
755  for( SEG& seg : m_FillSegmList )
756  {
757  if( aMirrorLeftRight )
758  {
759  MIRROR( seg.A.x, aMirrorRef.x );
760  MIRROR( seg.B.x, aMirrorRef.x );
761  }
762  else
763  {
764  MIRROR( seg.A.y, aMirrorRef.y );
765  MIRROR( seg.B.y, aMirrorRef.y );
766  }
767  }
768 }
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:841
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:175
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851
Definition: seg.h:39
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:899

References ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, MIRROR(), SHAPE_POLY_SET::Mirror(), wxPoint::x, and wxPoint::y.

Referenced by ZONE_CONTAINER::Flip().

◆ Move() [1/2]

void BOARD_ITEM::Move ( const VECTOR2I aMoveVector)
inlineinherited

Definition at line 237 of file class_board_item.h.

238  {
239  Move( wxPoint( aMoveVector.x, aMoveVector.y ) );
240  }
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 678 of file class_zone.cpp.

679 {
680  /* move outlines */
681  m_Poly->Move( offset );
682 
683  Hatch();
684 
685  m_FilledPolysList.Move( offset );
686 
687  for( SEG& seg : m_FillSegmList )
688  {
689  seg.A += VECTOR2I( offset );
690  seg.B += VECTOR2I( offset );
691  }
692 }
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:841
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:762
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851
Definition: seg.h:39
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:899

References ZONE_CONTAINER::Hatch(), 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 695 of file class_zone.cpp.

696 {
697  int next_corner;
698 
699  if( m_Poly->GetNeighbourIndexes( aEdge, nullptr, &next_corner ) )
700  {
701  m_Poly->SetVertex( aEdge, m_Poly->CVertex( aEdge ) + VECTOR2I( offset ) );
702  m_Poly->SetVertex( next_corner, m_Poly->CVertex( next_corner ) + VECTOR2I( offset ) );
703  Hatch();
704 
705  SetNeedRefill( true );
706  }
707 }
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:762
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:899
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:179

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

◆ NeedRefill()

bool ZONE_CONTAINER::NeedRefill ( ) const
inlineinherited

Definition at line 178 of file class_zone.h.

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

References ZONE_CONTAINER::m_needRefill.

Referenced by ZONE_CONTAINER::initDataFromSrcInCopyCtor().

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

528  {
529  m_Poly->NewHole();
530  }
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:762

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

◆ 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 197 of file base_struct.cpp.

198 {
199  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
200  GetChars( GetClass() ) ) );
201 
202  return false;
203 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
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:205

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

◆ operator=()

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

Definition at line 1245 of file class_zone.cpp.

1246 {
1247  ZONE_CONTAINER::operator=( aOther );
1248  return *this;
1249 }
ZONE_CONTAINER & operator=(const ZONE_CONTAINER &aOther)
Definition: class_zone.cpp:90

References ZONE_CONTAINER::operator=().

◆ Outline() [1/2]

◆ Outline() [2/2]

const SHAPE_POLY_SET* ZONE_CONTAINER::Outline ( ) const
inlineinherited

Definition at line 253 of file class_zone.h.

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

References ZONE_CONTAINER::m_Poly.

◆ RawPolysList()

SHAPE_POLY_SET& ZONE_CONTAINER::RawPolysList ( )
inlineinherited

Definition at line 647 of file class_zone.h.

648  {
649  return m_RawPolysList;
650  }
SHAPE_POLY_SET m_RawPolysList
Definition: class_zone.h:852

References ZONE_CONTAINER::m_RawPolysList.

◆ RemoveAllContours()

void ZONE_CONTAINER::RemoveAllContours ( void  )
inlineinherited

Definition at line 489 of file class_zone.h.

490  {
492  }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:762
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 780 of file class_zone.cpp.

781 {
782  // Ensure the requested cutout is valid
783  if( m_Poly->OutlineCount() < aOutlineIdx || m_Poly->HoleCount( aOutlineIdx ) < aHoleIdx )
784  return;
785 
786  SHAPE_POLY_SET cutPoly( m_Poly->Hole( aOutlineIdx, aHoleIdx ) );
787 
788  // Add the cutout back to the zone
790 
791  SetNeedRefill( true );
792 }
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:762
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:179

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().

◆ 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 170 of file base_struct.cpp.

171 {
172  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
173 
174  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
175  aSearchData.GetFindString() :
176  aSearchData.GetFindString().Upper() );
177 
178  if( result == wxNOT_FOUND )
179  return false;
180 
181  wxString prefix = aText.Left( result );
182  wxString suffix;
183 
184  if( aSearchData.GetFindString().length() + result < aText.length() )
185  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
186 
187  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
188  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
189  GetChars( suffix ) );
190 
191  aText = prefix + aSearchData.GetReplaceString() + suffix;
192 
193  return true;
194 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153

References GetChars(), and 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, and SCH_FIELD.

Definition at line 496 of file base_struct.h.

496 { return false; }

◆ Rotate() [1/2]

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

Definition at line 253 of file class_board_item.h.

254  {
255  Rotate( wxPoint( aRotCentre.x, aRotCentre.y ), aAngle );
256  }
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 centre,
double  angle 
)
overridevirtualinherited

Function Rotate Move the outlines.

Parameters
centre= rot centre
angle= in 0.1 degree

Reimplemented from BOARD_ITEM.

Definition at line 710 of file class_zone.cpp.

711 {
712  wxPoint pos;
713 
714  angle = -DECIDEG2RAD( angle );
715 
716  m_Poly->Rotate( angle, VECTOR2I( centre ) );
717  Hatch();
718 
719  /* rotate filled areas: */
720  m_FilledPolysList.Rotate( angle, VECTOR2I( centre ) );
721 
722  for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ )
723  {
724  wxPoint a( m_FillSegmList[ic].A );
725  RotatePoint( &a, centre, angle );
726  m_FillSegmList[ic].A = a;
727  wxPoint b( m_FillSegmList[ic].B );
728  RotatePoint( &b, centre, angle );
729  m_FillSegmList[ic].B = a;
730  }
731 }
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 })
Function Rotate rotates all vertices by a given angle.
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:841
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:762
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
double DECIDEG2RAD(double deg)
Definition: trigo.h:218
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:899

References PNS::angle(), DECIDEG2RAD(), ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, SHAPE_POLY_SET::Rotate(), and RotatePoint().

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

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

◆ SetCornerPosition()

void ZONE_CONTAINER::SetCornerPosition ( int  aCornerIndex,
wxPoint  new_pos 
)
inlineinherited

Definition at line 505 of file class_zone.h.

506  {
507  SHAPE_POLY_SET::VERTEX_INDEX relativeIndices;
508 
509  // Convert global to relative indices
510  if( m_Poly->GetRelativeIndices( aCornerIndex, &relativeIndices ) )
511  {
512  if( m_Poly->CVertex( relativeIndices ).x != new_pos.x
513  || m_Poly->CVertex( relativeIndices ).y != new_pos.y )
514  {
515  SetNeedRefill( true );
516  m_Poly->SetVertex( relativeIndices, new_pos );
517  }
518  }
519  else
520  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
521  }
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.
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:762
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Function GetRelativeIndices.
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:179

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

◆ SetCornerRadius()

void ZONE_CONTAINER::SetCornerRadius ( unsigned int  aRadius)
inherited

Definition at line 429 of file class_zone.cpp.

430 {
431  if( m_cornerRadius != aRadius )
432  SetNeedRefill( true );
433 
434  m_cornerRadius = aRadius;
435 }
unsigned int m_cornerRadius
Definition: class_zone.h:764
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:179

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

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetCornerSmoothingType()

void ZONE_CONTAINER::SetCornerSmoothingType ( int  aType)
inlineinherited

Definition at line 613 of file class_zone.h.

613 { m_cornerSmoothingType = aType; };
int m_cornerSmoothingType
Definition: class_zone.h:763

References ZONE_CONTAINER::m_cornerSmoothingType.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetDoNotAllowCopperPour()

◆ SetDoNotAllowFootprints()

◆ SetDoNotAllowPads()

◆ SetDoNotAllowTracks()

◆ SetDoNotAllowVias()

◆ SetFilledPolysList()

void ZONE_CONTAINER::SetFilledPolysList ( SHAPE_POLY_SET aPolysList)
inlineinherited

Function SetFilledPolysList sets the list of filled polygons.

Definition at line 589 of file class_zone.h.

590  {
591  m_FilledPolysList = aPolysList;
592  }
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:851

References ZONE_CONTAINER::m_FilledPolysList.

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

◆ SetFilledPolysUseThickness()

void ZONE_CONTAINER::SetFilledPolysUseThickness ( bool  aOption)
inlineinherited

Definition at line 622 of file class_zone.h.

622 { m_FilledPolysUseThickness = aOption; }
bool m_FilledPolysUseThickness
outline of filled polygons have thickness.
Definition: class_zone.h:791

References ZONE_CONTAINER::m_FilledPolysUseThickness.

Referenced by ZONE_FILLER::Fill().

◆ SetFillMode()

void ZONE_CONTAINER::SetFillMode ( ZONE_FILL_MODE  aFillMode)
inlineinherited

Definition at line 142 of file class_zone.h.

142 { m_FillMode = aFillMode; }
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:813

References ZONE_CONTAINER::m_FillMode.

Referenced by export_vrml_zones(), ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPolygon(), and ALTIUM_PCB::ParsePolygons6Data().

◆ SetFillSegments()

void ZONE_CONTAINER::SetFillSegments ( const ZONE_SEGMENT_FILL aSegments)
inlineinherited

Definition at line 642 of file class_zone.h.

643  {
644  m_FillSegmList = aSegments;
645  }
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:841

References ZONE_CONTAINER::m_FillSegmList.

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 239 of file base_struct.h.

239 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Definition: base_struct.h:180

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddModuleToBoard(), PCBNEW_CONTROL::AppendBoard(), SCH_EDIT_TOOL::ChangeTextType(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), LIB_PIN_TOOL::CreatePin(), SCH_EDIT_FRAME::CreateSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), LIB_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_VIEW::HighlightItem(), EDIT_POINTS_FACTORY::Make(), TRACKS_CLEANER::mergeCollinearSegments(), LIB_MOVE_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), WS_DATA_ITEM::SyncDrawItems(), WS_DATA_ITEM_TEXT::SyncDrawItems(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

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.

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

Definition at line 291 of file base_struct.h.

291 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: base_struct.h:179

References EDA_ITEM::m_forceVisible.

◆ SetHatch()

void ZONE_CONTAINER::SetHatch ( ZONE_HATCH_STYLE  aHatchStyle,
int  aHatchPitch,
bool  aRebuildHatch 
)
inherited

Function SetHatch sets all hatch parameters for the zone.

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

Definition at line 869 of file class_zone.cpp.

870 {
871  SetHatchPitch( aHatchPitch );
872  m_hatchStyle = aHatchStyle;
873 
874  if( aRebuildHatch )
875  Hatch();
876 }
void SetHatchPitch(int aPitch)
Function SetHatchPitch sets the hatch pitch parameter for the zone.
Definition: class_zone.cpp:879
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:856
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:899

References ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_hatchStyle, and ZONE_CONTAINER::SetHatchPitch().

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPlain(), ALTIUM_PCB::ParseArcs6Data(), ALTIUM_PCB::ParseFills6Data(), ALTIUM_PCB::ParsePolygons6Data(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), and ALTIUM_PCB::ParseTracks6Data().

◆ SetHatchFillTypeGap()

void ZONE_CONTAINER::SetHatchFillTypeGap ( int  aStep)
inlineinherited

Definition at line 204 of file class_zone.h.

204 { m_HatchFillTypeGap = aStep; }
int m_HatchFillTypeGap
Grid style shape: dist between center of lines (grid size) (0 -> solid shape)
Definition: class_zone.h:819

References ZONE_CONTAINER::m_HatchFillTypeGap.

Referenced by ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPolygon(), and ALTIUM_PCB::ParsePolygons6Data().

◆ SetHatchFillTypeOrientation()

void ZONE_CONTAINER::SetHatchFillTypeOrientation ( double  aStep)
inlineinherited

Definition at line 207 of file class_zone.h.

207 { m_HatchFillTypeOrientation = aStep; }
double m_HatchFillTypeOrientation
Grid style shape: orientation in degrees of the grid lines.
Definition: class_zone.h:822

References ZONE_CONTAINER::m_HatchFillTypeOrientation.

Referenced by ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPolygon(), and ALTIUM_PCB::ParsePolygons6Data().

◆ SetHatchFillTypeSmoothingLevel()

void ZONE_CONTAINER::SetHatchFillTypeSmoothingLevel ( int  aLevel)
inlineinherited

Definition at line 210 of file class_zone.h.

210 { m_HatchFillTypeSmoothingLevel = aLevel; }
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: class_zone.h:826

References ZONE_CONTAINER::m_HatchFillTypeSmoothingLevel.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchFillTypeSmoothingValue()

void ZONE_CONTAINER::SetHatchFillTypeSmoothingValue ( double  aValue)
inlineinherited

Definition at line 213 of file class_zone.h.

213 { m_HatchFillTypeSmoothingValue = aValue; }
double m_HatchFillTypeSmoothingValue
Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap ...
Definition: class_zone.h:830

References ZONE_CONTAINER::m_HatchFillTypeSmoothingValue.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchFillTypeThickness()

void ZONE_CONTAINER::SetHatchFillTypeThickness ( int  aThickness)
inlineinherited

Definition at line 201 of file class_zone.h.

201 { m_HatchFillTypeThickness = aThickness; }
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: class_zone.h:816

References ZONE_CONTAINER::m_HatchFillTypeThickness.

Referenced by ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPolygon(), and ALTIUM_PCB::ParsePolygons6Data().

◆ SetHatchPitch()

void ZONE_CONTAINER::SetHatchPitch ( int  aPitch)
inherited

Function SetHatchPitch sets the hatch pitch parameter for the zone.

Parameters
aPitchis the hatch pitch in iu.

Definition at line 879 of file class_zone.cpp.

880 {
881  m_hatchPitch = aPitch;
882 }

References ZONE_CONTAINER::m_hatchPitch.

Referenced by ZONE_CONTAINER::operator=(), and ZONE_CONTAINER::SetHatch().

◆ SetHatchStyle()

void ZONE_CONTAINER::SetHatchStyle ( ZONE_HATCH_STYLE  aStyle)
inlineinherited

Definition at line 547 of file class_zone.h.

548  {
549  m_hatchStyle = aStyle;
550  }
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:856

References ZONE_CONTAINER::m_hatchStyle.

Referenced by BOARD::InsertArea(), EAGLE_PLUGIN::loadPolygon(), and ZONE_CONTAINER::operator=().

◆ SetHighlighted()

void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 214 of file base_struct.h.

214 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:239
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:139

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

◆ SetHV45()

void ZONE_CONTAINER::SetHV45 ( bool  aConstrain)
inlineinherited

Definition at line 734 of file class_zone.h.

734 { m_hv45 = aConstrain; }

References ZONE_CONTAINER::m_hv45.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetIsFilled()

void ZONE_CONTAINER::SetIsFilled ( bool  isFilled)
inlineinherited

Definition at line 176 of file class_zone.h.

176 { m_IsFilled = isFilled; }
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:794

References ZONE_CONTAINER::m_IsFilled.

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

◆ SetIsKeepout()

◆ SetLayer()

void ZONE_CONTAINER::SetLayer ( PCB_LAYER_ID  aLayer)
overridevirtualinherited

Function SetLayer sets the layer this item is on.

Parameters
aLayerThe layer number. is virtual because some items (in fact: class DIMENSION) have a slightly different initialization

Reimplemented from BOARD_ITEM.

Definition at line 246 of file class_zone.cpp.

247 {
248  SetLayerSet( LSET( aLayer ) );
249 
250  m_Layer = aLayer;
251 }
PCB_LAYER_ID m_Layer
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:254
LSET is a set of PCB_LAYER_IDs.

References BOARD_ITEM::m_Layer, and ZONE_CONTAINER::SetLayerSet().

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), ZONE_SETTINGS::ExportSetting(), ZONE_CONTAINER::Flip(), BOARD::InsertArea(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), ALTIUM_PCB::ParseArcs6Data(), ALTIUM_PCB::ParseFills6Data(), ALTIUM_PCB::ParsePolygons6Data(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), ALTIUM_PCB::ParseTracks6Data(), and PlotSolderMaskLayer().

◆ SetLayerSet()

void ZONE_CONTAINER::SetLayerSet ( LSET  aLayerSet)
inherited

Definition at line 254 of file class_zone.cpp.

255 {
256  if( GetIsKeepout() )
257  {
258  // Keepouts can only exist on copper layers
259  aLayerSet &= LSET::AllCuMask();
260  }
261 
262  if( aLayerSet.count() == 0 )
263  return;
264 
265  if( m_layerSet != aLayerSet )
266  SetNeedRefill( true );
267 
268  m_layerSet = aLayerSet;
269 
270  // Set the single layer parameter.
271  // For keepout zones that can be on many layers, this parameter does not have
272  // really meaning and is a bit arbitrary if more than one layer is set.
273  // But many functions are using it.
274  // So we need to initialize it to a reasonable value.
275  // Priority is F_Cu then B_Cu then to the first selected layer
276  m_Layer = aLayerSet.Seq()[0];
277 
278  if( m_Layer != F_Cu && aLayerSet[B_Cu] )
279  m_Layer = B_Cu;
280 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:712
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:377
PCB_LAYER_ID m_Layer
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:661
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:179

References LSET::AllCuMask(), B_Cu, F_Cu, ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::m_Layer, ZONE_CONTAINER::m_layerSet, LSET::Seq(), and ZONE_CONTAINER::SetNeedRefill().

Referenced by ZONE_SETTINGS::ExportSetting(), ZONE_CONTAINER::Flip(), ZONE_CONTAINER::initDataFromSrcInCopyCtor(), ZONE_CONTAINER::operator=(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), and ZONE_CONTAINER::SetLayer().

◆ SetLocalFlags()

void ZONE_CONTAINER::SetLocalFlags ( int  aFlags)
inlineinherited

Definition at line 247 of file class_zone.h.

247 { m_localFlgs = aFlags; }
int m_localFlgs
Variable used in polygon calculations.
Definition: class_zone.h:836

References ZONE_CONTAINER::m_localFlgs.

Referenced by BOARD::CombineAreas(), ZONE_CONTAINER::initDataFromSrcInCopyCtor(), BOARD::NormalizeAreaPolygon(), and ZONE_CONTAINER::ZONE_CONTAINER().

◆ SetLocalRatsnestVisible()

void BOARD_CONNECTED_ITEM::SetLocalRatsnestVisible ( bool  aVisible)
inlineinherited

Definition at line 220 of file board_connected_item.h.

221  {
222  m_localRatsnestVisible = aVisible;
223  }

References BOARD_CONNECTED_ITEM::m_localRatsnestVisible.

Referenced by PCB_EDIT_FRAME::Exchange_Module().

◆ SetLocked()

virtual void BOARD_ITEM::SetLocked ( bool  aLocked)
inlinevirtualinherited

Function SetLocked modifies 'lock' status for of the item.

Reimplemented in MODULE, and TRACK.

Definition at line 208 of file class_board_item.h.

209  {
210  // only MODULEs & TRACKs can be locked at this time.
211  }

Referenced by PCB_EDITOR_CONTROL::modifyLockSelected(), ALTIUM_PCB::ParsePads6Data(), and ALTIUM_PCB::ParsePolygons6Data().

◆ SetMinThickness()

void ZONE_CONTAINER::SetMinThickness ( int  aMinThickness)
inlineinherited

Definition at line 192 of file class_zone.h.

193  {
194  if( m_ZoneMinThickness != aMinThickness )
195  SetNeedRefill( true );
196 
197  m_ZoneMinThickness = aMinThickness;
198  }
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:790
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:179

References ZONE_CONTAINER::m_ZoneMinThickness, and ZONE_CONTAINER::SetNeedRefill().

Referenced by ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPolygon(), ALTIUM_PCB::ParsePolygons6Data(), and PlotSolderMaskLayer().

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

Definition at line 85 of file base_struct.cpp.

86 {
87  SetFlags(