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 std::vector< KICAD_T > &aScanTypes) const override
 Check whether the item is one of the listed types. More...
 
bool HasHole () const override
 
FOOTPRINTGetParent () const
 
wxString GetParentAsString () const
 
bool IsLocked () const override
 
void ImportSettingsFrom (const PAD &aMasterPad)
 Import the pad settings from aMasterPad. More...
 
bool IsFlipped () const
 
void SetNumber (const wxString &aNumber)
 Set the pad number (note that it can be alphanumeric, such as the array reference "AA12"). More...
 
const wxString & GetNumber () const
 
bool CanHaveNumber () const
 Indicates whether or not the pad can have a number. More...
 
void SetPinFunction (const wxString &aName)
 Set the pad function (pin name in schematic) More...
 
const wxString & GetPinFunction () const
 
void SetPinType (const wxString &aType)
 Set the pad electrical type. More...
 
const wxString & GetPinType () 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...
 
bool IsNoConnectPad () const
 
bool IsFreePad () const
 
void SetShape (PAD_SHAPE aShape)
 Set the new shape of this pad. More...
 
PAD_SHAPE GetShape () const
 
void SetPosition (const VECTOR2I &aPos) override
 
VECTOR2I GetPosition () const override
 
PAD_SHAPE GetAnchorPadShape () const
 
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 aShape)
 Set the shape of the anchor pad for custom shaped pads. More...
 
bool IsOnCopperLayer () const override
 
void SetY (int y)
 
void SetX (int x)
 
void SetPos0 (const VECTOR2I &aPos)
 
const VECTOR2IGetPos0 () const
 
void SetY0 (int y)
 
void SetX0 (int x)
 
void SetSize (const VECTOR2I &aSize)
 
const VECTOR2IGetSize () const
 
void SetSizeX (const int aX)
 
int GetSizeX () const
 
void SetSizeY (const int aY)
 
int GetSizeY () const
 
void SetDelta (const VECTOR2I &aSize)
 
const VECTOR2IGetDelta () const
 
void SetDrillSize (const VECTOR2I &aSize)
 
const VECTOR2IGetDrillSize () const
 
void SetDrillSizeX (const int aX)
 
int GetDrillSizeX () const
 
void SetDrillSizeY (const int aY)
 
int GetDrillSizeY () const
 
void SetOffset (const VECTOR2I &aOffset)
 
const VECTOR2IGetOffset () const
 
VECTOR2I 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< VECTOR2I > &aPoly, int aThickness, bool aFilled)
 
void AddPrimitiveSegment (const VECTOR2I &aStart, const VECTOR2I &aEnd, int aThickness)
 
void AddPrimitiveCircle (const VECTOR2I &aCenter, int aRadius, int aThickness, bool aFilled)
 
void AddPrimitiveRect (const VECTOR2I &aStart, const VECTOR2I &aEnd, int aThickness, bool aFilled)
 
void AddPrimitiveArc (const VECTOR2I &aCenter, const VECTOR2I &aStart, const EDA_ANGLE &aArcAngle, int aThickness)
 
void AddPrimitiveCurve (const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCtrl1, const VECTOR2I &aCtrl2, int aThickness)
 
void AddPrimitiveAnnotationBox (const VECTOR2I &aStart, const VECTOR2I &aEnd)
 Has meaning only for custom shape pads. More...
 
bool GetBestAnchorPosition (VECTOR2I &aPos)
 
void MergePrimitivesAsPolygon (SHAPE_POLY_SET *aMergedPolygon, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
 Merge all basic shapes to a SHAPE_POLY_SET. 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 VECTOR2I &VECTOR2I, 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 primitive 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 (const EDA_ANGLE &aAngle)
 Set the rotation angle of the pad. More...
 
EDA_ANGLE GetOrientation () const
 Return the rotation angle of the pad. More...
 
void SetOrientationDegrees (double aOrientation)
 
double GetOrientationDegrees () 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_ATTRIB aAttribute)
 
PAD_ATTRIB GetAttribute () const
 
void SetProperty (PAD_PROP aProperty)
 
PAD_PROP 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
 Return 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)
 
int GetOwnClearance (PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const override
 Return an item's "own" clearance in internal units. More...
 
void TransformShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
 Convert the pad shape to a closed polygon. More...
 
bool TransformHoleWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, int aInflateValue, int aError, ERROR_LOC aErrorLoc) const
 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, FLASHING flashPTHPads=FLASHING::DEFAULT) 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
 
std::shared_ptr< SHAPE_SEGMENTGetEffectiveHoleShape () const override
 Return a SHAPE_SEGMENT object representing the pad's hole. More...
 
int GetBoundingRadius () const
 Return the radius of a minimum sized circle which fully encloses this pad. More...
 
int GetLocalClearanceOverrides (wxString *aSource) const override
 Return any local clearance overrides set in the "classic" (ie: pre-rule) system. More...
 
int GetSolderMaskExpansion () const
 
VECTOR2I GetSolderPasteMargin () const
 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. More...
 
void SetZoneConnection (ZONE_CONNECTION aType)
 
ZONE_CONNECTION GetZoneConnection () const
 
ZONE_CONNECTION GetLocalZoneConnectionOverride (wxString *aSource=nullptr) const
 
void SetThermalSpokeWidth (int aWidth)
 Set the width of the thermal spokes connecting the pad to a zone. More...
 
int GetThermalSpokeWidth () const
 
int GetLocalSpokeWidthOverride (wxString *aSource=nullptr) const
 
void SetThermalSpokeAngle (const EDA_ANGLE &aAngle)
 The orientation of the thermal spokes. More...
 
EDA_ANGLE GetThermalSpokeAngle () const
 
void SetThermalSpokeAngleDegrees (double aAngle)
 
double GetThermalSpokeAngleDegrees () const
 
void SetThermalGap (int aGap)
 
int GetThermalGap () const
 
int GetLocalThermalGapOverride (wxString *aSource=nullptr) const
 
void SetRoundRectCornerRadius (double aRadius)
 Has meaning only for rounded rectangle pads. More...
 
int GetRoundRectCornerRadius () const
 
VECTOR2I ShapePos () const
 
void SetRoundRectRadiusRatio (double aRadiusScale)
 Has meaning only for rounded rectangle pads. More...
 
double GetRoundRectRadiusRatio () const
 
void SetChamferRectRatio (double aChamferScale)
 Has meaning only for chamfered rectangular pads. More...
 
double GetChamferRectRatio () const
 
void SetChamferPositions (int aPositions)
 Has meaning only for chamfered rectangular pads. More...
 
int GetChamferPositions () const
 
int GetSubRatsnest () const
 
void SetSubRatsnest (int aSubRatsnest)
 
void SetRemoveUnconnected (bool aSet)
 Set the unconnected removal property. More...
 
bool GetRemoveUnconnected () const
 
void SetKeepTopBottom (bool aSet)
 Set 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) const
 Check to see whether the pad should be flashed on the specific layer. More...
 
PCB_LAYER_ID GetLayer () const override
 Return the primary layer this item is on. More...
 
PCB_LAYER_ID GetPrincipalLayer () const
 
bool FlashLayer (LSET aLayers) const
 Check to see if the pad should be flashed to any of the layers in the set. More...
 
bool HitTest (const VECTOR2I &aPosition, int aAccuracy=0) const override
 Test if aPosition is inside or on the boundary of this item. More...
 
bool HitTest (const BOX2I &aRect, bool aContained, int aAccuracy=0) const override
 Test if aRect intersects this item. More...
 
wxString GetClass () const override
 Return the class name. More...
 
const BOX2I GetBoundingBox () const override
 The bounding box is cached, so this will be efficient most of the time. More...
 
void SetDrawCoord ()
 
void SetLocalCoord ()
 < Set relative coordinates. More...
 
void Move (const VECTOR2I &aMoveVector) override
 Move this object. More...
 
