65    void Serialize( google::protobuf::Any &aContainer ) 
const override;
 
   66    bool Deserialize( 
const google::protobuf::Any &aContainer ) 
override;
 
   85    bool IsType( 
const std::vector<KICAD_T>& aScanTypes )
 const override 
   90        for( 
KICAD_T scanType : aScanTypes )
 
 
  233        m_padStack.SetCustomShapeInZoneMode( aOption );
 
 
  295        m_padStack.TrapezoidDeltaSize( aLayer ) = aSize;
 
 
  301        return m_padStack.TrapezoidDeltaSize( aLayer );
 
 
  383                            const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
 
  390                           const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
 
  418        return m_padStack.GetOrientation().AsDegrees();
 
 
  511                                  bool ignoreLineWidth = 
false ) 
const override;
 
  539    virtual std::shared_ptr<SHAPE>
 
  637        return m_padStack.ThermalSpokeAngle().AsDegrees();
 
 
  673        return m_padStack.RoundRectRadiusRatio( aLayer );
 
 
  708        m_padStack.SetChamferPositions( aPositions, aLayer );
 
 
  796    bool FlashLayer( 
int aLayer, 
bool aOnlyCheckIfPermitted = 
false ) 
const;
 
  819    bool HitTest( 
const VECTOR2I& aPosition, 
int aAccuracy = 0 ) 
const override;
 
  820    bool HitTest( 
const BOX2I& aRect, 
bool aContained, 
int aAccuracy = 0 ) 
const override;
 
  835    std::vector<PCB_SHAPE*> 
Recombine( 
bool aIsDryRun, 
int aMaxError );
 
  854    static int Compare( 
const PAD* aPadRef, 
const PAD* aPadCmp );
 
  858        m_pos += aMoveVector;
 
 
  910                   const std::function<
void( 
int aErrorCode, 
const wxString& aMsg )>& aErrorHandler ) 
const;
 
  918    virtual void Show( 
int nestLevel, std::ostream& os )
 const override { ShowDummy( os ); }
 
  928                     const std::function<
void( 
int aErrorCode, 
const wxString& aMsg )>& aErrorHandler ) 
const;
 
  947    typedef std::map<PCB_LAYER_ID, std::array<std::shared_ptr<SHAPE_POLY_SET>, 2>> 
LAYER_POLYGON_MAP;
 
 
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
 
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...
 
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
 
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
 
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
 
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.
 
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
 
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)
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.
 
UNCONNECTED_LAYER_MODE
! Whether or not to remove the copper shape for unconnected layers
 
@ REMOVE_EXCEPT_START_AND_END
 
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
 
