216 std::vector<KICAD_T> types
262 return board->GetConnectivity()->IsConnectedOnLayer(
this, aLayer, types,
true );
322 return std::make_shared<SHAPE_SEGMENT>( *hole );
325 return std::make_shared<SHAPE_NULL>();
369 auto add = [
this](
SHAPE* aShape )
380 switch( effectiveShape )
393 wxSize half_size =
m_size / 2;
394 int half_width = std::min( half_size.x, half_size.y );
395 wxPoint half_len( half_size.x - half_width, half_size.y - half_width );
397 add(
new SHAPE_SEGMENT( shapePos - half_len, shapePos + half_len, half_width * 2 ) );
408 wxSize trap_delta( 0, 0 );
412 half_size -= wxPoint(
r,
r );
418 if( half_size.x < min_len && half_size.y < min_len )
431 corners.
Append( -half_size.x - trap_delta.y, half_size.y + trap_delta.x );
432 corners.
Append( half_size.x + trap_delta.y, half_size.y - trap_delta.x );
433 corners.
Append( half_size.x - trap_delta.y, -half_size.y + trap_delta.x );
434 corners.
Append( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x );
437 corners.
Move( shapePos );
455 int width = std::abs( corners.
CPoint( 2 ).
x - corners.
CPoint( 0 ).
x );
456 int height = std::abs( corners.
CPoint( 2 ).
y - corners.
CPoint( 0 ).
y );
490 wxFAIL_MSG( wxT(
"PAD::buildEffectiveShapes: Unsupported pad shape: " )
499 for(
SHAPE* shape : primitive->MakeEffectiveShapes() )
502 shape->Move( shapePos );
513 wxSize half_size =
m_drill / 2;
514 int half_width = std::min( half_size.x, half_size.y );
515 wxPoint half_len( half_size.x - half_width, half_size.y - half_width );
557 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
584 if( parentFootprint ==
nullptr )
600 if( parentFootprint ==
nullptr )
639 void PAD::Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
658 auto mirrorBitFlags = [](
int& aBitfield,
int a,
int b )
660 bool temp = aBitfield & a;
700 primitive->Flip( wxPoint( 0, 0 ), aFlipLeftRight );
715 wxPoint shape_pos =
m_pos + loc_offset;
738 *aSource =
_(
"pad" );
752 if( !isOnCopperLayer )
759 if( parentFootprint )
781 if( margin < minsize )
797 if( !isOnCopperLayer )
798 return wxSize( 0, 0 );
805 if( parentFootprint )
812 if( margin == 0 && brd )
813 margin = brd->GetDesignSettings().m_SolderPasteMargin;
818 if( mratio == 0.0 && brd )
820 mratio = brd->GetDesignSettings().m_SolderPasteMarginRatio;
829 if( pad_margin.x < -
m_size.x / 2 )
830 pad_margin.x = -
m_size.x / 2;
832 if( pad_margin.y < -
m_size.y / 2 )
833 pad_margin.y = -
m_size.y / 2;
846 *aSource =
_(
"parent footprint" );
853 *aSource =
_(
"pad" );
867 *aSource =
_(
"parent footprint" );
873 *aSource =
_(
"pad" );
886 *aSource =
_(
"parent footprint" );
892 *aSource =
_(
"pad" );
906 if( parentFootprint )
907 aList.emplace_back(
_(
"Footprint" ), parentFootprint->
GetReference() );
910 aList.emplace_back(
_(
"Pad" ),
m_number );
916 aList.emplace_back(
_(
"Pin Type" ),
GetPinType() );
925 aList.emplace_back(
_(
"Status" ),
_(
"Locked" ) );
965 if( fp_orient_degrees != 0.0 )
966 msg.Printf( wxT(
"%g(+ %g)" ), pad_orient_degrees, fp_orient_degrees );
970 aList.emplace_back(
_(
"Rotation" ), msg );
975 aList.emplace_back(
_(
"Length in Package" ), msg );
982 aList.emplace_back(
_(
"Hole" ),
988 aList.emplace_back(
_(
"Hole X / Y" ),
998 if( !source.IsEmpty() )
1045 int count = poly->TotalVertices();
1047 for(
int ii = 0; ii < count; ii++ )
1049 auto vertex = poly->CVertex( ii );
1050 auto vertexNext = poly->CVertex(( ii + 1 ) % count );
1053 if( arect.
Contains( ( wxPoint ) vertex ) )
1057 if( arect.
Intersects( ( wxPoint ) vertex, ( wxPoint ) vertexNext ) )
1070 if( ( diff = static_cast<int>( aPadRef->
GetShape() ) -
1071 static_cast<int>( aPadCmp->
GetShape() ) ) != 0 )
1074 if( ( diff = static_cast<int>( aPadRef->
m_attribute ) -
1087 if( ( diff = aPadRef->
m_size.x - aPadCmp->
m_size.x ) != 0 )
1090 if( ( diff = aPadRef->
m_size.y - aPadCmp->
m_size.y ) != 0 )
1124 #if __cplusplus >= 201103L 1135 std::string s1 = aPadRef->
m_layerMask.to_string();
1136 std::string s2 = aPadCmp->
m_layerMask.to_string();
1137 return s1.compare( s2 );
1165 default:
return wxT(
"???" );
1178 default:
return wxT(
"???" );
1197 wxT(
"(" ) +
_(
"NPTH, Mechanical" ) + wxT(
")" ),
1220 wxT(
"(" ) +
_(
"NPTH, Mechanical" ) + wxT(
")" ),
1242 return new PAD( *
this );
1292 for (
int internal =
In1_Cu;
internal <
In30_Cu; ++internal )
1295 aLayers[aCount++] =
internal;
1307 aLayers[aCount++] = each_layer;
1314 msg.Printf( wxT(
"footprint %s, pad %s: could not find valid layer for pad" ),
1325 constexpr
double HIDE = std::numeric_limits<double>::max();
1344 visible.set( layer,
false );
1378 if( renderSettings->GetHighContrast() )
1381 if( !
FlashLayer( renderSettings->GetPrimaryHighContrastLayer() ) )
1431 int xMargin = std::max( solderMaskMargin, solderPasteMargin.
x ) + clearance;
1432 int yMargin = std::max( solderMaskMargin, solderPasteMargin.
y ) + clearance;
1441 return dynamic_cast<FOOTPRINT*>(
m_parent );
1533 std::swap( *((
PAD*)
this), *((
PAD*) aImage) );
1542 if( !drillsize.x || !drillsize.y )
1548 seg->
GetWidth() + aInflateValue * 2, aError, aErrorLoc );
1557 bool ignoreLineWidth )
const 1559 wxASSERT_MSG( !ignoreLineWidth, wxT(
"IgnoreLineWidth has no meaning for pads." ) );
1564 const int pad_min_seg_per_circle_count = 16;
1580 aErrorLoc, pad_min_seg_per_circle_count );
1584 int half_width = std::min( dx, dy );
1585 wxPoint
delta( dx - half_width, dy - half_width );
1590 ( half_width + aClearanceValue ) * 2, aError, aErrorLoc,
1591 pad_min_seg_per_circle_count );
1604 aClearanceValue, aError, aErrorLoc );
1605 aCornerBuffer.
Append( outline );
1619 aClearanceValue, aError, aErrorLoc );
1620 aCornerBuffer.
Append( outline );
1631 if( aClearanceValue )
1634 pad_min_seg_per_circle_count );
1635 int clearance = aClearanceValue;
1643 outline.
Inflate( clearance, numSegs );
1648 aCornerBuffer.
Append( outline );
1653 wxFAIL_MSG( wxT(
"PAD::TransformShapeWithClearanceToPolygon no implementation for " )
1743 roundRadiusRatio->SetAvailableFunc(
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
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.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Display value expressed in degrees.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
ZONE_CONNECTION
How pads are covered by copper in zone.
int GetLocalSolderMaskMargin() const
void FlipPrimitives(bool aFlipLeftRight)
Flip (mirror) the primitives left to right or top to bottom, around the anchor position in custom pad...
EDA_ITEM * m_parent
Linked list: Link (parent struct)
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
void SetOffset(const wxPoint &aOffset)
const int GetSizeY() const
int GetLocalClearance() const
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
static PROPERTY_MANAGER & Instance()
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint.
static LSET ConnSMDMask()
layer set for a SMD pad on Front layer used for edge board connectors
static struct PAD_DESC _PAD_DESC
void SetLocalSolderPasteMarginRatio(double aRatio)
void SetAttribute(PAD_ATTRIB aAttribute)
const int GetDrillSizeX() const
void Merge(const EDA_RECT &aRect)
Modify the position and size of the rectangle in order to contain aRect.
std::mutex m_shapesBuildingLock
int CircleToEndSegmentDeltaRadius(int aInnerCircleRadius, int aSegCount)
std::mutex m_polyBuildingLock
int GetLocalSolderPasteMargin() const
double GetRoundRectRadiusRatio() const
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void SetLocalClearance(int aClearance)
Implementation of conversion functions that require both schematic and board internal units.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
int m_effectiveBoundingRadius
void SetThermalSpokeWidth(int aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
void SetDrillSizeY(const int aY)
Meta control for all pads opacity/visibility (color ignored)
PAD_PROP GetProperty() const
int GetHolePlatingThickness() const
Pad & via drills are finish size.
int GetLocalClearanceOverrides(wxString *aSource) const override
Return any local clearance overrides set in the "classic" (ie: pre-rule) system.
virtual NETCLASS * GetNetClass() const
Return the NETCLASS for this item.
double m_roundedCornerScale
void Move(const VECTOR2I &aVector) override
Like smd, does not appear on the solder paste layer (default)
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetOrientationDegrees(double aOrientation)
Set orientation in degrees.
Additional netnames layers (not associated with a PCB layer)
Smd pad, appears on the solder paste layer (default)
bool IsLocked() const override
void SetSubRatsnest(int aSubRatsnest)
static ENUM_MAP< T > & Instance()
class PCB_ARC, an arc track segment on a copper layer
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
void SetSizeX(const int aX)
const SHAPE_SEGMENT * GetEffectiveHoleShape() const
Return a SHAPE object representing the pad's hole.
wxString GetNetname() const
wxString AsString() const
class PAD, a pad in a footprint
void SetPinType(const wxString &aType)
Set the pad electrical type.
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE >> &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
void SetSize(const wxSize &aSize)
int GetEffectiveThermalGap(wxString *aSource=nullptr) const
Return the effective thermal gap having resolved any inheritance.
void SetDelta(const wxSize &aSize)
void RotatePoint(int *pX, int *pY, double angle)
void NORMALIZE_ANGLE_POS(T &Angle)
The base class for create windows for drawing purpose.
bool IsAperturePad() const
#define NO_SETTER(owner, type)
virtual bool IsLocked() const
int PointCount() const
Return the number of points (vertices) in this line chain.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
std::shared_ptr< SHAPE_COMPOUND > m_effectiveShape
static SEG::ecoord Square(int a)
Contains methods for drawing PCB-specific items.
int GetThermalGap() const
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
wxString ShowPadShape() const
double m_localSolderPasteMarginRatio
bool Contains(const wxPoint &aPoint) const
int m_localSolderPasteMargin
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
const SEG & GetSeg() const
class PCB_TRACK, a track segment (segment on a copper layer)
EDA_RECT m_effectiveBoundingBox
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
This file contains miscellaneous commonly used macros and functions.
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
int m_localSolderMaskMargin
void SetPadToDieLength(int aLength)
void SetProperty(PAD_PROP aProperty)
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double 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.
void ImportSettingsFrom(const PAD &aMasterPad)
Import the pad settings from aMasterPad.
std::shared_ptr< SHAPE_SEGMENT > m_effectiveHoleShape
a pad used as heat sink, usually in SMD footprints
int GetEffectiveThermalSpokeWidth(wxString *aSource=nullptr) const
Return the effective thermal spoke width having resolved any inheritance.
bool m_keepTopBottomLayer
PCB specific render settings.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
void SetLocalSolderMaskMargin(int aMargin)
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape() DO NOT REORDER, legacy_plugin is dependent on ...
const wxPoint & GetOffset() const
std::shared_ptr< SHAPE_POLY_SET > m_effectivePolygon
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=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.
void SetDrillSizeX(const int aX)
const wxSize & GetDrillSize() const
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
virtual wxString layerMaskDescribe() const
Return a string (to be shown to the user) describing a layer mask.
like PAD_PTH, but not plated
bool IsHoleLayer(LAYER_NUM aLayer)
Display value expressed in distance units (mm/inch)
bool FlashLayer(int aLayer) const
Check to see whether the pad should be flashed on the specific layer.
LSET is a set of PCB_LAYER_IDs.
handle color for not plated holes (holes, not pads)
int GetThermalSpokeWidth() const
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
VECTOR2< double > VECTOR2D
void Move(const VECTOR2I &aVector) override
void SetPos0(const wxPoint &aPos)
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
void SetLocalCoord()
< Set relative coordinates.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
void SetThermalGap(int aGap)
Represent a set of closed polygons.
const wxPoint GetOrigin() const
coord_type GetWidth() const
void SetDrillSize(const wxSize &aSize)
const wxSize & GetSize() const
wxAny Get(PROPERTY_BASE *aProperty)
ZONE_CONNECTION GetEffectiveZoneConnection(wxString *aSource=nullptr) const
Return the zone connection in effect (either locally overridden or overridden in the parent footprint...
Smd pad, used in BGA footprints.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aCornerBuffer, const wxPoint &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void TransformTrapezoidToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aPosition, const wxSize &aSize, double aRotation, int aDeltaX, int aDeltaY, int aInflate, int aError, ERROR_LOC aErrorLoc)
Convert a rectangle or trapezoid to a polygon.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static LSET PTHMask()
layer set for a through hole pad
const EDA_RECT GetBoundingBox() const override
The bounding box is cached, so this will be efficient most of the time.
const wxString & GetNumber() const
const wxString & GetPinType() const
PAD_SHAPE GetShape() const
a fiducial (usually a smd) local to the parent footprint
PAD & operator=(const PAD &aOther)
static LSET AllLayersMask()
void Simplify(POLYGON_MODE aFastMode)
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
class ZONE, a copper pour area
An abstract shape on 2D plane.
void SetZoneConnection(ZONE_CONNECTION aType)
ZONE_CONNECTION m_zoneConnection
int GetCircleToPolyCorrection(int aMaxError)
void SetPinFunction(const wxString &aName)
Set the pad function (pin name in schematic)
void BuildEffectivePolygon() 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.
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Class that other classes need to inherit from, in order to be inspectable.
void SetRoundRectRadiusRatio(double aRadiusScale)
Has meaning only for rounded rectangle pads.
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
int GetLocalClearance(wxString *aSource) const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
void SetDrillShape(PAD_DRILL_SHAPE_T aShape)
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
wxString UnescapeString(const wxString &aSource)
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.
double GetLocalSolderPasteMarginRatio() const
class FOOTPRINT, a footprint
wxString GetNetnameMsg() const
void SetRoundRectCornerRadius(double aRadius)
Has meaning only for rounded rectangle pads.
void Inflate(int aAmount, int aCircleSegCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
Perform outline inflation/deflation.
const Vec & GetPosition() const
Some functions to handle hotkeys in KiCad.
int GetRoundRectCornerRadius() const
const wxSize & GetDelta() const
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
int GetSolderMaskMargin() const
FOOTPRINT * GetParent() const
void Rotate(double aAngle, const VECTOR2I &aCenter=VECTOR2I(0, 0)) override
Rotate all vertices by a given angle.
void SetChamferPositions(int aPositions)
Has meaning only for chamfered rectangular pads.
static int Compare(const PAD *aPadRef, const PAD *aPadCmp)
Compare two pads and return 0 if they are equal.
void Normalize()
Ensures that the height ant width are positive.
PAD_DRILL_SHAPE_T m_drillShape
const wxPoint & GetPos0() const
static LSET PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
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.
void SetSizeY(const int aY)
int GetBoundingRadius() const
Return the radius of a minimum sized circle which fully encloses this pad.
static LSET ApertureMask()
layer set for an aperture pad
void SetLayerSet(LSET aLayers) override
bool m_removeUnconnectedLayer
< If true, the pad copper is removed for layers that are not connected.
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
multilayer pads, usually with holes
a fiducial (usually a smd) for the full board
double GetChamferRectRatio() const
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
BITMAPS
A list of all bitmap identifiers.
wxSize GetSolderPasteMargin() const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
int GetSubRatsnest() const
PAD_PROP
Ghe set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
wxPoint GetPosition() const override
void SetLocalSolderPasteMargin(int aMargin)
PAD_DRILL_SHAPE_T GetDrillShape() const
no special fabrication property
ENUM_TO_WXANY(PAD_ATTRIB)
Information pertinent to a Pcbnew printed circuit board.
const int GetDrillSizeY() const
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
bool IsNetnameLayer(LAYER_NUM aLayer)
Test whether a layer is a netname layer.
PCB_LAYER_ID
A quick note on layer IDs:
PAD_ATTRIB GetAttribute() const
void SetNumber(const wxString &aNumber)
Set the pad number (note that it can be alphanumeric, such as the array reference "AA12").
double GetOrientationDegrees() const
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void SetPosition(const wxPoint &aPos) override
void AddProperty(PROPERTY_BASE *aProperty)
Register a property.
class ZONE, managed by a footprint
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Handle the component boundary box.
double DECIDEG2RAD(double deg)
const int GetSizeX() const
void TransformOvalToPolygon(SHAPE_POLY_SET &aCornerBuffer, const wxPoint &aStart, const wxPoint &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a oblong shape to a polygon, using multiple segments.
static std::string PAD_SHAPE_T_asString(PAD_SHAPE a)
const std::shared_ptr< SHAPE_POLY_SET > & GetEffectivePolygon() const
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
A base class for most all the KiCad significant classes used in schematics and boards.
coord_type GetHeight() const
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
double NormalizeAngleDegrees(double Angle, double aMin, double aMax)
Normalize angle to be aMin < angle <= aMax angle is in degrees.
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
void MergePrimitivesAsPolygon(SHAPE_POLY_SET *aMergedPolygon, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Merge all basic shapes to a SHAPE_POLY_SET.
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
int GetChamferPositions() const
wxString GetParentAsString() const
to draw pad holes (plated)
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Provide class metadata.Helper macro to map type hashes to names.
a pad with a castellated through hole
class PCB_VIA, a via (like a track segment on a copper layer)
wxString ShowPadAttr() const
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
#define PCB_EDIT_FRAME_NAME
CUST_PAD_SHAPE_IN_ZONE m_customShapeClearanceArea
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetChamferRectRatio(double aChamferScale)
Has meaning only for chamfered rectangular pads.
T NormalizeAngle360Min(T Angle)
Normalize angle to be > -360.0 and < 360.0 Angle equal to -360 or +360 are set to 0.
Message panel definition file.
static LSET SMDMask()
layer set for a SMD pad on Front layer
static constexpr int Millimeter2iu(double mm)
int GetPadToDieLength() const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
const wxString & GetPinFunction() const
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives() const
Accessor to the basic shape list for custom-shaped pads.
PAD_SHAPE GetAnchorPadShape() const
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
void SetOrientation(double aAngle)
Set the rotation angle of the pad.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
const wxSize GetSize() const
KICAD_T Type() const
Returns the type of object.
void SetAnchorPadShape(PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
Container for design settings for a BOARD object.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
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...
bool CanHaveNumber() const
Indicates whether or not the pad can have a number.