void Rotate (const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
 Rotate this object. More...
 
wxString GetSelectMenuText (UNITS_PROVIDER *aUnitsProvider) const override
 Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
BITMAPS GetMenuImage () const override
 Return a pointer to an image to be used in menus. More...
 
wxString ShowPadShape () const
 
wxString ShowPadAttr () const
 
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
 Rebuild 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
 Returns information if the object is derived from BOARD_CONNECTED_ITEM. More...
 
NETINFO_ITEMGetNet () const
 Return #NET_INFO object for a given item. More...
 
void SetNet (NETINFO_ITEM *aNetInfo)
 Set a NET_INFO object for the item. More...
 
int GetNetCode () const
 
bool SetNetCode (int aNetCode, bool aNoAssert)
 Set net using a net code. More...
 
void SetNetCode (int aNetCode)
 
wxString GetNetname () const
 
wxString GetNetnameMsg () const
 
wxString GetShortNetname () const
 
virtual NETCLASSGetEffectiveNetClass () const
 Return the NETCLASS for this item. More...
 
wxString GetNetClassName () const
 Returns the name of the effective netclass. More...
 
void SetLocalRatsnestVisible (bool aVisible)
 
bool GetLocalRatsnestVisible () const
 
void SetParentGroup (PCB_GROUP *aGroup)
 
PCB_GROUPGetParentGroup () const
 
int GetX () const
 
int GetY () const
 
virtual bool IsTented () const
 
BOARD_ITEM_CONTAINERGetParentFootprint () const
 
virtual bool HasLineStroke () const
 Check if this item has line stoke properties. More...
 
virtual STROKE_PARAMS GetStroke () const
 
virtual void SetStroke (const STROKE_PARAMS &aStroke)
 
virtual void SetLayer (PCB_LAYER_ID aLayer)
 Set the layer this item is on. More...
 
virtual BOARD_ITEMDuplicate () const
 Create a copy of this BOARD_ITEM. More...
 
virtual bool IsKnockout () const
 
virtual void SetIsKnockout (bool aKnockout)
 
virtual void SetLocked (bool aLocked)
 
void DeleteStructure ()
 Delete this object after removing from its parent if it has one. More...
 
virtual const BOARDGetBoard () const
 Return the BOARD in which this BOARD_ITEM resides, or NULL if none. More...
 
virtual BOARDGetBoard ()
 
wxString GetLayerName () const
 Return the name of the PCB layer on which the item resides. More...
 
KICAD_T Type () const
 Returns the type of object. More...
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsResized () const
 
bool IsBrightened () const
 
bool IsRollover () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (EDA_ITEM_FLAGS type) const
 
void SetState (EDA_ITEM_FLAGS type, bool state)
 
EDA_ITEM_FLAGS GetStatus () const
 
void SetStatus (EDA_ITEM_FLAGS aStatus)
 
void SetFlags (EDA_ITEM_FLAGS aMask)
 
void ClearFlags (EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
EDA_ITEM_FLAGS GetFlags () const
 
bool HasFlag (EDA_ITEM_FLAGS aFlag) const
 
EDA_ITEM_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool RenderAsBitmap (double aWorldScale) const
 
void SetIsShownAsBitmap (bool aBitmap)
 
bool IsShownAsBitmap () const
 
void SetForceVisible (bool aEnable)
 Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
bool IsForceVisible () const
 
virtual const VECTOR2I GetFocusPosition () const
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual VECTOR2I GetSortPosition () const
 Return the coordinates that should be used for sorting this element visually compared to other elements. More...
 
virtual INSPECT_RESULT Visit (INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
 May be re-implemented for each derived class in order to handle all the types given by its member data. More...
 
wxString GetTypeDesc ()
 Return a translated description of the type for this EDA_ITEM for display in user facing messages. More...
 
virtual bool Matches (const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
virtual bool Replace (const EDA_SEARCH_DATA &aSearchData, void *aAuxData=nullptr)
 Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Override this method in any derived object that supports test find and replace. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
Get (PROPERTY_BASE *aProperty) const
 
template<typename T >
std::optional< T > Get (const wxString &aProperty) const
 

Static Public Member Functions

static 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 *aPadRef, const PAD *aPadCmp)
 Compare two pads and return 0 if they are equal. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 This changes first parameter to avoid the DList and use the main queue instead. More...
 
template<class T >
static INSPECT_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes)
 Change first parameter to avoid the DList and use std::vector instead. More...
 
static bool Replace (const EDA_SEARCH_DATA &aSearchData, wxString &aText)
 Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

const KIID m_Uuid
 

Static Public Attributes

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

Protected Member Functions

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

Protected Attributes

NETINFO_ITEMm_netinfo
 Store all information about the net that item belongs to. More...
 
PCB_LAYER_ID m_layer
 
bool m_isKnockout
 
bool m_isLocked
 
PCB_GROUPm_group
 
EDA_ITEM_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
EDA_ITEM_FLAGS m_flags
 

Private Member Functions

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

Private Attributes

wxString m_number
 
wxString m_pinFunction
 
wxString m_pinType
 
VECTOR2I m_pos
 
PAD_SHAPE m_padShape
 
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
 
bool m_shapesDirty
 
std::mutex m_shapesBuildingLock
 
BOX2I 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
 
VECTOR2I m_drill
 
VECTOR2I m_size
 
PAD_DRILL_SHAPE_T m_drillShape
 
double m_roundedCornerScale
 
double m_chamferScale
 
int m_chamferPositions
 
PAD_SHAPE m_anchorPadShape
 
VECTOR2I m_offset
 
LSET m_layerMask
 
VECTOR2I m_deltaSize
 
VECTOR2I m_pos0
 
PAD_ATTRIB m_attribute
 
PAD_PROP m_property
 
EDA_ANGLE m_orient
 
int m_lengthPadToDie
 
bool m_removeUnconnectedLayer
 < If true, the pad copper is removed for layers that are not connected. More...
 
bool m_keepTopBottomLayer
 
int m_localClearance
 
int m_localSolderMaskMargin
 
int m_localSolderPasteMargin
 
double m_localSolderPasteMarginRatio
 
ZONE_CONNECTION m_zoneConnection
 
int m_thermalSpokeWidth
 
EDA_ANGLE m_thermalSpokeAngle
 
int m_thermalGap
 
bool m_localRatsnestVisible
 
KICAD_T m_structType
 Run time identification, keep private so it can never be changed after a ctor sets it. More...
 
VIEW_ITEM_DATA * m_viewPrivData
 

Detailed Description

Definition at line 57 of file pad.h.

Constructor & Destructor Documentation

◆ PAD() [1/2]

PAD::PAD ( FOOTPRINT parent)

Definition at line 60 of file pad.cpp.

60 :
62{
63 m_size.x = m_size.y = EDA_UNIT_UTILS::Mils2IU( pcbIUScale, 60 ); // Default pad size 60 mils.
64 m_drill.x = m_drill.y = EDA_UNIT_UTILS::Mils2IU( pcbIUScale, 30 ); // Default drill size 30 mils.
67
70
71 SetShape( PAD_SHAPE::CIRCLE ); // Default pad shape is PAD_CIRCLE.
72 SetAnchorPadShape( PAD_SHAPE::CIRCLE ); // Default shape for custom shaped pads
73 // is PAD_CIRCLE.
74 SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle.
75 m_attribute = PAD_ATTRIB::PTH; // Default pad type is plated through hole
76 SetProperty( PAD_PROP::NONE ); // no special fabrication property
81
82 // Parameters for round rect only:
83 m_roundedCornerScale = 0.25; // from IPC-7351C standard
84
85 // Parameters for chamfered rect only:
86 m_chamferScale = 0.2; // Size of chamfer: ratio of smallest of X,Y size
87 m_chamferPositions = RECT_NO_CHAMFER; // No chamfered corner
88
89 m_zoneConnection = ZONE_CONNECTION::INHERITED; // Use parent setting by default
90 m_thermalSpokeWidth = 0; // Use parent setting by default
91 m_thermalSpokeAngle = ANGLE_45; // Default for circular pads
92 m_thermalGap = 0; // Use parent setting by default
93
95
96 // Set layers mask to default for a standard thru hole pad.
98
99 SetSubRatsnest( 0 ); // used in ratsnest calculations
100
101 SetDirty();
105}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:111
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:510
VECTOR2I GetPosition() const override
Definition: footprint.h:192
int m_localClearance
Definition: pad.h:811
int m_localSolderMaskMargin
Definition: pad.h:812
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea
Definition: pad.h:749
VECTOR2I m_size
Definition: pad.h:755
double m_localSolderPasteMarginRatio
Definition: pad.h:814
VECTOR2I m_drill
Definition: pad.h:754
int m_chamferPositions
Definition: pad.h:763
static LSET PTHMask()
layer set for a through hole pad
Definition: pad.cpp:174
double m_roundedCornerScale
Definition: pad.h:759
EDA_ANGLE m_orient
Definition: pad.h:791
void SetDrillShape(PAD_DRILL_SHAPE_T aShape)
Definition: pad.h:376
void SetProperty(PAD_PROP aProperty)
Definition: pad.cpp:664
PAD_ATTRIB m_attribute
Definition: pad.h:787
void SetDirty()
Definition: pad.h:384
int m_localSolderPasteMargin
Definition: pad.h:813
int m_effectiveBoundingRadius
Definition: pad.h:742
LSET m_layerMask
Definition: pad.h:777
int m_thermalGap
Definition: pad.h:821
FOOTPRINT * GetParent() const
Definition: pad.cpp:1464
ZONE_CONNECTION m_zoneConnection
Definition: pad.h:817
int m_thermalSpokeWidth
Definition: pad.h:818
VECTOR2I m_pos
Definition: pad.h:721
double m_chamferScale
Definition: pad.h:761
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
Definition: pad.h:179
void SetAnchorPadShape(PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
Definition: pad.h:227
bool m_removeUnconnectedLayer
< If true, the pad copper is removed for layers that are not connected.
Definition: pad.h:796
bool m_keepTopBottomLayer
Definition: pad.h:799
int m_lengthPadToDie
Definition: pad.h:793
EDA_ANGLE m_thermalSpokeAngle
Definition: pad.h:819
void SetSubRatsnest(int aSubRatsnest)
Definition: pad.h:581
static constexpr EDA_ANGLE & ANGLE_45
Definition: eda_angle.h:413
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:412
constexpr int Mils2IU(const EDA_IU_SCALE &aIuScale, int mils)
Definition: eda_units.h:123
@ CUST_PAD_SHAPE_IN_ZONE_OUTLINE
Definition: pad.h:43
@ PTH
Plated through hole pad.
@ PAD_DRILL_SHAPE_CIRCLE
Definition: pad_shapes.h:70
@ NONE
no special fabrication property
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87

References ANGLE_0, ANGLE_45, CIRCLE, 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_thermalSpokeAngle, m_thermalSpokeWidth, m_zoneConnection, EDA_UNIT_UTILS::Mils2IU(), NONE, PAD_DRILL_SHAPE_CIRCLE, PCB_FOOTPRINT_T, pcbIUScale, PTH, PTHMask(), RECT_NO_CHAMFER, SetAnchorPadShape(), SetDirty(), SetDrillShape(), SetProperty(), SetShape(), SetSubRatsnest(), EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by Clone().

◆ PAD() [2/2]

PAD::PAD ( const PAD aPad)

Definition at line 108 of file pad.cpp.

108 :
109 BOARD_CONNECTED_ITEM( aOther.GetParent(), PCB_PAD_T )
110{
111 PAD::operator=( aOther );
112
113 const_cast<KIID&>( m_Uuid ) = aOther.m_Uuid;
114}
const KIID m_Uuid
Definition: eda_item.h:506
Definition: kiid.h:47
PAD & operator=(const PAD &aOther)
Definition: pad.cpp:117

References EDA_ITEM::m_Uuid, and operator=().

Member Function Documentation

◆ addPadPrimitivesToPolygon()

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

Definition at line 205 of file pad_custom_shape_functions.cpp.

207{
208 SHAPE_POLY_SET polyset;
209
210 for( const std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
211 {
212 if( !primitive->IsAnnotationProxy() )
213 {
214 primitive->TransformShapeWithClearanceToPolygon( polyset, UNDEFINED_LAYER, 0, aError,
215 aErrorLoc );
216 }
217 }
218
220
221 // Merge all polygons with the initial pad anchor shape
222 if( polyset.OutlineCount() )
223 {
224 aMergedPolygon->BooleanAdd( polyset, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
226 }
227}
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
Definition: pad.h:730
Represent a set of closed polygons.
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset difference For aFastMode meaning, see function booleanOp.
void Simplify(POLYGON_MODE aFastMode)
int OutlineCount() const
Return the number of vertices in a given outline/hole.
@ UNDEFINED_LAYER
Definition: layer_ids.h:60

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, SHAPE_POLY_SET::Simplify(), and UNDEFINED_LAYER.

Referenced by GetBestAnchorPosition(), and MergePrimitivesAsPolygon().

◆ AddPrimitive()

void PAD::AddPrimitive ( PCB_SHAPE aPrimitive)

Add item to the custom shape primitives list.

Definition at line 187 of file pad_custom_shape_functions.cpp.

188{
189 aPrimitive->SetParent( this );
190 m_editPrimitives.emplace_back( aPrimitive );
191
192 SetDirty();
193}
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:114

References m_editPrimitives, SetDirty(), and EDA_ITEM::SetParent().

Referenced by AppendPrimitives(), and PAD_TOOL::RecombinePad().

◆ AddPrimitiveAnnotationBox()

void PAD::AddPrimitiveAnnotationBox ( const VECTOR2I aStart,
const VECTOR2I aEnd 
)

Has meaning only for custom shape pads.

Allows one to specify the box in which to place the pad number and/or net name (if they are being displayed).

Definition at line 150 of file pad_custom_shape_functions.cpp.

151{
152 PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::RECT );
153 item->SetIsAnnotationProxy();
154 item->SetFilled( false );
155 item->SetStart( aStart );
156 item->SetEnd( aEnd );
158 item->SetParent( this );
159 m_editPrimitives.emplace_back( item );
160 SetDirty();
161}
void SetFilled(bool aFlag)
Definition: eda_shape.h:96
void SetStart(const VECTOR2I &aStart)
Definition: eda_shape.h:121
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:146
void SetIsAnnotationProxy(bool aIsProxy=true)
Definition: eda_shape.h:89
void SetStroke(const STROKE_PARAMS &aStroke) override
Definition: pcb_shape.h:70
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88

References m_editPrimitives, RECT, SetDirty(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), EDA_SHAPE::SetIsAnnotationProxy(), EDA_ITEM::SetParent(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), and SOLID.

◆ AddPrimitiveArc()

void PAD::AddPrimitiveArc ( const VECTOR2I aCenter,
const VECTOR2I aStart,
const EDA_ANGLE aArcAngle,
int  aThickness 
)

Definition at line 92 of file pad_custom_shape_functions.cpp.

94{
95 PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::ARC );
96 item->SetFilled( false );
97 item->SetCenter( aCenter );
98 item->SetStart( aStart );
99 item->SetArcAngleAndEnd( aArcAngle );
100 item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) );
101 item->SetParent( this );
102 m_editPrimitives.emplace_back( item );
103 SetDirty();
104}
void SetCenter(const VECTOR2I &aCenter)
Definition: eda_shape.cpp:423
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Set the end point from the angle center and start.
Definition: eda_shape.cpp:549

References ARC, m_editPrimitives, EDA_SHAPE::SetArcAngleAndEnd(), EDA_SHAPE::SetCenter(), SetDirty(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetParent(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), and SOLID.

◆ AddPrimitiveCircle()

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

Definition at line 123 of file pad_custom_shape_functions.cpp.

124{
125 PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::CIRCLE );
126 item->SetFilled( aFilled );
127 item->SetStart( aCenter );
128 item->SetEnd( wxPoint( aCenter.x + aRadius, aCenter.y ) );
129 item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) );
130 item->SetParent( this );
131 m_editPrimitives.emplace_back( item );
132 SetDirty();
133}

References CIRCLE, m_editPrimitives, SetDirty(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetParent(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), SOLID, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ AddPrimitiveCurve()

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

Definition at line 107 of file pad_custom_shape_functions.cpp.

109{
110 PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::BEZIER );
111 item->SetFilled( false );
112 item->SetStart( aStart );
113 item->SetEnd( aEnd );
114 item->SetBezierC1( aCtrl1 );
115 item->SetBezierC2( aCtrl2 );
116 item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) );
117 item->SetParent( this );
118 m_editPrimitives.emplace_back( item );
119 SetDirty();
120}
void SetBezierC2(const VECTOR2I &aPt)
Definition: eda_shape.h:175
void SetBezierC1(const VECTOR2I &aPt)
Definition: eda_shape.h:172

References BEZIER, m_editPrimitives, EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), SetDirty(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetParent(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), and SOLID.

◆ 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 40 of file pad_custom_shape_functions.cpp.

41{
42 // If aPoly has holes, convert it to a polygon with no holes.
43 SHAPE_POLY_SET poly_no_hole;
44 poly_no_hole.Append( aPoly );
45
46 if( poly_no_hole.HasHoles() )
48
49 // There should never be multiple shapes, but if there are, we split them into
50 // primitives so that we can edit them both.
51 for( int ii = 0; ii < poly_no_hole.OutlineCount(); ++ii )
52 {
53 SHAPE_POLY_SET poly_outline( poly_no_hole.COutline( ii ) );
54 PCB_SHAPE* item = new PCB_SHAPE();
55 item->SetShape( SHAPE_T::POLY );
56 item->SetFilled( aFilled );
57 item->SetPolyShape( poly_outline );
58 item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) );
59 item->SetParent( this );
60 m_editPrimitives.emplace_back( item );
61 }
62
63 SetDirty();
64}
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition: eda_shape.h:252
void SetShape(SHAPE_T aShape)
Definition: eda_shape.h:111
bool HasHoles() const
Return true if the polygon set has any holes that share a vertex.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const

References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::COutline(), SHAPE_POLY_SET::Fracture(), SHAPE_POLY_SET::HasHoles(), m_editPrimitives, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, POLY, SetDirty(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetParent(), EDA_SHAPE::SetPolyShape(), EDA_SHAPE::SetShape(), PCB_SHAPE::SetStroke(), and SOLID.

◆ AddPrimitivePoly() [2/2]

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

Definition at line 67 of file pad_custom_shape_functions.cpp.

68{
69 PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::POLY );
70 item->SetFilled( aFilled );
71 item->SetPolyPoints( aPoly );
72 item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) );
73 item->SetParent( this );
74 m_editPrimitives.emplace_back( item );
75 SetDirty();
76}
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
Definition: eda_shape.cpp:1069

References m_editPrimitives, POLY, SetDirty(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetParent(), EDA_SHAPE::SetPolyPoints(), PCB_SHAPE::SetStroke(), and SOLID.

◆ AddPrimitiveRect()

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

Definition at line 136 of file pad_custom_shape_functions.cpp.

138{
139 PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::RECT );
140 item->SetFilled( aFilled );
141 item->SetStart( aStart );
142 item->SetEnd( aEnd );
143 item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) );
144 item->SetParent( this );
145 m_editPrimitives.emplace_back( item );
146 SetDirty();
147}

References m_editPrimitives, RECT, SetDirty(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetParent(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), and SOLID.

◆ AddPrimitiveSegment()

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

Definition at line 79 of file pad_custom_shape_functions.cpp.

80{
81 PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::SEGMENT );
82 item->SetFilled( false );
83 item->SetStart( aStart );
84 item->SetEnd( aEnd );
85 item->SetStroke( STROKE_PARAMS( aThickness, PLOT_DASH_TYPE::SOLID ) );
86 item->SetParent( this );
87 m_editPrimitives.emplace_back( item );
88 SetDirty();
89}

References m_editPrimitives, SEGMENT, SetDirty(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), EDA_ITEM::SetParent(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), and SOLID.

◆ ApertureMask()

LSET PAD::ApertureMask ( )
static

layer set for an aperture pad

Definition at line 202 of file pad.cpp.

203{
204 static LSET saved( 1, F_Paste );
205 return saved;
206}
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
@ F_Paste
Definition: layer_ids.h:101

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 primitive list (composed of basic shapes) and add items to the current list.

Copies the input, which is not altered.

Definition at line 177 of file pad_custom_shape_functions.cpp.

178{
179 // Add duplicates of aPrimitivesList to the pad primitives list:
180 for( const std::shared_ptr<PCB_SHAPE>& prim : aPrimitivesList )
181 AddPrimitive( new PCB_SHAPE( *prim ) );
182
183 SetDirty();
184}
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 574 of file pad.cpp.