void SetAnchorPadShape(PCB_LAYER_ID aLayer, PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
 
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 CheckPad(UNITS_PROVIDER *aUnitsProvider, bool aForPadProperties, const std::function< void(int aErrorCode, const wxString &aMsg)> &aErrorHandler) const
 
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.
 
double GetFrontRoundRectRadiusRatio() const
 
void doCheckPad(PCB_LAYER_ID aLayer, UNITS_PROVIDER *aUnitsProvider, bool aForPadProperties, const std::function< void(int aErrorCode, const wxString &aMsg)> &aErrorHandler) const
 
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 std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives(PCB_LAYER_ID aLayer) const
Accessor to the basic shape list for custom-shaped pads.
 
const ZONE_LAYER_OVERRIDE & GetZoneLayerOverride(PCB_LAYER_ID aLayer) const
 
void MergePrimitivesAsPolygon(PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aMergedPolygon, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Merge all basic shapes to a SHAPE_POLY_SET.
 
int GetRoundRectCornerRadius(PCB_LAYER_ID aLayer) const
 
bool FlashLayer(int aLayer, bool aOnlyCheckIfPermitted=false) const
Check to see whether the pad should be flashed on the specific layer.
 
void SetLocalThermalGapOverride(const std::optional< int > &aOverride)
 
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer, FLASHING flashPTHPads=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
 
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 GetDrillSizeY() const
 
std::map< PCB_LAYER_ID, std::shared_ptr< SHAPE_COMPOUND > > LAYER_SHAPE_MAP
 
void AddPrimitivePoly(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPoly, int aThickness, bool aFilled)
Has meaning only for custom shape pads.
 
std::optional< double > GetLocalSolderPasteMarginRatio() const
 
void SetFrontShape(PAD_SHAPE aShape)
 
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
 
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.
 
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
 
const wxString & GetNumber() const
 
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
 
const VECTOR2I & GetDelta(PCB_LAYER_ID aLayer) const
 
void SetFrontRoundRectRadiusRatio(double aRadiusScale)
 
void BuildEffectiveShapes() const
Rebuild the effective shape cache (and bounding box and radius) for the pad and clears the dirty bit.
 
PAD_SHAPE GetFrontShape() const
 
static bool ClassOf(const EDA_ITEM *aItem)
 
void CopyFrom(const BOARD_ITEM *aOther) override
 
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
 
PAD & operator=(const PAD &aOther)
 
void SetLocalThermalSpokeWidthOverride(std::optional< int > aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
 
void SetShape(PCB_LAYER_ID aLayer, PAD_SHAPE aShape)
Set the new shape of this pad.
 
std::shared_ptr< SHAPE_SEGMENT > m_effectiveHoleShape
 
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)
 
EDA_ANGLE GetThermalSpokeAngle() const
 
std::map< PCB_LAYER_ID, ZONE_LAYER_OVERRIDE > m_zoneLayerOverrides
 
bool ConditionallyFlashed(PCB_LAYER_ID aLayer) const
 
void Flip(const VECTOR2I &VECTOR2I, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
 
void Move(const VECTOR2I &aMoveVector) override
Move this object.
 
std::vector< PCB_SHAPE * > Recombine(bool aIsDryRun, int aMaxError)
Recombines the pad with other graphical shapes in the footprint.
 
PCB_LAYER_ID GetPrincipalLayer() const
 
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
 
void SetDelta(PCB_LAYER_ID aLayer, const VECTOR2I &aSize)
 
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
 
std::map< PCB_LAYER_ID, std::array< std::shared_ptr< SHAPE_POLY_SET >, 2 > > LAYER_POLYGON_MAP
 
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 SetPadToDieDelay(int aDelay)
 
void FlipPrimitives(FLIP_DIRECTION aFlipDirection)
Flip (mirror) the primitives left to right or top to bottom, around the anchor position in custom pad...
 
LAYER_SHAPE_MAP m_effectiveShapes
 
bool IsNoConnectPad() const
 
int GetDrillSizeX() const
 
double GetRoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
 
void SetKeepTopBottom(bool aSet)
 
void DeletePrimitivesList(PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
Clear the basic shapes list.
 
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) 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").
 
void SetFrontRoundRectRadiusSize(int aRadius)
 
wxString ShowPadAttr() const
 
void AddPrimitive(PCB_LAYER_ID aLayer, PCB_SHAPE *aPrimitive)
Add item to the custom shape primitives list.
 
void SetDrillShape(PAD_DRILL_SHAPE aShape)
 
int m_effectiveBoundingRadius
 
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
 
void SetOffset(PCB_LAYER_ID aLayer, const VECTOR2I &aOffset)
 
bool GetKeepTopBottom() const
 
void SetLocalZoneConnection(ZONE_CONNECTION aType)
 
void SetChamferRectRatio(PCB_LAYER_ID aLayer, double aChamferScale)
Has meaning only for chamfered rectangular pads.
 
int GetSolderMaskExpansion(PCB_LAYER_ID aLayer) const
 
int GetPadToDieDelay() const
 
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.
 
bool IsOnCopperLayer() const override
 
void SetPadstack(const PADSTACK &aPadstack)
 
void SetPosition(const VECTOR2I &aPos) override
 
const SHAPE_COMPOUND & buildEffectiveShape(PCB_LAYER_ID aLayer) const
 
const PADSTACK & Padstack() const
 
const VECTOR2I & GetOffset(PCB_LAYER_ID aLayer) const
 
double m_lastGalZoomLevel
 
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.
 
bool CanFlashLayer(int aLayer)
 
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
 
void SetSize(PCB_LAYER_ID aLayer, const VECTOR2I &aSize)
 
PADSTACK::CUSTOM_SHAPE_ZONE_MODE GetCustomShapeInZoneOpt() const
 
PAD_DRILL_SHAPE GetDrillShape() const
 
void ReplacePrimitives(PCB_LAYER_ID aLayer, const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
 
int GetChamferPositions(PCB_LAYER_ID aLayer) const
 
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
 
void SetRoundRectCornerRadius(PCB_LAYER_ID aLayer, double aRadius)
Has meaning only for rounded rectangle pads.
 
void SetDrillSizeY(int aY)
 
static LSET SMDMask()
layer set for a SMD pad on Front layer
 
std::optional< int > GetLocalSolderPasteMargin() const
 
int GetFrontRoundRectRadiusSize() const
 
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon(PCB_LAYER_ID aLayer, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
 
void SetChamferPositions(PCB_LAYER_ID aLayer, int aPositions)
Has meaning only for chamfered rectangular pads.
 
std::optional< int > GetLocalSolderMaskMargin() const
 
void SetDrillSizeX(int aX)
 
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
 
std::optional< int > GetLocalThermalGapOverride() const
 
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
 
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
 
void SetPinFunction(const wxString &aName)
Set the pad function (pin name in schematic)
 
EDA_ANGLE GetFPRelativeOrientation() const
 
double GetChamferRectRatio(PCB_LAYER_ID aLayer) 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 ClearZoneLayerOverrides()
 
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
 
std::mutex m_zoneLayerOverridesMutex
 
std::optional< int > GetLocalThermalSpokeWidthOverride() const
 
PADSTACK::UNCONNECTED_LAYER_MODE GetUnconnectedLayerMode() const
 
VECTOR2I GetSolderPasteMargin(PCB_LAYER_ID aLayer) const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
 
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
 
void AppendPrimitives(PCB_LAYER_ID aLayer, 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 HasDrilledHole() const override
 
LAYER_POLYGON_MAP m_effectivePolygons
 
void SetLocalClearance(std::optional< int > aClearance)
 
int GetSubRatsnest() const
 
void SetSizeX(const int aX)
 
ZONE_CONNECTION GetLocalZoneConnection() const
 
bool HasHole() const override
 
double GetThermalSpokeAngleDegrees() const
 
PAD * ClonePad() const
Same as Clone, but returns a PAD item.
 
int GetThermalGap() const
 
VECTOR2I ShapePos(PCB_LAYER_ID aLayer) 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
 
void SetLayerSet(const LSET &aLayers) override
 
bool SharesNetTieGroup(const PAD *aOther) const
 
PAD_SHAPE GetAnchorPadShape(PCB_LAYER_ID aLayer) const
 
void SetRoundRectRadiusRatio(PCB_LAYER_ID aLayer, double aRadiusScale)
Has meaning only for rounded rectangle pads.
 
void SetSubRatsnest(int aSubRatsnest)
 
int GetLocalSpokeWidthOverride(wxString *aSource=nullptr) 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.
 
void SetPadToDieLength(int aLength)
 
bool operator==(const PAD &aOther) const
 
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
 
wxString ShowPadShape(PCB_LAYER_ID aLayer) const
 
void SetSizeY(const int aY)
 
int GetPadToDieLength() const
 
BOX2I m_effectiveBoundingBox
 
const VECTOR2I & GetSize(PCB_LAYER_ID aLayer) const
 
virtual std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
 
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
 
Represent a set of closed polygons.
 
An abstract shape on 2D plane.
 
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
 
@ DEFAULT
Flashing follows connectivity.
 
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().
 
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
 
@ PTH
Plated through hole pad.
 
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
 
VECTOR2< int32_t > VECTOR2I
 
ZONE_CONNECTION
How pads are covered by copper in zone.