62 void Serialize( google::protobuf::Any &aContainer )
const override;
63 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
82 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override
87 for(
KICAD_T scanType : aScanTypes )
232 ? PAD_SHAPE::RECTANGLE
233 : PAD_SHAPE::CIRCLE );
288 void AddPrimitivePoly(
const std::vector<VECTOR2I>& aPoly,
int aThickness,
bool aFilled );
329 void ReplacePrimitives(
const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
335 void AppendPrimitives(
const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
454 bool ignoreLineWidth =
false )
const override;
483 virtual std::shared_ptr<SHAPE>
485 FLASHING flashPTHPads = FLASHING::DEFAULT )
const override;
705 bool FlashLayer(
int aLayer,
bool aOnlyCheckIfPermitted =
false )
const;
728 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
729 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
747 static int Compare(
const PAD* aPadRef,
const PAD* aPadCmp );
751 m_pos += aMoveVector;
790 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
818 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.
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
CUSTOM_SHAPE_ZONE_MODE CustomShapeInZoneMode() const
void SetCustomShapeInZoneMode(CUSTOM_SHAPE_ZONE_MODE aM)
std::optional< int > & Clearance(PCB_LAYER_ID aLayer=F_Cu)
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer=F_Cu)
std::optional< double > & SolderPasteMarginRatio(PCB_LAYER_ID aLayer=F_Cu)
void SetAnchorShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer=F_Cu)
void SetThermalSpokeAngle(EDA_ANGLE aAngle, PCB_LAYER_ID aLayer=F_Cu)
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
std::optional< int > & ThermalSpokeWidth(PCB_LAYER_ID aLayer=F_Cu)
std::optional< int > & SolderPasteMargin(PCB_LAYER_ID aLayer=F_Cu)
std::optional< int > & SolderMaskMargin(PCB_LAYER_ID aLayer=F_Cu)
const LSET & LayerSet() const
PAD_SHAPE AnchorShape(PCB_LAYER_ID aLayer=F_Cu) const
EDA_ANGLE ThermalSpokeAngle(PCB_LAYER_ID aLayer=F_Cu) const
int & ChamferPositions(PCB_LAYER_ID aLayer=F_Cu)
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
std::optional< int > & ThermalGap(PCB_LAYER_ID aLayer=F_Cu)
double RoundRectRadiusRatio(PCB_LAYER_ID aLayer=F_Cu) const
VECTOR2I & TrapezoidDeltaSize(PCB_LAYER_ID aLayer=F_Cu)
VECTOR2I & Offset(PCB_LAYER_ID aLayer=F_Cu)
VECTOR2I & Size(PCB_LAYER_ID aLayer=F_Cu)
UNCONNECTED_LAYER_MODE
! Whether or not to remove the copper shape for unconnected layers
@ REMOVE_EXCEPT_START_AND_END
double ChamferRatio(PCB_LAYER_ID aLayer=F_Cu) const
PAD_SHAPE Shape(PCB_LAYER_ID aLayer=F_Cu) const
void SetLayerSet(const LSET &aSet)
std::optional< ZONE_CONNECTION > & ZoneConnection(PCB_LAYER_ID aLayer=F_Cu)
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer=F_Cu)
bool IsAperturePad() const
void SetAttribute(PAD_ATTRIB aAttribute)
int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const override
Return the pad'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
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
std::optional< int > GetClearanceOverrides(wxString *aSource) const override
Return any clearance overrides set in the "classic" (ie: pre-rule) system.
void SetPinType(const wxString &aType)
Set the pad electrical type.
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
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.
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
std::optional< double > GetLocalSolderPasteMarginRatio() const
const wxString & GetPinType() const
void SetZoneLayerOverride(PCB_LAYER_ID aLayer, ZONE_LAYER_OVERRIDE aOverride)
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
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.
void SetUnconnectedLayerMode(PADSTACK::UNCONNECTED_LAYER_MODE aMode)
void SetRemoveUnconnected(bool aSet)
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.
std::mutex m_shapesBuildingLock
void SetThermalGap(int aGap)
std::shared_ptr< SHAPE_POLY_SET > m_effectivePolygon[2]
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.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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.
int GetRoundRectCornerRadius() const
static bool ClassOf(const EDA_ITEM *aItem)
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
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
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
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 operator==(const BOARD_ITEM &aOther) const override
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.
bool operator!=(const BOARD_ITEM &aOther) const
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 SetKeepTopBottom(bool aSet)
VECTOR2I ShapePos() const
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc=ERROR_INSIDE, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
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
wxString ShowPadShape() const
void SetDrillShape(PAD_DRILL_SHAPE aShape)
int m_effectiveBoundingRadius
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
bool GetKeepTopBottom() const
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon(ERROR_LOC aErrorLoc=ERROR_INSIDE) const
void SetLocalZoneConnection(ZONE_CONNECTION aType)
std::optional< int > GetLocalClearance() const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
void ImportSettingsFrom(const PAD &aMasterPad)
Import the pad settings from aMasterPad.
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void SetDelta(const VECTOR2I &aSize)
bool IsOnCopperLayer() const override
void SetDrillSizeX(const int aX)
void SetPadstack(const PADSTACK &aPadstack)
void SetPosition(const VECTOR2I &aPos) override
const PADSTACK & Padstack() const
const VECTOR2I & GetDelta() const
void BuildEffectivePolygon(ERROR_LOC aErrorLoc=ERROR_INSIDE) const
static LSET ConnSMDMask()
layer set for a SMD pad on Front layer used for edge board connectors
void SetDrillSize(const VECTOR2I &aSize)
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.
PADSTACK::CUSTOM_SHAPE_ZONE_MODE GetCustomShapeInZoneOpt() const
PAD_DRILL_SHAPE GetDrillShape() const
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
std::optional< int > GetLocalSolderPasteMargin() const
std::optional< int > GetLocalSolderMaskMargin() const
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
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)
EDA_ANGLE GetFPRelativeOrientation() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetFPRelativeOrientation(const EDA_ANGLE &aAngle)
void SetCustomShapeInZoneOpt(PADSTACK::CUSTOM_SHAPE_ZONE_MODE aOption)
Set the option for the custom pad shape to use as clearance area in copper zones.
int GetBoundingRadius() const
Return the radius of a minimum sized circle which fully encloses this pad.
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.
PADSTACK::UNCONNECTED_LAYER_MODE GetUnconnectedLayerMode() 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.
void SetLocalClearance(std::optional< int > aClearance)
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)
ZONE_CONNECTION GetLocalZoneConnection() const
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)
ZONE_CONNECTION GetZoneConnectionOverrides(wxString *aSource=nullptr) const
bool SharesNetTieGroup(const PAD *aOther) const
const VECTOR2I & GetSize() const
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
bool TransformHoleToPolygon(SHAPE_POLY_SET &aBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Build the corner list of the polygonal drill shape in the board coordinate system.
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
Represent a set of closed polygons.
An abstract shape on 2D plane.
a few functions useful in geometry calculations.
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.
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
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 ...
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
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.