575{
576 std::lock_guard<std::mutex> RAII_lock( m_polyBuildingLock );
577
578 // If we had to wait for the lock then we were probably waiting for someone else to
579 // finish rebuilding the shapes. So check to see if they're clean now.
580 if( !m_polyDirty )
581 return;
582
583 const BOARD* board = GetBoard();
584 int maxError = board ? board->GetDesignSettings().m_MaxError : ARC_HIGH_DEF;
585
586 // Polygon
587 m_effectivePolygon = std::make_shared<SHAPE_POLY_SET>();
589 ERROR_INSIDE );
590
591 // Bounding radius
592 //
593 // PADSTACKS TODO: these will both need to cycle through all layers to get the largest
594 // values....
596
597 for( int cnt = 0; cnt < m_effectivePolygon->OutlineCount(); ++cnt )
598 {
599 const SHAPE_LINE_CHAIN& poly = m_effectivePolygon->COutline( cnt );
600
601 for( int ii = 0; ii < poly.PointCount(); ++ii )
602 {
603 int dist = KiROUND( ( poly.CPoint( ii ) - m_pos ).EuclideanNorm() );
605 }
606 }
607
608 // All done
609 m_polyDirty = false;
610}
constexpr int ARC_HIGH_DEF
Definition: base_units.h:121
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:37
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:602
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
Definition: pad.cpp:1576
std::mutex m_polyBuildingLock
Definition: pad.h:740
bool m_polyDirty
Definition: pad.h:739
std::shared_ptr< SHAPE_POLY_SET > m_effectivePolygon
Definition: pad.h:741
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
@ ERROR_INSIDE
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:80

References ARC_HIGH_DEF, SHAPE_LINE_CHAIN::CPoint(), ERROR_INSIDE, 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

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

Definition at line 402 of file pad.cpp.

403{
404 std::lock_guard<std::mutex> RAII_lock( m_shapesBuildingLock );
405
406 // If we had to wait for the lock then we were probably waiting for someone else to
407 // finish rebuilding the shapes. So check to see if they're clean now.
408 if( !m_shapesDirty )
409 return;
410
411 const BOARD* board = GetBoard();
412 int maxError = board ? board->GetDesignSettings().m_MaxError : ARC_HIGH_DEF;
413
414 m_effectiveShape = std::make_shared<SHAPE_COMPOUND>();
415 m_effectiveHoleShape = nullptr;
416
417 auto add = [this]( SHAPE* aShape )
418 {
419 m_effectiveShape->AddShape( aShape );
420 };
421
422 VECTOR2I shapePos = ShapePos(); // Fetch only once; rotation involves trig
423 PAD_SHAPE effectiveShape = GetShape();
424
425 if( GetShape() == PAD_SHAPE::CUSTOM )
426 effectiveShape = GetAnchorPadShape();
427
428 switch( effectiveShape )
429 {
431 add( new SHAPE_CIRCLE( shapePos, m_size.x / 2 ) );
432 break;
433
434 case PAD_SHAPE::OVAL:
435 if( m_size.x == m_size.y ) // the oval pad is in fact a circle
436 {
437 add( new SHAPE_CIRCLE( shapePos, m_size.x / 2 ) );
438 }
439 else
440 {
441 VECTOR2I half_size = m_size / 2;
442 int half_width = std::min( half_size.x, half_size.y );
443 VECTOR2I half_len( half_size.x - half_width, half_size.y - half_width );
444 RotatePoint( half_len, m_orient );
445 add( new SHAPE_SEGMENT( shapePos - half_len, shapePos + half_len, half_width * 2 ) );
446 }
447
448 break;
449
450 case PAD_SHAPE::RECT:
453 {
454 int r = ( effectiveShape == PAD_SHAPE::ROUNDRECT ) ? GetRoundRectCornerRadius() : 0;
455 VECTOR2I half_size( m_size.x / 2, m_size.y / 2 );
456 VECTOR2I trap_delta( 0, 0 );
457
458 if( r )
459 {
460 half_size -= VECTOR2I( r, r );
461
462 // Avoid degenerated shapes (0 length segments) that always create issues
463 // For roundrect pad very near a circle, use only a circle
464 const int min_len = pcbIUScale.mmToIU( 0.0001);
465
466 if( half_size.x < min_len && half_size.y < min_len )
467 {
468 add( new SHAPE_CIRCLE( shapePos, r ) );
469 break;
470 }
471 }
472 else if( effectiveShape == PAD_SHAPE::TRAPEZOID )
473 {
474 trap_delta = m_deltaSize / 2;
475 }
476
477 SHAPE_LINE_CHAIN corners;
478
479 corners.Append( -half_size.x - trap_delta.y, half_size.y + trap_delta.x );
480 corners.Append( half_size.x + trap_delta.y, half_size.y - trap_delta.x );
481 corners.Append( half_size.x - trap_delta.y, -half_size.y + trap_delta.x );
482 corners.Append( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x );
483
484 corners.Rotate( m_orient );
485 corners.Move( shapePos );
486
487 // GAL renders rectangles faster than 4-point polygons so it's worth checking if our
488 // body shape is a rectangle.
489 if( corners.PointCount() == 4
490 &&
491 ( ( corners.CPoint( 0 ).y == corners.CPoint( 1 ).y
492 && corners.CPoint( 1 ).x == corners.CPoint( 2 ).x
493 && corners.CPoint( 2 ).y == corners.CPoint( 3 ).y
494 && corners.CPoint( 3 ).x == corners.CPoint( 0 ).x )
495 ||
496 ( corners.CPoint( 0 ).x == corners.CPoint( 1 ).x
497 && corners.CPoint( 1 ).y == corners.CPoint( 2 ).y
498 && corners.CPoint( 2 ).x == corners.CPoint( 3 ).x
499 && corners.CPoint( 3 ).y == corners.CPoint( 0 ).y )
500 )
501 )
502 {
503 int width = std::abs( corners.CPoint( 2 ).x - corners.CPoint( 0 ).x );
504 int height = std::abs( corners.CPoint( 2 ).y - corners.CPoint( 0 ).y );
505 VECTOR2I pos( std::min( corners.CPoint( 2 ).x, corners.CPoint( 0 ).x ),
506 std::min( corners.CPoint( 2 ).y, corners.CPoint( 0 ).y ) );
507
508 add( new SHAPE_RECT( pos, width, height ) );
509 }
510 else
511 {
512 add( new SHAPE_SIMPLE( corners ) );
513 }
514
515 if( r )
516 {
517 add( new SHAPE_SEGMENT( corners.CPoint( 0 ), corners.CPoint( 1 ), r * 2 ) );
518 add( new SHAPE_SEGMENT( corners.CPoint( 1 ), corners.CPoint( 2 ), r * 2 ) );
519 add( new SHAPE_SEGMENT( corners.CPoint( 2 ), corners.CPoint( 3 ), r * 2 ) );
520 add( new SHAPE_SEGMENT( corners.CPoint( 3 ), corners.CPoint( 0 ), r * 2 ) );
521 }
522 }
523 break;
524
526 {
527 SHAPE_POLY_SET outline;
528
531 GetChamferPositions(), 0, maxError, ERROR_INSIDE );
532
533 add( new SHAPE_SIMPLE( outline.COutline( 0 ) ) );
534 }
535 break;
536
537 default:
538 wxFAIL_MSG( wxT( "PAD::buildEffectiveShapes: Unsupported pad shape: " )
539 + PAD_SHAPE_T_asString( effectiveShape ) );
540 break;
541 }
542
543 if( GetShape() == PAD_SHAPE::CUSTOM )
544 {
545 for( const std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
546 {
547 for( SHAPE* shape : primitive->MakeEffectiveShapes() )
548 {
549 shape->Rotate( m_orient );
550 shape->Move( shapePos );
551 add( shape );
552 }
553 }
554 }
555
557
558 // Hole shape
559 VECTOR2I half_size = m_drill / 2;
560 int half_width = std::min( half_size.x, half_size.y );
561 VECTOR2I half_len( half_size.x - half_width, half_size.y - half_width );
562
563 RotatePoint( half_len, m_orient );
564
565 m_effectiveHoleShape = std::make_shared<SHAPE_SEGMENT>( m_pos - half_len, m_pos + half_len,
566 half_width * 2 );
568
569 // All done
570 m_shapesDirty = false;
571}
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:588
VECTOR2I m_deltaSize
Definition: pad.h:780
std::mutex m_shapesBuildingLock
Definition: pad.h:734
int GetRoundRectCornerRadius() const
Definition: pad.cpp:307
std::shared_ptr< SHAPE_SEGMENT > m_effectiveHoleShape
Definition: pad.h:737
VECTOR2I ShapePos() const
Definition: pad.cpp:748
PAD_SHAPE GetShape() const
Definition: pad.h:188
bool m_shapesDirty
Definition: pad.h:733
int GetChamferPositions() const
Definition: pad.h:575
const VECTOR2I & GetSize() const
Definition: pad.h:251
std::shared_ptr< SHAPE_COMPOUND > m_effectiveShape
Definition: pad.h:736
PAD_SHAPE GetAnchorPadShape() const
Definition: pad.h:201
double GetChamferRectRatio() const
Definition: pad.h:565
BOX2I m_effectiveBoundingBox
Definition: pad.h:735
void Move(const VECTOR2I &aVector) override
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
Definition: shape_simple.h:42
An abstract shape on 2D plane.
Definition: shape.h:123
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const VECTOR2I &aPosition, const VECTOR2I &aSize, const EDA_ANGLE &aRotation, int aCornerRadius, double aChamferRatio, int aChamferCorners, int aInflate, int aError, ERROR_LOC aErrorLoc)
Convert a rectangle with rounded corners and/or chamfered corners to a polygon.
E_SERIE r
Definition: eserie.cpp:41
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:401
static std::string PAD_SHAPE_T_asString(PAD_SHAPE a)
Definition: pad_shapes.h:48
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition: pad_shapes.h:35
constexpr int mmToIU(double mm) const
Definition: base_units.h:89
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Definition: trigo.cpp:183
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618

References std::abs(), SHAPE_LINE_CHAIN::Append(), ARC_HIGH_DEF, CHAMFERED_RECT, CIRCLE, SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), CUSTOM, ERROR_INSIDE, GetAnchorPadShape(), BOARD_ITEM::GetBoard(), GetChamferPositions(), GetChamferRectRatio(), BOARD::GetDesignSettings(), GetRoundRectCornerRadius(), GetShape(), GetSize(), 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, BOX2< Vec >::Merge(), EDA_IU_SCALE::mmToIU(), SHAPE_LINE_CHAIN::Move(), OVAL, PAD_SHAPE_T_asString(), pcbIUScale, SHAPE_LINE_CHAIN::PointCount(), r, RECT, SHAPE_LINE_CHAIN::Rotate(), RotatePoint(), ROUNDRECT, ShapePos(), TransformRoundChamferedRectToPolygon(), TRAPEZOID, VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ CanHaveNumber()

bool PAD::CanHaveNumber ( ) const

Indicates whether or not the pad can have a number.

(NPTH and SMD aperture pads can not.)

Definition at line 137 of file pad.cpp.

138{
139 // Aperture pads don't get a number
140 if( IsAperturePad() )
141 return false;
142
143 // NPTH pads don't get numbers
145 return false;
146
147 return true;
148}
bool IsAperturePad() const
Definition: pad.h:401
PAD_ATTRIB GetAttribute() const
Definition: pad.h:394
@ NPTH
like PAD_PTH, but not plated

References GetAttribute(), IsAperturePad(), and NPTH.

◆ ClassOf()

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

Definition at line 79 of file pad.h.

80 {
81 return aItem && PCB_PAD_T == aItem->Type();
82 }

References PCB_PAD_T, and EDA_ITEM::Type().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 136 of file eda_item.h.

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

References BRIGHTENED, and EDA_ITEM::ClearFlags().

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

◆ ClearEditFlags()

◆ ClearFlags()

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

Definition at line 157 of file eda_item.h.

