171 int thisNetTieGroup = padToNetTieGroupMap[
GetNumber() ];
172 int otherNetTieGroup = padToNetTieGroupMap[ aOther->
GetNumber() ];
174 return thisNetTieGroup >= 0 && thisNetTieGroup == otherNetTieGroup;
183 return m_pinType.Contains( wxT(
"no_connect" ) );
317 else if( aOnlyCheckIfPermitted )
320 return board->GetConnectivity()->IsConnectedOnLayer(
this, aLayer, types );
375 return std::make_shared<SHAPE_NULL>();
382 if( flashPTHPads == FLASHING::NEVER_FLASHED )
384 else if( flashPTHPads == FLASHING::ALWAYS_FLASHED )
394 return std::make_shared<SHAPE_NULL>();
438 auto add = [
this](
SHAPE* aShape )
446 if(
GetShape() == PAD_SHAPE::CUSTOM )
449 switch( effectiveShape )
451 case PAD_SHAPE::CIRCLE:
455 case PAD_SHAPE::OVAL:
463 int half_width = std::min( half_size.
x, half_size.
y );
464 VECTOR2I half_len( half_size.
x - half_width, half_size.
y - half_width );
466 add(
new SHAPE_SEGMENT( shapePos - half_len, shapePos + half_len, half_width * 2 ) );
471 case PAD_SHAPE::RECTANGLE:
472 case PAD_SHAPE::TRAPEZOID:
473 case PAD_SHAPE::ROUNDRECT:
487 if( half_size.
x < min_len && half_size.
y < min_len )
493 else if( effectiveShape == PAD_SHAPE::TRAPEZOID )
500 corners.
Append( -half_size.
x - trap_delta.
y, half_size.
y + trap_delta.
x );
501 corners.
Append( half_size.
x + trap_delta.
y, half_size.
y - trap_delta.
x );
502 corners.
Append( half_size.
x - trap_delta.
y, -half_size.
y + trap_delta.
x );
503 corners.
Append( -half_size.
x + trap_delta.
y, -half_size.
y - trap_delta.
x );
506 corners.
Move( shapePos );
546 case PAD_SHAPE::CHAMFERED_RECT:
559 wxFAIL_MSG( wxT(
"PAD::buildEffectiveShapes: Unsupported pad shape: " )
564 if(
GetShape() == PAD_SHAPE::CUSTOM )
568 if( !primitive->IsProxyItem() )
570 for(
SHAPE* shape : primitive->MakeEffectiveShapes() )
573 shape->Move( shapePos );
584 int half_width = std::min( half_size.
x, half_size.
y );
585 VECTOR2I half_len( half_size.
x - half_width, half_size.
y - half_width );
624 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
649 if( aAttribute == PAD_ATTRIB::SMD )
708 auto mirrorBitFlags = [](
int& aBitfield,
int a,
int b )
710 bool temp = aBitfield & a;
750 primitive->Flip(
VECTOR2I( 0, 0 ), aFlipLeftRight );
780 case PAD_SHAPE::CIRCLE:
786 case PAD_SHAPE::OVAL:
820 *aSource =
_(
"pad" );
866 if( parentFootprint->GetLocalSolderMaskMargin() )
867 margin = parentFootprint->GetLocalSolderMaskMargin();
884 if( margin < minsize )
906 margin = parentFootprint->GetLocalSolderPasteMargin();
910 if( margin == 0 && brd )
911 margin = brd->GetDesignSettings().m_SolderPasteMargin;
914 mratio = parentFootprint->GetLocalSolderPasteMarginRatio();
916 if( mratio == 0.0 && brd )
918 mratio = brd->GetDesignSettings().m_SolderPasteMarginRatio;
943 *aSource =
_(
"pad" );
952 *aSource =
_(
"pad" );
961 *aSource =
_(
"pad" );
974 if( parentFootprint )
975 aList.emplace_back(
_(
"Footprint" ), parentFootprint->
GetReference() );
978 aList.emplace_back(
_(
"Pad" ),
m_number );
984 aList.emplace_back(
_(
"Pin Type" ),
GetPinType() );
990 aList.emplace_back(
_(
"Resolved Netclass" ),
994 aList.emplace_back(
_(
"Status" ),
_(
"Locked" ) );
1008 case PAD_PROP::NONE:
break;
1009 case PAD_PROP::BGA: props +=
_(
"BGA" );
break;
1010 case PAD_PROP::FIDUCIAL_GLBL: props +=
_(
"Fiducial global" );
break;
1011 case PAD_PROP::FIDUCIAL_LOCAL: props +=
_(
"Fiducial local" );
break;
1012 case PAD_PROP::TESTPOINT: props +=
_(
"Test point" );
break;
1013 case PAD_PROP::HEATSINK: props +=
_(
"Heat sink" );
break;
1014 case PAD_PROP::CASTELLATED: props +=
_(
"Castellated" );
break;
1034 if( !fp_orient.
IsZero() )
1039 aList.emplace_back(
_(
"Rotation" ), msg );
1043 aList.emplace_back(
_(
"Length in Package" ),
1051 aList.emplace_back(
_(
"Hole" ),
1052 wxString::Format( wxT(
"%s" ),
1057 aList.emplace_back(
_(
"Hole X / Y" ),
1058 wxString::Format( wxT(
"%s / %s" ),
1067 if( !source.IsEmpty() )
1069 aList.emplace_back( wxString::Format(
_(
"Min Clearance: %s" ),
1071 wxString::Format(
_(
"(from %s)" ),
1095 BOX2I arect = aRect;
1114 int count = poly->TotalVertices();
1116 for(
int ii = 0; ii < count; ii++ )
1118 VECTOR2I vertex = poly->CVertex( ii );
1119 VECTOR2I vertexNext = poly->CVertex( ( ii + 1 ) % count );
1139 if( ( diff =
static_cast<int>( aPadRef->
GetShape() ) -
1140 static_cast<int>( aPadCmp->
GetShape() ) ) != 0 )
1143 if( ( diff =
static_cast<int>( aPadRef->
m_attribute ) -
1193#if __cplusplus >= 201103L
1204 std::string s1 = aPadRef->
m_layerMask.to_string();
1205 std::string s2 = aPadCmp->
m_layerMask.to_string();
1206 return s1.compare( s2 );
1226 case PAD_SHAPE::CIRCLE:
return _(
"Circle" );
1227 case PAD_SHAPE::OVAL:
return _(
"Oval" );
1228 case PAD_SHAPE::RECTANGLE:
return _(
"Rect" );
1229 case PAD_SHAPE::TRAPEZOID:
return _(
"Trap" );
1230 case PAD_SHAPE::ROUNDRECT:
return _(
"Roundrect" );
1231 case PAD_SHAPE::CHAMFERED_RECT:
return _(
"Chamferedrect" );
1232 case PAD_SHAPE::CUSTOM:
return _(
"CustomShape" );
1233 default:
return wxT(
"???" );
1242 case PAD_ATTRIB::PTH:
return _(
"PTH" );
1243 case PAD_ATTRIB::SMD:
return _(
"SMD" );
1244 case PAD_ATTRIB::CONN:
return _(
"Conn" );
1245 case PAD_ATTRIB::NPTH:
return _(
"NPTH" );
1246 default:
return wxT(
"???" );
1257 return wxString::Format(
_(
"Pad %s of %s on %s" ),
1268 return wxString::Format(
_(
"PTH pad %s of %s" ),
1277 return wxString::Format(
_(
"Pad %s %s of %s on %s" ),
1289 return wxString::Format(
_(
"PTH pad %s %s of %s" ),
1300 return BITMAPS::pad;
1306 return new PAD( *
this );
1356 for (
int internal =
In1_Cu; internal <
In30_Cu; ++internal )
1359 aLayers[aCount++] = internal;
1371 aLayers[aCount++] = each_layer;
1378 constexpr double HIDE = std::numeric_limits<double>::max();
1456 if( cfg && cfg->m_Display.m_PadClearance &&
GetBoard() )
1461 int xMargin = std::max( solderMaskMargin, solderPasteMargin.
x ) + clearance;
1462 int yMargin = std::max( solderMaskMargin, solderPasteMargin.
y ) + clearance;
1507 case PAD_SHAPE::TRAPEZOID:
1511 case PAD_SHAPE::CIRCLE:
1522 case PAD_ATTRIB::SMD:
1523 case PAD_ATTRIB::CONN:
1557 std::swap( *
this, *
static_cast<PAD*
>( aImage ) );
1566 if( !drillsize.
x || !drillsize.
y )
1572 slot->GetWidth() + aClearance * 2, aError, aErrorLoc );
1579 int aMaxError,
ERROR_LOC aErrorLoc,
bool ignoreLineWidth )
const
1581 wxASSERT_MSG( !ignoreLineWidth, wxT(
"IgnoreLineWidth has no meaning for pads." ) );
1586 const int pad_min_seg_per_circle_count = 16;
1595 case PAD_SHAPE::CIRCLE:
1596 case PAD_SHAPE::OVAL:
1598 if( dx == dy || (
GetShape() == PAD_SHAPE::CIRCLE ) )
1601 pad_min_seg_per_circle_count );
1605 int half_width = std::min( dx, dy );
1611 ( half_width + aClearance ) * 2, aMaxError, aErrorLoc,
1612 pad_min_seg_per_circle_count );
1617 case PAD_SHAPE::TRAPEZOID:
1618 case PAD_SHAPE::RECTANGLE:
1625 aMaxError, aErrorLoc );
1626 aBuffer.
Append( outline );
1630 case PAD_SHAPE::CHAMFERED_RECT:
1631 case PAD_SHAPE::ROUNDRECT:
1633 bool doChamfer =
GetShape() == PAD_SHAPE::CHAMFERED_RECT;
1640 aClearance, aMaxError, aErrorLoc );
1641 aBuffer.
Append( outline );
1645 case PAD_SHAPE::CUSTOM:
1655 aClearance += aMaxError;
1660 else if( aClearance < 0 )
1670 aBuffer.
Append( outline );
1675 wxFAIL_MSG( wxT(
"PAD::TransformShapeToPolygon no implementation for " )
1687 .Map( PAD_ATTRIB::PTH,
_HKI(
"Through-hole" ) )
1688 .Map( PAD_ATTRIB::SMD,
_HKI(
"SMD" ) )
1689 .Map( PAD_ATTRIB::CONN,
_HKI(
"Edge connector" ) )
1690 .Map( PAD_ATTRIB::NPTH,
_HKI(
"NPTH, mechanical" ) );
1693 .Map( PAD_SHAPE::CIRCLE,
_HKI(
"Circle" ) )
1694 .Map( PAD_SHAPE::RECTANGLE,
_HKI(
"Rectangle" ) )
1695 .Map( PAD_SHAPE::OVAL,
_HKI(
"Oval" ) )
1696 .Map( PAD_SHAPE::TRAPEZOID,
_HKI(
"Trapezoid" ) )
1697 .Map( PAD_SHAPE::ROUNDRECT,
_HKI(
"Rounded rectangle" ) )
1698 .Map( PAD_SHAPE::CHAMFERED_RECT,
_HKI(
"Chamfered rectangle" ) )
1699 .Map( PAD_SHAPE::CUSTOM,
_HKI(
"Custom" ) );
1702 .Map( PAD_PROP::NONE,
_HKI(
"None" ) )
1703 .Map( PAD_PROP::BGA,
_HKI(
"BGA pad" ) )
1704 .Map( PAD_PROP::FIDUCIAL_GLBL,
_HKI(
"Fiducial, global to board" ) )
1705 .Map( PAD_PROP::FIDUCIAL_LOCAL,
_HKI(
"Fiducial, local to footprint" ) )
1706 .Map( PAD_PROP::TESTPOINT,
_HKI(
"Test point pad" ) )
1707 .Map( PAD_PROP::HEATSINK,
_HKI(
"Heatsink pad" ) )
1708 .Map( PAD_PROP::CASTELLATED,
_HKI(
"Castellated pad" ) );
1712 if( zcMap.
Choices().GetCount() == 0 )
1714 zcMap.
Undefined( ZONE_CONNECTION::INHERITED );
1715 zcMap.
Map( ZONE_CONNECTION::INHERITED,
_HKI(
"Inherited" ) )
1716 .
Map( ZONE_CONNECTION::NONE,
_HKI(
"None" ) )
1717 .
Map( ZONE_CONNECTION::THERMAL,
_HKI(
"Thermal reliefs" ) )
1718 .
Map( ZONE_CONNECTION::FULL,
_HKI(
"Solid" ) )
1719 .
Map( ZONE_CONNECTION::THT_THERMAL,
_HKI(
"Thermal reliefs for PTH" ) );
1730 PROPERTY_DISPLAY::PT_DEGREE ) );
1735 if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
1736 return pad->GetAttribute() != PAD_ATTRIB::NPTH;
1741 auto padCanHaveHole =
1744 if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
1746 return pad->GetAttribute() == PAD_ATTRIB::PTH
1747 ||
pad->GetAttribute() == PAD_ATTRIB::NPTH;
1754 _HKI(
"Net" ), isCopperPad );
1756 _HKI(
"Net Class" ), isCopperPad );
1758 const wxString groupPad =
_HKI(
"Pad Properties" );
1770 padNumber->SetAvailableFunc( isCopperPad );
1782 PROPERTY_DISPLAY::PT_SIZE ), groupPad );
1785 PROPERTY_DISPLAY::PT_SIZE ), groupPad )
1790 if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
1791 return pad->GetShape() != PAD_SHAPE::CIRCLE;
1798 roundRadiusRatio->SetAvailableFunc(
1801 if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
1802 return pad->GetShape() == PAD_SHAPE::ROUNDRECT;
1806 propMgr.
AddProperty( roundRadiusRatio, groupPad );
1810 PROPERTY_DISPLAY::PT_SIZE ), groupPad )
1816 PROPERTY_DISPLAY::PT_SIZE ), groupPad )
1825 PROPERTY_DISPLAY::PT_SIZE );
1826 padToDie->SetAvailableFunc( isCopperPad );
1829 const wxString groupOverrides =
_HKI(
"Overrides" );
1833 PROPERTY_DISPLAY::PT_SIZE ), groupOverrides );
1837 PROPERTY_DISPLAY::PT_SIZE ), groupOverrides );
1841 PROPERTY_DISPLAY::PT_SIZE ), groupOverrides );
1848 _HKI(
"Zone Connection Style" ),
1855 PROPERTY_DISPLAY::PT_SIZE ), groupOverrides )
1856 .
SetValidator( PROPERTY_VALIDATORS::RangeIntValidator<minZoneWidth, INT_MAX> );
1860 PROPERTY_DISPLAY::PT_DEGREE ), groupOverrides );
1864 PROPERTY_DISPLAY::PT_SIZE ), groupOverrides )
constexpr int ARC_HIGH_DEF
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
BITMAPS
A list of all bitmap identifiers.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
wxString GetNetnameMsg() const
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
wxString GetNetname() const
wxString GetShortNetname() const
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
int m_SolderMaskExpansion
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
virtual bool IsLocked() const
BOARD_ITEM_CONTAINER * GetParent() const
virtual wxString layerMaskDescribe() const
Return a string (to be shown to the user) describing a layer mask.
Information pertinent to a Pcbnew printed circuit board.
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
int GetMaxClearanceValue() const
Returns the maximum clearance value for any object on the board.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
const Vec & GetOrigin() const
bool Intersects(const BOX2< Vec > &aRect) const
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
const Vec & GetSize() const
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
MINOPTMAX< int > & Value()
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
ENUM_MAP & Undefined(T aValue)
Class that other classes need to inherit from, in order to be inspectable.
Contains methods for drawing PCB-specific items.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
PCB_LAYER_ID GetPrimaryHighContrastLayer() const
Return the board layer which is in high-contrast mode.
bool GetHighContrast() const
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
wxString AsString() const
LSET is a set of PCB_LAYER_IDs.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET FrontBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static LSET PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
static LSET BackBoardTechMask()
Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
PAD_DRILL_SHAPE_T m_drillShape
int GetLocalClearance(wxString *aSource) const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
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
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
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
std::vector< std::shared_ptr< PCB_SHAPE > > m_editPrimitives
PAD & operator=(const PAD &aOther)
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.
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
void SetOffset(const VECTOR2I &aOffset)
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
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
PAD_SHAPE GetShape() const
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.
std::array< ZONE_LAYER_OVERRIDE, MAX_CU_LAYERS > m_zoneLayerOverrides
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
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.
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.
void SetSize(const VECTOR2I &aSize)
void SetDrillSizeY(const int aY)
double GetThermalSpokeAngleDegrees() const
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
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)
void SetSizeY(const int aY)
int GetPadToDieLength() const
BOX2I m_effectiveBoundingBox
std::shared_ptr< SHAPE_POLY_SET > m_effectivePolygon
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
PROPERTY_BASE & SetWriteableFunc(std::function< bool(INSPECTABLE *)> aFunc)
PROPERTY_BASE & SetValidator(PROPERTY_VALIDATOR_FN &&aValidator)
PROPERTY_BASE & SetIsHiddenFromLibraryEditors(bool aIsHidden=true)
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void OverrideAvailability(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName, std::function< bool(INSPECTABLE *)> aFunc)
Sets an override availability functor for a base class property of a given derived class.
static VALIDATOR_RESULT PositiveIntValidator(const wxAny &&aValue, EDA_ITEM *aItem)
static SEG::ecoord Square(int a)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void Move(const VECTOR2I &aVector) override
int PointCount() const
Return the number of points (vertices) in this line chain.
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.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
void Fracture(POLYGON_MODE aFastMode)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
@ ALLOW_ACUTE_CORNERS
just inflate the polygon. Acute angles create spikes
@ ROUND_ALL_CORNERS
All angles are rounded.
void Inflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError, bool aSimplify=false)
Perform outline inflation/deflation.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
void Move(const VECTOR2I &aVector) override
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
An abstract shape on 2D plane.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
void TransformRoundChamferedRectToPolygon(SHAPE_POLY_SET &aBuffer, 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.
void TransformOvalToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a oblong shape to a polygon, using multiple segments.
void TransformTrapezoidToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aPosition, const VECTOR2I &aSize, const EDA_ANGLE &aRotation, int aDeltaX, int aDeltaY, int aInflate, int aError, ERROR_LOC aErrorLoc)
Convert a rectangle or trapezoid to a polygon.
@ RECT_CHAMFER_BOTTOM_RIGHT
@ RECT_CHAMFER_BOTTOM_LEFT
@ HOLE_CLEARANCE_CONSTRAINT
static constexpr EDA_ANGLE & ANGLE_45
static constexpr EDA_ANGLE & ANGLE_0
#define PCB_EDIT_FRAME_NAME
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Some functions to handle hotkeys in KiCad.
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer)
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
@ LAYER_FOOTPRINTS_FR
show footprints on front
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
@ LAYER_FOOTPRINTS_BK
show footprints on back
@ LAYER_PADS_SMD_BK
smd pads, back layer
@ LAYER_PADS_TH
multilayer pads, usually with holes
@ LAYER_PADS_SMD_FR
smd pads, front layer
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
bool IsHoleLayer(int aLayer)
PCB_LAYER_ID
A quick note on layer IDs:
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint.
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.
Message panel definition file.
constexpr int Mils2IU(const EDA_IU_SCALE &aIuScale, int mils)
T clamp(T min, T value, T max)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
static struct PAD_DESC _PAD_DESC
@ CUST_PAD_SHAPE_IN_ZONE_OUTLINE
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
static std::string PAD_SHAPE_T_asString(PAD_SHAPE a)
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 ...
#define NO_SETTER(owner, type)
#define ENUM_TO_WXANY(type)
Macro to define read-only fields (no setter method available)
wxString UnescapeString(const wxString &aSource)
constexpr int mmToIU(double mm) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< double > VECTOR2D
ZONE_CONNECTION
How pads are covered by copper in zone.
#define ZONE_THICKNESS_MIN_VALUE_MM