84 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override
89 for(
KICAD_T scanType : aScanTypes )
230 m_anchorPadShape = ( aShape == PAD_SHAPE::RECTANGLE ) ? PAD_SHAPE::RECTANGLE : PAD_SHAPE::CIRCLE;
276 void AddPrimitivePoly(
const std::vector<VECTOR2I>& aPoly,
int aThickness,
bool aFilled );
317 void ReplacePrimitives(
const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
323 void AppendPrimitives(
const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
413 bool ignoreLineWidth =
false )
const override;
442 virtual std::shared_ptr<SHAPE>
444 FLASHING flashPTHPads = FLASHING::DEFAULT )
const override;
615 bool FlashLayer(
int aLayer,
bool aOnlyCheckIfPermitted =
false )
const;
638 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
639 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
657 static int Compare(
const PAD* aPadRef,
const PAD* aPadCmp );
661 m_pos += aMoveVector;
700 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
723 virtual void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
BITMAPS
A list of all bitmap identifiers.
ZONE_LAYER_OVERRIDE
Conditionally flashed vias and pads that interact with zones of different priority can be very squirr...
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
FOOTPRINT * GetParentFootprint() const
Implement a canvas based on a wxGLCanvas.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
LSET is a set of PCB_LAYER_IDs.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
PAD_DRILL_SHAPE_T m_drillShape
bool IsAperturePad() const
void SetAttribute(PAD_ATTRIB aAttribute)
int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const override
Return an item's "own" clearance in internal units.
void SetLayerSet(LSET aLayers) override
virtual void swapData(BOARD_ITEM *aImage) override
PAD_PROP GetProperty() const
bool GetRemoveUnconnected() const
PAD_DRILL_SHAPE_T GetDrillShape() const
void SetPinType(const wxString &aType)
Set the pad electrical type.
int m_localSolderMaskMargin
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea
const ZONE_LAYER_OVERRIDE & GetZoneLayerOverride(PCB_LAYER_ID aLayer) const
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.
bool FlashLayer(int aLayer, bool aOnlyCheckIfPermitted=false) const
Check to see whether the pad should be flashed on the specific layer.
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.
double m_localSolderPasteMarginRatio
const BOX2I GetBoundingBox() const override
The bounding box is cached, so this will be efficient most of the time.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
int GetSolderMaskExpansion() const
int GetDrillSizeY() const
const wxString & GetPinType() const
void SetZoneLayerOverride(PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride)
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
void SetLocalSolderPasteMargin(int aMargin)
static LSET PTHMask()
layer set for a through hole pad
static int Compare(const PAD *aPadRef, const PAD *aPadCmp)
Compare two pads and return 0 if they are equal.
ZONE_CONNECTION GetZoneConnection() const
void SetRemoveUnconnected(bool aSet)
Set the unconnected removal property.
const wxString & GetPinFunction() const
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.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
std::mutex m_shapesBuildingLock
void SetThermalGap(int aGap)
bool CanHaveNumber() const
Indicates whether or not the pad can have a number.
void SetThermalSpokeAngle(const EDA_ANGLE &aAngle)
The orientation of the thermal spokes.
double m_roundedCornerScale
const wxString & GetNumber() const
void FlipPrimitives(bool aFlipLeftRight)
Flip (mirror) the primitives left to right or top to bottom, around the anchor position in custom pad...
void MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Merge all basic shapes to a SHAPE_POLY_SET.
double GetLocalSolderPasteMarginRatio() const
int GetRoundRectCornerRadius() const
static bool ClassOf(const EDA_ITEM *aItem)
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
PAD & operator=(const PAD &aOther)
void DeletePrimitivesList()
Clear the basic shapes list.
std::shared_ptr< SHAPE_SEGMENT > m_effectiveHoleShape
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
bool IsLocked() const override
bool TransformHoleToPolygon(SHAPE_POLY_SET &aBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc) const
Build the corner list of the polygonal drill shape in the board coordinate system.
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
void SetDrillShape(PAD_DRILL_SHAPE_T aShape)
VECTOR2I GetPosition() const override
void SetProperty(PAD_PROP aProperty)
void SetThermalSpokeAngleDegrees(double aAngle)
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives() const
Accessor to the basic shape list for custom-shaped pads.
EDA_ANGLE GetThermalSpokeAngle() const
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
void SetOffset(const VECTOR2I &aOffset)
void Move(const VECTOR2I &aMoveVector) override
Move this object.
PCB_LAYER_ID GetPrincipalLayer() const
void SetChamferRectRatio(double aChamferScale)
Has meaning only for chamfered rectangular pads.
const VECTOR2I & GetOffset() const
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
double GetOrientationDegrees() const
bool SameLogicalPadAs(const PAD *aOther) const
Before we had custom pad shapes it was common to have multiple overlapping pads to represent a more c...
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetRoundRectCornerRadius(double aRadius)
Has meaning only for rounded rectangle pads.
bool IsNoConnectPad() const
int GetDrillSizeX() const
void SetLocalClearance(int aClearance)
void SetKeepTopBottom(bool aSet)
Set whether we keep the top and bottom connections even if they are not connected.
VECTOR2I ShapePos() const
int m_localSolderPasteMargin
void SetNumber(const wxString &aNumber)
Set the pad number (note that it can be alphanumeric, such as the array reference "AA12").
int GetLocalThermalGapOverride(wxString *aSource=nullptr) const
wxString ShowPadAttr() const
void SetZoneConnection(ZONE_CONNECTION aType)
wxString ShowPadShape() const
int m_effectiveBoundingRadius
int GetLocalSolderMaskMargin() const
bool GetKeepTopBottom() const
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
void ImportSettingsFrom(const PAD &aMasterPad)
Import the pad settings from aMasterPad.
ZONE_CONNECTION m_zoneConnection
void SetDelta(const VECTOR2I &aSize)
bool IsOnCopperLayer() const override
void SetDrillSizeX(const int aX)
void SetPosition(const VECTOR2I &aPos) override
const VECTOR2I & GetDelta() const
static LSET ConnSMDMask()
layer set for a SMD pad on Front layer used for edge board connectors
void SetDrillSize(const VECTOR2I &aSize)
int GetLocalClearance() const
wxString GetClass() const override
Return the class name.
PAD_SHAPE GetShape() const
bool CanFlashLayer(int aLayer)
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
EDA_ANGLE GetFPRelativeOrientation()
void Flip(const VECTOR2I &VECTOR2I, bool aFlipLeftRight) override
Flip this object, i.e.
VECTOR2I GetSolderPasteMargin() const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
static LSET ApertureMask()
layer set for an aperture pad
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
std::mutex m_polyBuildingLock
static LSET SMDMask()
layer set for a SMD pad on Front layer
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
int GetLocalClearanceOverrides(wxString *aSource) const override
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
void SetLocalSolderPasteMarginRatio(double aRatio)
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
int GetThermalSpokeWidth() const
void SetPinFunction(const wxString &aName)
Set the pad function (pin name in schematic)
int GetLocalSolderPasteMargin() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void BuildEffectivePolygon() const
void SetFPRelativeOrientation(const EDA_ANGLE &aAngle)
int GetBoundingRadius() const
Return the radius of a minimum sized circle which fully encloses this pad.
void SetCustomShapeInZoneOpt(CUST_PAD_SHAPE_IN_ZONE aOption)
Set the option for the custom pad shape to use as clearance area in copper zones.
void SetRoundRectRadiusRatio(double aRadiusScale)
Has meaning only for rounded rectangle pads.
void SetAnchorPadShape(PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
void ClearZoneLayerOverrides()
std::array< ZONE_LAYER_OVERRIDE, MAX_CU_LAYERS > m_zoneLayerOverrides
void AddPrimitive(PCB_SHAPE *aPrimitive)
Add item to the custom shape primitives list.
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
std::mutex m_zoneLayerOverridesMutex
void AddPrimitivePoly(const SHAPE_POLY_SET &aPoly, int aThickness, bool aFilled)
Has meaning only for custom shape pads.
ZONE_CONNECTION GetLocalZoneConnectionOverride(wxString *aSource=nullptr) const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
int GetChamferPositions() const
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
bool m_removeUnconnectedLayer
< If true, the pad copper is removed for layers that are not connected.
void SetLocalSolderMaskMargin(int aMargin)
virtual std::shared_ptr< SHAPE > GetEffectiveShape(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.
void addPadPrimitivesToPolygon(SHAPE_POLY_SET *aMergedPolygon, int aError, ERROR_LOC aErrorLoc) const
int GetSubRatsnest() const
void SetSizeX(const int aX)
bool m_keepTopBottomLayer
void SetThermalSpokeWidth(int aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
bool HasHole() const override
void SetSize(const VECTOR2I &aSize)
void SetDrillSizeY(const int aY)
double GetThermalSpokeAngleDegrees() const
PAD * ClonePad() const
Same as Clone, but returns a PAD item.
double GetRoundRectRadiusRatio() const
int GetThermalGap() const
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Return a SHAPE_SEGMENT object representing the pad's hole.
void SetOrientationDegrees(double aOrientation)
bool SharesNetTieGroup(const PAD *aOther) const
const VECTOR2I & GetSize() const
PAD_SHAPE m_anchorPadShape
EDA_ANGLE m_thermalSpokeAngle
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
void SetSubRatsnest(int aSubRatsnest)
std::shared_ptr< SHAPE_COMPOUND > m_effectiveShape
void SetChamferPositions(int aPositions)
Has meaning only for chamfered rectangular pads.
int GetLocalSpokeWidthOverride(wxString *aSource=nullptr) const
PAD_SHAPE GetAnchorPadShape() const
double GetChamferRectRatio() const
void SetPadToDieLength(int aLength)
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
void SetSizeY(const int aY)
int GetPadToDieLength() const
BOX2I m_effectiveBoundingBox
std::shared_ptr< SHAPE_POLY_SET > m_effectivePolygon
Represent a set of closed polygons.
An abstract shape on 2D plane.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
PCB_LAYER_ID
A quick note on layer IDs:
The Cairo implementation of the graphics abstraction layer.
@ CUST_PAD_SHAPE_IN_ZONE_OUTLINE
@ CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
PAD_DRILL_SHAPE_T
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_PAD_T
class PAD, a pad in a footprint
ZONE_CONNECTION
How pads are covered by copper in zone.