157{ m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:512

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), FOOTPRINT::BuildCourtyardCaches(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), 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(), SCH_ITEM::Duplicate(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE_ON_MOVE::Init(), EE_COLLECTOR::Inspect(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), DIALOG_SYMBOL_PROPERTIES::OnUnitChoice(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), PAD_TOOL::RecombinePad(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), DRC_TEST_PROVIDER_DISALLOW::Run(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetIsShownAsBitmap(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), SCH_DRAWING_TOOLS::TwoClickPlace(), and EE_SELECTION_TOOL::unhighlight().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 169 of file eda_item.h.

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

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

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

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 143 of file view_item.h.

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

References KIGFX::VIEW_ITEM::m_viewPrivData.

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

◆ Clone()

EDA_ITEM * 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 1273 of file pad.cpp.

1274{
1275 return new PAD( *this );
1276}
PAD(FOOTPRINT *parent)
Definition: pad.cpp:60

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 687 of file pad.h.

688 {
689 return (PAD*) Clone();
690 }
Definition: pad.h:58
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pad.cpp:1273

References Clone().

◆ Compare()

int PAD::Compare ( const PAD aPadRef,
const PAD aPadCmp 
)
static

Compare two pads and return 0 if they are equal.

Returns
less than 0 if left less than right, 0 if equal, or greater than 0 if left greater than right.

Definition at line 1102 of file pad.cpp.

1103{
1104 int diff;
1105
1106 if( ( diff = static_cast<int>( aPadRef->GetShape() ) -
1107 static_cast<int>( aPadCmp->GetShape() ) ) != 0 )
1108 return diff;
1109
1110 if( ( diff = static_cast<int>( aPadRef->m_attribute ) -
1111 static_cast<int>( aPadCmp->m_attribute ) ) != 0 )
1112 return diff;
1113
1114 if( ( diff = aPadRef->m_drillShape - aPadCmp->m_drillShape ) != 0 )
1115 return diff;
1116
1117 if( ( diff = aPadRef->m_drill.x - aPadCmp->m_drill.x ) != 0 )
1118 return diff;
1119
1120 if( ( diff = aPadRef->m_drill.y - aPadCmp->m_drill.y ) != 0 )
1121 return diff;
1122
1123 if( ( diff = aPadRef->m_size.x - aPadCmp->m_size.x ) != 0 )
1124 return diff;
1125
1126 if( ( diff = aPadRef->m_size.y - aPadCmp->m_size.y ) != 0 )
1127 return diff;
1128
1129 if( ( diff = aPadRef->m_offset.x - aPadCmp->m_offset.x ) != 0 )
1130 return diff;
1131
1132 if( ( diff = aPadRef->m_offset.y - aPadCmp->m_offset.y ) != 0 )
1133 return diff;
1134
1135 if( ( diff = aPadRef->m_deltaSize.x - aPadCmp->m_deltaSize.x ) != 0 )
1136 return diff;
1137
1138 if( ( diff = aPadRef->m_deltaSize.y - aPadCmp->m_deltaSize.y ) != 0 )
1139 return diff;
1140
1141 if( ( diff = aPadRef->m_roundedCornerScale - aPadCmp->m_roundedCornerScale ) != 0 )
1142 return diff;
1143
1144 if( ( diff = aPadRef->m_chamferPositions - aPadCmp->m_chamferPositions ) != 0 )
1145 return diff;
1146
1147 if( ( diff = aPadRef->m_chamferScale - aPadCmp->m_chamferScale ) != 0 )
1148 return diff;
1149
1150 if( ( diff = static_cast<int>( aPadRef->m_editPrimitives.size() ) -
1151 static_cast<int>( aPadCmp->m_editPrimitives.size() ) ) != 0 )
1152 return diff;
1153
1154 // @todo: Compare custom pad primitives for pads that have the same number of primitives
1155 // here. Currently there is no compare function for PCB_SHAPE objects.
1156
1157 // Dick: specctra_export needs this
1158 // Lorenzo: gencad also needs it to implement padstacks!
1159
1160#if __cplusplus >= 201103L
1161 long long d = aPadRef->m_layerMask.to_ullong() - aPadCmp->m_layerMask.to_ullong();
1162
1163 if( d < 0 )
1164 return -1;
1165 else if( d > 0 )
1166 return 1;
1167
1168 return 0;
1169#else
1170 // these strings are not typically constructed, since we don't get here often.
1171 std::string s1 = aPadRef->m_layerMask.to_string();
1172 std::string s2 = aPadCmp->m_layerMask.to_string();
1173 return s1.compare( s2 );
1174#endif
1175}
PAD_DRILL_SHAPE_T m_drillShape
Definition: pad.h:757
VECTOR2I m_offset
Definition: pad.h:775

References GetShape(), m_attribute, m_chamferPositions, m_chamferScale, m_deltaSize, m_drill, m_drillShape, m_editPrimitives, m_layerMask, m_offset, m_roundedCornerScale, m_size, VECTOR2< T >::x, and VECTOR2< T >::y.

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 188 of file pad.cpp.

189{
190 static LSET saved( 2, F_Cu, F_Mask );
191 return saved;
192}
@ F_Mask
Definition: layer_ids.h:107
@ F_Cu
Definition: layer_ids.h:64

References F_Cu, and F_Mask.

Referenced by DIALOG_PAD_PROPERTIES::updatePadLayersList().

◆ DeletePrimitivesList()

void PAD::DeletePrimitivesList ( )

Clear the basic shapes list.

Definition at line 197 of file pad_custom_shape_functions.cpp.

198{
199 m_editPrimitives.clear();
200
201 SetDirty();
202}

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 144 of file board_item.cpp.

145{
147
148 if( parent )
149 parent->Remove( this );
150
151 delete this;
152}
Abstract interface for BOARD_ITEMs capable of storing other items inside.
virtual void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL)=0
Removes an item from the container.
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:152

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

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

◆ Duplicate()

BOARD_ITEM * BOARD_ITEM::Duplicate ( ) const
virtualinherited

Create a copy of this BOARD_ITEM.

Reimplemented in FOOTPRINT.

Definition at line 160 of file board_item.cpp.

161{
162 BOARD_ITEM* dupe = static_cast<BOARD_ITEM*>( Clone() );
163 const_cast<KIID&>( dupe->m_Uuid ) = KIID();
164
165 if( dupe->GetParentGroup() )
166 dupe->GetParentGroup()->AddItem( dupe );
167
168 return static_cast<BOARD_ITEM*>( dupe );
169}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:52
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:64
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:82
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Definition: pcb_group.cpp:39

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

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

◆ FlashLayer() [1/2]

bool PAD::FlashLayer ( int  aLayer) const

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

Parameters
aLayerLayer to check for connectivity
Returns
true if connected by pad or track (or optionally zone)

Heat sink pads always get copper

Definition at line 245 of file pad.cpp.

246{
247 if( aLayer != UNDEFINED_LAYER && !IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) ) )
248 return false;
249
250 if( aLayer == UNDEFINED_LAYER )
251 return true;
252
253 if( GetAttribute() == PAD_ATTRIB::NPTH && IsCopperLayer( aLayer ) )
254 {
256 {
257 if( GetOffset() == VECTOR2I( 0, 0 ) && GetDrillSize().x >= GetSize().x )
258 return false;
259 }
261 {
262 if( GetOffset() == VECTOR2I( 0, 0 )
263 && GetDrillSize().x >= GetSize().x && GetDrillSize().y >= GetSize().y )
264 {
265 return false;
266 }
267 }
268 }
269
270 if( LSET::FrontBoardTechMask().test( aLayer ) )
271 aLayer = F_Cu;
272 else if( LSET::BackBoardTechMask().test( aLayer ) )
273 aLayer = B_Cu;
274
275 if( GetAttribute() == PAD_ATTRIB::PTH && IsCopperLayer( aLayer ) )
276 {
279 return true;
280
282 return true;
283
284 // Plated through hole pads need copper on the top/bottom layers for proper soldering
285 // Unless the user has removed them in the pad dialog
286 if( m_keepTopBottomLayer && ( aLayer == F_Cu || aLayer == B_Cu ) )
287 return true;
288
289 if( const BOARD* board = GetBoard() )
290 {
291 // Must be static to keep from raising its ugly head in performance profiles
292 static std::initializer_list<KICAD_T> types = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T,
293 PCB_PAD_T };
294
295 // Do not check zones. Doing so results in race conditions when the via collides with
296 // two different zones of different priorities.
297 // See https://gitlab.com/kicad/code/kicad/-/issues/11299.
298
299 return board->GetConnectivity()->IsConnectedOnLayer( this, aLayer, types, true );
300 }
301 }
302
303 return true;
304}
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
Definition: lset.cpp:834
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
Definition: lset.cpp:821
PAD_PROP GetProperty() const
Definition: pad.h:397
PAD_DRILL_SHAPE_T GetDrillShape() const
Definition: pad.h:377
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: pad.h:600
const VECTOR2I & GetDrillSize() const
Definition: pad.h:261
const VECTOR2I & GetOffset() const
Definition: pad.h:268
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:823
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ B_Cu
Definition: layer_ids.h:95
@ PAD_DRILL_SHAPE_OBLONG
Definition: pad_shapes.h:71
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:102
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:103
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:101

References B_Cu, LSET::BackBoardTechMask(), CIRCLE, F_Cu, LSET::FrontBoardTechMask(), GetAttribute(), BOARD_ITEM::GetBoard(), GetDrillShape(), GetDrillSize(), GetOffset(), GetProperty(), GetShape(), GetSize(), HEATSINK, IsCopperLayer(), IsOnLayer(), m_keepTopBottomLayer, m_removeUnconnectedLayer, NPTH, OVAL, PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG, PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, PTH, and UNDEFINED_LAYER.

Referenced by KIGFX::PCB_PAINTER::draw(), FlashLayer(), GetEffectiveShape(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), and ViewGetLOD().

◆ FlashLayer() [2/2]

bool PAD::FlashLayer ( LSET  aLayers) const

Check 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
Returns
true if connected by pad or track (or optionally zone) on any of the associated layers

Definition at line 233 of file pad.cpp.

234{
235 for( PCB_LAYER_ID layer : aLayers.Seq() )
236 {
237 if( FlashLayer( layer ) )
238 return true;
239 }
240
241 return false;
242}
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) const
Check to see whether the pad should be flashed on the specific layer.
Definition: pad.cpp:245

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

◆ Flip()

