KiCad PCB EDA Suite
PAD Class Reference

#include <pad.h>

Inheritance diagram for PAD:
BOARD_CONNECTED_ITEM BOARD_ITEM EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 PAD (FOOTPRINT *parent)
 
 PAD (const PAD &aPad)
 
PADoperator= (const PAD &aOther)
 
bool IsType (const KICAD_T aScanTypes[]) const override
 Check whether the item is one of the listed types. More...
 
FOOTPRINTGetParent () const
 
bool IsLocked () const override
 
void ImportSettingsFrom (const PAD &aMasterPad)
 Imports the pad settings from aMasterPad. More...
 
bool IsFlipped () const
 
void SetName (const wxString &aName)
 Set the pad name (sometimes called pad number, although it can be an array reference like AA12). More...
 
const wxString & GetName () const
 
void SetPinFunction (const wxString &aName)
 Set the pad function (pin name in schematic) More...
 
const wxString & GetPinFunction () const
 
bool SameLogicalPadAs (const PAD *other) const
 Before we had custom pad shapes it was common to have multiple overlapping pads to represent a more complex shape. More...
 
void SetShape (PAD_SHAPE_T aShape)
 Set the new shape of this pad. More...
 
PAD_SHAPE_T GetShape () const
 
void SetPosition (const wxPoint &aPos) override
 
wxPoint GetPosition () const override
 
PAD_SHAPE_T GetAnchorPadShape () const
 Function GetAnchorPadShape. More...
 
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt () const
 
void SetCustomShapeInZoneOpt (CUST_PAD_SHAPE_IN_ZONE aOption)
 Set the option for the custom pad shape to use as clearance area in copper zones. More...
 
void SetAnchorPadShape (PAD_SHAPE_T aShape)
 Function SetAnchorPadShape Set the shape of the anchor pad for custm shped pads. More...
 
bool IsOnCopperLayer () const override
 
void SetY (int y)
 
void SetX (int x)
 
void SetPos0 (const wxPoint &aPos)
 
const wxPoint & GetPos0 () const
 
void SetY0 (int y)
 
void SetX0 (int x)
 
void SetSize (const wxSize &aSize)
 
const wxSize & GetSize () const
 
void SetSizeX (const int aX)
 
const int GetSizeX () const
 
void SetSizeY (const int aY)
 
const int GetSizeY () const
 
void SetDelta (const wxSize &aSize)
 
const wxSize & GetDelta () const
 
void SetDrillSize (const wxSize &aSize)
 
const wxSize & GetDrillSize () const
 
void SetDrillSizeX (const int aX)
 
const int GetDrillSizeX () const
 
void SetDrillSizeY (const int aY)
 
const int GetDrillSizeY () const
 
void SetOffset (const wxPoint &aOffset)
 
const wxPoint & GetOffset () const
 
wxPoint GetCenter () const override
 This defaults to the center of the bounding box if not overridden. More...
 
void AddPrimitivePoly (const SHAPE_POLY_SET &aPoly, int aThickness, bool aFilled)
 Has meaning only for custom shape pads. More...
 
void AddPrimitivePoly (const std::vector< wxPoint > &aPoly, int aThickness, bool aFilled)
 
void AddPrimitiveSegment (const wxPoint &aStart, const wxPoint &aEnd, int aThickness)
 
void AddPrimitiveCircle (const wxPoint &aCenter, int aRadius, int aThickness, bool aFilled)
 
void AddPrimitiveRect (const wxPoint &aStart, const wxPoint &aEnd, int aThickness, bool aFilled)
 
void AddPrimitiveArc (const wxPoint &aCenter, const wxPoint &aStart, int aArcAngle, int aThickness)
 
void AddPrimitiveCurve (const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &aCtrl1, const wxPoint &aCtrl2, int aThickness)
 
bool GetBestAnchorPosition (VECTOR2I &aPos)
 
void MergePrimitivesAsPolygon (SHAPE_POLY_SET *aMergedPolygon, PCB_LAYER_ID aLayer) const
 Merge all basic shapes to a SHAPE_POLY_SET Note: The results are relative to the pad position, orientation 0. More...
 
void DeletePrimitivesList ()
 clear the basic shapes list More...
 
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives () const
 Accessor to the basic shape list for custom-shaped pads. More...
 
void Flip (const wxPoint &aCentre, bool aFlipLeftRight) override
 Flip this object, i.e. More...
 
void FlipPrimitives (bool aFlipLeftRight)
 Flip (mirror) the primitives left to right or top to bottom, around the anchor position in custom pads. More...
 
void ReplacePrimitives (const std::vector< std::shared_ptr< PCB_SHAPE >> &aPrimitivesList)
 Clear the current custom shape primitives list and import a new list. More...
 
void AppendPrimitives (const std::vector< std::shared_ptr< PCB_SHAPE >> &aPrimitivesList)
 Import a custom shape primites list (composed of basic shapes) and add items to the current list. More...
 
void AddPrimitive (PCB_SHAPE *aPrimitive)
 Add item to the custom shape primitives list. More...
 
void SetOrientation (double aAngle)
 Function SetOrientation sets the rotation angle of the pad. More...
 
void SetOrientationDegrees (double aOrientation)
 Set orientation in degrees. More...
 
double GetOrientation () const
 Function GetOrientation returns the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees). More...
 
double GetOrientationDegrees () const
 
double GetOrientationRadians () const
 
void SetDrillShape (PAD_DRILL_SHAPE_T aShape)
 
PAD_DRILL_SHAPE_T GetDrillShape () const
 
bool IsDirty () const
 
void SetDirty ()
 
void SetLayerSet (LSET aLayers) override
 
LSET GetLayerSet () const override
 Return a std::bitset of all layers on which the item physically resides. More...
 
void SetAttribute (PAD_ATTR_T aAttribute)
 
PAD_ATTR_T GetAttribute () const
 
void SetProperty (PAD_PROP_T aProperty)
 
PAD_PROP_T GetProperty () const
 
bool IsAperturePad () const
 
void SetPadToDieLength (int aLength)
 
int GetPadToDieLength () const
 
int GetLocalSolderMaskMargin () const
 
void SetLocalSolderMaskMargin (int aMargin)
 
int GetLocalClearance (wxString *aSource) const override
 Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system. More...
 
int GetLocalClearance () const
 
void SetLocalClearance (int aClearance)
 
int GetLocalSolderPasteMargin () const
 
void SetLocalSolderPasteMargin (int aMargin)
 
double GetLocalSolderPasteMarginRatio () const
 
void SetLocalSolderPasteMarginRatio (double aRatio)
 
void TransformShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
 Function TransformShapeWithClearanceToPolygon Convert the pad shape to a closed polygon. More...
 
bool TransformHoleWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aError, ERROR_LOC aErrorLoc) const
 Function TransformHoleWithClearanceToPolygon Build the Corner list of the polygonal drill shape in the board coordinate system. More...
 