void PAD::Flip ( const VECTOR2I 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 681 of file pad.cpp.

682{
683 if( aFlipLeftRight )
684 {
685 MIRROR( m_pos.x, aCentre.x );
686 MIRROR( m_pos0.x, 0 );
687 MIRROR( m_offset.x, 0 );
688 MIRROR( m_deltaSize.x, 0 );
689 }
690 else
691 {
692 MIRROR( m_pos.y, aCentre.y );
693 MIRROR( m_pos0.y, 0 );
694 MIRROR( m_offset.y, 0 );
695 MIRROR( m_deltaSize.y, 0 );
696 }
697
699
700 auto mirrorBitFlags = []( int& aBitfield, int a, int b )
701 {
702 bool temp = aBitfield & a;
703
704 if( aBitfield & b )
705 aBitfield |= a;
706 else
707 aBitfield &= ~a;
708
709 if( temp )
710 aBitfield |= b;
711 else
712 aBitfield &= ~b;
713 };
714
715 if( aFlipLeftRight )
716 {
719 }
720 else
721 {
724 }
725
726 // flip pads layers
727 // PADS items are currently on all copper layers, or
728 // currently, only on Front or Back layers.
729 // So the copper layers count is not taken in account
731
732 // Flip the basic shapes, in custom pads
733 FlipPrimitives( aFlipLeftRight );
734
735 SetDirty();
736}
void SetLayerSet(LSET aLayers) override
Definition: pad.h:390
void FlipPrimitives(bool aFlipLeftRight)
Flip (mirror) the primitives left to right or top to bottom, around the anchor position in custom pad...
Definition: pad.cpp:739
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition: pad.h:364
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
Definition: pad.cpp:672
VECTOR2I m_pos0
Definition: pad.h:784
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint.
Definition: lset.cpp:590
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Definition: mirror.h:40

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(), SetOrientation(), VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ 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 739 of file pad.cpp.

740{
741 for( std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
742 primitive->Flip( VECTOR2I( 0, 0 ), aFlipLeftRight );
743
744 SetDirty();
745}

References m_editPrimitives, and SetDirty().

Referenced by Flip(), mirrorPadX(), and mirrorPadY().

◆ Get() [1/3]

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

Definition at line 104 of file inspectable.h.

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

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

◆ Get() [2/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty) const
inlineinherited

Definition at line 84 of file inspectable.h.

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

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

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

◆ Get() [3/3]

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

Definition at line 92 of file inspectable.h.

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

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

◆ GetAnchorPadShape()

PAD_SHAPE PAD::GetAnchorPadShape ( ) const
inline

◆ GetAttribute()

◆ GetBestAnchorPosition()

bool PAD::GetBestAnchorPosition ( VECTOR2I aPos)

Definition at line 258 of file pad_custom_shape_functions.cpp.

259{
260 SHAPE_POLY_SET poly;
262
263 if( poly.OutlineCount() > 1 )
264 return false;
265
266 const int minSteps = 10;
267 const int maxSteps = 50;
268
269 int stepsX, stepsY;
270
271 auto bbox = poly.BBox();
272
273 if( bbox.GetWidth() < bbox.GetHeight() )
274 {
275 stepsX = minSteps;
276 stepsY = minSteps * (double) bbox.GetHeight() / (double )(bbox.GetWidth() + 1);
277 }
278 else
279 {
280 stepsY = minSteps;
281 stepsX = minSteps * (double) bbox.GetWidth() / (double )(bbox.GetHeight() + 1);
282 }
283
284 stepsX = std::max(minSteps, std::min( maxSteps, stepsX ) );
285 stepsY = std::max(minSteps, std::min( maxSteps, stepsY ) );
286
287 VECTOR2I center = bbox.Centre();
288
289 int64_t minDist = std::numeric_limits<int64_t>::max();
290 int64_t minDistEdge;
291
293 {
294 minDistEdge = GetSize().x;
295 }
296 else
297 {
298 minDistEdge = std::max( GetSize().x, GetSize().y );
299 }
300
301 std::optional<VECTOR2I> bestAnchor( []()->std::optional<VECTOR2I> { return std::nullopt; }() );
302
303 for( int y = 0; y < stepsY ; y++ )
304 {
305 for( int x = 0; x < stepsX; x++ )
306 {
307 VECTOR2I p = bbox.GetPosition();
308 p.x += rescale( x, bbox.GetWidth(), (stepsX - 1) );
309 p.y += rescale( y, bbox.GetHeight(), (stepsY - 1) );
310
311 if( poly.Contains(p) )
312 {
313
314 int dist = (center - p).EuclideanNorm();
315 int distEdge = poly.COutline(0).Distance( p, true );
316
317 if( distEdge >= minDistEdge )
318 {
319 if( dist < minDist )
320 {
321 bestAnchor = p;
322 minDist = dist;
323 }
324 }
325 }
326 }
327 }
328
329 if( bestAnchor )
330 {
331 aPos = *bestAnchor;
332 return true;
333 }
334
335 return false;
336}
constexpr int ARC_LOW_DEF
Definition: base_units.h:120
coord_type GetHeight() const
Definition: box2.h:188
void addPadPrimitivesToPolygon(SHAPE_POLY_SET *aMergedPolygon, int aError, ERROR_LOC aErrorLoc) const
int Distance(const VECTOR2I &aP, bool aOutlineOnly=false) const
Compute the minimum distance between the line chain and a point aP.
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, int aAccuracy=0, bool aUseBBoxCaches=false) const
Return true if a given subpolygon contains the point aP.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
double EuclideanNorm(const VECTOR2I &vector)
Definition: trigo.h:129
T rescale(T aNumerator, T aValue, T aDenominator)
Scale a number (value) by rational (numerator/denominator).
Definition: util.h:105

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

◆ GetBoard() [1/2]

BOARD * BOARD_ITEM::GetBoard ( )
virtualinherited

Definition at line 51 of file board_item.cpp.

52{
53 if( Type() == PCB_T )
54 return static_cast<BOARD*>( this );
55
56 BOARD_ITEM* parent = GetParent();
57
58 if( parent )
59 return parent->GetBoard();
60
61 return nullptr;
62}
@ PCB_T
Definition: typeinfo.h:82

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

◆ GetBoard() [2/2]

const BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

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

Definition at line 37 of file board_item.cpp.

38{
39 if( Type() == PCB_T )
40 return static_cast<const BOARD*>( this );
41
42 BOARD_ITEM* parent = GetParent();
43
44 if( parent )
45 return parent->GetBoard();
46
47 return nullptr;
48}

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

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

◆ GetBoundingBox()

const BOX2I PAD::GetBoundingBox ( ) const
overridevirtual

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

Set absolute coordinates.

Reimplemented from EDA_ITEM.

Definition at line 613 of file pad.cpp.

614{
615 if( m_shapesDirty )
617
619}
void BuildEffectiveShapes(PCB_LAYER_ID aLayer) const
Rebuild the effective shape cache (and bounding box and radius) for the pad and clears the dirty bit.
Definition: pad.cpp:402

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

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

◆ GetBoundingRadius()

int PAD::GetBoundingRadius ( ) const

Return 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 393 of file pad.cpp.

394{
395 if( m_polyDirty )
397
399}
void BuildEffectivePolygon() const
Definition: pad.cpp:574

References BuildEffectivePolygon(), m_effectiveBoundingRadius, and m_polyDirty.

Referenced by HitTest().

◆ GetCenter()

VECTOR2I 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 270 of file pad.h.

270{ return GetPosition(); }
VECTOR2I GetPosition() const override
Definition: pad.h:196

References GetPosition().

◆ GetChamferPositions()

◆ GetChamferRectRatio()

◆ GetClass()

wxString PAD::GetClass ( ) const
inlineoverridevirtual

Return the class name.

Implements EDA_ITEM.

Definition at line 632 of file pad.h.

633 {
634 return wxT( "PAD" );
635 }

◆ 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 206 of file pad.h.

207 {
209 }

References m_customShapeClearanceArea.

Referenced by ZONE_FILLER::addKnockout(), KI_TEST::CheckFpPad(), PCB_PLUGIN::format(), ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::initValues(), padsNeedUpdate(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ GetDelta()

◆ GetDrillShape()

◆ GetDrillSize()

◆ GetDrillSizeX()

int PAD::GetDrillSizeX ( ) const
inline

Definition at line 263 of file pad.h.

263{ return m_drill.x; }

References m_drill, and VECTOR2< T >::x.

Referenced by HasHole(), PAD_DESC::PAD_DESC(), and VIAPAD::VIAPAD().

◆ GetDrillSizeY()

int PAD::GetDrillSizeY ( ) const
inline

Definition at line 265 of file pad.h.

265{ return m_drill.y; }

References m_drill, and VECTOR2< T >::y.

Referenced by HasHole(), PAD_DESC::PAD_DESC(), and VIAPAD::VIAPAD().

◆ GetEditFlags()

EDA_ITEM_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 161 of file eda_item.h.

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

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

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

◆ GetEffectiveHoleShape()

◆ GetEffectiveNetClass()

NETCLASS * BOARD_CONNECTED_ITEM::GetEffectiveNetClass ( ) const
virtualinherited

Return the NETCLASS for this item.

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

Definition at line 97 of file board_connected_item.cpp.

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

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

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

◆ GetEffectivePolygon()

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

◆ GetEffectiveShape()

std::shared_ptr< SHAPE > PAD::GetEffectiveShape ( PCB_LAYER_ID  aLayer = UNDEFINED_LAYER,
FLASHING  aFlash = FLASHING::DEFAULT 
) 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 347 of file pad.cpp.

348{
349 if( aLayer == Edge_Cuts )
350 {
352 return GetEffectiveHoleShape();
353 else
354 return std::make_shared<SHAPE_NULL>();
355 }
356
358 {
359 bool flash;
360
361 if( flashPTHPads == FLASHING::NEVER_FLASHED )
362 flash = false;
363 else if( flashPTHPads == FLASHING::ALWAYS_FLASHED )
364 flash = true;
365 else
366 flash = FlashLayer( aLayer );
367
368 if( !flash )
369 {
371 return GetEffectiveHoleShape();
372 else
373 return std::make_shared<SHAPE_NULL>();
374 }
375 }
376
377 if( m_shapesDirty )
378 BuildEffectiveShapes( aLayer );
379
380 return m_effectiveShape;
381}
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Return a SHAPE_SEGMENT object representing the pad's hole.
Definition: pad.cpp:384
@ ALWAYS_FLASHED
@ Edge_Cuts
Definition: layer_ids.h:113

References ALWAYS_FLASHED, BuildEffectiveShapes(), Edge_Cuts, FlashLayer(), GetAttribute(), GetEffectiveHoleShape(), m_effectiveShape, m_shapesDirty, NEVER_FLASHED, NPTH, and PTH.

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

◆ GetFlags()

◆ GetFocusPosition()

virtual const VECTOR2I EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

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

Reimplemented in BOARD, PCB_SHAPE, and PCB_TRACK.

Definition at line 270 of file eda_item.h.

270{ return GetPosition(); }
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:263

References EDA_ITEM::GetPosition().

Referenced by SCH_EDIT_FRAME::FocusOnItem().

◆ GetKeepTopBottom()

◆ GetLayer()

PCB_LAYER_ID PAD::GetLayer ( ) const
overridevirtual

Return the primary layer this item is on.

Reimplemented from BOARD_ITEM.

Definition at line 217 of file pad.cpp.

218{
219 return BOARD_ITEM::GetLayer();
220}
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:169

References BOARD_ITEM::GetLayer().

Referenced by DRC_TEST_PROVIDER_MISC::testDisabledLayers().

◆ 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 88 of file board_item.cpp.

89{
90 const BOARD* board = GetBoard();
91
92 if( board )
93 return board->GetLayerName( m_layer );
94
95 // If no parent, return standard name
97}
PCB_LAYER_ID m_layer
Definition: board_item.h:319
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition: board.h:689
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:384

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

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

◆ GetLayerSet()

◆ GetLocalClearance() [1/2]

int PAD::GetLocalClearance ( ) const
inline

Definition at line 413 of file pad.h.

413{ return m_localClearance; }

References m_localClearance.

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

◆ GetLocalClearance() [2/2]

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

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

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

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

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 777 of file pad.cpp.

778{
779 if( aSource )
780 *aSource = _( "pad" );
781
782 return m_localClearance;
783}
#define _(s)

References _, and m_localClearance.

Referenced by KI_TEST::CheckFpPad(), PCB_PLUGIN::format(), ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::initValues(), padsNeedUpdate(), DIALOG_PAD_PROPERTIES::padValuesOK(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ GetLocalClearanceOverrides()

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

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

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

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 763 of file pad.cpp.

764{
765 // A pad can have specific clearance that overrides its NETCLASS clearance value
766 if( GetLocalClearance() )
767 return GetLocalClearance( aSource );
768
769 // A footprint can have a specific clearance value
771 return GetParent()->GetLocalClearance( aSource );
772
773 return 0;
774}
int GetLocalClearance() const
Definition: footprint.h:225
int GetLocalClearance() const
Definition: pad.h:413

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

◆ GetLocalRatsnestVisible()

bool BOARD_CONNECTED_ITEM::GetLocalRatsnestVisible ( ) const
inlineinherited

◆ GetLocalSolderMaskMargin()

◆ GetLocalSolderPasteMargin()

◆ GetLocalSolderPasteMarginRatio()

◆ GetLocalSpokeWidthOverride()

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

Definition at line 916 of file pad.cpp.

917{
918 if( m_thermalSpokeWidth > 0 && aSource )
919 *aSource = _( "pad" );
920
921 return m_thermalSpokeWidth;
922}

References _, and m_thermalSpokeWidth.

◆ GetLocalThermalGapOverride()

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

Definition at line 925 of file pad.cpp.

926{
927 if( m_thermalGap > 0 && aSource )
928 *aSource = _( "pad" );
929
930 return m_thermalGap;
931}

References _, and m_thermalGap.

Referenced by ZONE::GetThermalReliefGap().

◆ GetLocalZoneConnectionOverride()

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

Definition at line 907 of file pad.cpp.

908{
910 *aSource = _( "pad" );
911
912 return m_zoneConnection;
913}

References _, INHERITED, and m_zoneConnection.

◆ GetMenuImage()

BITMAPS 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 1267 of file pad.cpp.

1268{
1269 return BITMAPS::pad;
1270}

References pad.

◆ 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 934 of file pad.cpp.

935{
936 wxString msg;
937 FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_parent );
938
939 if( aFrame->GetName() == PCB_EDIT_FRAME_NAME )
940 {
941 if( parentFootprint )
942 aList.emplace_back( _( "Footprint" ), parentFootprint->GetReference() );
943 }
944
945 aList.emplace_back( _( "Pad" ), m_number );
946
947 if( !GetPinFunction().IsEmpty() )
948 aList.emplace_back( _( "Pin Name" ), GetPinFunction() );
949
950 if( !GetPinType().IsEmpty() )
951 aList.emplace_back( _( "Pin Type" ), GetPinType() );
952
953 if( aFrame->GetName() == PCB_EDIT_FRAME_NAME )
954 {
955 aList.emplace_back( _( "Net" ), UnescapeString( GetNetname() ) );
956
957 aList.emplace_back( _( "Resolved Netclass" ),
958 UnescapeString( GetEffectiveNetClass()->GetName() ) );
959
960 if( IsLocked() )
961 aList.emplace_back( _( "Status" ), _( "Locked" ) );
962 }
963
965 aList.emplace_back( _( "Layer" ), layerMaskDescribe() );
966
967 // Show the pad shape, attribute and property
968 wxString props = ShowPadAttr();
969
970 if( GetProperty() != PAD_PROP::NONE )
971 props += ',';
972
973 switch( GetProperty() )
974 {
975 case PAD_PROP::NONE: break;
976 case PAD_PROP::BGA: props += _( "BGA" ); break;
977 case PAD_PROP::FIDUCIAL_GLBL: props += _( "Fiducial global" ); break;
978 case PAD_PROP::FIDUCIAL_LOCAL: props += _( "Fiducial local" ); break;
979 case PAD_PROP::TESTPOINT: props += _( "Test point" ); break;
980 case PAD_PROP::HEATSINK: props += _( "Heat sink" ); break;
981 case PAD_PROP::CASTELLATED: props += _( "Castellated" ); break;
982 }
983
984 aList.emplace_back( ShowPadShape(), props );
985
987 && m_size.x == m_size.y )
988 {
989 aList.emplace_back( _( "Diameter" ), aFrame->MessageTextFromValue( m_size.x ) );
990 }
991 else
992 {
993 aList.emplace_back( _( "Width" ), aFrame->MessageTextFromValue( m_size.x ) );
994 aList.emplace_back( _( "Height" ), aFrame->MessageTextFromValue( m_size.y ) );
995 }
996
997 EDA_ANGLE fp_orient = parentFootprint ? parentFootprint->GetOrientation() : ANGLE_0;
998 EDA_ANGLE pad_orient = GetOrientation() - fp_orient;
999 pad_orient.Normalize180();
1000
1001 if( !fp_orient.IsZero() )
1002 msg.Printf( wxT( "%g(+ %g)" ), pad_orient.AsDegrees(), fp_orient.AsDegrees() );
1003 else
1004 msg.Printf( wxT( "%g" ), GetOrientation().AsDegrees() );
1005
1006 aList.emplace_back( _( "Rotation" ), msg );
1007
1008 if( GetPadToDieLength() )
1009 {
1010 aList.emplace_back( _( "Length in Package" ),
1012 }
1013
1014 if( m_drill.x > 0 || m_drill.y > 0 )
1015 {
1017 {
1018 aList.emplace_back( _( "Hole" ),
1019 wxString::Format( wxT( "%s" ),
1020 aFrame->MessageTextFromValue( m_drill.x ) ) );
1021 }
1022 else
1023 {
1024 aList.emplace_back( _( "Hole X / Y" ),
1025 wxString::Format( wxT( "%s / %s" ),
1026 aFrame->MessageTextFromValue( m_drill.x ),
1027 aFrame->MessageTextFromValue( m_drill.y ) ) );
1028 }
1029 }
1030
1031 wxString source;
1032 int clearance = GetOwnClearance( UNDEFINED_LAYER, &source );
1033
1034 if( !source.IsEmpty() )
1035 {
1036 aList.emplace_back( wxString::Format( _( "Min Clearance: %s" ),
1037 aFrame->MessageTextFromValue( clearance ) ),
1038 wxString::Format( _( "(from %s)" ),
1039 source ) );
1040 }
1041#if 0
1042 // useful for debug only
1043 aList.emplace_back( wxT( "UUID" ), m_Uuid.AsString() );
1044#endif
1045}
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
virtual wxString layerMaskDescribe() const
Return a string (to be shown to the user) describing a layer mask.
Definition: board_item.cpp:100
double AsDegrees() const
Definition: eda_angle.h:149
bool IsZero() const
Definition: eda_angle.h:169
EDA_ANGLE Normalize180()
Definition: eda_angle.h:271
EDA_ANGLE GetOrientation() const
Definition: footprint.h:195
const wxString & GetReference() const
Definition: footprint.h:519
wxString AsString() const
Definition: kiid.cpp:249
int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const override
Return an item's "own" clearance in internal units.
Definition: pad.cpp:786
const wxString & GetPinType() const
Definition: pad.h:151
const wxString & GetPinFunction() const
Definition: pad.h:145
bool IsLocked() const override
Definition: pad.cpp:151
wxString ShowPadAttr() const
Definition: pad.cpp:1207
wxString ShowPadShape() const
Definition: pad.cpp:1191
wxString m_number
Definition: pad.h:717
int GetPadToDieLength() const
Definition: pad.h:407
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
#define PCB_EDIT_FRAME_NAME
@ SMD
Smd pad, appears on the solder paste layer (default)
@ CONN
Like smd, does not appear on the solder paste layer (default)
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
@ TESTPOINT
a test point pad
@ CASTELLATED
a pad with a castellated through hole
@ BGA
Smd pad, used in BGA footprints.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
wxString UnescapeString(const wxString &aSource)

References _, ANGLE_0, EDA_ANGLE::AsDegrees(), KIID::AsString(), BGA, CASTELLATED, CIRCLE, CONN, FIDUCIAL_GLBL, FIDUCIAL_LOCAL, Format(), GetAttribute(), GetDrillShape(), BOARD_CONNECTED_ITEM::GetEffectiveNetClass(), BOARD_CONNECTED_ITEM::GetNetname(), FOOTPRINT::GetOrientation(), GetOrientation(), GetOwnClearance(), GetPadToDieLength(), GetPinFunction(), GetPinType(), GetProperty(), FOOTPRINT::GetReference(), GetShape(), HEATSINK, IsLocked(), EDA_ANGLE::IsZero(), BOARD_ITEM::layerMaskDescribe(), m_drill, m_number, EDA_ITEM::m_parent, m_size, EDA_ITEM::m_Uuid, UNITS_PROVIDER::MessageTextFromValue(), NONE, EDA_ANGLE::Normalize180(), OVAL, PAD_DRILL_SHAPE_CIRCLE, PCB_EDIT_FRAME_NAME, ShowPadAttr(), ShowPadShape(), SMD, TESTPOINT, UNDEFINED_LAYER, UnescapeString(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ GetNet()

◆ GetNetClassName()

wxString BOARD_CONNECTED_ITEM::GetNetClassName ( ) const
inherited

Returns the name of the effective netclass.

Primarily for the use of the property system.

Definition at line 106 of file board_connected_item.cpp.

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

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

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

◆ GetNetCode()

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

Definition at line 89 of file board_connected_item.cpp.

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

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

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

◆ GetNetname()

◆ GetNetnameMsg()

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

Definition at line 118 of file board_connected_item.cpp.

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

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

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

◆ GetNumber()

◆ GetOffset()

◆ GetOrientation()

◆ GetOrientationDegrees()

double PAD::GetOrientationDegrees ( ) const
inline

Definition at line 371 of file pad.h.

372 {
373 return m_orient.AsDegrees();
374 }

References EDA_ANGLE::AsDegrees(), and m_orient.

Referenced by PAD_DESC::PAD_DESC().

◆ GetOwnClearance()

int PAD::GetOwnClearance ( PCB_LAYER_ID  aLayer,
wxString *  aSource = nullptr 
) const
overridevirtual

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

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

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 786 of file pad.cpp.

787{
789
790 if( GetBoard() && GetBoard()->GetDesignSettings().m_DRCEngine )
791 {
793
795 c = bds.m_DRCEngine->EvalRules( HOLE_CLEARANCE_CONSTRAINT, this, nullptr, aLayer );
796 else
797 c = bds.m_DRCEngine->EvalRules( CLEARANCE_CONSTRAINT, this, nullptr, aLayer );
798 }
799
800 if( c.Value().HasMin() )
801 {
802 if( aSource )
803 *aSource = c.GetName();
804
805 return c.Value().Min();
806 }
807
808 return 0;
809}
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
wxString GetName() const
Definition: drc_rule.h:147
MINOPTMAX< int > & Value()
Definition: drc_rule.h:140
T Min() const
Definition: minoptmax.h:33
bool HasMin() const
Definition: minoptmax.h:37
@ CLEARANCE_CONSTRAINT
Definition: drc_rule.h:46
@ HOLE_CLEARANCE_CONSTRAINT
Definition: drc_rule.h:47

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

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

◆ GetPadToDieLength()

◆ GetParent()

◆ GetParentAsString()

wxString PAD::GetParentAsString ( ) const
inline

Definition at line 112 of file pad.h.

112{ return m_parent->m_Uuid.AsString(); }

References KIID::AsString(), EDA_ITEM::m_parent, and EDA_ITEM::m_Uuid.

Referenced by PAD_DESC::PAD_DESC().

◆ GetParentFootprint()

◆ GetParentGroup()

◆ GetPinFunction()

const wxString & PAD::GetPinFunction ( ) const
inline

◆ GetPinType()

const wxString & PAD::GetPinType ( ) const
inline

Definition at line 151 of file pad.h.

151{ return m_pinType; }
wxString m_pinType
Definition: pad.h:719

References m_pinType.

Referenced by KI_TEST::CheckFpPad(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_PLUGIN::format(), GetMsgPanelInfo(), operator=(), and PAD_DESC::PAD_DESC().

◆ GetPos0()

const VECTOR2I & PAD::GetPos0 ( ) const
inline

◆ GetPosition()

◆ GetPrimitives()

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

◆ GetPrincipalLayer()

PCB_LAYER_ID PAD::GetPrincipalLayer ( ) const
Returns
the principal copper layer for SMD and CONN pads.

Definition at line 223 of file pad.cpp.

224{
226 return m_layer;
227 else
228 return GetLayerSet().Seq().front();
229
230}
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:391

References CONN, GetLayerSet(), m_attribute, BOARD_ITEM::m_layer, LSET::Seq(), and SMD.

Referenced by DRC_TEST_PROVIDER_FOOTPRINT_CHECKS::Run().

◆ GetProperty()

◆ GetRemoveUnconnected()

◆ GetRoundRectCornerRadius()

◆ GetRoundRectRadiusRatio()

◆ GetSelectMenuText()

wxString PAD::GetSelectMenuText ( UNITS_PROVIDER aUnitsProvider) 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 1220 of file pad.cpp.

1221{
1222 if( GetNumber().IsEmpty() )
1223 {
1225 {
1226 return wxString::Format( _( "Pad %s of %s on %s" ),
1227 GetNetnameMsg(),
1228 GetParent()->GetReference(),
1230 }
1231 else if( GetAttribute() == PAD_ATTRIB::NPTH )
1232 {
1233 return wxString::Format( _( "NPTH pad of %s" ), GetParent()->GetReference() );
1234 }
1235 else
1236 {
1237 return wxString::Format( _( "PTH pad %s of %s" ),
1238 GetNetnameMsg(),
1239 GetParent()->GetReference() );
1240 }
1241 }
1242 else
1243 {
1245 {
1246 return wxString::Format( _( "Pad %s %s of %s on %s" ),
1247 GetNumber(),
1248 GetNetnameMsg(),
1249 GetParent()->GetReference(),
1251 }
1252 else if( GetAttribute() == PAD_ATTRIB::NPTH )
1253 {
1254 return wxString::Format( _( "NPTH of %s" ), GetParent()->GetReference() );
1255 }
1256 else
1257 {
1258 return wxString::Format( _( "PTH pad %s %s of %s" ),
1259 GetNumber(),
1260 GetNetnameMsg(),
1261 GetParent()->GetReference() );
1262 }
1263 }
1264}
wxString GetNetnameMsg() const
const wxString & GetNumber() const
Definition: pad.h:134

References _, CONN, Format(), GetAttribute(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), GetNumber(), GetParent(), BOARD_ITEM::layerMaskDescribe(), NPTH, and SMD.

◆ GetShape()

◆ GetShortNetname()

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

Definition at line 134 of file board_connected_item.cpp.

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

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

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

◆ GetSize()

◆ GetSizeX()

int PAD::GetSizeX ( ) const
inline

Definition at line 253 of file pad.h.

253{ return m_size.x; }

References m_size, and VECTOR2< T >::x.

Referenced by PAD_DESC::PAD_DESC(), and PAD_TOOL::RecombinePad().

◆ GetSizeY()

int PAD::GetSizeY ( ) const
inline

Definition at line 255 of file pad.h.

255{ return m_size.y; }

References m_size, and VECTOR2< T >::y.

Referenced by PAD_DESC::PAD_DESC(), and PAD_TOOL::RecombinePad().

◆ GetSolderMaskExpansion()

int PAD::GetSolderMaskExpansion ( ) const
Returns
the expansion for the solder mask layer

Usually > 0 (mask shape bigger than pad). For pads not on copper layers, the value is the local value because there is no default shape to build. 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

Definition at line 812 of file pad.cpp.

813{
814 // The pad inherits the margin only to calculate a default shape,
815 // therefore only if it is also a copper layer
816 // Pads defined only on mask layers (and perhaps on other tech layers) use the shape
817 // defined by the pad settings only
818 bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
819
820 if( !isOnCopperLayer )
821 return 0;
822
823 int margin = m_localSolderMaskMargin;
824
825 FOOTPRINT* parentFootprint = GetParent();
826
827 if( parentFootprint )
828 {
829 if( margin == 0 )
830 {
831 if( parentFootprint->GetLocalSolderMaskMargin() )
832 margin = parentFootprint->GetLocalSolderMaskMargin();
833 }
834
835 if( margin == 0 )
836 {
837 const BOARD* brd = GetBoard();
838
839 if( brd )
841 }
842 }
843
844 // ensure mask have a size always >= 0
845 if( margin < 0 )
846 {
847 int minsize = -std::min( m_size.x, m_size.y ) / 2;
848
849 if( margin < minsize )
850 margin = minsize;
851 }
852
853 return margin;
854}
int GetLocalSolderMaskMargin() const
Definition: footprint.h:222
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773

References LSET::AllCuMask(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), FOOTPRINT::GetLocalSolderMaskMargin(), GetParent(), m_layerMask, m_localSolderMaskMargin, m_size, BOARD_DESIGN_SETTINGS::m_SolderMaskExpansion, VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ GetSolderPasteMargin()

VECTOR2I PAD::GetSolderPasteMargin ( ) const

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 not on copper layers, the value is the local value because there is no default shape to build. 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

Returns
the margin for the solder mask layer.

Definition at line 857 of file pad.cpp.

858{
859 // The pad inherits the margin only to calculate a default shape,
860 // therefore only if it is also a copper layer.
861 // Pads defined only on mask layers (and perhaps on other tech layers) use the shape
862 // defined by the pad settings only
863 bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
864
865 if( !isOnCopperLayer )
866 return VECTOR2I( 0, 0 );
867
868 int margin = m_localSolderPasteMargin;
869 double mratio = m_localSolderPasteMarginRatio;
870
871 FOOTPRINT* parentFootprint = GetParent();
872
873 if( parentFootprint )
874 {
875 if( margin == 0 )
876 margin = parentFootprint->GetLocalSolderPasteMargin();
877
878 auto brd = GetBoard();
879
880 if( margin == 0 && brd )
881 margin = brd->GetDesignSettings().m_SolderPasteMargin;
882
883 if( mratio == 0.0 )
884 mratio = parentFootprint->GetLocalSolderPasteMarginRatio();
885
886 if( mratio == 0.0 && brd )
887 {
888 mratio = brd->GetDesignSettings().m_SolderPasteMarginRatio;
889 }
890 }
891
892 VECTOR2I pad_margin;
893 pad_margin.x = margin + KiROUND( m_size.x * mratio );
894 pad_margin.y = margin + KiROUND( m_size.y * mratio );
895
896 // ensure mask have a size always >= 0
897 if( pad_margin.x < -m_size.x / 2 )
898 pad_margin.x = -m_size.x / 2;
899
900 if( pad_margin.y < -m_size.y / 2 )
901 pad_margin.y = -m_size.y / 2;
902
903 return pad_margin;
904}
double GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:239
int GetLocalSolderPasteMargin() const
Definition: footprint.h:236

References LSET::AllCuMask(), BOARD_ITEM::GetBoard(), FOOTPRINT::GetLocalSolderPasteMargin(), FOOTPRINT::GetLocalSolderPasteMarginRatio(), GetParent(), KiROUND(), m_layerMask, m_localSolderPasteMargin, m_localSolderPasteMarginRatio, m_size, VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ GetSortPosition()

virtual VECTOR2I EDA_ITEM::GetSortPosition ( ) const
inlinevirtualinherited

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

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

Returns
X,Y coordinate of the sort point

Reimplemented in SCH_LINE.

Definition at line 279 of file eda_item.h.

279{ return GetPosition(); }

References EDA_ITEM::GetPosition().

◆ GetState()

int EDA_ITEM::GetState ( EDA_ITEM_FLAGS  type) const
inlineinherited

Definition at line 140 of file eda_item.h.

141 {
142 return m_status & type;
143 }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:509

References EDA_ITEM::m_status.

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 153 of file eda_item.h.

153{ return m_status; }

References EDA_ITEM::m_status.

◆ GetStroke()

STROKE_PARAMS BOARD_ITEM::GetStroke ( ) const
virtualinherited

Reimplemented in PCB_SHAPE.

Definition at line 76 of file board_item.cpp.

77{
78 wxCHECK( false, STROKE_PARAMS( pcbIUScale.mmToIU( DEFAULT_LINE_WIDTH ) ) );
79}
#define DEFAULT_LINE_WIDTH

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

Referenced by PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog().

◆ GetSubRatsnest()

int PAD::GetSubRatsnest ( ) const
inline
Returns
the netcode.

Definition at line 580 of file pad.h.

580{ return m_subRatsnest; }
int m_subRatsnest
Definition: pad.h:751

References m_subRatsnest.

Referenced by operator=().

◆ GetThermalGap()

◆ GetThermalSpokeAngle()

◆ GetThermalSpokeAngleDegrees()

double PAD::GetThermalSpokeAngleDegrees ( ) const
inline

Definition at line 529 of file pad.h.

530 {
532 }

References EDA_ANGLE::AsDegrees(), and m_thermalSpokeAngle.

Referenced by PAD_DESC::PAD_DESC().

◆ GetThermalSpokeWidth()

◆ GetTypeDesc()

wxString EDA_ITEM::GetTypeDesc ( )
inherited

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

Definition at line 301 of file eda_item.cpp.

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

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

Referenced by PROPERTIES_PANEL::update().

◆ GetX()

◆ GetY()

◆ GetZoneConnection()

◆ HasFlag()

◆ HasHole()

bool PAD::HasHole ( ) const
inlineoverridevirtual

Reimplemented from BOARD_ITEM.

Definition at line 105 of file pad.h.

106 {
107 return GetDrillSizeX() > 0 && GetDrillSizeY() > 0;
108 }
int GetDrillSizeY() const
Definition: pad.h:265
int GetDrillSizeX() const
Definition: pad.h:263

References GetDrillSizeX(), and GetDrillSizeY().

Referenced by BOARD_ADAPTER::createPadWithDrill(), IsType(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem().

◆ HasLineStroke()

virtual bool BOARD_ITEM::HasLineStroke ( ) const
inlinevirtualinherited

Check if this item has line stoke properties.

See also
STROKE_PARAMS

Reimplemented in PCB_SHAPE.

Definition at line 161 of file board_item.h.

161{ return false; }

◆ HitTest() [1/2]

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

Test if aRect intersects this item.

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

Reimplemented from EDA_ITEM.

Definition at line 1060 of file pad.cpp.

1061{
1062 BOX2I arect = aRect;
1063 arect.Normalize();
1064 arect.Inflate( aAccuracy );
1065
1066 BOX2I bbox = GetBoundingBox();
1067
1068 if( aContained )
1069 {
1070 return arect.Contains( bbox );
1071 }
1072 else
1073 {
1074 // Fast test: if aRect is outside the polygon bounding box,
1075 // rectangles cannot intersect
1076 if( !arect.Intersects( bbox ) )
1077 return false;
1078
1079 const std::shared_ptr<SHAPE_POLY_SET>& poly = GetEffectivePolygon();
1080
1081 int count = poly->TotalVertices();
1082
1083 for( int ii = 0; ii < count; ii++ )
1084 {
1085 VECTOR2I vertex = poly->CVertex( ii );
1086 VECTOR2I vertexNext = poly->CVertex( ( ii + 1 ) % count );
1087
1088 // Test if the point is within aRect
1089 if( arect.Contains( vertex ) )
1090 return true;
1091
1092 // Test if this edge intersects aRect
1093 if( arect.Intersects( vertex, vertexNext ) )
1094 return true;
1095 }
1096
1097 return false;
1098 }
1099}
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
Definition: box2.h:119
bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:269
bool Contains(const Vec &aPoint) const
Definition: box2.h:141
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:506
const BOX2I GetBoundingBox() const override
The bounding box is cached, so this will be efficient most of the time.
Definition: pad.cpp:613
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
Definition: pad.cpp:338

References BOX2< Vec >::Contains(), GetBoundingBox(), GetEffectivePolygon(), BOX2< Vec >::Inflate(), BOX2< Vec >::Intersects(), and BOX2< Vec >::Normalize().

◆ HitTest() [2/2]

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

Test if aPosition is inside or on the boundary of this item.

Parameters
aPositionA reference to a VECTOR2I 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 1048 of file pad.cpp.

1049{
1050 VECTOR2I delta = aPosition - GetPosition();
1051 int boundingRadius = GetBoundingRadius() + aAccuracy;
1052
1053 if( delta.SquaredEuclideanNorm() > SEG::Square( boundingRadius ) )
1054 return false;
1055
1056 return GetEffectivePolygon()->Contains( aPosition, -1, aAccuracy );
1057}
int GetBoundingRadius() const
Return the radius of a minimum sized circle which fully encloses this pad.
Definition: pad.cpp:393
static SEG::ecoord Square(int a)
Definition: seg.h:123
constexpr int delta

References delta, GetBoundingRadius(), GetEffectivePolygon(), GetPosition(), and SEG::Square().

◆ ImportSettingsFrom()

void PAD::ImportSettingsFrom ( const PAD aMasterPad)

Import the pad settings from aMasterPad.

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

Parameters
aMasterPadthe template pad.

Definition at line 1470 of file pad.cpp.

1471{
1472 SetShape( aMasterPad.GetShape() );
1473 SetLayerSet( aMasterPad.GetLayerSet() );
1474 SetAttribute( aMasterPad.GetAttribute() );
1475 SetProperty( aMasterPad.GetProperty() );
1476
1477 // I am not sure the m_LengthPadToDie should be imported, because this is a parameter
1478 // really specific to a given pad (JPC).
1479#if 0
1480 SetPadToDieLength( aMasterPad.GetPadToDieLength() );
1481#endif
1482
1483 // The pad orientation, for historical reasons is the pad rotation + parent rotation.
1484 EDA_ANGLE pad_rot = aMasterPad.GetOrientation();
1485
1486 if( aMasterPad.GetParent() )
1487 pad_rot -= aMasterPad.GetParent()->GetOrientation();
1488
1489 if( GetParent() )
1490 pad_rot += GetParent()->GetOrientation();
1491
1492 SetOrientation( pad_rot );
1493
1494 SetSize( aMasterPad.GetSize() );
1495 SetDelta( VECTOR2I( 0, 0 ) );
1496 SetOffset( aMasterPad.GetOffset() );
1497 SetDrillSize( aMasterPad.GetDrillSize() );
1498 SetDrillShape( aMasterPad.GetDrillShape() );
1502
1503 switch( aMasterPad.GetShape() )
1504 {
1506 SetDelta( aMasterPad.GetDelta() );
1507 break;
1508
1509 case PAD_SHAPE::CIRCLE:
1510 // ensure size.y == size.x
1511 SetSize( VECTOR2I( GetSize().x, GetSize().x ) );
1512 break;
1513
1514 default:
1515 ;
1516 }
1517
1518 switch( aMasterPad.GetAttribute() )
1519 {
1520 case PAD_ATTRIB::SMD:
1521 case PAD_ATTRIB::CONN:
1522 // These pads do not have a hole (they are expected to be on one external copper layer)
1523 SetDrillSize( VECTOR2I( 0, 0 ) );
1524 break;
1525
1526 default:
1527 ;
1528 }
1529
1530 // copy also local settings:
1531 SetLocalClearance( aMasterPad.GetLocalClearance() );
1535
1536 SetZoneConnection( aMasterPad.GetZoneConnection() );
1539 SetThermalGap( aMasterPad.GetThermalGap() );
1540
1542
1543 // Add or remove custom pad shapes:
1544 ReplacePrimitives( aMasterPad.GetPrimitives() );
1545 SetAnchorPadShape( aMasterPad.GetAnchorPadShape() );
1546
1547 SetDirty();
1548}
int GetLocalClearance(wxString *aSource) const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
Definition: pad.cpp:777
void SetAttribute(PAD_ATTRIB aAttribute)
Definition: pad.cpp:653
void SetLocalSolderPasteMargin(int aMargin)
Definition: pad.h:417
ZONE_CONNECTION GetZoneConnection() const
Definition: pad.h:503
void SetThermalGap(int aGap)
Definition: pad.h:534
void SetThermalSpokeAngle(const EDA_ANGLE &aAngle)
The orientation of the thermal spokes.
Definition: pad.h:521
double GetLocalSolderPasteMarginRatio() const
Definition: pad.h:419
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives() const
Accessor to the basic shape list for custom-shaped pads.
Definition: pad.h:324
EDA_ANGLE GetThermalSpokeAngle() const
Definition: pad.h:522
void SetOffset(const VECTOR2I &aOffset)
Definition: pad.h:267
void SetChamferRectRatio(double aChamferScale)
Has meaning only for chamfered rectangular pads.
Definition: pad.cpp:330
void SetLocalClearance(int aClearance)
Definition: pad.h:414
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: pad.h:502
int GetLocalSolderMaskMargin() const
Definition: pad.h:409
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
Definition: pad.h:206
void SetDelta(const VECTOR2I &aSize)
Definition: pad.h:257
const VECTOR2I & GetDelta() const
Definition: pad.h:258
void SetDrillSize(const VECTOR2I &aSize)
Definition: pad.h:260
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: pad.h:420
int GetThermalSpokeWidth() const
Definition: pad.h:512
int GetLocalSolderPasteMargin() const
Definition: pad.h:416
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:216
void SetRoundRectRadiusRatio(double aRadiusScale)
Has meaning only for rounded rectangle pads.
Definition: pad.cpp:322
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
void SetLocalSolderMaskMargin(int aMargin)
Definition: pad.h:410
void SetThermalSpokeWidth(int aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
Definition: pad.h:511
void SetSize(const VECTOR2I &aSize)
Definition: pad.h:250
double GetRoundRectRadiusRatio() const
Definition: pad.h:556
int GetThermalGap() const
Definition: pad.h:535
void SetChamferPositions(int aPositions)
Has meaning only for chamfered rectangular pads.
Definition: pad.h:574
void SetPadToDieLength(int aLength)
Definition: pad.h:406

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

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

◆ IsAperturePad()

bool PAD::IsAperturePad ( ) const
inline

Definition at line 401 of file pad.h.

402 {
403 return ( m_layerMask & LSET::AllCuMask() ).none();
404 }

References LSET::AllCuMask(), and m_layerMask.

Referenced by CanHaveNumber(), doPushPadProperties(), and DIALOG_PAD_PROPERTIES::initValues().

◆ IsBrightened()

◆ IsConnected()

bool BOARD_CONNECTED_ITEM::IsConnected ( ) const
inlineoverridevirtualinherited

Returns information if the object is derived from BOARD_CONNECTED_ITEM.

Returns
True if the object is of BOARD_CONNECTED_ITEM type, false otherwise.

Reimplemented from BOARD_ITEM.

Reimplemented in ZONE.

Definition at line 67 of file board_connected_item.h.

68 {
69 return true;
70 }

◆ IsDirty()

bool PAD::IsDirty ( ) const
inline

Definition at line 379 of file pad.h.

380 {
381 return m_shapesDirty || m_polyDirty;
382 }

References m_polyDirty, and m_shapesDirty.

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 119 of file eda_item.h.

119{ return m_flags & IS_DRAGGING; }

References IS_DRAGGING, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 122 of file eda_item.h.

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

References ENTERED, and EDA_ITEM::m_flags.

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

◆ IsFlipped()

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

Definition at line 209 of file pad.cpp.

210{
211 FOOTPRINT* parent = GetParent();
212
213 return ( parent && parent->GetLayer() == B_Cu );
214}

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 217 of file eda_item.h.

217{ return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:511

References EDA_ITEM::m_forceVisible.

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

◆ IsFreePad()

bool PAD::IsFreePad ( ) const
Returns
true if the pad is associated with a "free" pin (not-internally-connected) and has not yet been assigned another net (ie: by being routed to).

Definition at line 167 of file pad.cpp.

168{
169 return GetShortNetname().StartsWith( wxT( "unconnected-(" ) )
170 && m_pinType == wxT( "free" );
171}
wxString GetShortNetname() const

References BOARD_CONNECTED_ITEM::GetShortNetname(), and m_pinType.

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

◆ IsKnockout()

◆ IsLocked()

bool PAD::IsLocked ( ) const
overridevirtual

Reimplemented from BOARD_ITEM.

Definition at line 151 of file pad.cpp.

152{
153 if( GetParent() && GetParent()->IsLocked() )
154 return true;
155
156 return BOARD_ITEM::IsLocked();
157};
virtual bool IsLocked() const
Definition: board_item.cpp:65

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

Referenced by KI_TEST::CheckFpPad(), PCB_PLUGIN::format(), GetMsgPanelInfo(), and IsLocked().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 116 of file eda_item.h.

116{ return m_flags & IS_CHANGED; }

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsNoConnectPad()

bool PAD::IsNoConnectPad ( ) const
Returns
true if the pad is associated with an "unconnected" pin (or a no-connect symbol) and has no net.

Definition at line 160 of file pad.cpp.

161{
162 return GetShortNetname().StartsWith( wxT( "unconnected-(" ) )
163 && ( m_pinType == wxT( "no_connect" ) || m_pinType.EndsWith( wxT( "+no_connect" ) ) );
164}

References BOARD_CONNECTED_ITEM::GetShortNetname(), and m_pinType.

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

◆ IsOnCopperLayer()

bool PAD::IsOnCopperLayer ( ) const
inlineoverridevirtual
Returns
true if the pad is on any copper layer, false otherwise.

Reimplemented from BOARD_ITEM.

Definition at line 236 of file pad.h.

237 {
238 return ( GetLayerSet() & LSET::AllCuMask() ) != 0;
239 }

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

Referenced by PCB_EDIT_FRAME::ExchangeFootprint(), 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 600 of file pad.h.

601 {
602 return m_layerMask[aLayer];
603 }

References m_layerMask.

Referenced by AR_AUTOPLACER::addPad(), PAD_TOOL::explodePad(), FlashLayer(), DSN::SPECCTRA_DB::makePADSTACK(), PAD_TOOL::RecombinePad(), 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 LIB_TEXTBOX, SCH_FIELD, SCH_LABEL, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, and SCH_TEXTBOX.

Definition at line 434 of file eda_item.h.

434{ return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 123 of file eda_item.h.

123{ return m_flags & IS_RESIZING; }

References IS_RESIZING, and EDA_ITEM::m_flags.

◆ IsRollover()

bool EDA_ITEM::IsRollover ( ) const
inlineinherited

Definition at line 126 of file eda_item.h.

127 {
128 return ( m_flags & ( IS_ROLLOVER | IS_MOVING ) ) == IS_ROLLOVER;
129 }
#define IS_ROLLOVER
Rollover active. Used for hyperlink highlighting.

References IS_MOVING, IS_ROLLOVER, and EDA_ITEM::m_flags.

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

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 121 of file eda_item.h.

121{ return m_flags & SELECTED; }

References EDA_ITEM::m_flags, and SELECTED.

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

◆ IsShownAsBitmap()

bool EDA_ITEM::IsShownAsBitmap ( ) const
inlineinherited

Definition at line 189 of file eda_item.h.

189{ return m_flags & IS_SHOWN_AS_BITMAP; }
#define IS_SHOWN_AS_BITMAP

References IS_SHOWN_AS_BITMAP, and EDA_ITEM::m_flags.

◆ IsTented()

virtual bool BOARD_ITEM::IsTented ( ) const
inlinevirtualinherited

Reimplemented in PCB_VIA.

Definition at line 125 of file board_item.h.

126 {
127 return false;
128 }

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

◆ IsType()

bool PAD::IsType ( const std::vector< 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 84 of file pad.h.

85 {
86 if( BOARD_CONNECTED_ITEM::IsType( aScanTypes ) )
87 return true;
88
89 for( KICAD_T scanType : aScanTypes )
90 {
91 if( HasHole() )
92 {
93 if( scanType == PCB_LOCATE_HOLE_T )
94 return true;
95 else if( scanType == PCB_LOCATE_PTH_T && m_attribute != PAD_ATTRIB::NPTH )
96 return true;
97 else if( scanType == PCB_LOCATE_NPTH_T && m_attribute == PAD_ATTRIB::NPTH )
98 return true;
99 }
100 }
101
102 return false;
103 }
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition: eda_item.h:197
bool HasHole() const override
Definition: pad.h:105
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ PCB_LOCATE_NPTH_T
Definition: typeinfo.h:127
@ PCB_LOCATE_PTH_T
Definition: typeinfo.h:126
@ PCB_LOCATE_HOLE_T
Definition: typeinfo.h:125

References HasHole(), EDA_ITEM::IsType(), m_attribute, NPTH, PCB_LOCATE_HOLE_T, PCB_LOCATE_NPTH_T, and PCB_LOCATE_PTH_T.

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 120 of file eda_item.h.

120{ return m_flags & IS_WIRE_IMAGE; }

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ IterateForward() [1/2]

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

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

Definition at line 316 of file eda_item.h.

318 {
319 for( const auto& it : aList )
320 {
321 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
322 testData,
323 scanTypes ) == INSPECT_RESULT::QUIT )
324 {
326 }
327 }
328
330 }
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:91

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

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

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

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

Definition at line 336 of file eda_item.h.

338 {
339 for( const auto& it : aList )
340 {
341 if( static_cast<EDA_ITEM*>( it )->Visit( inspector,
342 testData,
343 scanTypes ) == INSPECT_RESULT::QUIT )
344 {
346 }
347 }
348
350 }

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.

Reimplemented in PCB_VIA.

Definition at line 100 of file board_item.cpp.

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

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

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( const EDA_SEARCH_DATA 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_MARKER, LIB_TEXTBOX, SCH_FIELD, SCH_PIN, SCH_SHEET, SCH_SHEET_PIN, SCH_SYMBOL, SCH_TEXT, SCH_TEXTBOX, FP_TEXT, FP_TEXTBOX, NETINFO_ITEM, PCB_MARKER, PCB_TEXT, PCB_TEXTBOX, and ZONE.

Definition at line 396 of file eda_item.h.

397 {
398 return false;
399 }

Referenced by SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_EDITOR_CONTROL::HasMatch(), SCH_MARKER::Matches(), LIB_TEXTBOX::Matches(), SCH_FIELD::Matches(), SCH_PIN::Matches(), SCH_SHEET_PIN::Matches(), SCH_TEXT::Matches(), SCH_TEXTBOX::Matches(), FP_TEXT::Matches(), FP_TEXTBOX::Matches(), NETINFO_ITEM::Matches(), PCB_MARKER::Matches(), PCB_TEXT::Matches(), PCB_TEXTBOX::Matches(), ZONE::Matches(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

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

Compare aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

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

Definition at line 117 of file eda_item.cpp.

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

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

◆ MergePrimitivesAsPolygon()

void PAD::MergePrimitivesAsPolygon ( SHAPE_POLY_SET aMergedPolygon,
ERROR_LOC  aErrorLoc = ERROR_INSIDE 
) const

Merge all basic shapes to a SHAPE_POLY_SET.

Note
The results are relative to the pad position, orientation 0.
Parameters
aMergedPolygonwill store the final polygon
aErrorLocis used when a circle (or arc) is approximated by segments = ERROR_INSIDE to build a polygon inside the arc/circle (usual shape to raw/plot) = ERROR_OUIDE to build a polygon outside the arc/circle (for instance when building a clearance area)

Definition at line 229 of file pad_custom_shape_functions.cpp.

230{
231 const BOARD* board = GetBoard();
232 int maxError = board ? board->GetDesignSettings().m_MaxError : ARC_HIGH_DEF;
233
234 aMergedPolygon->RemoveAllContours();
235
236 // Add the anchor pad shape in aMergedPolygon, others in aux_polyset:
237 // The anchor pad is always at 0,0
238 switch( GetAnchorPadShape() )
239 {
240 case PAD_SHAPE::RECT:
241 {
242 SHAPE_RECT rect( -GetSize().x / 2, -GetSize().y / 2, GetSize().x, GetSize().y );
243 aMergedPolygon->AddOutline( rect.Outline() );
244 }
245 break;
246
247 default:
249 TransformCircleToPolygon( *aMergedPolygon, wxPoint( 0, 0 ), GetSize().x / 2, maxError,
250 aErrorLoc );
251 break;
252 }
253
254 addPadPrimitivesToPolygon( aMergedPolygon, maxError, aErrorLoc );
255}
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new hole to the given outline (default: last) and returns its index.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aCornerBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.

References SHAPE_POLY_SET::AddOutline(), addPadPrimitivesToPolygon(), ARC_HIGH_DEF, CIRCLE, GetAnchorPadShape(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), GetSize(), BOARD_DESIGN_SETTINGS::m_MaxError, SHAPE_RECT::Outline(), RECT, SHAPE_POLY_SET::RemoveAllContours(), and TransformCircleToPolygon().

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

◆ Move()

void PAD::Move ( const VECTOR2I aMoveVector)
inlineoverridevirtual

Move this object.

Parameters
aMoveVectorthe move vector for this object.

Reimplemented from BOARD_ITEM.

Definition at line 657 of file pad.h.

658 {
659 m_pos += aMoveVector;
661 SetDirty();
662 }
void SetLocalCoord()
< Set relative coordinates.
Definition: pad.cpp:638

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 231 of file eda_item.cpp.

232{
233 wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
234 GetClass() ) );
235
236 return false;
237}
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 117 of file pad.cpp.

118{
120
121 ImportSettingsFrom( aOther );
123 SetPosition( aOther.GetPosition() );
124 SetPos0( aOther.GetPos0() );
125 SetNumber( aOther.GetNumber() );
126 SetPinType( aOther.GetPinType() );
127 SetPinFunction( aOther.GetPinFunction() );
128 SetSubRatsnest( aOther.GetSubRatsnest() );
132
133 return *this;
134}
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
Definition: eda_item.cpp:240
void SetPinType(const wxString &aType)
Set the pad electrical type.
Definition: pad.h:150
void SetNumber(const wxString &aNumber)
Set the pad number (note that it can be alphanumeric, such as the array reference "AA12").
Definition: pad.h:133
void ImportSettingsFrom(const PAD &aMasterPad)
Import the pad settings from aMasterPad.
Definition: pad.cpp:1470
void SetPosition(const VECTOR2I &aPos) override
Definition: pad.h:190
void SetPinFunction(const wxString &aName)
Set the pad function (pin name in schematic)
Definition: pad.h:144
void SetPos0(const VECTOR2I &aPos)
Definition: pad.h:244
int GetSubRatsnest() const
Definition: pad.h:580
const VECTOR2I & GetPos0() const
Definition: pad.h:245

References GetNumber(), GetPadToDieLength(), GetPinFunction(), GetPinType(), GetPos0(), GetPosition(), GetSubRatsnest(), ImportSettingsFrom(), m_effectiveBoundingRadius, m_keepTopBottomLayer, m_removeUnconnectedLayer, EDA_ITEM::operator=(), SetNumber(), SetPadToDieLength(), SetPinFunction(), SetPinType(), SetPos0(), SetPosition(), and SetSubRatsnest().

Referenced by PAD().

◆ PTHMask()

LSET PAD::PTHMask ( )
static

layer set for a through hole pad

Definition at line 174 of file pad.cpp.

175{
176 static LSET saved = LSET::AllCuMask() | LSET( 2, F_Mask, B_Mask );
177 return saved;
178}
@ B_Mask
Definition: layer_ids.h:106

References LSET::AllCuMask(), B_Mask, and F_Mask.

Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), FABMASTER::loadFootprints(), PAD(), PAD_TOOL::PlacePad(), and DIALOG_PAD_PROPERTIES::updatePadLayersList().

◆ RenderAsBitmap()

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

Reimplemented in SCH_ITEM.

Definition at line 179 of file eda_item.h.

179{ return false; }

◆ Replace() [1/2]

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

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

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

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

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

Definition at line 423 of file eda_item.h.

424 {
425 return false;
426 }

◆ Replace() [2/2]

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

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

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

Definition at line 168 of file eda_item.cpp.

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

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

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

◆ ReplacePrimitives()

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

Clear the current custom shape primitives list and import a new list.

Copies the input, which is not altered.

Definition at line 164 of file pad_custom_shape_functions.cpp.

165{
166 // clear old list
168
169 // Import to the given shape list
170 if( aPrimitivesList.size() )
171 AppendPrimitives( aPrimitivesList );
172
173 SetDirty();
174}
void AppendPrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList)
Import a custom shape primitive list (composed of basic shapes) and add items to the current list.
void DeletePrimitivesList()
Clear the basic shapes list.

References AppendPrimitives(), DeletePrimitivesList(), and SetDirty().

Referenced by ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ Rotate()

void PAD::Rotate ( const VECTOR2I aRotCentre,
const EDA_ANGLE aAngle 
)
overridevirtual

Rotate this object.

Parameters
aRotCentrethe rotation center point.

Reimplemented from BOARD_ITEM.

Definition at line 1178 of file pad.cpp.

1179{
1180 RotatePoint( m_pos, aRotCentre, aAngle );
1181
1182 m_orient += aAngle;
1184
1185 SetLocalCoord();
1186
1187 SetDirty();
1188}
EDA_ANGLE Normalize()
Definition: eda_angle.h:249

References m_orient, m_pos, EDA_ANGLE::Normalize(), RotatePoint(), SetDirty(), and SetLocalCoord().

◆ SameLogicalPadAs()

bool PAD::SameLogicalPadAs ( const PAD other) const
inline

Before we had custom pad shapes it was common to have multiple overlapping pads to represent a more complex shape.

Definition at line 157 of file pad.h.

158 {
159 // hide tricks behind sensible API
160 return GetParentFootprint() == other->GetParentFootprint()
161 && !m_number.IsEmpty() && m_number == other->m_number;
162 }
BOARD_ITEM_CONTAINER * GetParentFootprint() const
Definition: board_item.cpp:217

References BOARD_ITEM::GetParentFootprint(), and m_number.

◆ Set() [1/3]

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

Definition at line 66 of file inspectable.h.

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

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

◆ Set() [2/3]

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

Definition at line 54 of file inspectable.h.

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

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

◆ Set() [3/3]

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

Definition at line 42 of file inspectable.h.

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

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

Referenced by PCB_PROPERTIES_PANEL::valueChanged().

◆ SetAnchorPadShape()

void PAD::SetAnchorPadShape ( PAD_SHAPE  aShape)
inline

Set the shape of the anchor pad for custom shaped pads.

Parameters
aShapeis the shape of the anchor pad shape( currently, only PAD_SHAPE::RECT or PAD_SHAPE::CIRCLE.

Definition at line 227 of file pad.h.

228 {
230 SetDirty();
231 }

References CIRCLE, m_anchorPadShape, RECT, and SetDirty().

Referenced by ImportSettingsFrom(), PAD(), PCB_PARSER::parsePAD_option(), PAD_TOOL::RecombinePad(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ SetAttribute()

void PAD::SetAttribute ( PAD_ATTRIB  aAttribute)

Definition at line 653 of file pad.cpp.

654{
655 m_attribute = aAttribute;
656
657 if( aAttribute == PAD_ATTRIB::SMD )
658 m_drill = VECTOR2I( 0, 0 );
659
660 SetDirty();
661}

References m_attribute, m_drill, SetDirty(), and SMD.

Referenced by ImportSettingsFrom(), PAD_DESC::PAD_DESC(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ SetBrightened()

◆ SetChamferPositions()

void PAD::SetChamferPositions ( int  aPositions)
inline

Has meaning only for chamfered rectangular pads.

Set the position of the chamfers for orientation 0.

Parameters
aPositionsa bit-set of RECT_CHAMFER_POSITIONS.

Definition at line 574 of file pad.h.

574{ m_chamferPositions = aPositions; }

References m_chamferPositions.

Referenced by ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ SetChamferRectRatio()

void PAD::SetChamferRectRatio ( double  aChamferScale)

Has meaning only for chamfered rectangular pads.

Set the ratio between the smaller X or Y size and chamfered corner size. Cannot be < 0.5.

Definition at line 330 of file pad.cpp.

331{
332 m_chamferScale = std::max( 0.0, std::min( aChamferScale, 0.5 ) );
333
334 SetDirty();
335}

References m_chamferScale, and SetDirty().

Referenced by ImportSettingsFrom(), DIALOG_PAD_PROPERTIES::OnPadShapeSelection(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ SetCustomShapeInZoneOpt()

void PAD::SetCustomShapeInZoneOpt ( CUST_PAD_SHAPE_IN_ZONE  aOption)
inline

Set the option for the custom pad shape to use as clearance area in copper zones.

Parameters
aOptionis the clearance area shape CUST_PAD_SHAPE_IN_ZONE option

Definition at line 216 of file pad.h.

217 {
219 }

References m_customShapeClearanceArea.

Referenced by ImportSettingsFrom(), PCB_PARSER::parsePAD_option(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ SetDelta()

void PAD::SetDelta ( const VECTOR2I aSize)
inline

◆ SetDirty()

◆ SetDrawCoord()

void PAD::SetDrawCoord ( )

Definition at line 622 of file pad.cpp.

623{
624 FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_parent );
625
626 m_pos = m_pos0;
627
628 if( parentFootprint == nullptr )
629 return;
630
631 RotatePoint( &m_pos.x, &m_pos.y, parentFootprint->GetOrientation() );
632 m_pos += parentFootprint->GetPosition();
633
634 SetDirty();
635}

References FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), EDA_ITEM::m_parent, m_pos, m_pos0, RotatePoint(), SetDirty(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ SetDrillShape()

void PAD::SetDrillShape ( PAD_DRILL_SHAPE_T  aShape)
inline

◆ SetDrillSize()

void PAD::SetDrillSize ( const VECTOR2I aSize)
inline

◆ SetDrillSizeX()

void PAD::SetDrillSizeX ( const int  aX)
inline

Definition at line 262 of file pad.h.

262{ m_drill.x = aX; SetDirty(); }

References m_drill, SetDirty(), and VECTOR2< T >::x.

Referenced by PAD_DESC::PAD_DESC().

◆ SetDrillSizeY()

void PAD::SetDrillSizeY ( const int  aY)
inline

Definition at line 264 of file pad.h.

264{ m_drill.y = aY; SetDirty(); }

References m_drill, SetDirty(), and VECTOR2< T >::y.

Referenced by PAD_DESC::PAD_DESC().

◆ SetFlags()

void EDA_ITEM::SetFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 156 of file eda_item.h.

156{ m_flags |= aMask; }

References EDA_ITEM::m_flags.

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

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

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

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

Definition at line 215 of file eda_item.h.

215{ m_forceVisible = aEnable; }

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetIsKnockout()

virtual void BOARD_ITEM::SetIsKnockout ( bool  aKnockout)
inlinevirtualinherited

Definition at line 240 of file board_item.h.

240{ m_isKnockout = aKnockout; }

References BOARD_ITEM::m_isKnockout.

◆ SetIsShownAsBitmap()

void EDA_ITEM::SetIsShownAsBitmap ( bool  aBitmap)
inlineinherited

Definition at line 181 of file eda_item.h.

182 {
183 if( aBitmap )
185 else
187 }

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