virtual std::shared_ptr< SHAPEGetEffectiveShape (PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
 Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes. More...
 
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon () const
 
const SHAPE_SEGMENTGetEffectiveHoleShape () const
 Function GetEffectiveHoleShape Returns a SHAPE object representing the pad's hole. More...
 
int GetBoundingRadius () const
 Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad. More...
 
int GetLocalClearanceOverrides (wxString *aSource) const override
 Function GetLocalClearanceOverrides returns any local clearance overrides set in the "classic" (ie: pre-rule) system. More...
 
int GetSolderMaskMargin () const
 Function GetSolderMaskMargin. More...
 
wxSize GetSolderPasteMargin () const
 Function GetSolderPasteMargin. More...
 
void SetZoneConnection (ZONE_CONNECTION aType)
 
ZONE_CONNECTION GetZoneConnection () const
 
ZONE_CONNECTION GetEffectiveZoneConnection (wxString *aSource=nullptr) const
 Return the zone connection in effect (either locally overridden or overridden in the parent footprint). More...
 
void SetThermalSpokeWidth (int aWidth)
 Set the width of the thermal spokes connecting the pad to a zone. More...
 
int GetThermalSpokeWidth () const
 
int GetEffectiveThermalSpokeWidth (wxString *aSource=nullptr) const
 Return the effective thermal spoke width having resolved any inheritance. More...
 
void SetThermalGap (int aGap)
 
int GetThermalGap () const
 
int GetEffectiveThermalGap (wxString *aSource=nullptr) const
 Return the effective thermal gap having resolved any inheritance. More...
 
void SetRoundRectCornerRadius (double aRadius)
 Function SetRoundRectCornerRadius has meaning only for rounded rect pads. More...
 
int GetRoundRectCornerRadius () const
 
wxPoint ShapePos () const
 
void SetRoundRectRadiusRatio (double aRadiusScale)
 has meaning only for rounded rect pads Set the ratio between the smaller X or Y size and the rounded corner radius. More...
 
double GetRoundRectRadiusRatio () const
 
void SetChamferRectRatio (double aChamferScale)
 has meaning only for chamfered rect pads Set the ratio between the smaller X or Y size and chamfered corner size. More...
 
double GetChamferRectRatio () const
 
void SetChamferPositions (int aPositions)
 has meaning only for chamfered rect pads set the position of the chamfers for orientation 0. More...
 
int GetChamferPositions () const
 
int GetSubRatsnest () const
 Function GetSubRatsnest. More...
 
void SetSubRatsnest (int aSubRatsnest)
 
void SetRemoveUnconnected (bool aSet)
 Sets the unconnected removal property. More...
 
bool GetRemoveUnconnected () const
 
void SetKeepTopBottom (bool aSet)
 Sets whether we keep the top and bottom connections even if they are not connected. More...
 
bool GetKeepTopBottom () const
 
void GetMsgPanelInfo (EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
 Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
bool IsOnLayer (PCB_LAYER_ID aLayer) const override
 Test to see if this object is on the given layer. More...
 
bool FlashLayer (int aLayer, bool aIncludeZones=false) const
 Checks to see whether the pad should be flashed on the specific layer. More...
 
bool FlashLayer (LSET aLayers, bool aIncludeZones=false) const
 Checks to see if the pad should be flashed to any of the layers in the set. More...
 
bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const override
 Test if aPosition is contained within or on the bounding box of an item. More...
 
bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const override
 Test if aRect intersects or is contained within the bounding box of an item. More...
 
wxString GetClass () const override
 Return the class name. More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox The bounding box is cached, so this will be efficient most of the time. More...
 
void SetDrawCoord ()
 

Set absolute coordinates.

More...
 
void SetLocalCoord ()
 

Set relative coordinates.

More...
 
void Move (const wxPoint &aMoveVector) override
 Move this object. More...
 
void Rotate (const wxPoint &aRotCentre, double aAngle) override
 Rotate this object. More...
 
wxString GetSelectMenuText (EDA_UNITS aUnits) const override
 Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
BITMAP_DEF GetMenuImage () const override
 Return a pointer to an image to be used in menus. More...
 
wxString ShowPadShape () const
 Function ShowPadShape. More...
 
wxString ShowPadAttr () const
 Function ShowPadAttr. More...
 
EDA_ITEMClone () const override
 Create a duplicate of this item with linked list members set to NULL. More...
 
PADClonePad () const
 same as Clone, but returns a PAD item. More...
 
void BuildEffectiveShapes (PCB_LAYER_ID aLayer) const
 Rebuilds the effective shape cache (and bounding box and radius) for the pad and clears the dirty bit. More...
 
void BuildEffectivePolygon () const
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Return the all the layers within the VIEW the object is painted on. More...
 
double ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 Return the level of detail (LOD) of the item. More...
 
virtual const BOX2I ViewBBox () const override
 Return the bounding box of the item covering all its layers. More...
 
virtual void SwapData (BOARD_ITEM *aImage) override
 Swap data between aItem and aImage. More...
 
bool IsConnected () const override
 

More...
 
NETINFO_ITEMGetNet () const
 Function GetNet Returns NET_INFO object for a given item. More...
 
void SetNet (NETINFO_ITEM *aNetInfo)
 Function SetNet Sets a NET_INFO object for the item. More...
 
int GetNetCode () const
 Function GetNetCode. More...
 
bool SetNetCode (int aNetCode, bool aNoAssert)
 Sets net using a net code. More...
 
void SetNetCode (int aNetCode)
 
wxString GetNetname () const
 Function GetNetname. More...
 
wxString GetNetnameMsg () const
 Function GetNetnameMsg. More...
 
wxString GetShortNetname () const
 Function GetShortNetname. More...
 
virtual int GetOwnClearance (PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
 Function GetClearance returns an item's "own" clearance in internal units. More...
 
virtual NETCLASSGetNetClass () const
 Function GetNetClassPtr returns the NETCLASS for this item. More...
 
virtual NETCLASSGetEffectiveNetclass () const
 Function GetEffectiveNetclass returns the NETCLASS for this item, or the default netclass if none is defined. More...
 
virtual wxString GetNetClassName () const
 Function GetNetClassName returns a pointer to the netclass of the zone. More...
 
void SetLocalRatsnestVisible (bool aVisible)
 
bool GetLocalRatsnestVisible () const
 
void SetParentGroup (PCB_GROUP *aGroup)
 
PCB_GROUPGetParentGroup () const
 
int GetX () const
 
int GetY () const
 
virtual PCB_LAYER_ID GetLayer () const
 Return the primary layer this item is on. More...
 
virtual void SetLayer (PCB_LAYER_ID aLayer)
 Set the layer this item is on. More...
 
virtual BOARD_ITEMDuplicate () const
 Create a copy of a of this BOARD_ITEM. More...
 
bool IsTrack () const
 Test to see if this object is a track or via (or microvia). More...
 
virtual void SetLocked (bool aLocked)
 Modify the 'lock' status for of the item. More...
 
void DeleteStructure ()
 Delete this object after removing from its parent if it has one. More...
 
void Move (const VECTOR2I &aMoveVector)
 
void Rotate (const VECTOR2I &aRotCentre, double aAngle)
 
void Flip (const VECTOR2I &aCentre, bool aFlipLeftRight)
 
virtual BOARDGetBoard () const
 Return the BOARD in which this BOARD_ITEM resides, or NULL if none. More...
 
wxString GetLayerName () const
 Return the name of the PCB layer on which the item resides. More...
 
KICAD_T Type () const
 Returns the type of object. More...
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag) const
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
void SetForceVisible (bool aEnable)
 Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual const wxPoint GetFocusPosition () const
 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[])
 May be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
virtual bool Matches (const wxFindReplaceData &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
virtual bool Replace (const wxFindReplaceData &aSearchData, void *aAuxData=nullptr)
 Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Override this method in any derived object that supports test find and replace. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Static Public Member Functions

static LSET PTHMask ()
 layer set for a through hole pad More...
 
static LSET SMDMask ()
 layer set for a SMD pad on Front layer More...
 
static LSET ConnSMDMask ()
 layer set for a SMD pad on Front layer used for edge board connectors More...
 
static LSET UnplatedHoleMask ()
 layer set for a mechanical unplated through hole pad More...
 
static LSET ApertureMask ()
 layer set for an aperture pad More...
 
static bool ClassOf (const EDA_ITEM *aItem)
 
static int Compare (const PAD *padref, const PAD *padcmp)
 Function Compare compares two pads and return 0 if they are equal. More...
 
static wxString ShowShape (PCB_SHAPE_TYPE_T aShape)
 Convert the enum PCB_SHAPE_TYPE_T integer value to a wxString. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const wxFindReplaceData &aSearchData, wxString &aText)
 Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

Static Public Attributes

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

Protected Member Functions

virtual wxString layerMaskDescribe () const
 Return a string (to be shown to the user) describing a layer mask. More...
 
bool Matches (const wxString &aText, const wxFindReplaceData &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 

Protected Attributes

NETINFO_ITEMm_netinfo
 Stores all informations about the net that item belongs to. More...
 
PCB_LAYER_ID m_layer
 
PCB_GROUPm_group
 
STATUS_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_flags
 

Private Member Functions

void addPadPrimitivesToPolygon (SHAPE_POLY_SET *aMergedPolygon, PCB_LAYER_ID aLayer, int aError, ERROR_LOC aErrorLoc) const
 

Private Attributes

wxString m_name
 
wxString m_pinFunction
 
wxPoint m_pos
 
PAD_SHAPE_T m_padShape
 
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
 
bool m_shapesDirty
 
std::mutex m_shapesBuildingLock
 
EDA_RECT m_effectiveBoundingBox
 
std::shared_ptr< SHAPE_COMPOUNDm_effectiveShape
 
std::shared_ptr< SHAPE_SEGMENTm_effectiveHoleShape
 
bool m_polyDirty
 
std::mutex m_polyBuildingLock
 
std::shared_ptr< SHAPE_POLY_SETm_effectivePolygon
 
int m_effectiveBoundingRadius
 
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea
 
int m_subRatsnest
 
wxSize m_drill
 
wxSize m_size
 
PAD_DRILL_SHAPE_T m_drillShape
 
double m_roundedCornerScale
 
double m_chamferScale
 
int m_chamferPositions
 
PAD_SHAPE_T m_anchorPadShape
 
wxPoint m_offset
 
LSET m_layerMask
 
wxSize m_deltaSize
 
wxPoint m_pos0
 
PAD_ATTR_T m_attribute
 
PAD_PROP_T m_property
 
double m_orient
 
int m_lengthPadToDie
 
bool m_removeUnconnectedLayer
 
bool m_keepTopBottomLayer
 
int m_localClearance
 
int m_localSolderMaskMargin
 
int m_localSolderPasteMargin
 
double m_localSolderPasteMarginRatio
 
ZONE_CONNECTION m_zoneConnection
 
int m_thermalWidth
 
int m_thermalGap
 

Detailed Description

Definition at line 60 of file pad.h.

Constructor & Destructor Documentation

◆ PAD() [1/2]

PAD::PAD ( FOOTPRINT parent)

Definition at line 49 of file pcbnew/pad.cpp.

49  :
51 {
52  m_size.x = m_size.y = Mils2iu( 60 ); // Default pad size 60 mils.
53  m_drill.x = m_drill.y = Mils2iu( 30 ); // Default drill size 30 mils.
54  m_orient = 0; // Pad rotation in 1/10 degrees.
55  m_lengthPadToDie = 0;
56 
57  if( m_parent && m_parent->Type() == PCB_FOOTPRINT_T )
58  {
60  }
61 
62  SetShape( PAD_SHAPE_CIRCLE ); // Default pad shape is PAD_CIRCLE.
63  SetAnchorPadShape( PAD_SHAPE_CIRCLE ); // Default shape for custom shaped pads
64  // is PAD_CIRCLE.
65  SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle.
66  m_attribute = PAD_ATTRIB_PTH; // Default pad type is plated through hole
67  SetProperty( PAD_PROP_NONE ); // no special fabrication property
68  m_localClearance = 0;
72  // Parameters for round rect only:
73  m_roundedCornerScale = 0.25; // from IPC-7351C standard
74  // Parameters for chamfered rect only:
75  m_chamferScale = 0.2; // Size of chamfer: ratio of smallest of X,Y size
76  m_chamferPositions = RECT_NO_CHAMFER; // No chamfered corner
77 
78  m_zoneConnection = ZONE_CONNECTION::INHERITED; // Use parent setting by default
79  m_thermalWidth = 0; // Use parent setting by default
80  m_thermalGap = 0; // Use parent setting by default
81 
83 
84  // Set layers mask to default for a standard thru hole pad.
85  m_layerMask = PTHMask();
86 
87  SetSubRatsnest( 0 ); // used in ratsnest calculations
88 
89  SetDirty();
92  m_keepTopBottomLayer = true;
93 }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:527
int m_chamferPositions
Definition: pad.h:710
no special fabrication property
Definition: pad_shapes.h:96
int m_effectiveBoundingRadius
Definition: pad.h:689
wxSize m_drill
Definition: pad.h:701
double m_roundedCornerScale
Definition: pad.h:706
LSET m_layerMask
Definition: pad.h:724
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
void SetAnchorPadShape(PAD_SHAPE_T aShape)
Function SetAnchorPadShape Set the shape of the anchor pad for custm shped pads.
Definition: pad.h:203
void SetSubRatsnest(int aSubRatsnest)
Definition: pad.h:537
class PAD, a pad in a footprint
Definition: typeinfo.h:89
wxPoint m_pos
Definition: pad.h:668
PAD_ATTR_T m_attribute
Definition: pad.h:734
double m_localSolderPasteMarginRatio
Definition: pad.h:758
int m_localSolderPasteMargin
Definition: pad.h:757
int m_localSolderMaskMargin
Definition: pad.h:756
bool m_keepTopBottomLayer
Definition: pad.h:743
int m_localClearance
Definition: pad.h:755
double m_chamferScale
Definition: pad.h:708
int m_thermalGap
Definition: pad.h:763
int m_thermalWidth
Definition: pad.h:762
static LSET PTHMask()
layer set for a through hole pad
Definition: pcbnew/pad.cpp:143
double m_orient
Definition: pad.h:738
ZONE_CONNECTION m_zoneConnection
Definition: pad.h:761
void SetShape(PAD_SHAPE_T aShape)
Set the new shape of this pad.
Definition: pad.h:153
void SetDrillShape(PAD_DRILL_SHAPE_T aShape)
Definition: pad.h:341
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
wxSize m_size
Definition: pad.h:702
FOOTPRINT * GetParent() const
bool m_removeUnconnectedLayer
Definition: pad.h:742
void SetDirty()
Definition: pad.h:349
Plated through hole pad.
Definition: pad_shapes.h:80
wxPoint GetPosition() const override
Definition: footprint.h:200
int m_lengthPadToDie
Definition: pad.h:740
void SetProperty(PAD_PROP_T aProperty)
Definition: pcbnew/pad.cpp:577
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea
Definition: pad.h:696
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:161

References CUST_PAD_SHAPE_IN_ZONE_OUTLINE, GetParent(), FOOTPRINT::GetPosition(), INHERITED, m_attribute, m_chamferPositions, m_chamferScale, m_customShapeClearanceArea, m_drill, m_effectiveBoundingRadius, m_keepTopBottomLayer, m_layerMask, m_lengthPadToDie, m_localClearance, m_localSolderMaskMargin, m_localSolderPasteMargin, m_localSolderPasteMarginRatio, m_orient, EDA_ITEM::m_parent, m_pos, m_removeUnconnectedLayer, m_roundedCornerScale, m_size, m_thermalGap, m_thermalWidth, m_zoneConnection, PAD_ATTRIB_PTH, PAD_DRILL_SHAPE_CIRCLE, PAD_PROP_NONE, PAD_SHAPE_CIRCLE, PCB_FOOTPRINT_T, PTHMask(), RECT_NO_CHAMFER, SetAnchorPadShape(), SetDirty(), SetDrillShape(), SetProperty(), SetShape(), SetSubRatsnest(), and EDA_ITEM::Type().

Referenced by Clone().

◆ PAD() [2/2]

PAD::PAD ( const PAD aPad)

Definition at line 96 of file pcbnew/pad.cpp.

96  :
97  BOARD_CONNECTED_ITEM( aOther.GetParent(), PCB_PAD_T )
98 {
100 
101  ImportSettingsFrom( aOther );
102  SetPadToDieLength( aOther.GetPadToDieLength() );
103  SetPosition( aOther.GetPosition() );
104  SetPos0( aOther.GetPos0() );
105  SetName( aOther.GetName() );
106  SetPinFunction( aOther.GetPinFunction() );
107  SetSubRatsnest( aOther.GetSubRatsnest() );
108  m_effectiveBoundingRadius = aOther.m_effectiveBoundingRadius;
109  m_removeUnconnectedLayer = aOther.m_removeUnconnectedLayer;
110  m_keepTopBottomLayer = aOther.m_keepTopBottomLayer;
111  const_cast<KIID&>( m_Uuid ) = aOther.m_Uuid;
112 }
int m_effectiveBoundingRadius
Definition: pad.h:689
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12).
Definition: pad.h:129
void SetSubRatsnest(int aSubRatsnest)
Definition: pad.h:537
class PAD, a pad in a footprint
Definition: typeinfo.h:89
void SetPadToDieLength(int aLength)
Definition: pad.h:368
void ImportSettingsFrom(const PAD &aMasterPad)
Imports the pad settings from aMasterPad.
bool m_keepTopBottomLayer
Definition: pad.h:743
void SetPos0(const wxPoint &aPos)
Definition: pad.h:222
void SetPinFunction(const wxString &aName)
Set the pad function (pin name in schematic)
Definition: pad.h:135
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
Definition: eda_item.cpp:193
const KIID m_Uuid
Definition: eda_item.h:523
bool m_removeUnconnectedLayer
Definition: pad.h:742
void SetPosition(const wxPoint &aPos) override
Definition: pad.h:164

References GetName(), GetPadToDieLength(), GetPinFunction(), GetPos0(), GetPosition(), GetSubRatsnest(), ImportSettingsFrom(), m_effectiveBoundingRadius, m_keepTopBottomLayer, m_removeUnconnectedLayer, EDA_ITEM::m_Uuid, EDA_ITEM::operator=(), SetName(), SetPadToDieLength(), SetPinFunction(), SetPos0(), SetPosition(), and SetSubRatsnest().

Member Function Documentation

◆ addPadPrimitivesToPolygon()

void PAD::addPadPrimitivesToPolygon ( SHAPE_POLY_SET aMergedPolygon,
PCB_LAYER_ID  aLayer,
int  aError,
ERROR_LOC  aErrorLoc 
) const
private

Definition at line 178 of file pad_custom_shape_functions.cpp.

180 {
181  SHAPE_POLY_SET polyset;
182 
183  for( const std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
184  primitive->TransformShapeWithClearanceToPolygon( polyset, aLayer, 0, aError, aErrorLoc );
185 
187 
188  // Merge all polygons with the initial pad anchor shape
189  if( polyset.OutlineCount() )
190  {
191  aMergedPolygon->BooleanAdd( polyset, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
192  aMergedPolygon->Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
193  }
194 }
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_POLY_SET.
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677

References SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::Fracture(), m_editPrimitives, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, and SHAPE_POLY_SET::Simplify().

Referenced by GetBestAnchorPosition(), and MergePrimitivesAsPolygon().

◆ AddPrimitive()

void PAD::AddPrimitive ( PCB_SHAPE aPrimitive)

Add item to the custom shape primitives list.

Definition at line 161 of file pad_custom_shape_functions.cpp.

162 {
163  m_editPrimitives.emplace_back( aPrimitive );
164 
165  SetDirty();
166 }
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetDirty()
Definition: pad.h:349

References m_editPrimitives, and SetDirty().

Referenced by AppendPrimitives(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), and PAD_TOOL::recombinePad().

◆ AddPrimitiveArc()

void PAD::AddPrimitiveArc ( const wxPoint &  aCenter,
const wxPoint &  aStart,
int  aArcAngle,
int  aThickness 
)

Definition at line 80 of file pad_custom_shape_functions.cpp.

82 {
83  PCB_SHAPE* item = new PCB_SHAPE();
84  item->SetShape( S_ARC );
85  item->SetFilled( false );
86  item->SetCenter( aCenter );
87  item->SetArcStart( aStart );
88  item->SetAngle( aArcAngle );
89  item->SetWidth( aThickness );
90  m_editPrimitives.emplace_back( item );
91  SetDirty();
92 }
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
Arcs (with rounded ends)
Definition: board_item.h:52
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:128
void SetCenter(const wxPoint &aCenterPoint)
For arcs and circles:
Definition: pcb_shape.h:228
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetDirty()
Definition: pad.h:349
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
virtual void SetAngle(double aAngle, bool aUpdateEnd=true)
Function SetAngle sets the angle for arcs, and normalizes it within the range 0 - 360 degrees.
Definition: pcb_shape.cpp:444
void SetArcStart(const wxPoint &aArcStartPoint)
Initialize the start arc point.
Definition: pcb_shape.h:212

References m_editPrimitives, S_ARC, PCB_SHAPE::SetAngle(), PCB_SHAPE::SetArcStart(), PCB_SHAPE::SetCenter(), SetDirty(), PCB_SHAPE::SetFilled(), PCB_SHAPE::SetShape(), and PCB_SHAPE::SetWidth().

◆ AddPrimitiveCircle()

void PAD::AddPrimitiveCircle ( const wxPoint &  aCenter,
int  aRadius,
int  aThickness,
bool  aFilled 
)

Definition at line 111 of file pad_custom_shape_functions.cpp.

112 {
113  PCB_SHAPE* item = new PCB_SHAPE();
114  item->SetShape( S_CIRCLE );
115  item->SetFilled( aFilled );
116  item->SetStart( aCenter );
117  item->SetEnd( wxPoint( aCenter.x + aRadius, aCenter.y ) );
118  item->SetWidth( aThickness );
119  m_editPrimitives.emplace_back( item );
120  SetDirty();
121 }
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:128
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:147
void SetDirty()
Definition: pad.h:349
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
ring
Definition: board_item.h:53
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:158

References m_editPrimitives, S_CIRCLE, SetDirty(), PCB_SHAPE::SetEnd(), PCB_SHAPE::SetFilled(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetStart(), and PCB_SHAPE::SetWidth().

◆ AddPrimitiveCurve()

void PAD::AddPrimitiveCurve ( const wxPoint &  aStart,
const wxPoint &  aEnd,
const wxPoint &  aCtrl1,
const wxPoint &  aCtrl2,
int  aThickness 
)

Definition at line 95 of file pad_custom_shape_functions.cpp.

97 {
98  PCB_SHAPE* item = new PCB_SHAPE();
99  item->SetShape( S_CURVE );
100  item->SetFilled( false );
101  item->SetStart( aStart );
102  item->SetEnd( aEnd );
103  item->SetBezControl1( aCtrl1 );
104  item->SetBezControl2( aCtrl2 );
105  item->SetWidth( aThickness );
106  m_editPrimitives.emplace_back( item );
107  SetDirty();
108 }
void SetBezControl2(const wxPoint &aPoint)
Definition: pcb_shape.h:134
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:128
void SetBezControl1(const wxPoint &aPoint)
Definition: pcb_shape.h:131
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:147
void SetDirty()
Definition: pad.h:349
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
Bezier Curve.
Definition: board_item.h:55
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:158

References m_editPrimitives, S_CURVE, PCB_SHAPE::SetBezControl1(), PCB_SHAPE::SetBezControl2(), SetDirty(), PCB_SHAPE::SetEnd(), PCB_SHAPE::SetFilled(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetStart(), and PCB_SHAPE::SetWidth().

◆ AddPrimitivePoly() [1/2]

void PAD::AddPrimitivePoly ( const SHAPE_POLY_SET aPoly,
int  aThickness,
bool  aFilled 
)

Has meaning only for custom shape pads.

add a free shape to the shape list. the shape can be a polygon (outline can have a thickness) a thick segment a filled circle (thickness == 0) or ring a filled rect (thickness == 0) or rectangular outline a arc a bezier curve

Definition at line 39 of file pad_custom_shape_functions.cpp.

40 {
41  std::vector<wxPoint> points;
42 
43  // If aPoly has holes, convert it to a polygon with no holes.
44  SHAPE_POLY_SET poly_no_hole;
45  poly_no_hole.Append( aPoly );
47 
48  for( auto iter = poly_no_hole.CIterate(); iter; iter++ )
49  points.emplace_back( iter->x, iter->y );
50 
51  AddPrimitivePoly( points, aThickness, aFilled );
52 }
SHAPE_POLY_SET.
CONST_ITERATOR CIterate(int aFirst, int aLast, bool aIterateHoles=false) const
void Fracture(POLYGON_MODE aFastMode)
Converts a set of polygons with holes to a singe outline with "slits"/"fractures" connecting the oute...
void AddPrimitivePoly(const SHAPE_POLY_SET &aPoly, int aThickness, bool aFilled)
Has meaning only for custom shape pads.
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)

References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::CIterate(), SHAPE_POLY_SET::Fracture(), and SHAPE_POLY_SET::PM_STRICTLY_SIMPLE.

Referenced by MICROWAVE_TOOL::createFootprint().

◆ AddPrimitivePoly() [2/2]

void PAD::AddPrimitivePoly ( const std::vector< wxPoint > &  aPoly,
int  aThickness,
bool  aFilled 
)

Definition at line 55 of file pad_custom_shape_functions.cpp.

56 {
57  PCB_SHAPE* item = new PCB_SHAPE();
58  item->SetShape( S_POLYGON );
59  item->SetFilled( aFilled );
60  item->SetPolyPoints( aPoly );
61  item->SetWidth( aThickness );
62  m_editPrimitives.emplace_back( item );
63  SetDirty();
64 }
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
polygon (not yet used for tracks, but could be in microwave apps)
Definition: board_item.h:54
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:128
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetDirty()
Definition: pad.h:349
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
void SetPolyPoints(const std::vector< wxPoint > &aPoints)
Definition: pcb_shape.cpp:1046

References m_editPrimitives, S_POLYGON, SetDirty(), PCB_SHAPE::SetFilled(), PCB_SHAPE::SetPolyPoints(), PCB_SHAPE::SetShape(), and PCB_SHAPE::SetWidth().

◆ AddPrimitiveRect()

void PAD::AddPrimitiveRect ( const wxPoint &  aStart,
const wxPoint &  aEnd,
int  aThickness,
bool  aFilled 
)

Definition at line 124 of file pad_custom_shape_functions.cpp.

126 {
127  PCB_SHAPE* item = new PCB_SHAPE();
128  item->SetShape( S_RECT );
129  item->SetFilled( aFilled );
130  item->SetStart( aStart );
131  item->SetEnd( aEnd );
132  item->SetWidth( aThickness );
133  m_editPrimitives.emplace_back( item );
134  SetDirty();
135 }
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
segment with non rounded ends
Definition: board_item.h:51
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:128
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:147
void SetDirty()
Definition: pad.h:349
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:158

References m_editPrimitives, S_RECT, SetDirty(), PCB_SHAPE::SetEnd(), PCB_SHAPE::SetFilled(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetStart(), and PCB_SHAPE::SetWidth().

◆ AddPrimitiveSegment()

void PAD::AddPrimitiveSegment ( const wxPoint &  aStart,
const wxPoint &  aEnd,
int  aThickness 
)

Definition at line 67 of file pad_custom_shape_functions.cpp.

68 {
69  PCB_SHAPE* item = new PCB_SHAPE();
70  item->SetShape( S_SEGMENT );
71  item->SetFilled( false );
72  item->SetStart( aStart );
73  item->SetEnd( aEnd );
74  item->SetWidth( aThickness );
75  m_editPrimitives.emplace_back( item );
76  SetDirty();
77 }
void SetFilled(bool aFlag)
Definition: pcb_shape.h:94
usual segment : line with rounded ends
Definition: board_item.h:50
void SetShape(PCB_SHAPE_TYPE_T aShape)
Definition: pcb_shape.h:128
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetStart(const wxPoint &aStart)
Definition: pcb_shape.h:147
void SetDirty()
Definition: pad.h:349
void SetWidth(int aWidth)
Definition: pcb_shape.h:117
void SetEnd(const wxPoint &aEnd)
Definition: pcb_shape.h:158

References m_editPrimitives, S_SEGMENT, SetDirty(), PCB_SHAPE::SetEnd(), PCB_SHAPE::SetFilled(), PCB_SHAPE::SetShape(), PCB_SHAPE::SetStart(), and PCB_SHAPE::SetWidth().

◆ ApertureMask()

LSET PAD::ApertureMask ( )
static

layer set for an aperture pad

Definition at line 171 of file pcbnew/pad.cpp.

172 {
173  static LSET saved( 1, F_Paste );
174  return saved;
175 }
LSET is a set of PCB_LAYER_IDs.

References F_Paste.

Referenced by PAD_FIXTURE::MakeAperture(), and DIALOG_PAD_PROPERTIES::updatePadLayersList().

◆ AppendPrimitives()

void PAD::AppendPrimitives ( const std::vector< std::shared_ptr< PCB_SHAPE >> &  aPrimitivesList)

Import a custom shape primites list (composed of basic shapes) and add items to the current list.

Copies the input, which is not altered.

Definition at line 151 of file pad_custom_shape_functions.cpp.

152 {
153  // Add duplicates of aPrimitivesList to the pad primitives list:
154  for( const std::shared_ptr<PCB_SHAPE>& prim : aPrimitivesList )
155  AddPrimitive( new PCB_SHAPE( *prim ) );
156 
157  SetDirty();
158 }
void SetDirty()
Definition: pad.h:349
void AddPrimitive(PCB_SHAPE *aPrimitive)
Add item to the custom shape primitives list.

References AddPrimitive(), and SetDirty().

Referenced by ReplacePrimitives().

◆ BuildEffectivePolygon()

void PAD::BuildEffectivePolygon ( ) const

Definition at line 482 of file pcbnew/pad.cpp.

483 {
484  std::lock_guard<std::mutex> RAII_lock( m_polyBuildingLock );
485 
486  // If we had to wait for the lock then we were probably waiting for someone else to
487  // finish rebuilding the shapes. So check to see if they're clean now.
488  if( !m_polyDirty )
489  return;
490 
491  BOARD* board = GetBoard();
492  int maxError = board ? board->GetDesignSettings().m_MaxError : ARC_HIGH_DEF;
493 
494  // Polygon
495  //
496  m_effectivePolygon = std::make_shared<SHAPE_POLY_SET>();
498  ERROR_INSIDE );
499 
500  // Bounding radius
501  //
502  // PADSTACKS TODO: these will both need to cycle through all layers to get the largest
503  // values....
504  //
506 
507  for( int cnt = 0; cnt < m_effectivePolygon->OutlineCount(); ++cnt )
508  {
509  const SHAPE_LINE_CHAIN& poly = m_effectivePolygon->COutline( cnt );
510 
511  for( int ii = 0; ii < poly.PointCount(); ++ii )
512  {
513  int dist = KiROUND( ( poly.CPoint( ii ) - m_pos ).EuclideanNorm() );
515  }
516  }
517 
518  // All done
519  //
520  m_polyDirty = false;
521 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:134
std::mutex m_polyBuildingLock
Definition: pad.h:687
int m_effectiveBoundingRadius
Definition: pad.h:689
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
wxPoint m_pos
Definition: pad.h:668
int PointCount() const
Function PointCount()
const VECTOR2I & CPoint(int aIndex) const
Function Point()
std::shared_ptr< SHAPE_POLY_SET > m_effectivePolygon
Definition: pad.h:688
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Function TransformShapeWithClearanceToPolygon Convert the pad shape to a closed polygon.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189
SHAPE_LINE_CHAIN.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
bool m_polyDirty
Definition: pad.h:686

References SHAPE_LINE_CHAIN::CPoint(), ERROR_INSIDE, EuclideanNorm(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), KiROUND(), m_effectiveBoundingRadius, m_effectivePolygon, BOARD_DESIGN_SETTINGS::m_MaxError, m_polyBuildingLock, m_polyDirty, m_pos, SHAPE_LINE_CHAIN::PointCount(), TransformShapeWithClearanceToPolygon(), and UNDEFINED_LAYER.

Referenced by GetBoundingRadius(), and GetEffectivePolygon().

◆ BuildEffectiveShapes()

void PAD::BuildEffectiveShapes ( PCB_LAYER_ID  aLayer) const

Rebuilds the effective shape cache (and bounding box and radius) for the pad and clears the dirty bit.

Definition at line 310 of file pcbnew/pad.cpp.

311 {
312  std::lock_guard<std::mutex> RAII_lock( m_shapesBuildingLock );
313 
314  // If we had to wait for the lock then we were probably waiting for someone else to
315  // finish rebuilding the shapes. So check to see if they're clean now.
316  if( !m_shapesDirty )
317  return;
318 
319  BOARD* board = GetBoard();
320  int maxError = board ? board->GetDesignSettings().m_MaxError : ARC_HIGH_DEF;
321 
322  m_effectiveShape = std::make_shared<SHAPE_COMPOUND>();
323  m_effectiveHoleShape = nullptr;
324 
325  auto add = [this]( SHAPE* aShape )
326  {
327  m_effectiveShape->AddShape( aShape );
328  };
329 
330  wxPoint shapePos = ShapePos(); // Fetch only once; rotation involves trig
331  PAD_SHAPE_T effectiveShape = GetShape();
332 
333  if( GetShape() == PAD_SHAPE_CUSTOM )
334  effectiveShape = GetAnchorPadShape();
335 
336  switch( effectiveShape )
337  {
338  case PAD_SHAPE_CIRCLE:
339  add( new SHAPE_CIRCLE( shapePos, m_size.x / 2 ) );
340  break;
341 
342  case PAD_SHAPE_OVAL:
343  if( m_size.x == m_size.y ) // the oval pad is in fact a circle
344  add( new SHAPE_CIRCLE( shapePos, m_size.x / 2 ) );
345  else
346  {
347  wxSize half_size = m_size / 2;
348  int half_width = std::min( half_size.x, half_size.y );
349  wxPoint half_len( half_size.x - half_width, half_size.y - half_width );
350  RotatePoint( &half_len, m_orient );
351  add( new SHAPE_SEGMENT( shapePos - half_len, shapePos + half_len, half_width * 2 ) );
352  }
353  break;
354 
355  case PAD_SHAPE_RECT:
356  case PAD_SHAPE_TRAPEZOID:
357  case PAD_SHAPE_ROUNDRECT:
358  {
359  int r = ( effectiveShape == PAD_SHAPE_ROUNDRECT ) ? GetRoundRectCornerRadius() : 0;
360  wxPoint half_size( m_size.x / 2, m_size.y / 2 );
361  wxSize trap_delta( 0, 0 );
362 
363  if( r )
364  {
365  half_size -= wxPoint( r, r );
366 
367  // Avoid degenerated shapes (0 length segments) that always create issues
368  // For roundrect pad very near a circle, use only a circle
369  const int min_len = Millimeter2iu( 0.0001);
370 
371  if( half_size.x < min_len && half_size.y < min_len )
372  {
373  add( new SHAPE_CIRCLE( shapePos, r ) );
374  break;
375  }
376  }
377  else if( effectiveShape == PAD_SHAPE_TRAPEZOID )
378  {
379  trap_delta = m_deltaSize / 2;
380  }
381 
382  SHAPE_LINE_CHAIN corners;
383 
384  corners.Append( -half_size.x - trap_delta.y, half_size.y + trap_delta.x );
385  corners.Append( half_size.x + trap_delta.y, half_size.y - trap_delta.x );
386  corners.Append( half_size.x - trap_delta.y, -half_size.y + trap_delta.x );
387  corners.Append( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x );
388 
389  corners.Rotate( -DECIDEG2RAD( m_orient ) );
390  corners.Move( shapePos );
391 
392  // GAL renders rectangles faster than 4-point polygons so it's worth checking if our
393  // body shape is a rectangle.
394  if( corners.PointCount() == 4
395  &&
396  ( ( corners.CPoint( 0 ).y == corners.CPoint( 1 ).y
397  && corners.CPoint( 1 ).x == corners.CPoint( 2 ).x
398  && corners.CPoint( 2 ).y == corners.CPoint( 3 ).y
399  && corners.CPoint( 3 ).x == corners.CPoint( 0 ).x )
400  ||
401  ( corners.CPoint( 0 ).x == corners.CPoint( 1 ).x
402  && corners.CPoint( 1 ).y == corners.CPoint( 2 ).y
403  && corners.CPoint( 2 ).x == corners.CPoint( 3 ).x
404  && corners.CPoint( 3 ).y == corners.CPoint( 0 ).y )
405  )
406  )
407  {
408  int width = std::abs( corners.CPoint( 2 ).x - corners.CPoint( 0 ).x );
409  int height = std::abs( corners.CPoint( 2 ).y - corners.CPoint( 0 ).y );
410  VECTOR2I pos( std::min( corners.CPoint( 2 ).x, corners.CPoint( 0 ).x ),
411  std::min( corners.CPoint( 2 ).y, corners.CPoint( 0 ).y ) );
412 
413  add( new SHAPE_RECT( pos, width, height ) );
414  }
415  else
416  {
417  add( new SHAPE_SIMPLE( corners ) );
418  }
419 
420  if( r )
421  {
422  add( new SHAPE_SEGMENT( corners.CPoint( 0 ), corners.CPoint( 1 ), r * 2 ) );
423  add( new SHAPE_SEGMENT( corners.CPoint( 1 ), corners.CPoint( 2 ), r * 2 ) );
424  add( new SHAPE_SEGMENT( corners.CPoint( 2 ), corners.CPoint( 3 ), r * 2 ) );
425  add( new SHAPE_SEGMENT( corners.CPoint( 3 ), corners.CPoint( 0 ), r * 2 ) );
426  }
427  }
428  break;
429 
431  {
432  SHAPE_POLY_SET outline;
433 
436  GetChamferPositions(), maxError, ERROR_INSIDE );
437 
438  add( new SHAPE_SIMPLE( outline.COutline( 0 ) ) );
439  }
440  break;
441 
442  default:
443  wxFAIL_MSG( "PAD::buildEffectiveShapes: Unsupported pad shape: "
444  + PAD_SHAPE_T_asString( effectiveShape ) );
445  break;
446  }
447 
448  if( GetShape() == PAD_SHAPE_CUSTOM )
449  {
450  for( const std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
451  {
452  for( SHAPE* shape : primitive->MakeEffectiveShapes() )
453  {
454  shape->Rotate( -DECIDEG2RAD( m_orient ) );
455  shape->Move( shapePos );
456  add( shape );
457  }
458  }
459  }
460 
461  BOX2I bbox = m_effectiveShape->BBox();
462  m_effectiveBoundingBox = EDA_RECT( (wxPoint) bbox.GetPosition(),
463  wxSize( bbox.GetWidth(), bbox.GetHeight() ) );
464 
465  // Hole shape
466  //
467  wxSize half_size = m_drill / 2;
468  int half_width = std::min( half_size.x, half_size.y );
469  wxPoint half_len( half_size.x - half_width, half_size.y - half_width );
470 
471  RotatePoint( &half_len, m_orient );
472 
473  m_effectiveHoleShape = std::make_shared<SHAPE_SEGMENT>( m_pos - half_len, m_pos + half_len,
474  half_width * 2 );
475 
476  // All done
477  //
478  m_shapesDirty = false;
479 }
SHAPE_SIMPLE.
Definition: shape_simple.h:43
bool m_shapesDirty
Definition: pad.h:680
std::mutex m_shapesBuildingLock
Definition: pad.h:681
static std::string PAD_SHAPE_T_asString(PAD_SHAPE_T a)
Definition: pad_shapes.h:46
wxSize m_deltaSize
Definition: pad.h:727
wxSize m_drill
Definition: pad.h:701
void Move(const VECTOR2I &aVector) override
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aError, ERROR_LOC aErrorLoc)
convert a rectangle with rounded corners and/or chamfered corners to a polygon Convert rounded corner...
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
PAD_SHAPE_T GetShape() const
Definition: pad.h:162
wxPoint m_pos
Definition: pad.h:668
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
int PointCount() const
Function PointCount()
std::shared_ptr< SHAPE_COMPOUND > m_effectiveShape
Definition: pad.h:683
PAD_SHAPE_T
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition: pad_shapes.h:32
EDA_RECT m_effectiveBoundingBox
Definition: pad.h:682
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
std::shared_ptr< SHAPE_SEGMENT > m_effectiveHoleShape
Definition: pad.h:684
const VECTOR2I & CPoint(int aIndex) const
Function Point()
wxPoint ShapePos() const
Definition: pcbnew/pad.cpp:663
SHAPE_POLY_SET.
coord_type GetWidth() const
Definition: box2.h:197
const wxSize & GetSize() const
Definition: pad.h:229
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
double m_orient
Definition: pad.h:738
SHAPE.
Definition: shape.h:123
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: pad.h:176
const Vec & GetPosition() const
Definition: box2.h:194
int GetRoundRectCornerRadius() const
Definition: pcbnew/pad.cpp:243
wxSize m_size
Definition: pad.h:702
void Rotate(double aAngle, const VECTOR2I &aCenter=VECTOR2I(0, 0)) override
Function Rotate rotates all vertices by a given angle.
double GetChamferRectRatio() const
Definition: pad.h:522
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189
SHAPE_LINE_CHAIN.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Handle the component boundary box.
Definition: eda_rect.h:42
double DECIDEG2RAD(double deg)
Definition: trigo.h:221
coord_type GetHeight() const
Definition: box2.h:198
int GetChamferPositions() const
Definition: pad.h:530
static constexpr int Millimeter2iu(double mm)

References SHAPE_LINE_CHAIN::Append(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), DECIDEG2RAD(), ERROR_INSIDE, GetAnchorPadShape(), BOARD_ITEM::GetBoard(), GetChamferPositions(), GetChamferRectRatio(), BOARD::GetDesignSettings(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetPosition(), GetRoundRectCornerRadius(), GetShape(), GetSize(), BOX2< Vec >::GetWidth(), m_deltaSize, m_drill, m_editPrimitives, m_effectiveBoundingBox, m_effectiveHoleShape, m_effectiveShape, BOARD_DESIGN_SETTINGS::m_MaxError, m_orient, m_pos, m_shapesBuildingLock, m_shapesDirty, m_size, Millimeter2iu(), SHAPE_LINE_CHAIN::Move(), PAD_SHAPE_CHAMFERED_RECT, PAD_SHAPE_CIRCLE, PAD_SHAPE_CUSTOM, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, PAD_SHAPE_T_asString(), PAD_SHAPE_TRAPEZOID, SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::Rotate(), RotatePoint(), ShapePos(), TransformRoundChamferedRectToPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by GetBoundingBox(), GetEffectiveHoleShape(), and GetEffectiveShape().

◆ ClassOf()

static bool PAD::ClassOf ( const EDA_ITEM aItem)
inlinestatic

Definition at line 81 of file pad.h.

82  {
83  return aItem && PCB_PAD_T == aItem->Type();
84  }
class PAD, a pad in a footprint
Definition: typeinfo.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:161

References PCB_PAD_T, and EDA_ITEM::Type().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearEditFlags()

◆ ClearFlags()

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

Definition at line 202 of file eda_item.h.

202 { m_flags &= ~aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:529

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), FOOTPRINT::BuildPolyCourtyards(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SYMBOL_EDITOR_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), EE_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::narrowSelection(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_PIN_TOOL::RepeatPin(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 214 of file eda_item.h.

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

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

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 148 of file view_item.h.

149  {
150  m_viewPrivData = nullptr;
151  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:156

References KIGFX::VIEW_ITEM::m_viewPrivData.

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

◆ Clone()

EDA_ITEM * PAD::Clone ( ) const
overridevirtual

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

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

Returns
A clone of the item.

Reimplemented from EDA_ITEM.

Definition at line 1139 of file pcbnew/pad.cpp.

1140 {
1141  return new PAD( *this );
1142 }
PAD(FOOTPRINT *parent)
Definition: pcbnew/pad.cpp:49

References PAD().

Referenced by ClonePad().

◆ ClonePad()

PAD* PAD::ClonePad ( ) const
inline

same as Clone, but returns a PAD item.

Useful mainly for python scripts, because Clone returns an EDA_ITEM.

Definition at line 635 of file pad.h.

636  {
637  return (PAD*) Clone();
638  }
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pad.h:60

References Clone().

◆ Compare()

int PAD::Compare ( const PAD padref,
const PAD padcmp 
)
static

Function Compare compares two pads and return 0 if they are equal.

Returns
int - <0 if left less than right, 0 if equal, >0 if left greater than right.

Definition at line 1001 of file pcbnew/pad.cpp.

1002 {
1003  int diff;
1004 
1005  if( ( diff = padref->GetShape() - padcmp->GetShape() ) != 0 )
1006  return diff;
1007 
1008  if( ( diff = padref->GetDrillShape() - padcmp->GetDrillShape() ) != 0)
1009  return diff;
1010 
1011  if( ( diff = padref->m_drill.x - padcmp->m_drill.x ) != 0 )
1012  return diff;
1013 
1014  if( ( diff = padref->m_drill.y - padcmp->m_drill.y ) != 0 )
1015  return diff;
1016 
1017  if( ( diff = padref->m_size.x - padcmp->m_size.x ) != 0 )
1018  return diff;
1019 
1020  if( ( diff = padref->m_size.y - padcmp->m_size.y ) != 0 )
1021  return diff;
1022 
1023  if( ( diff = padref->m_offset.x - padcmp->m_offset.x ) != 0 )
1024  return diff;
1025 
1026  if( ( diff = padref->m_offset.y - padcmp->m_offset.y ) != 0 )
1027  return diff;
1028 
1029  if( ( diff = padref->m_deltaSize.x - padcmp->m_deltaSize.x ) != 0 )
1030  return diff;
1031 
1032  if( ( diff = padref->m_deltaSize.y - padcmp->m_deltaSize.y ) != 0 )
1033  return diff;
1034 
1035 // TODO: test custom shapes
1036 
1037  // Dick: specctra_export needs this
1038  // Lorenzo: gencad also needs it to implement padstacks!
1039 
1040 #if __cplusplus >= 201103L
1041  long long d = padref->m_layerMask.to_ullong() - padcmp->m_layerMask.to_ullong();
1042  if( d < 0 )
1043  return -1;
1044  else if( d > 0 )
1045  return 1;
1046 
1047  return 0;
1048 #else
1049  // these strings are not typically constructed, since we don't get here often.
1050  std::string s1 = padref->m_layerMask.to_string();
1051  std::string s2 = padcmp->m_layerMask.to_string();
1052  return s1.compare( s2 );
1053 #endif
1054 }
wxSize m_deltaSize
Definition: pad.h:727
wxSize m_drill
Definition: pad.h:701
LSET m_layerMask
Definition: pad.h:724
PAD_SHAPE_T GetShape() const
Definition: pad.h:162
wxSize m_size
Definition: pad.h:702
wxPoint m_offset
Definition: pad.h:722
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: pad.h:342

References GetDrillShape(), GetShape(), m_deltaSize, m_drill, m_layerMask, m_offset, and m_size.

Referenced by CreatePadsShapesSection().

◆ ConnSMDMask()

LSET PAD::ConnSMDMask ( )
static

layer set for a SMD pad on Front layer used for edge board connectors

Definition at line 157 of file pcbnew/pad.cpp.

158 {
159  static LSET saved( 2, F_Cu, F_Mask );
160  return saved;
161 }
LSET is a set of PCB_LAYER_IDs.

References F_Cu, and F_Mask.

Referenced by DIALOG_PAD_PROPERTIES::updatePadLayersList().

◆ DeletePrimitivesList()

void PAD::DeletePrimitivesList ( )

clear the basic shapes list

Definition at line 170 of file pad_custom_shape_functions.cpp.

171 {
172  m_editPrimitives.clear();
173 
174  SetDirty();
175 }
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetDirty()
Definition: pad.h:349

References m_editPrimitives, and SetDirty().

Referenced by PAD_TOOL::explodePad(), ReplacePrimitives(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ DeleteStructure()

void BOARD_ITEM::DeleteStructure ( )
inherited

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

Definition at line 113 of file board_item.cpp.

114 {
115  BOARD_ITEM_CONTAINER* parent = GetParent();
116 
117  if( parent )
118  parent->Remove( this );
119 
120  delete this;
121 }
virtual void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL)=0
Removes an item from the container.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168

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

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

◆ Duplicate()

virtual BOARD_ITEM* BOARD_ITEM::Duplicate ( ) const
inlinevirtualinherited

Create a copy of a of this BOARD_ITEM.

Reimplemented in FOOTPRINT.

Definition at line 202 of file board_item.h.

203  {
204  EDA_ITEM* dupe = Clone();
205  const_cast<KIID&>( dupe->m_Uuid ) = KIID();
206 
207  return static_cast<BOARD_ITEM*>( dupe );
208  }
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
Definition: kiid.h:44
const KIID m_Uuid
Definition: eda_item.h:523
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148

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

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

◆ FlashLayer() [1/2]

bool PAD::FlashLayer ( int  aLayer,
bool  aIncludeZones = false 
) const

Checks to see whether the pad should be flashed on the specific layer.

Parameters
aLayerLayer to check for connectivity
aIncludeZonesWe include zones in potentially connected elements when drawing
Returns
true if connected by pad or track (or optionally zone)

Normally, we don't need to include zones in our flash check because the zones will fill over the hole. But, when we are drawing the pad in pcbnew, it is helpful to show the annular ring where the pad is connected

We don't remove the copper from non-PTH pads

Heatsink pads always get copper

Plated through hole pads need copper on the top/bottom layers for proper soldering Unless the user has removed them in the pad dialog

Definition at line 198 of file pcbnew/pad.cpp.

199 {
200  std::vector<KICAD_T> types{ PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T };
201 
207  if( aIncludeZones )
208  {
209  types.push_back( PCB_ZONE_T );
210  types.push_back( PCB_FP_ZONE_T );
211  }
212 
213  // Return the "normal" shape if the caller doesn't specify a particular layer
214  if( aLayer == UNDEFINED_LAYER )
215  return true;
216 
217  BOARD* board = GetBoard();
218 
219  if( !board )
220  return false;
221 
223  if( GetAttribute() != PAD_ATTRIB_PTH )
224  return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
225 
227  if( GetProperty() == PAD_PROP_HEATSINK )
228  return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
229 
231  return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
232 
235  if( m_keepTopBottomLayer && ( aLayer == F_Cu || aLayer == B_Cu ) )
236  return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
237 
238  return board->GetConnectivity()->IsConnectedOnLayer( this, static_cast<int>( aLayer ),
239  types );
240 }
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: pad.h:555
class PAD, a pad in a footprint
Definition: typeinfo.h:89
a pad used as heat sink, usually in SMD footprints
Definition: pad_shapes.h:101
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
PAD_ATTR_T GetAttribute() const
Definition: pad.h:359
bool m_keepTopBottomLayer
Definition: pad.h:743
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:397
class ZONE, a copper pour area
Definition: typeinfo.h:105
PAD_PROP_T GetProperty() const
Definition: pad.h:362
bool m_removeUnconnectedLayer
Definition: pad.h:742
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189
class ZONE, managed by a footprint
Definition: typeinfo.h:94
Plated through hole pad.
Definition: pad_shapes.h:80
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96

References B_Cu, F_Cu, GetAttribute(), BOARD_ITEM::GetBoard(), BOARD::GetConnectivity(), GetProperty(), IsOnLayer(), m_keepTopBottomLayer, m_removeUnconnectedLayer, PAD_ATTRIB_PTH, PAD_PROP_HEATSINK, PCB_ARC_T, PCB_FP_ZONE_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, and UNDEFINED_LAYER.

Referenced by KIGFX::PCB_PAINTER::draw(), FlashLayer(), PNS_KICAD_IFACE::IsFlashedOnLayer(), DIALOG_DRC::OnDRCItemSelected(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), and ViewGetLOD().

◆ FlashLayer() [2/2]

bool PAD::FlashLayer ( LSET  aLayers,
bool  aIncludeZones = false 
) const

Checks to see if the pad should be flashed to any of the layers in the set.

Parameters
aLayersset of layers to check the via against
aIncludeZonesWe include zones in potentially connected elements when drawing
Returns
true if connected by pad or track (or optionally zone) on any of the associated layers

Definition at line 186 of file pcbnew/pad.cpp.

187 {
188  for( auto layer : aLayers.Seq() )
189  {
190  if( FlashLayer( layer, aIncludeZones ) )
191  return true;
192  }
193 
194  return false;
195 }
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
bool FlashLayer(int aLayer, bool aIncludeZones=false) const
Checks to see whether the pad should be flashed on the specific layer.
Definition: pcbnew/pad.cpp:198

References FlashLayer(), and LSET::Seq().

◆ Flip() [1/2]

void PAD::Flip ( const wxPoint &  aCentre,
bool  aFlipLeftRight 
)
overridevirtual

Flip this object, i.e.

change the board side for this object.

Parameters
aCentrethe rotation point.
aFlipLeftRightmirror across Y axis instead of X (the default).

Reimplemented from BOARD_ITEM.

Definition at line 594 of file pcbnew/pad.cpp.

595 {
596  if( aFlipLeftRight )
597  {
598  MIRROR( m_pos.x, aCentre.x );
599  MIRROR( m_pos0.x, 0 );
600  MIRROR( m_offset.x, 0 );
601  MIRROR( m_deltaSize.x, 0 );
602  }
603  else
604  {
605  MIRROR( m_pos.y, aCentre.y );
606  MIRROR( m_pos0.y, 0 );
607  MIRROR( m_offset.y, 0 );
608  MIRROR( m_deltaSize.y, 0 );
609  }
610 
612 
613  auto mirrorBitFlags = []( int& aBitfield, int a, int b )
614  {
615  bool temp = aBitfield & a;
616 
617  if( aBitfield & b )
618  aBitfield |= a;
619  else
620  aBitfield &= ~a;
621 
622  if( temp )
623  aBitfield |= b;
624  else
625  aBitfield &= ~b;
626  };
627 
628  if( aFlipLeftRight )
629  {
632  }
633  else
634  {
637  }
638 
639  // flip pads layers
640  // PADS items are currently on all copper layers, or
641  // currently, only on Front or Back layers.
642  // So the copper layers count is not taken in account
644 
645  // Flip the basic shapes, in custom pads
646  FlipPrimitives( aFlipLeftRight );
647 
648  SetDirty();
649 }
void FlipPrimitives(bool aFlipLeftRight)
Flip (mirror) the primitives left to right or top to bottom, around the anchor position in custom pad...
Definition: pcbnew/pad.cpp:653
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint.
Definition: lset.cpp:567
int m_chamferPositions
Definition: pad.h:710
wxSize m_deltaSize
Definition: pad.h:727
LSET m_layerMask
Definition: pad.h:724
wxPoint m_pos
Definition: pad.h:668
wxPoint m_pos0
Definition: pad.h:731
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Definition: mirror.h:40
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in a variety of units (the basic call r...
Definition: pad.h:337
wxPoint m_offset
Definition: pad.h:722
void SetLayerSet(LSET aLayers) override
Definition: pad.h:355
void SetDirty()
Definition: pad.h:349
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: pcbnew/pad.cpp:585

References FlipLayerMask(), FlipPrimitives(), GetOrientation(), m_chamferPositions, m_deltaSize, m_layerMask, m_offset, m_pos, m_pos0, MIRROR(), RECT_CHAMFER_BOTTOM_LEFT, RECT_CHAMFER_BOTTOM_RIGHT, RECT_CHAMFER_TOP_LEFT, RECT_CHAMFER_TOP_RIGHT, SetDirty(), SetLayerSet(), and SetOrientation().

Referenced by DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ Flip() [2/2]

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

Definition at line 315 of file board_item.h.

316  {
317  Flip( wxPoint( aCentre.x, aCentre.y ), aFlipLeftRight );
318  }
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight)
Flip this object, i.e.
Definition: board_item.h:310

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

◆ FlipPrimitives()

void PAD::FlipPrimitives ( bool  aFlipLeftRight)

Flip (mirror) the primitives left to right or top to bottom, around the anchor position in custom pads.

Definition at line 653 of file pcbnew/pad.cpp.

654 {
655  for( std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
656  primitive->Flip( wxPoint( 0, 0 ), aFlipLeftRight );
657 
658  SetDirty();
659 }
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677
void SetDirty()
Definition: pad.h:349

References m_editPrimitives, and SetDirty().

Referenced by Flip(), and mirrorPadX().

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 84 of file inspectable.h.

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

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

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

◆ Get() [2/3]

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

Definition at line 93 of file inspectable.h.

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

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

◆ Get() [3/3]

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

Definition at line 102 of file inspectable.h.

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

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

◆ GetAnchorPadShape()

PAD_SHAPE_T PAD::GetAnchorPadShape ( ) const
inline

Function GetAnchorPadShape.

Returns
the shape of the anchor pad shape, for custom shaped pads.

Definition at line 176 of file pad.h.

176 { return m_anchorPadShape; }
PAD_SHAPE_T m_anchorPadShape
Definition: pad.h:712

References m_anchorPadShape.

Referenced by BuildEffectiveShapes(), PAD_TOOL::explodePad(), PCB_IO::format(), GetBestAnchorPosition(), ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::initValues(), MergePrimitivesAsPolygon(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ GetAttribute()

◆ GetBestAnchorPosition()

bool PAD::GetBestAnchorPosition ( VECTOR2I aPos)

Definition at line 225 of file pad_custom_shape_functions.cpp.

226 {
227  SHAPE_POLY_SET poly;
229 
230  if( poly.OutlineCount() > 1 )
231  return false;
232 
233  const int minSteps = 10;
234  const int maxSteps = 50;
235 
236  int stepsX, stepsY;
237 
238  auto bbox = poly.BBox();
239 
240  if( bbox.GetWidth() < bbox.GetHeight() )
241  {
242  stepsX = minSteps;
243  stepsY = minSteps * (double) bbox.GetHeight() / (double )(bbox.GetWidth() + 1);
244  }
245  else
246  {
247  stepsY = minSteps;
248  stepsX = minSteps * (double) bbox.GetWidth() / (double )(bbox.GetHeight() + 1);
249  }
250 
251  stepsX = std::max(minSteps, std::min( maxSteps, stepsX ) );
252  stepsY = std::max(minSteps, std::min( maxSteps, stepsY ) );
253 
254  VECTOR2I center = bbox.Centre();
255 
256  int64_t minDist = std::numeric_limits<int64_t>::max();
257  int64_t minDistEdge;
258 
260  {
261  minDistEdge = GetSize().x;
262  }
263  else
264  {
265  minDistEdge = std::max( GetSize().x, GetSize().y );
266  }
267 
268  OPT<VECTOR2I> bestAnchor( []()->OPT<VECTOR2I> { return NULLOPT; }() );
269 
270  for( int y = 0; y < stepsY ; y++ )
271  {
272  for( int x = 0; x < stepsX; x++ )
273  {
274  VECTOR2I p = bbox.GetPosition();
275  p.x += rescale( x, bbox.GetWidth(), (stepsX - 1) );
276  p.y += rescale( y, bbox.GetHeight(), (stepsY - 1) );
277 
278  if( poly.Contains(p) )
279  {
280 
281  int dist = (center - p).EuclideanNorm();
282  int distEdge = poly.COutline(0).Distance( p, true );
283 
284  if( distEdge >= minDistEdge )
285  {
286  if( dist < minDist )
287  {
288  bestAnchor = p;
289  minDist = dist;
290  }
291  }
292  }
293  }
294  }
295 
296  if( bestAnchor )
297  {
298  aPos = *bestAnchor;
299  return true;
300  }
301 
302  return false;
303 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:134
int OutlineCount() const
Returns the number of outlines in the set
int Distance(const VECTOR2I &aP, bool aOutlineOnly=false) const
Function Distance()
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.
const auto NULLOPT
Definition: optional.h:9
SHAPE_POLY_SET.
const wxSize & GetSize() const
Definition: pad.h:229
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: pad.h:176
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
T rescale(T aNumerator, T aValue, T aDenominator)
Function rescale()
Definition: util.h:95
coord_type GetHeight() const
Definition: box2.h:198
boost::optional< T > OPT
Definition: optional.h:7
const BOX2I BBox(int aClearance=0) const override
Function BBox()
void addPadPrimitivesToPolygon(SHAPE_POLY_SET *aMergedPolygon, PCB_LAYER_ID aLayer, int aError, ERROR_LOC aErrorLoc) const

References addPadPrimitivesToPolygon(), SHAPE_POLY_SET::BBox(), SHAPE_POLY_SET::Contains(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::Distance(), ERROR_INSIDE, EuclideanNorm(), GetAnchorPadShape(), BOX2< Vec >::GetHeight(), GetSize(), NULLOPT, SHAPE_POLY_SET::OutlineCount(), PAD_SHAPE_CIRCLE, rescale(), UNDEFINED_LAYER, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ GetBoard()

BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

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

Definition at line 46 of file board_item.cpp.

47 {
48  if( Type() == PCB_T )
49  return (BOARD*) this;
50 
51  BOARD_ITEM* parent = GetParent();
52 
53  if( parent )
54  return parent->GetBoard();
55 
56  return NULL;
57 }
Definition: typeinfo.h:84
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
#define NULL
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:161

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

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

◆ GetBoundingBox()

const EDA_RECT PAD::GetBoundingBox ( ) const
overridevirtual

Function GetBoundingBox The bounding box is cached, so this will be efficient most of the time.

Reimplemented from EDA_ITEM.

Definition at line 524 of file pcbnew/pad.cpp.

525 {
526  if( m_shapesDirty )
528 
529  return m_effectiveBoundingBox;
530 }
bool m_shapesDirty
Definition: pad.h:680
EDA_RECT m_effectiveBoundingBox
Definition: pad.h:682
void BuildEffectiveShapes(PCB_LAYER_ID aLayer) const
Rebuilds the effective shape cache (and bounding box and radius) for the pad and clears the dirty bit...
Definition: pcbnew/pad.cpp:310

References BuildEffectiveShapes(), m_effectiveBoundingBox, m_shapesDirty, and UNDEFINED_LAYER.

Referenced by AR_AUTOPLACER::addPad(), ZONE_FILLER::buildThermalSpokes(), KIGFX::PCB_PAINTER::draw(), hasThermalConnection(), HitTest(), DSN::SPECCTRA_DB::makePADSTACK(), ViewBBox(), and ViewGetLOD().

◆ GetBoundingRadius()

int PAD::GetBoundingRadius ( ) const

Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad.

The center is the pad position NOT THE SHAPE POS!

Definition at line 301 of file pcbnew/pad.cpp.

302 {
303  if( m_polyDirty )
305 
307 }
int m_effectiveBoundingRadius
Definition: pad.h:689
void BuildEffectivePolygon() const
Definition: pcbnew/pad.cpp:482
bool m_polyDirty
Definition: pad.h:686

References BuildEffectivePolygon(), m_effectiveBoundingRadius, and m_polyDirty.

Referenced by HitTest().

◆ GetCenter()

wxPoint PAD::GetCenter ( ) const
inlineoverridevirtual

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

Returns
center point of the item

Reimplemented from BOARD_ITEM.

Definition at line 248 of file pad.h.

248 { return GetPosition(); }
wxPoint GetPosition() const override
Definition: pad.h:170

References GetPosition().

◆ GetChamferPositions()

◆ GetChamferRectRatio()

◆ GetClass()

wxString PAD::GetClass ( ) const
inlineoverridevirtual

Return the class name.

Implements EDA_ITEM.

Definition at line 579 of file pad.h.

580  {
581  return wxT( "PAD" );
582  }

◆ GetCustomShapeInZoneOpt()

CUST_PAD_SHAPE_IN_ZONE PAD::GetCustomShapeInZoneOpt ( ) const
inline
Returns
the option for the custom pad shape to use as clearance area in copper zones

Definition at line 182 of file pad.h.

183  {
185  }
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea
Definition: pad.h:696

References m_customShapeClearanceArea.

Referenced by ZONE_FILLER::addKnockout(), PCB_IO::format(), ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ GetDelta()

◆ GetDrillShape()

◆ GetDrillSize()

◆ GetDrillSizeX()

const int PAD::GetDrillSizeX ( ) const
inline

Definition at line 241 of file pad.h.

241 { return m_drill.x; }
wxSize m_drill
Definition: pad.h:701

References m_drill.

Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and PAD_DESC::PAD_DESC().

◆ GetDrillSizeY()

const int PAD::GetDrillSizeY ( ) const
inline

Definition at line 243 of file pad.h.

243 { return m_drill.y; }
wxSize m_drill
Definition: pad.h:701

References m_drill.

Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and PAD_DESC::PAD_DESC().

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 206 of file eda_item.h.

207  {
208  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
210 
211  return m_flags & mask;
212  }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:107
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:115
#define IS_MOVED
Item being moved.
Definition: eda_item.h:105
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:108
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:119
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110
STATUS_FLAGS m_flags
Definition: eda_item.h:529
#define IS_NEW
New item, just created.
Definition: eda_item.h:106

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, IS_WIRE_IMAGE, EDA_ITEM::m_flags, and STRUCT_DELETED.

Referenced by SCH_EDIT_TOOL::ChangeTextType(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithLibEdit(), SCH_COMPONENT::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), PAD_TOOL::recombinePad(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), and SCH_EDIT_FRAME::TrimWire().

◆ GetEffectiveHoleShape()

const SHAPE_SEGMENT * PAD::GetEffectiveHoleShape ( ) const

Function GetEffectiveHoleShape Returns a SHAPE object representing the pad's hole.

Definition at line 292 of file pcbnew/pad.cpp.

293 {
294  if( m_shapesDirty )
296 
297  return m_effectiveHoleShape.get();
298 }
bool m_shapesDirty
Definition: pad.h:680
std::shared_ptr< SHAPE_SEGMENT > m_effectiveHoleShape
Definition: pad.h:684
void BuildEffectiveShapes(PCB_LAYER_ID aLayer) const
Rebuilds the effective shape cache (and bounding box and radius) for the pad and clears the dirty bit...
Definition: pcbnew/pad.cpp:310

References BuildEffectiveShapes(), m_effectiveHoleShape, m_shapesDirty, and UNDEFINED_LAYER.

Referenced by BOARD_ADAPTER::createPadWithDrill(), KIGFX::PCB_PAINTER::draw(), getShape(), insideArea(), DIALOG_PAD_PROPERTIES::padValuesOK(), PNS_KICAD_IFACE_BASE::syncPad(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), and TransformHoleWithClearanceToPolygon().

◆ GetEffectiveNetclass()

NETCLASS * BOARD_CONNECTED_ITEM::GetEffectiveNetclass ( ) const
virtualinherited

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

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

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

◆ GetEffectivePolygon()

const std::shared_ptr< SHAPE_POLY_SET > & PAD::GetEffectivePolygon ( ) const

Definition at line 274 of file pcbnew/pad.cpp.

275 {
276  if( m_polyDirty )
278 
279  return m_effectivePolygon;
280 }
std::shared_ptr< SHAPE_POLY_SET > m_effectivePolygon
Definition: pad.h:688
void BuildEffectivePolygon() const
Definition: pcbnew/pad.cpp:482
bool m_polyDirty
Definition: pad.h:686

References BuildEffectivePolygon(), m_effectivePolygon, and m_polyDirty.

Referenced by BOARD_ADAPTER::buildPadOutlineAsPolygon(), BOARD_ADAPTER::buildPadOutlineAsSegments(), CN_ITEM::GetAnchor(), HitTest(), BRDITEMS_PLOTTER::PlotPad(), and PNS_KICAD_IFACE_BASE::syncPad().

◆ GetEffectiveShape()

std::shared_ptr< SHAPE > PAD::GetEffectiveShape ( PCB_LAYER_ID  aLayer = UNDEFINED_LAYER) const
overridevirtual

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

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

Note
This list can contain a SHAPE_SIMPLE (a simple single-outline non-intersecting polygon), but should never contain a SHAPE_POLY_SET (a complex polygon consisting of multiple outlines and/or holes).
Parameters
aLayerin case of items spanning multiple layers, only the shapes belonging to aLayer will be returned. Pass UNDEFINED_LAYER to return shapes for all layers.

Reimplemented from BOARD_ITEM.

Definition at line 283 of file pcbnew/pad.cpp.

284 {
285  if( m_shapesDirty )
286  BuildEffectiveShapes( aLayer );
287 
288  return m_effectiveShape;
289 }
bool m_shapesDirty
Definition: pad.h:680
std::shared_ptr< SHAPE_COMPOUND > m_effectiveShape
Definition: pad.h:683
void BuildEffectiveShapes(PCB_LAYER_ID aLayer) const
Rebuilds the effective shape cache (and bounding box and radius) for the pad and clears the dirty bit...
Definition: pcbnew/pad.cpp:310

References BuildEffectiveShapes(), m_effectiveShape, and m_shapesDirty.

Referenced by BOARD_ADAPTER::createPadWithClearance(), KIGFX::PCB_PAINTER::draw(), and PNS_KICAD_IFACE_BASE::syncPad().

◆ GetEffectiveThermalGap()

int PAD::GetEffectiveThermalGap ( wxString *  aSource = nullptr) const

Return the effective thermal gap having resolved any inheritance.

Definition at line 838 of file pcbnew/pad.cpp.

839 {
840  FOOTPRINT* parentFootprint = GetParent();
841 
842  if( m_thermalGap == 0 && parentFootprint )
843  {
844  if( aSource )
845  *aSource = _( "parent footprint" );
846 
847  return parentFootprint->GetThermalGap();
848  }
849 
850  if( aSource )
851  *aSource = _( "pad" );
852 
853  return m_thermalGap;
854 }
int m_thermalGap
Definition: pad.h:763
FOOTPRINT * GetParent() const
#define _(s)
Definition: 3d_actions.cpp:33
int GetThermalGap() const
Definition: footprint.h:247

References _, GetParent(), FOOTPRINT::GetThermalGap(), and m_thermalGap.

Referenced by ZONE::GetThermalReliefGap().

◆ GetEffectiveThermalSpokeWidth()

int PAD::GetEffectiveThermalSpokeWidth ( wxString *  aSource = nullptr) const

Return the effective thermal spoke width having resolved any inheritance.

Definition at line 819 of file pcbnew/pad.cpp.

820 {
821  FOOTPRINT* parentFootprint = GetParent();
822 
823  if( m_thermalWidth == 0 && parentFootprint )
824  {
825  if( aSource )
826  *aSource = _( "parent footprint" );
827 
828  return parentFootprint->GetThermalWidth();
829  }
830 
831  if( aSource )
832  *aSource = _( "pad" );
833 
834  return m_thermalWidth;
835 }
int m_thermalWidth
Definition: pad.h:762
int GetThermalWidth() const
Definition: footprint.h:244
FOOTPRINT * GetParent() const
#define _(s)
Definition: 3d_actions.cpp:33

References _, GetParent(), FOOTPRINT::GetThermalWidth(), and m_thermalWidth.

Referenced by ZONE::GetThermalReliefSpokeWidth().

◆ GetEffectiveZoneConnection()

ZONE_CONNECTION PAD::GetEffectiveZoneConnection ( wxString *  aSource = nullptr) const

Return the zone connection in effect (either locally overridden or overridden in the parent footprint).

Optionally reports on the source of the property (pad, parent footprint or zone).

Definition at line 798 of file pcbnew/pad.cpp.

799 {
800  FOOTPRINT* parentFootprint = GetParent();
801 
802  if( m_zoneConnection == ZONE_CONNECTION::INHERITED && parentFootprint )
803  {
804  if( aSource )
805  *aSource = _( "parent footprint" );
806 
807  return parentFootprint->GetZoneConnection();
808  }
809  else
810  {
811  if( aSource )
812  *aSource = _( "pad" );
813 
814  return m_zoneConnection;
815  }
816 }
ZONE_CONNECTION m_zoneConnection
Definition: pad.h:761
FOOTPRINT * GetParent() const
#define _(s)
Definition: 3d_actions.cpp:33
ZONE_CONNECTION GetZoneConnection() const
Definition: footprint.h:241

References _, GetParent(), FOOTPRINT::GetZoneConnection(), INHERITED, and m_zoneConnection.

Referenced by PCB_IO::format(), ZONE::GetPadConnection(), ImportSettingsFrom(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

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

Reimplemented in BOARD, PCB_SHAPE, and TRACK.

Definition at line 307 of file eda_item.h.

307 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:300

References EDA_ITEM::GetPosition().

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

◆ GetKeepTopBottom()

bool PAD::GetKeepTopBottom ( ) const
inline

◆ GetLayer()

virtual PCB_LAYER_ID BOARD_ITEM::GetLayer ( ) const
inlinevirtualinherited

Return the primary layer this item is on.

Reimplemented in ZONE.

Definition at line 173 of file board_item.h.

173 { return m_layer; }
PCB_LAYER_ID m_layer
Definition: board_item.h:363

References BOARD_ITEM::m_layer.

Referenced by CN_LIST::Add(), BOARD_ADAPTER::addFootprintShapesWithClearance(), GRAPHICS_CLEANER::areEquivalent(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), BOARD_ITEM_DESC::BOARD_ITEM_DESC(), AR_AUTOPLACER::buildFpAreas(), TRACKS_CLEANER::cleanup(), CreateBoardSection(), MICROWAVE_TOOL::createMicrowaveInductor(), PCB_BASE_FRAME::CreateNewFootprint(), CreateRoutesSection(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), KIGFX::PCB_PAINTER::draw(), PCB_EDIT_FRAME::ExchangeFootprint(), export_vrml_drawsegment(), export_vrml_footprint(), export_vrml_fp_shape(), export_vrml_fp_text(), export_vrml_pcbtext(), export_vrml_tracks(), extractDiffPairCoupledItems(), EDIT_TOOL::FilletTracks(), PCB_TARGET::Flip(), PCB_TEXT::Flip(), FP_SHAPE::Flip(), TRACK::Flip(), FP_TEXT::Flip(), DIMENSION_BASE::Flip(), FOOTPRINT::Flip(), ARC::Flip(), PCB_SHAPE::Flip(), FOOTPRINT_DESC::FOOTPRINT_DESC(), PCB_IO::FootprintSave(), FootprintWriteShape(), PCB_IO::format(), PCB_IO::formatLayer(), FP_TEXT::FP_TEXT(), DSN::SPECCTRA_DB::FromBOARD(), AR_AUTOPLACER::genModuleOnRoutingMatrix(), FOOTPRINT::GetBoundingBox(), ZONE::GetLayer(), getMatchingTextItem(), TRACK::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), GetMsgPanelInfo(), AR_AUTOPLACER::getOptimalFPPlacement(), BOARD::GetPad(), TEXT_MOD_GRID_TABLE::GetValueAsLong(), TRACK::GetWidthConstraints(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), idf_export_footprint(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), IsFlipped(), PNS_KICAD_IFACE::IsItemVisible(), BOARD_ITEM::IsOnCopperLayer(), FP_SHAPE::IsParentFlipped(), FP_TEXT::IsParentFlipped(), itemIsIncludedByFilter(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), DIALOG_FOOTPRINT_FP_EDITOR::OnAddField(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), TRACK::cmp_tracks::operator()(), PCB_SHAPE::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), EAGLE_PLUGIN::packagePad(), BRDITEMS_PLOTTER::PlotBoardGraphicItems(), BRDITEMS_PLOTTER::PlotDimension(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), BRDITEMS_PLOTTER::PlotFootprintGraphicItems(), BRDITEMS_PLOTTER::PlotFootprintTextItems(), BRDITEMS_PLOTTER::PlotPcbShape(), BRDITEMS_PLOTTER::PlotPcbTarget(), BRDITEMS_PLOTTER::PlotPcbText(), CONVERT_TOOL::PolyToLines(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), processTextItem(), PAD_TOOL::recombinePad(), CLIPBOARD_IO::SaveSelection(), CONVERT_TOOL::SegmentToArc(), PCB_SELECTION_TOOL::Selectable(), TEXT_MOD_GRID_TABLE::SetValueAsLong(), GLOBAL_EDIT_TOOL::swapBoardItem(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncGraphicalItem(), PNS_KICAD_IFACE_BASE::syncTrack(), AR_AUTOPLACER::testFootprintOnBoard(), TRACK_VIA_DESC::TRACK_VIA_DESC(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), BOARD_ADAPTER::transformFPShapesToPolygon(), FOOTPRINT::TransformFPShapesWithClearanceToPolygon(), TRACK::ViewGetLayers(), FP_TEXT::ViewGetLayers(), FP_TEXT::ViewGetLOD(), FP_ZONE::ViewGetLOD(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetLayerName()

wxString BOARD_ITEM::GetLayerName ( ) const
inherited

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

Returns
the layer name associated with this item.

Definition at line 60 of file board_item.cpp.

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

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

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

◆ GetLayerSet()

◆ GetLocalClearance() [1/2]

int PAD::GetLocalClearance ( wxString *  aSource) const
overridevirtual

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 692 of file pcbnew/pad.cpp.

693 {
694  if( aSource )
695  *aSource = wxString::Format( _( "pad %s" ), GetName() );
696 
697  return m_localClearance;
698 }
int m_localClearance
Definition: pad.h:755
const wxString & GetName() const
Definition: pad.h:130
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
#define _(s)
Definition: 3d_actions.cpp:33

References _, Format(), GetName(), and m_localClearance.

Referenced by PCB_IO::format(), ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::initValues(), DIALOG_PAD_PROPERTIES::padValuesOK(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ GetLocalClearance() [2/2]

int PAD::GetLocalClearance ( ) const
inline

Definition at line 375 of file pad.h.

375 { return m_localClearance; }
int m_localClearance
Definition: pad.h:755

References m_localClearance.

Referenced by GetLocalClearanceOverrides(), and PAD_DESC::PAD_DESC().

◆ GetLocalClearanceOverrides()

int PAD::GetLocalClearanceOverrides ( wxString *  aSource) const
overridevirtual

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 from BOARD_CONNECTED_ITEM.

Definition at line 678 of file pcbnew/pad.cpp.

679 {
680  // A pad can have specific clearance that overrides its NETCLASS clearance value
681  if( GetLocalClearance() )
682  return GetLocalClearance( aSource );
683 
684  // A footprint can have a specific clearance value
685  if( GetParent() && GetParent()->GetLocalClearance() )
686  return GetParent()->GetLocalClearance( aSource );
687 
688  return 0;
689 }
int GetLocalClearance() const
Definition: pad.h:375
int GetLocalClearance() const
Definition: footprint.h:223
FOOTPRINT * GetParent() const

References FOOTPRINT::GetLocalClearance(), GetLocalClearance(), and GetParent().

◆ GetLocalRatsnestVisible()

bool BOARD_CONNECTED_ITEM::GetLocalRatsnestVisible ( ) const
inlineinherited

◆ GetLocalSolderMaskMargin()

int PAD::GetLocalSolderMaskMargin ( ) const
inline

◆ GetLocalSolderPasteMargin()

int PAD::GetLocalSolderPasteMargin ( ) const
inline

◆ GetLocalSolderPasteMarginRatio()

double PAD::GetLocalSolderPasteMarginRatio ( ) const
inline

◆ GetMenuImage()

BITMAP_DEF PAD::GetMenuImage ( ) const
overridevirtual

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

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

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 1133 of file pcbnew/pad.cpp.

1134 {
1135  return pad_xpm;
1136 }
const BITMAP_OPAQUE pad_xpm[1]

References pad_xpm.

◆ GetMsgPanelInfo()

void PAD::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

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

Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 857 of file pcbnew/pad.cpp.

858 {
859  EDA_UNITS units = aFrame->GetUserUnits();
860  wxString msg;
861  FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_parent );
862 
863  if( parentFootprint )
864  aList.emplace_back( _( "Footprint" ), parentFootprint->GetReference() );
865 
866  aList.emplace_back( _( "Pad" ), m_name );
867 
868  if( !GetPinFunction().IsEmpty() )
869  aList.emplace_back( _( "Pin Name" ), GetPinFunction() );
870 
871  aList.emplace_back( _( "Net" ), UnescapeString( GetNetname() ) );
872 
873  aList.emplace_back( _( "NetClass" ), UnescapeString( GetNetClass()->GetName() ) );
874 
876  aList.emplace_back( _( "Layer" ), layerMaskDescribe() );
877 
878  // Show the pad shape, attribute and property
879  wxString props = ShowPadAttr();
880 
881  if( GetProperty() != PAD_PROP_NONE )
882  props += ',';
883 
884  switch( GetProperty() )
885  {
886  case PAD_PROP_NONE: break;
887  case PAD_PROP_BGA: props += _("BGA" ); break;
888  case PAD_PROP_FIDUCIAL_GLBL: props += _("Fiducial global" ); break;
889  case PAD_PROP_FIDUCIAL_LOCAL: props += _("Fiducial local" ); break;
890  case PAD_PROP_TESTPOINT: props += _("Test point" ); break;
891  case PAD_PROP_HEATSINK: props += _("Heat sink" ); break;
892  case PAD_PROP_CASTELLATED: props += _("Castellated" ); break;
893  }
894 
895  aList.emplace_back( ShowPadShape(), props );
896 
897  if( ( GetShape() == PAD_SHAPE_CIRCLE || GetShape() == PAD_SHAPE_OVAL ) && m_size.x == m_size.y )
898  {
899  aList.emplace_back( _( "Diameter" ), MessageTextFromValue( units, m_size.x ) );
900  }
901  else
902  {
903  aList.emplace_back( _( "Width" ), MessageTextFromValue( units, m_size.x ) );
904  aList.emplace_back( _( "Height" ), MessageTextFromValue( units, m_size.y ) );
905  }
906 
907  double fp_orient_degrees = parentFootprint ? parentFootprint->GetOrientationDegrees() : 0;
908  double pad_orient_degrees = GetOrientationDegrees() - fp_orient_degrees;
909  pad_orient_degrees = NormalizeAngleDegrees( pad_orient_degrees, -180.0, +180.0 );
910 
911  if( fp_orient_degrees != 0.0 )
912  msg.Printf( wxT( "%g(+ %g)" ), pad_orient_degrees, fp_orient_degrees );
913  else
914  msg.Printf( wxT( "%g" ), GetOrientationDegrees() );
915 
916  aList.emplace_back( _( "Rotation" ), msg );
917 
918  if( GetPadToDieLength() )
919  {
920  msg = MessageTextFromValue(units, GetPadToDieLength() );
921  aList.emplace_back( _( "Length in Package" ), msg );
922  }
923 
924  if( m_drill.x > 0 || m_drill.y > 0 )
925  {
927  {
928  aList.emplace_back( _( "Hole" ),
929  wxString::Format( "%s",
930  MessageTextFromValue( units, m_drill.x ) ) );
931  }
932  else
933  {
934  aList.emplace_back( _( "Hole X / Y" ),
935  wxString::Format( "%s / %s",
936  MessageTextFromValue( units, m_drill.x ),
937  MessageTextFromValue( units, m_drill.y ) ) );
938  }
939  }
940 
941  wxString source;
942  int clearance = GetOwnClearance( GetLayer(), &source );
943 
944  aList.emplace_back( wxString::Format( _( "Min Clearance: %s" ),
945  MessageTextFromValue( units, clearance ) ),
946  wxString::Format( _( "(from %s)" ), source ) );
947 }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:527
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Definition: base_units.cpp:123
no special fabrication property
Definition: pad_shapes.h:96
wxSize m_drill
Definition: pad.h:701
virtual NETCLASS * GetNetClass() const
Function GetNetClassPtr returns the NETCLASS for this item.
a fiducial (usually a smd) for the full board
Definition: pad_shapes.h:98
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
Smd pad, used in BGA footprints.
Definition: pad_shapes.h:97
wxString GetNetname() const
Function GetNetname.
PAD_SHAPE_T GetShape() const
Definition: pad.h:162
a pad used as heat sink, usually in SMD footprints
Definition: pad_shapes.h:101
wxString ShowPadShape() const
Function ShowPadShape.
a pad with a castellated through hole
Definition: pad_shapes.h:102
PAD_ATTR_T GetAttribute() const
Definition: pad.h:359
virtual wxString layerMaskDescribe() const
Return a string (to be shown to the user) describing a layer mask.
Definition: board_item.cpp:72
const wxString & GetName() const
Definition: pad.h:130
const wxString GetReference() const
Function GetReference.
Definition: footprint.h:442
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
PAD_PROP_T GetProperty() const
Definition: pad.h:362
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
wxSize m_size
Definition: pad.h:702
EDA_UNITS
Definition: eda_units.h:38
double GetOrientationDegrees() const
Definition: footprint.h:205
a fiducial (usually a smd) local to the parent footprint
Definition: pad_shapes.h:99
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: pad.h:342
#define _(s)
Definition: 3d_actions.cpp:33
double GetOrientationDegrees() const
Definition: pad.h:338
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:150
wxString m_name
Definition: pad.h:665
double NormalizeAngleDegrees(double Angle, double aMin, double aMax)
Normalize angle to be aMin < angle <= aMax angle is in degrees.
Definition: trigo.h:309
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Function GetClearance returns an item's "own" clearance in internal units.
wxString ShowPadAttr() const
Function ShowPadAttr.
a test point pad
Definition: pad_shapes.h:100
int GetPadToDieLength() const
Definition: pad.h:369
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
const wxString & GetPinFunction() const
Definition: pad.h:136
EDA_UNITS GetUserUnits() const
Return the user units currently in use.

References _, Format(), GetAttribute(), GetDrillShape(), BOARD_ITEM::GetLayer(), GetName(), BOARD_CONNECTED_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetname(), FOOTPRINT::GetOrientationDegrees(), GetOrientationDegrees(), BOARD_CONNECTED_ITEM::GetOwnClearance(), GetPadToDieLength(), GetPinFunction(), GetProperty(), FOOTPRINT::GetReference(), GetShape(), EDA_BASE_FRAME::GetUserUnits(), BOARD_ITEM::layerMaskDescribe(), m_drill, m_name, EDA_ITEM::m_parent, m_size, MessageTextFromValue(), NormalizeAngleDegrees(), PAD_ATTRIB_CONN, PAD_ATTRIB_SMD, PAD_DRILL_SHAPE_CIRCLE, PAD_PROP_BGA, PAD_PROP_CASTELLATED, PAD_PROP_FIDUCIAL_GLBL, PAD_PROP_FIDUCIAL_LOCAL, PAD_PROP_HEATSINK, PAD_PROP_NONE, PAD_PROP_TESTPOINT, PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, ShowPadAttr(), ShowPadShape(), and UnescapeString().

◆ GetName()

◆ 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(), EDIT_TOOL::FilletTracks(), EDA_3D_CANVAS::OnMouseMove(), BOARD_EDITOR_CONTROL::RepairBoard(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow().

◆ GetNetClass()

NETCLASS * BOARD_CONNECTED_ITEM::GetNetClass ( ) const
virtualinherited

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.

Reimplemented in ZONE.

Definition at line 107 of file board_connected_item.cpp.

108 {
109  if( m_netinfo && m_netinfo->GetNetClass() )
110  return m_netinfo->GetNetClass();
111  else
112  return GetBoard()->GetDesignSettings().GetDefault();
113 }
NETCLASS * GetNetClass()
Function GetNetClass.
Definition: netinfo.h:121
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
NETCLASS * GetDefault() const

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

Referenced by EDIT_TOOL::ChangeTrackWidth(), DRAWING_TOOL::DrawVia(), VIA::GetDrillValue(), BOARD_CONNECTED_ITEM::GetEffectiveNetclass(), BOARD_INSPECTION_TOOL::getItemDescription(), GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), ZONE::GetNetClass(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), and DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

◆ GetNetClassName()

wxString BOARD_CONNECTED_ITEM::GetNetClassName ( ) const
virtualinherited

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

Reimplemented in ZONE.

Definition at line 116 of file board_connected_item.cpp.

117 {
118  if( m_netinfo )
119  return m_netinfo->GetNetClassName();
120  else
121  return wxEmptyString;
122 }
wxString GetNetClassName() const
Definition: netinfo.h:126
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

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

Referenced by BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), ZONE::GetNetClassName(), main(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ GetNetCode()

int BOARD_CONNECTED_ITEM::GetNetCode ( ) const
inlineinherited

Function GetNetCode.

Returns
int - the net code.

Definition at line 99 of file board_connected_item.h.

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

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

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC(), ZONE_FILLER::buildCopperItemClearances(), BOARD::CombineAllZonesInNet(), connectedItemFilter(), CreateRoutesSection(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), ZONE_FILLER::Fill(), PNS::NODE::FindItemByParent(), PCB_IO::format(), DSN::SPECCTRA_DB::FromBOARD(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), CONNECTIVITY_DATA::GetConnectedItems(), ZONE::GetInteractingZones(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), hash_fp_item(), hasThermalConnection(), BOARD_INSPECTION_TOOL::highlightNet(), DIALOG_PAD_PROPERTIES::initValues(), BOARD_INSPECTION_TOOL::InspectClearance(), CONNECTIVITY_DATA::IsConnectedOnLayer(), ZONE::IsIsland(), ZONE::IsSame(), DSN::SPECCTRA_DB::makeIMAGE(), AR_AUTOPLACER::nearestPad(), ROUTER_TOOL::NeighboringSegmentFilter(), CN_ITEM::Net(), BOARD::NormalizeAreaPolygon(), BOARD::OnAreaPolygonModified(), TRACK::cmp_tracks::operator()(), ZONE_SETTINGS::operator<<(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), process(), BOARD_EDITOR_CONTROL::RepairBoard(), PCB_SELECTION_CONDITIONS::sameNetFunc(), SaveCopyOfZones(), PCB_SELECTION_TOOL::selectNet(), ZONE_FILLER::subtractHigherPriorityZones(), PNS_KICAD_IFACE_BASE::syncArc(), PNS_KICAD_IFACE_BASE::syncPad(), PNS_KICAD_IFACE_BASE::syncTrack(), PNS_KICAD_IFACE_BASE::syncVia(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), BOARD::TestZoneIntersections(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZones(), BOARD::TracksInNet(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and BOARD_EDITOR_CONTROL::ZoneMerge().

◆ GetNetname()

◆ GetNetnameMsg()

wxString BOARD_CONNECTED_ITEM::GetNetnameMsg ( ) const
inherited

Function GetNetnameMsg.

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

Definition at line 125 of file board_connected_item.cpp.

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

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

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

◆ GetOffset()

◆ GetOrientation()

◆ GetOrientationDegrees()

double PAD::GetOrientationDegrees ( ) const
inline

Definition at line 338 of file pad.h.

338 { return m_orient/10.0; }
double m_orient
Definition: pad.h:738

References m_orient.

Referenced by GetMsgPanelInfo(), DSN::SPECCTRA_DB::makeIMAGE(), and PAD_DESC::PAD_DESC().

◆ GetOrientationRadians()

double PAD::GetOrientationRadians ( ) const
inline

Definition at line 339 of file pad.h.

339 { return m_orient*M_PI/1800; }
double m_orient
Definition: pad.h:738

References m_orient.

◆ GetOwnClearance()

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

Function GetClearance returns an item's "own" clearance in internal units.

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

Definition at line 81 of file board_connected_item.cpp.

82 {
83  DRC_CONSTRAINT constraint;
84 
85  if( GetBoard() && GetBoard()->GetDesignSettings().m_DRCEngine )
86  {
88 
89  constraint = bds.m_DRCEngine->EvalRulesForItems( CLEARANCE_CONSTRAINT, this, nullptr,
90  aLayer );
91  }
92 
93  if( constraint.Value().HasMin() )
94  {
95  if( aSource )
96  *aSource = constraint.GetName();
97 
98  return constraint.Value().Min();
99  }
100 
101  return 0;
102 }
bool HasMin() const
Definition: minoptmax.h:37
MINOPTMAX< int > & Value()
Definition: drc_rule.h:122
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
T Min() const
Definition: minoptmax.h:33
wxString GetName() const
Definition: drc_rule.h:127
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
std::shared_ptr< DRC_ENGINE > m_DRCEngine
Container for design settings for a BOARD object.

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

Referenced by KIGFX::PCB_PAINTER::draw(), ZONE::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), and GetMsgPanelInfo().

◆ GetPadToDieLength()

◆ GetParent()

◆ GetParentGroup()

◆ GetPinFunction()

const wxString& PAD::GetPinFunction ( ) const
inline

◆ GetPos0()

const wxPoint& PAD::GetPos0 ( ) const
inline

◆ GetPosition()

◆ GetPrimitives()

const std::vector<std::shared_ptr<PCB_SHAPE> >& PAD::GetPrimitives ( ) const
inline

Accessor to the basic shape list for custom-shaped pads.

Definition at line 289 of file pad.h.

290  {
291  return m_editPrimitives;
292  }
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:677

References m_editPrimitives.

Referenced by PAD_TOOL::explodePad(), PCB_IO::format(), ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::initValues(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ GetProperty()

◆ GetRemoveUnconnected()

bool PAD::GetRemoveUnconnected ( ) const
inline

◆ GetRoundRectCornerRadius()

int PAD::GetRoundRectCornerRadius ( ) const

Definition at line 243 of file pcbnew/pad.cpp.

244 {
245  return KiROUND( std::min( m_size.x, m_size.y ) * m_roundedCornerScale );
246 }
double m_roundedCornerScale
Definition: pad.h:706
wxSize m_size
Definition: pad.h:702
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68

References KiROUND(), m_roundedCornerScale, and m_size.

Referenced by BuildEffectiveShapes(), CreatePadsShapesSection(), export_vrml_padshape(), DSN::SPECCTRA_DB::makePADSTACK(), DIALOG_PAD_PROPERTIES::onCornerSizePercentChange(), BRDITEMS_PLOTTER::PlotPad(), TransformShapeWithClearanceToPolygon(), and DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues().

◆ GetRoundRectRadiusRatio()

◆ GetSelectMenuText()

wxString PAD::GetSelectMenuText ( EDA_UNITS  aUnits) const
overridevirtual

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

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

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 1098 of file pcbnew/pad.cpp.

1099 {
1100  if( GetName().IsEmpty() )
1101  {
1103  {
1104  return wxString::Format( _( "Pad of %s on %s" ),
1105  GetParent()->GetReference(),
1106  layerMaskDescribe() );
1107  }
1108  else
1109  {
1110  return wxString::Format( _( "Through hole pad of %s" ),
1111  GetParent()->GetReference() );
1112  }
1113  }
1114  else
1115  {
1117  {
1118  return wxString::Format( _( "Pad %s of %s on %s" ),
1119  GetName(),
1120  GetParent()->GetReference(),
1121  layerMaskDescribe() );
1122  }
1123  else
1124  {
1125  return wxString::Format( _( "Through hole pad %s of %s" ),
1126  GetName(),
1127  GetParent()->GetReference() );
1128  }
1129  }
1130 }
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
PAD_ATTR_T GetAttribute() const
Definition: pad.h:359
virtual wxString layerMaskDescribe() const
Return a string (to be shown to the user) describing a layer mask.
Definition: board_item.cpp:72
const wxString & GetName() const
Definition: pad.h:130
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
FOOTPRINT * GetParent() const
#define _(s)
Definition: 3d_actions.cpp:33

References _, Format(), GetAttribute(), GetName(), GetParent(), BOARD_ITEM::layerMaskDescribe(), PAD_ATTRIB_CONN, and PAD_ATTRIB_SMD.

◆ GetShape()

◆ GetShortNetname()

wxString BOARD_CONNECTED_ITEM::GetShortNetname ( ) const
inlineinherited

Function GetShortNetname.

Returns
wxString - the short netname

Definition at line 140 of file board_connected_item.h.

141  {
142  return m_netinfo->GetShortNetname();
143  }
const wxString & GetShortNetname() const
Function GetShortNetname.
Definition: netinfo.h:144
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().

◆ GetSize()

◆ GetSizeX()

const int PAD::GetSizeX ( ) const
inline

Definition at line 231 of file pad.h.

231 { return m_size.x; }
wxSize m_size
Definition: pad.h:702

References m_size.

Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and PAD_DESC::PAD_DESC().

◆ GetSizeY()

const int PAD::GetSizeY ( ) const
inline

Definition at line 233 of file pad.h.

233 { return m_size.y; }
wxSize m_size
Definition: pad.h:702

References m_size.

Referenced by KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and PAD_DESC::PAD_DESC().

◆ GetSolderMaskMargin()

int PAD::GetSolderMaskMargin ( ) const

Function GetSolderMaskMargin.

Returns
the margin for the solder mask layer usually > 0 (mask shape bigger than pad) For pads also on copper layers, the value (used to build a default shape) is 1 - the local value 2 - if 0, the parent footprint value 3 - if 0, the global value For pads NOT on copper layers, the value is the local value because there is no default shape to build

Definition at line 703 of file pcbnew/pad.cpp.

704 {
705  // The pad inherits the margin only to calculate a default shape,
706  // therefore only if it is also a copper layer
707  // Pads defined only on mask layers (and perhaps on other tech layers) use the shape
708  // defined by the pad settings only
709  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
710 
711  if( !isOnCopperLayer )
712  return 0;
713 
714  int margin = m_localSolderMaskMargin;
715 
716  FOOTPRINT* parentFootprint = GetParent();
717 
718  if( parentFootprint )
719  {
720  if( margin == 0 )
721  {
722  if( parentFootprint->GetLocalSolderMaskMargin() )
723  margin = parentFootprint->GetLocalSolderMaskMargin();
724  }
725 
726  if( margin == 0 )
727  {
728  BOARD* brd = GetBoard();
729 
730  if( brd )
731  margin = brd->GetDesignSettings().m_SolderMaskMargin;
732  }
733  }
734 
735  // ensure mask have a size always >= 0
736  if( margin < 0 )
737  {
738  int minsize = -std::min( m_size.x, m_size.y ) / 2;
739 
740  if( margin < minsize )
741  margin = minsize;
742  }
743 
744  return margin;
745 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
LSET m_layerMask
Definition: pad.h:724
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
int m_localSolderMaskMargin
Definition: pad.h:756
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
wxSize m_size
Definition: pad.h:702
FOOTPRINT * GetParent() const
int GetLocalSolderMaskMargin() const
Definition: footprint.h:220
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189

References LSET::AllCuMask(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), FOOTPRINT::GetLocalSolderMaskMargin(), GetParent(), m_layerMask, m_localSolderMaskMargin, m_size, and BOARD_DESIGN_SETTINGS::m_SolderMaskMargin.

Referenced by KIGFX::PCB_PAINTER::draw(), and ViewBBox().

◆ GetSolderPasteMargin()

wxSize PAD::GetSolderPasteMargin ( ) const

Function GetSolderPasteMargin.

Returns
the margin for the solder mask layer usually < 0 (mask shape smaller than pad) because the margin can be dependent on the pad size, the margin has a x and a y value

For pads also on copper layers, the value (used to build a default shape) is 1 - the local value 2 - if 0, the parent footprint value 3 - if 0, the global value

For pads NOT on copper layers, the value is the local value because there is no default shape to build

Definition at line 748 of file pcbnew/pad.cpp.

749 {
750  // The pad inherits the margin only to calculate a default shape,
751  // therefore only if it is also a copper layer.
752  // Pads defined only on mask layers (and perhaps on other tech layers) use the shape
753  // defined by the pad settings only
754  bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
755 
756  if( !isOnCopperLayer )
757  return wxSize( 0, 0 );
758 
759  int margin = m_localSolderPasteMargin;
760  double mratio = m_localSolderPasteMarginRatio;
761 
762  FOOTPRINT* parentFootprint = GetParent();
763 
764  if( parentFootprint )
765  {
766  if( margin == 0 )
767  margin = parentFootprint->GetLocalSolderPasteMargin();
768 
769  auto brd = GetBoard();
770 
771  if( margin == 0 && brd )
772  margin = brd->GetDesignSettings().m_SolderPasteMargin;
773 
774  if( mratio == 0.0 )
775  mratio = parentFootprint->GetLocalSolderPasteMarginRatio();
776 
777  if( mratio == 0.0 && brd )
778  {
779  mratio = brd->GetDesignSettings().m_SolderPasteMarginRatio;
780  }
781  }
782 
783  wxSize pad_margin;
784  pad_margin.x = margin + KiROUND( m_size.x * mratio );
785  pad_margin.y = margin + KiROUND( m_size.y * mratio );
786 
787  // ensure mask have a size always >= 0
788  if( pad_margin.x < -m_size.x / 2 )
789  pad_margin.x = -m_size.x / 2;
790 
791  if( pad_margin.y < -m_size.y / 2 )
792  pad_margin.y = -m_size.y / 2;
793 
794  return pad_margin;
795 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
LSET m_layerMask
Definition: pad.h:724
double m_localSolderPasteMarginRatio
Definition: pad.h:758
int m_localSolderPasteMargin
Definition: pad.h:757
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
wxSize m_size
Definition: pad.h:702
FOOTPRINT * GetParent() const
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
double GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:237
int GetLocalSolderPasteMargin() const
Definition: footprint.h:234

References LSET::AllCuMask(), BOARD_ITEM::GetBoard(), FOOTPRINT::GetLocalSolderPasteMargin(), FOOTPRINT::GetLocalSolderPasteMarginRatio(), GetParent(), KiROUND(), m_layerMask, m_localSolderPasteMargin, m_localSolderPasteMarginRatio, and m_size.

Referenced by KIGFX::PCB_PAINTER::draw(), and ViewBBox().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 185 of file eda_item.h.

186  {
187  return m_status & type;
188  }
STATUS_FLAGS m_status
Definition: eda_item.h:526

References EDA_ITEM::m_status.

Referenced by BOARD_ITEM::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 198 of file eda_item.h.

198 { return m_status; }
STATUS_FLAGS m_status
Definition: eda_item.h:526

References EDA_ITEM::m_status.

◆ GetSubRatsnest()

int PAD::GetSubRatsnest ( ) const
inline

Function GetSubRatsnest.

Returns
int - the netcode

Definition at line 536 of file pad.h.

536 { return m_subRatsnest; }
int m_subRatsnest
Definition: pad.h:698

References m_subRatsnest.

Referenced by CreatePadsShapesSection(), operator=(), and PAD().

◆ GetThermalGap()

int PAD::GetThermalGap ( ) const
inline

◆ GetThermalSpokeWidth()

int PAD::GetThermalSpokeWidth ( ) const
inline

◆ GetX()

int BOARD_ITEM::GetX ( ) const
inlineinherited

◆ GetY()

int BOARD_ITEM::GetY ( ) const
inlineinherited

◆ GetZoneConnection()

ZONE_CONNECTION PAD::GetZoneConnection ( ) const
inline

Definition at line 468 of file pad.h.

468 { return m_zoneConnection; }
ZONE_CONNECTION m_zoneConnection
Definition: pad.h:761

References m_zoneConnection.

Referenced by DIALOG_PAD_PROPERTIES::initValues().

◆ HasFlag()

◆ HitTest() [1/2]

bool PAD::HitTest ( const wxPoint &  aPosition,
int  aAccuracy = 0 
) const
overridevirtual

Test if aPosition is contained within or on the bounding box of an item.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
aAccuracyIncrease the item bounding box by this amount.
Returns
True if aPosition is within the item bounding box.

Reimplemented from EDA_ITEM.

Definition at line 950 of file pcbnew/pad.cpp.

951 {
952  VECTOR2I delta = aPosition - GetPosition();
953  int boundingRadius = GetBoundingRadius() + aAccuracy;
954 
955  if( delta.SquaredEuclideanNorm() > SEG::Square( boundingRadius ) )
956  return false;
957 
958  return GetEffectivePolygon()->Contains( aPosition, -1, aAccuracy );
959 }
extended_type SquaredEuclideanNorm() const
Function Squared Euclidean Norm computes the squared euclidean norm of the vector,...
Definition: vector2d.h:307
static SEG::ecoord Square(int a)
Definition: seg.h:123
int GetBoundingRadius() const
Function GetBoundingRadius returns the radius of a minimum sized circle which fully encloses this pad...
Definition: pcbnew/pad.cpp:301
wxPoint GetPosition() const override
Definition: pad.h:170
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
Definition: pcbnew/pad.cpp:274

References GetBoundingRadius(), GetEffectivePolygon(), GetPosition(), SEG::Square(), and VECTOR2< T >::SquaredEuclideanNorm().

Referenced by BOARD::GetTrackLength().

◆ HitTest() [2/2]

bool PAD::HitTest ( const EDA_RECT aRect,
bool  aContained,
int  aAccuracy = 0 
) const
overridevirtual

Test if aRect intersects or is contained within the bounding box of an item.

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 962 of file pcbnew/pad.cpp.

963 {
964  auto getArea = []( const SHAPE_POLY_SET& aPoly ) -> double
965  {
966  return aPoly.OutlineCount() ? aPoly.COutline( 0 ).Area() : 0;
967  };
968 
969  EDA_RECT arect = aRect;
970  arect.Normalize();
971  arect.Inflate( aAccuracy );
972 
973  EDA_RECT bbox = GetBoundingBox();
974 
975  if( !arect.Intersects( bbox ) )
976  return false;
977 
978  // This covers total containment for all test cases
979  if( arect.Contains( bbox ) )
980  return true;
981 
982  SHAPE_POLY_SET selRect;
983  selRect.NewOutline();
984  selRect.Append( arect.GetOrigin() );
985  selRect.Append( VECTOR2I( arect.GetRight(), arect.GetTop() ) );
986  selRect.Append( VECTOR2I( arect.GetRight(), arect.GetBottom() ) );
987  selRect.Append( VECTOR2I( arect.GetLeft(), arect.GetBottom() ) );
988 
990 
991  double padArea = getArea( *GetEffectivePolygon() );
992  double intersection = getArea( selRect );
993 
994  if( intersection > ( padArea * 0.99 ) )
995  return true;
996  else
997  return !aContained && intersection > 0;
998 }
int GetTop() const
Definition: eda_rect.h:118
int GetLeft() const
Definition: eda_rect.h:117
VECTOR2< int > VECTOR2I
Definition: vector2d.h:628
bool Contains(const wxPoint &aPoint) const
Definition: eda_rect.cpp:57
int GetBottom() const
Definition: eda_rect.h:119
SHAPE_POLY_SET.
const wxPoint GetOrigin() const
Definition: eda_rect.h:106
int GetRight() const
Definition: eda_rect.h:116
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox The bounding box is cached, so this will be efficient most of the time.
Definition: pcbnew/pad.cpp:524
void BooleanIntersection(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset intersection For aFastMode meaning, see function booleanOp
int NewOutline()
Creates a new empty polygon in the set and returns its index
void Normalize()
Ensures that the height ant width are positive.
Definition: eda_rect.cpp:35
Handle the component boundary box.
Definition: eda_rect.h:42
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
Definition: pcbnew/pad.cpp:274
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
Definition: eda_rect.cpp:150
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363
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)

References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::BooleanIntersection(), EDA_RECT::Contains(), EDA_RECT::GetBottom(), GetBoundingBox(), GetEffectivePolygon(), EDA_RECT::GetLeft(), EDA_RECT::GetOrigin(), EDA_RECT::GetRight(), EDA_RECT::GetTop(), EDA_RECT::Inflate(), EDA_RECT::Intersects(), SHAPE_POLY_SET::NewOutline(), EDA_RECT::Normalize(), and SHAPE_POLY_SET::PM_FAST.

◆ ImportSettingsFrom()

void PAD::ImportSettingsFrom ( const PAD aMasterPad)

Imports the pad settings from aMasterPad.

The result is "this" has the same settinds (sizes, shapes ... ) as aMasterPad

Parameters
aMasterPad= the template pad

Definition at line 1302 of file pcbnew/pad.cpp.

1303 {
1304  SetShape( aMasterPad.GetShape() );
1305  SetLayerSet( aMasterPad.GetLayerSet() );
1306  SetAttribute( aMasterPad.GetAttribute() );
1307  SetProperty( aMasterPad.GetProperty() );
1308 
1309  // I am not sure the m_LengthPadToDie must be imported, because this is
1310  // a parameter really specific to a given pad (JPC).
1311  // So this is currently non imported
1312  #if 0
1313  SetPadToDieLength( aMasterPad.GetPadToDieLength() );
1314  #endif
1315 
1316  // The pad orientation, for historical reasons is the
1317  // pad rotation + parent rotation.
1318  // So we have to manage this parent rotation
1319  double pad_rot = aMasterPad.GetOrientation();
1320 
1321  if( aMasterPad.GetParent() )
1322  pad_rot -= aMasterPad.GetParent()->GetOrientation();
1323 
1324  if( GetParent() )
1325  pad_rot += GetParent()->GetOrientation();
1326 
1327  SetOrientation( pad_rot );
1328 
1329  SetSize( aMasterPad.GetSize() );
1330  SetDelta( wxSize( 0, 0 ) );
1331  SetOffset( aMasterPad.GetOffset() );
1332  SetDrillSize( aMasterPad.GetDrillSize() );
1333  SetDrillShape( aMasterPad.GetDrillShape() );
1335  SetChamferRectRatio( aMasterPad.GetChamferRectRatio() );
1336  SetChamferPositions( aMasterPad.GetChamferPositions() );
1337 
1338  switch( aMasterPad.GetShape() )
1339  {
1340  case PAD_SHAPE_TRAPEZOID:
1341  SetDelta( aMasterPad.GetDelta() );
1342  break;
1343 
1344  case PAD_SHAPE_CIRCLE:
1345  // ensure size.y == size.x
1346  SetSize( wxSize( GetSize().x, GetSize().x ) );
1347  break;
1348 
1349  default:
1350  ;
1351  }
1352 
1353  switch( aMasterPad.GetAttribute() )
1354  {
1355  case PAD_ATTRIB_SMD:
1356  case PAD_ATTRIB_CONN:
1357  // These pads do not have hole (they are expected to be only on one
1358  // external copper layer)
1359  SetDrillSize( wxSize( 0, 0 ) );
1360  break;
1361 
1362  default:
1363  ;
1364  }
1365 
1366  // copy also local settings:
1367  SetLocalClearance( aMasterPad.GetLocalClearance() );
1371 
1374  SetThermalGap( aMasterPad.GetThermalGap() );
1375 
1377 
1378  // Add or remove custom pad shapes:
1379  ReplacePrimitives( aMasterPad.GetPrimitives() );
1380  SetAnchorPadShape( aMasterPad.GetAnchorPadShape() );
1381 
1382  SetDirty();
1383 }
int GetLocalSolderMaskMargin() const
Definition: pad.h:371
void SetOffset(const wxPoint &aOffset)
Definition: pad.h:245
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: pad.h:382
int GetLocalSolderPasteMargin() const
Definition: pad.h:378
double GetRoundRectRadiusRatio() const
Definition: pad.h:514
void SetLocalClearance(int aClearance)
Definition: pad.h:376
void SetThermalSpokeWidth(int aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
Definition: pad.h:482
void SetAnchorPadShape(PAD_SHAPE_T aShape)
Function SetAnchorPadShape Set the shape of the anchor pad for custm shped pads.
Definition: pad.h:203
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
double GetOrientation() const
Definition: footprint.h:204
PAD_SHAPE_T GetShape() const
Definition: pad.h:162
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE >> &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
void SetSize(const wxSize &aSize)
Definition: pad.h:228
void SetDelta(const wxSize &aSize)
Definition: pad.h:235
int GetThermalGap() const
Definition: pad.h:491
void SetPadToDieLength(int aLength)
Definition: pad.h:368
PAD_ATTR_T GetAttribute() const
Definition: pad.h:359
void SetLocalSolderMaskMargin(int aMargin)
Definition: pad.h:372
const wxPoint & GetOffset() const
Definition: pad.h:246
const wxSize & GetDrillSize() const
Definition: pad.h:239
int GetThermalSpokeWidth() const
Definition: pad.h:483
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in a variety of units (the basic call r...
Definition: pad.h:337
void SetThermalGap(int aGap)
Definition: pad.h:490
void SetDrillSize(const wxSize &aSize)
Definition: pad.h:238
const wxSize & GetSize() const
Definition: pad.h:229
ZONE_CONNECTION GetEffectiveZoneConnection(wxString *aSource=nullptr) const
Return the zone connection in effect (either locally overridden or overridden in the parent footprint...
Definition: pcbnew/pad.cpp:798
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:356
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: pad.h:467
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: pad.h:176
void SetCustomShapeInZoneOpt(CUST_PAD_SHAPE_IN_ZONE aOption)
Set the option for the custom pad shape to use as clearance area in copper zones.
Definition: pad.h:192
void SetShape(PAD_SHAPE_T aShape)
Set the new shape of this pad.
Definition: pad.h:153
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
void SetRoundRectRadiusRatio(double aRadiusScale)
has meaning only for rounded rect pads Set the ratio between the smaller X or Y size and the rounded ...
Definition: pcbnew/pad.cpp:258
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system.
Definition: pcbnew/pad.cpp:692
void SetDrillShape(PAD_DRILL_SHAPE_T aShape)
Definition: pad.h:341
PAD_PROP_T GetProperty() const
Definition: pad.h:362
double GetLocalSolderPasteMarginRatio() const
Definition: pad.h:381
const wxSize & GetDelta() const
Definition: pad.h:236
FOOTPRINT * GetParent() const
void SetChamferPositions(int aPositions)
has meaning only for chamfered rect pads set the position of the chamfers for orientation 0.
Definition: pad.h:529
void SetLayerSet(LSET aLayers) override
Definition: pad.h:355
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
Definition: pad.h:182
double GetChamferRectRatio() const
Definition: pad.h:522
void SetLocalSolderPasteMargin(int aMargin)
Definition: pad.h:379
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: pad.h:342
void SetDirty()
Definition: pad.h:349
int GetChamferPositions() const
Definition: pad.h:530
void SetProperty(PAD_PROP_T aProperty)
Definition: pcbnew/pad.cpp:577
void SetChamferRectRatio(double aChamferScale)
has meaning only for chamfered rect pads Set the ratio between the smaller X or Y size and chamfered ...
Definition: pcbnew/pad.cpp:266
int GetPadToDieLength() const
Definition: pad.h:369
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives() const
Accessor to the basic shape list for custom-shaped pads.
Definition: pad.h:289
void SetOrientation(double aAngle)
Function SetOrientation sets the rotation angle of the pad.
Definition: pcbnew/pad.cpp:585
void SetAttribute(PAD_ATTR_T aAttribute)
Definition: pcbnew/pad.cpp:566

References GetAnchorPadShape(), GetAttribute(), GetChamferPositions(), GetChamferRectRatio(), GetCustomShapeInZoneOpt(), GetDelta(), GetDrillShape(), GetDrillSize(), GetEffectiveZoneConnection(), GetLayerSet(), GetLocalClearance(), GetLocalSolderMaskMargin(), GetLocalSolderPasteMargin(), GetLocalSolderPasteMarginRatio(), GetOffset(), FOOTPRINT::GetOrientation(), GetOrientation(), GetPadToDieLength(), GetParent(), GetPrimitives(), GetProperty(), GetRoundRectRadiusRatio(), GetShape(), GetSize(), GetThermalGap(), GetThermalSpokeWidth(), PAD_ATTRIB_CONN, PAD_ATTRIB_SMD, PAD_SHAPE_CIRCLE, PAD_SHAPE_TRAPEZOID, ReplacePrimitives(), SetAnchorPadShape(), SetAttribute(), SetChamferPositions(), SetChamferRectRatio(), SetCustomShapeInZoneOpt(), SetDelta(), SetDirty(), SetDrillShape(), SetDrillSize(), SetLayerSet(), SetLocalClearance(), SetLocalSolderMaskMargin(), SetLocalSolderPasteMargin(), SetLocalSolderPasteMarginRatio(), SetOffset(), SetOrientation(), SetPadToDieLength(), SetProperty(), SetRoundRectRadiusRatio(), SetShape(), SetSize(), SetThermalGap(), SetThermalSpokeWidth(), and SetZoneConnection().

Referenced by PAD_TOOL::copyPadSettings(), operator=(), PAD(), and PAD_TOOL::PlacePad().

◆ IsAperturePad()

bool PAD::IsAperturePad ( ) const
inline

Definition at line 366 of file pad.h.

366 { return ( m_layerMask & LSET::AllCuMask() ).none(); }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
LSET m_layerMask
Definition: pad.h:724

References LSET::AllCuMask(), and m_layerMask.

Referenced by doPushPadProperties(), DIALOG_PAD_PROPERTIES::initValues(), and PAD_NAMING::PadCanHaveName().

◆ IsBrightened()

◆ IsConnected()

bool BOARD_CONNECTED_ITEM::IsConnected ( ) const
inlineoverridevirtualinherited

Reimplemented from BOARD_ITEM.

Reimplemented in ZONE.

Definition at line 72 of file board_connected_item.h.

73  {
74  return true;
75  }

Referenced by BOARD_INSPECTION_TOOL::InspectClearance().

◆ IsDirty()

bool PAD::IsDirty ( ) const
inline

Definition at line 344 of file pad.h.

345  {
346  return m_shapesDirty || m_polyDirty;
347  }
bool m_shapesDirty
Definition: pad.h:680
bool m_polyDirty
Definition: pad.h:686

References m_polyDirty, and m_shapesDirty.

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 169 of file eda_item.h.

169 { return m_flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:108
STATUS_FLAGS m_flags
Definition: eda_item.h:529

References IS_DRAGGED, and EDA_ITEM::m_flags.

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

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 172 of file eda_item.h.

172 { return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered
Definition: eda_item.h:136
STATUS_FLAGS m_flags
Definition: eda_item.h:529

References ENTERED, and EDA_ITEM::m_flags.

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

◆ IsFlipped()

bool PAD::IsFlipped ( ) const
Returns
true if the pad has a footprint parent flipped (on the back/bottom layer)

Definition at line 178 of file pcbnew/pad.cpp.

179 {
180  if( GetParent() && GetParent()->GetLayer() == B_Cu )
181  return true;
182  return false;
183 }
FOOTPRINT * GetParent() const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173

References B_Cu, BOARD_ITEM::GetLayer(), and GetParent().

Referenced by DIALOG_PAD_PROPERTIES::initValues(), and ViewGetLOD().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 254 of file eda_item.h.

254 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:528

References EDA_ITEM::m_forceVisible.

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

◆ IsLocked()

bool PAD::IsLocked ( ) const
overridevirtual
Returns
true if the object is locked, else false.

Reimplemented from BOARD_ITEM.

Definition at line 134 of file pcbnew/pad.cpp.

135 {
136  if( GetParent() && static_cast<FOOTPRINT*>( GetParent() )->IsLocked() )
137  return true;
138 
139  return BOARD_ITEM::IsLocked();
140 };
bool IsLocked() const override
Definition: pcbnew/pad.cpp:134
FOOTPRINT * GetParent() const
virtual bool IsLocked() const
Definition: board_item.h:249

References GetParent(), and BOARD_ITEM::IsLocked().

Referenced by PCB_IO::format(), DIALOG_PAD_PROPERTIES::initValues(), POINT_EDITOR::makePoints(), and POINT_EDITOR::updatePoints().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 166 of file eda_item.h.

166 { return m_flags & IS_CHANGED; }
#define IS_CHANGED
Item was edited, and modified.
Definition: eda_item.h:102
STATUS_FLAGS m_flags
Definition: eda_item.h:529

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsOnCopperLayer()

bool PAD::IsOnCopperLayer ( ) const
inlineoverridevirtual
Returns
true if the pad is on any copper layer, false otherwise. pads can be only on tech layers to build special pads. they are therefore not always on a copper layer

Reimplemented from BOARD_ITEM.

Definition at line 214 of file pad.h.

215  {
216  return ( GetLayerSet() & LSET::AllCuMask() ) != 0;
217  }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:356

References LSET::AllCuMask(), and GetLayerSet().

Referenced by CN_LIST::Add(), isCopper(), EDA_3D_CANVAS::OnMouseMove(), and DIALOG_PAD_PROPERTIES::padValuesOK().

◆ IsOnLayer()

bool PAD::IsOnLayer ( PCB_LAYER_ID  aLayer) const
inlineoverridevirtual

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

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

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

Reimplemented from BOARD_ITEM.

Definition at line 555 of file pad.h.

556  {
557  return m_layerMask[aLayer];
558  }
LSET m_layerMask
Definition: pad.h:724

References m_layerMask.

Referenced by AR_AUTOPLACER::addPad(), PAD_TOOL::explodePad(), FlashLayer(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), DSN::SPECCTRA_DB::makePADSTACK(), PAD_TOOL::recombinePad(), PCB_SELECTION_TOOL::Selectable(), and ViewGetLayers().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

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

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

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_SHEET_PIN, and SCH_FIELD.

Definition at line 451 of file eda_item.h.

451 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 173 of file eda_item.h.

173 { return m_flags & IS_RESIZED; }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:107
STATUS_FLAGS m_flags
Definition: eda_item.h:529

References IS_RESIZED, and EDA_ITEM::m_flags.

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

◆ IsSelected()

◆ IsTrack()

bool BOARD_ITEM::IsTrack ( ) const
inlineinherited

Test to see if this object is a track or via (or microvia).

Returns
true if a track or via, else false.

Definition at line 241 of file board_item.h.

242  {
243  return ( Type() == PCB_TRACE_T ) || ( Type() == PCB_VIA_T );
244  }
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:161

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

◆ IsType()

bool PAD::IsType ( const KICAD_T  aScanTypes[]) const
inlineoverridevirtual

Check whether the item is one of the listed types.

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

Reimplemented from EDA_ITEM.

Definition at line 86 of file pad.h.

87  {
88  if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
89  return true;
90 
91  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
92  {
93  if( m_drill.x > 0 && m_drill.y > 0 )
94  {
95  if( *p == PCB_LOCATE_HOLE_T )
96  return true;
97  else if( *p == PCB_LOCATE_PTH_T && m_attribute != PAD_ATTRIB_NPTH )
98  return true;
99  else if( *p == PCB_LOCATE_NPTH_T && m_attribute == PAD_ATTRIB_NPTH )
100  return true;
101  }
102  }
103 
104  return false;
105  }
wxSize m_drill
Definition: pad.h:701
PAD_ATTR_T m_attribute
Definition: pad.h:734
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Definition: eda_item.h:231

References EOT, EDA_ITEM::IsType(), m_attribute, m_drill, PAD_ATTRIB_NPTH, PCB_LOCATE_HOLE_T, PCB_LOCATE_NPTH_T, and PCB_LOCATE_PTH_T.

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 170 of file eda_item.h.

170 { return m_flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:110
STATUS_FLAGS m_flags
Definition: eda_item.h:529

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ 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

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

Definition at line 343 of file eda_item.h.

347  {
348  for( auto it : aList )
349  {
350  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
352  return SEARCH_RESULT::QUIT;
353  }
354 
356  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:107

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

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

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

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

Definition at line 362 of file eda_item.h.

364  {
365  for( auto it : aList )
366  {
367  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
369  return SEARCH_RESULT::QUIT;
370  }
371 
373  }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:107

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

◆ layerMaskDescribe()

wxString BOARD_ITEM::layerMaskDescribe ( ) const
protectedvirtualinherited

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

The BOARD is needed because layer names are customizable.

Reimplemented in VIA.

Definition at line 72 of file board_item.cpp.

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

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

Referenced by TRACK::GetMsgPanelInfo(), GetMsgPanelInfo(), and GetSelectMenuText().

◆ Matches() [1/2]

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

Compare the item against the search criteria in aSearchData.

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

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

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_SHEET_PIN, SCH_FIELD, ZONE, SCH_PIN, SCH_MARKER, PCB_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 413 of file eda_item.h.

414  {
415  return false;
416  }

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

◆ Matches() [2/2]

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

Compare aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

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

Definition at line 132 of file eda_item.cpp.

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

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

◆ MergePrimitivesAsPolygon()

void PAD::MergePrimitivesAsPolygon ( SHAPE_POLY_SET aMergedPolygon,
PCB_LAYER_ID  aLayer 
) const

Merge all basic shapes to a SHAPE_POLY_SET Note: The results are relative to the pad position, orientation 0.

Definition at line 196 of file pad_custom_shape_functions.cpp.

197 {
198  BOARD* board = GetBoard();
199  int maxError = board ? board->GetDesignSettings().m_MaxError: ARC_HIGH_DEF;
200 
201  aMergedPolygon->RemoveAllContours();
202 
203  // Add the anchor pad shape in aMergedPolygon, others in aux_polyset:
204  // The anchor pad is always at 0,0
205  switch( GetAnchorPadShape() )
206  {
207  case PAD_SHAPE_RECT:
208  {
209  SHAPE_RECT rect( -GetSize().x / 2, -GetSize().y / 2, GetSize().x, GetSize().y );
210  aMergedPolygon->AddOutline( rect.Outline() );
211  }
212  break;
213 
214  default:
215  case PAD_SHAPE_CIRCLE:
216  TransformCircleToPolygon( *aMergedPolygon, wxPoint( 0, 0 ), GetSize().x / 2, maxError,
217  ERROR_INSIDE );
218  break;
219  }
220 
221  addPadPrimitivesToPolygon( aMergedPolygon, aLayer, maxError, ERROR_INSIDE );
222 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
const wxSize & GetSize() const
Definition: pad.h:229
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
PAD_SHAPE_T GetAnchorPadShape() const
Function GetAnchorPadShape.
Definition: pad.h:176
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aCornerBuffer, wxPoint aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc)
Function TransformCircleToPolygon convert a circle to a polygon, using multiple straight lines.
void addPadPrimitivesToPolygon(SHAPE_POLY_SET *aMergedPolygon, PCB_LAYER_ID aLayer, int aError, ERROR_LOC aErrorLoc) const

References SHAPE_POLY_SET::AddOutline(), addPadPrimitivesToPolygon(), ERROR_INSIDE, GetAnchorPadShape(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), GetSize(), BOARD_DESIGN_SETTINGS::m_MaxError, SHAPE_RECT::Outline(), PAD_SHAPE_CIRCLE, PAD_SHAPE_RECT, SHAPE_POLY_SET::RemoveAllContours(), and TransformCircleToPolygon().

Referenced by CreatePadsShapesSection(), export_vrml_padshape(), DSN::SPECCTRA_DB::makePADSTACK(), DIALOG_PAD_PROPERTIES::padValuesOK(), and TransformShapeWithClearanceToPolygon().

◆ Move() [1/2]

void BOARD_ITEM::Move ( const VECTOR2I aMoveVector)
inlineinherited

Definition at line 283 of file board_item.h.

284  {
285  Move( wxPoint( aMoveVector.x, aMoveVector.y ) );
286  }
virtual void Move(const wxPoint &aMoveVector)
Move this object.
Definition: board_item.h:277

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

◆ Move() [2/2]

void PAD::Move ( const wxPoint &  aMoveVector)
inlineoverridevirtual

Move this object.

Parameters
aMoveVectorthe move vector for this object.

Reimplemented from BOARD_ITEM.

Definition at line 604 of file pad.h.

605  {
606  m_pos += aMoveVector;
607  SetLocalCoord();
608  SetDirty();
609  }
wxPoint m_pos
Definition: pad.h:668
void SetLocalCoord()
Set relative coordinates.
Definition: pcbnew/pad.cpp:551
void SetDirty()
Definition: pad.h:349

References m_pos, SetDirty(), and SetLocalCoord().

◆ operator<()

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

Test if another item is less than this object.

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

Definition at line 185 of file eda_item.cpp.

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

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

◆ operator=()

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

Definition at line 115 of file pcbnew/pad.cpp.

116 {
118 
119  ImportSettingsFrom( aOther );
121  SetPosition( aOther.GetPosition() );
122  SetPos0( aOther.GetPos0() );
123  SetName( aOther.GetName() );
124  SetPinFunction( aOther.GetPinFunction() );
125  SetSubRatsnest( aOther.GetSubRatsnest() );
129 
130  return *this;
131 }
int m_effectiveBoundingRadius
Definition: pad.h:689
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12).
Definition: pad.h:129
void SetSubRatsnest(int aSubRatsnest)
Definition: pad.h:537
void SetPadToDieLength(int aLength)
Definition: pad.h:368
void ImportSettingsFrom(const PAD &aMasterPad)
Imports the pad settings from aMasterPad.
bool m_keepTopBottomLayer
Definition: pad.h:743
void SetPos0(const wxPoint &aPos)
Definition: pad.h:222
const wxString & GetName() const
Definition: pad.h:130
void SetPinFunction(const wxString &aName)
Set the pad function (pin name in schematic)
Definition: pad.h:135
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
Definition: eda_item.cpp:193
const wxPoint & GetPos0() const
Definition: pad.h:223
bool m_removeUnconnectedLayer
Definition: pad.h:742
int GetSubRatsnest() const
Function GetSubRatsnest.
Definition: pad.h:536
wxPoint GetPosition() const override
Definition: pad.h:170
void SetPosition(const wxPoint &aPos) override
Definition: pad.h:164
int GetPadToDieLength() const
Definition: pad.h:369