54#include <wx/choicdlg.h>
103#define PTH_DLG_TYPE 0
104#define SMD_DLG_TYPE 1
105#define CONN_DLG_TYPE 2
106#define NPTH_DLG_TYPE 3
107#define APERTURE_DLG_TYPE 4
121 m_posX( aParent, m_posXLabel, m_posXCtrl, m_posXUnits ),
122 m_posY( aParent, m_posYLabel, m_posYCtrl, m_posYUnits ),
123 m_sizeX( aParent, m_sizeXLabel, m_sizeXCtrl, m_sizeXUnits ),
124 m_sizeY( aParent, m_sizeYLabel, m_sizeYCtrl, m_sizeYUnits ),
125 m_offsetX( aParent, m_offsetXLabel, m_offsetXCtrl, m_offsetXUnits ),
126 m_offsetY( aParent, m_offsetYLabel, m_offsetYCtrl, m_offsetYUnits ),
127 m_padToDie( aParent, m_padToDieLabel, m_padToDieCtrl, m_padToDieUnits ),
128 m_padToDieDelay( aParent, m_padToDieDelayLabel, m_padToDieDelayCtrl, m_padToDieDelayUnits ),
129 m_trapDelta( aParent, m_trapDeltaLabel, m_trapDeltaCtrl, m_trapDeltaUnits ),
130 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
131 m_cornerRatio( aParent, m_cornerRatioLabel, m_cornerRatioCtrl, m_cornerRatioUnits ),
132 m_chamferRatio( aParent, m_chamferRatioLabel, m_chamferRatioCtrl, m_chamferRatioUnits ),
133 m_mixedCornerRatio( aParent, m_mixedCornerRatioLabel, m_mixedCornerRatioCtrl, m_mixedCornerRatioUnits ),
134 m_mixedChamferRatio( aParent, m_mixedChamferRatioLabel, m_mixedChamferRatioCtrl, m_mixedChamferRatioUnits ),
135 m_holeX( aParent, m_holeXLabel, m_holeXCtrl, m_holeXUnits ),
136 m_holeY( aParent, m_holeYLabel, m_holeYCtrl, m_holeYUnits ),
137 m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
138 m_maskMargin( aParent, m_maskMarginLabel, m_maskMarginCtrl, m_maskMarginUnits ),
139 m_pasteMargin( aParent, m_pasteMarginLabel, m_pasteMarginCtrl, m_pasteMarginUnits ),
140 m_pasteMarginRatio( aParent, m_pasteMarginRatioLabel, m_pasteMarginRatioCtrl, m_pasteMarginRatioUnits ),
141 m_thermalGap( aParent, m_thermalGapLabel, m_thermalGapCtrl, m_thermalGapUnits ),
142 m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
143 m_spokeAngle( aParent, m_spokeAngleLabel, m_spokeAngleCtrl, m_spokeAngleUnits ),
144 m_pad_orientation( aParent, m_PadOrientText, m_cb_padrotation, m_orientationUnits ),
145 m_teardropMaxLenSetting( aParent, m_stMaxLen, m_tcTdMaxLen, m_stMaxLenUnits ),
146 m_teardropMaxHeightSetting( aParent, m_stTdMaxSize, m_tcMaxHeight, m_stMaxHeightUnits )
173 SetTitle(
_(
"Pad Properties" ) );
181 SetTitle(
_(
"Default Pad Properties for Add Pad Tool" ) );
276 wxUpdateUIEvent dummyUI;
359 settings->SetHighContrast(
false );
360 settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
424 wxCommandEvent cmd_event;
479 wxObject* ctrl =
event.GetEventObject();
480 wxString value =
event.GetString();
481 bool changed =
false;
487 if( value.ToDouble( &ratioPercent ) )
490 if( ratioPercent < 0.0 )
495 else if( ratioPercent > 50.0 )
513 if( value.ToDouble( &ratioPercent ) )
516 if( ratioPercent < 0.0 )
521 else if( ratioPercent > 50.0 )
576 if( footprint->IsFlipped() )
580 relPos.
y = - relPos.
y;
587 msg.Printf(
_(
"Footprint %s (%s), %s, rotated %g deg"),
588 footprint->Reference().GetShownText(
false ),
589 footprint->Value().GetShownText(
false ),
590 footprint->IsFlipped() ?
_(
"back side (mirrored)" ) :
_(
"front side" ),
591 footprint->GetOrientation().AsDegrees() );
608 case FOOTPRINT_ATTR_T::FP_THROUGH_HOLE:
616 case FOOTPRINT_ATTR_T::FP_SMD:
752 wxCommandEvent cmd_event;
794 case PAD_SHAPE::CHAMFERED_RECT:
801 case PAD_SHAPE::CUSTOM:
828 wxCHECK_MSG(
m_board, ,
"Expected valid board in afterPadstackModeChanged" );
846 std::vector choices = {
910 settings->SetHighContrast(
false );
911 settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
938 const double ipcRadiusRatio =
975 const double ipcRadiusRatio =
1025 for(
size_t i = 0; i <
m_notebook->GetPageCount(); ++i )
1100 bool hasHole =
true;
1101 bool hasConnection =
true;
1102 bool hasProperty =
true;
1106 case PTH_DLG_TYPE: hasHole =
true; hasConnection =
true; hasProperty =
true;
break;
1107 case SMD_DLG_TYPE: hasHole =
false; hasConnection =
true; hasProperty =
true;
break;
1108 case CONN_DLG_TYPE: hasHole =
false; hasConnection =
true; hasProperty =
true;
break;
1109 case NPTH_DLG_TYPE: hasHole =
true; hasConnection =
false; hasProperty =
false;
break;
1110 case APERTURE_DLG_TYPE: hasHole =
false; hasConnection =
false; hasProperty =
true;
break;
1138 if( !hasConnection )
1162 if( !enablePadstack )
1179 bool hasHole =
true;
1180 bool hasConnection =
true;
1184 case PTH_DLG_TYPE: hasHole =
true; hasConnection =
true;
break;
1185 case SMD_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1186 case CONN_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1187 case NPTH_DLG_TYPE: hasHole =
true; hasConnection =
false;
break;
1243 if( cu_set.test(
F_Cu ) && cu_set.test(
B_Cu ) )
1245 else if( cu_set.test(
F_Cu ) )
1247 else if( cu_set.test(
B_Cu ) )
1279 bool keep_top_bottom )
1286 if( !layer_mask.any() )
1291 else if( !remove_unconnected )
1293 else if( keep_top_bottom )
1301 if( !layer_mask.any() )
1304 if( layer_mask.test(
F_Cu ) )
1312 if( !layer_mask.any() )
1315 if( layer_mask.test(
F_Cu ) )
1323 if( !layer_mask.any() )
1326 if( layer_mask.test(
F_Cu ) && layer_mask.test(
B_Cu ) )
1328 else if( layer_mask.test(
F_Cu ) )
1330 else if( layer_mask.test(
B_Cu ) )
1338 if( !layer_mask.any() )
1412 wxArrayString error_msgs;
1413 wxArrayString warning_msgs;
1416 [&](
int errorCode,
const wxString& msg )
1419 error_msgs.Add(
_(
"Error: " ) + msg );
1421 warning_msgs.Add(
_(
"Warning: " ) + msg );
1423 error_msgs.Add(
_(
"Error: Through hole pad has no hole." ) );
1426 if( error_msgs.GetCount() || warning_msgs.GetCount() )
1428 wxString title = error_msgs.GetCount() ?
_(
"Pad Properties Errors" )
1429 :
_(
"Pad Properties Warnings" );
1432 wxArrayString msgs = error_msgs;
1434 for(
const wxString& msg : warning_msgs )
1442 return error_msgs.GetCount() == 0;
1459 #define SELECTED_ITEMS_LAYER Dwgs_User
1466 static const std::vector<int> topLayers = {
1473 for(
int layer : topLayers )
1494 int maxXExtent = std::max( abs( bbox.
GetLeft() ), abs( bbox.
GetRight() ) );
1495 int maxYExtent = std::max( abs( bbox.
GetTop() ), abs( bbox.
GetBottom() ) );
1498 if( maxXExtent > INT_MAX / 4 )
1499 maxXExtent = INT_MAX / 4;
1501 if( maxYExtent > INT_MAX / 4 )
1502 maxYExtent = INT_MAX / 4;
1506 viewBox.
Inflate( maxXExtent * 1.4, maxYExtent * 1.4 );
1507 canvasBox.
Inflate( maxXExtent * 2.0, maxYExtent * 2.0 );
1522 if( !wxDialog::TransferDataToWindow() )
1539 if( !wxDialog::TransferDataFromWindow() )
1609 commit.
Push(
_(
"Edit Pad Properties" ) );
1621 case 0: prop = PAD_PROP::NONE;
break;
1622 case 1: prop = PAD_PROP::BGA;
break;
1623 case 2: prop = PAD_PROP::FIDUCIAL_LOCAL;
break;
1624 case 3: prop = PAD_PROP::FIDUCIAL_GLBL;
break;
1625 case 4: prop = PAD_PROP::TESTPOINT;
break;
1626 case 5: prop = PAD_PROP::HEATSINK;
break;
1627 case 6: prop = PAD_PROP::CASTELLATED;
break;
1628 case 7: prop = PAD_PROP::MECHANICAL;
break;
1773 pos -= fp->GetPosition();
1906 case PAD_ATTRIB::PTH:
1909 case PAD_ATTRIB::CONN:
1910 case PAD_ATTRIB::SMD:
1920 case PAD_ATTRIB::NPTH:
1928 wxFAIL_MSG( wxT(
"DIALOG_PAD_PROPERTIES::transferDataToPad: unknown pad type" ) );
1960 switch( copperLayersChoice )
1988 switch( copperLayersChoice )
1991 case 1: padLayerMask.
set(
F_Cu );
break;
1992 case 2: padLayerMask.
set(
B_Cu );
break;
2000 switch( copperLayersChoice )
2002 case 0: padLayerMask.
set(
F_Cu );
break;
2003 case 1: padLayerMask.
set(
B_Cu );
break;
2064 for(
size_t i = 0; i <
m_notebook->GetPageCount(); ++i )
constexpr EDA_IU_SCALE pcbIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
#define DEFAULT_PAD_DRILL_DIAMETER_MM
BASE_SET & set(size_t pos)
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
TEARDROP_PARAMETERS & GetTeardropParams()
std::unique_ptr< PAD > m_Pad_Master
void SetDefaultMasterPad()
FOOTPRINT * GetParentFootprint() const
VECTOR2I GetFPRelativePosition() const
BOARD_ITEM_CONTAINER * GetParent() const
const NETINFO_LIST & GetNetInfo() const
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
bool LegacyTeardrops() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr coord_type GetLeft() const
constexpr void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
constexpr coord_type GetRight() const
constexpr const SizeVec & GetSize() const
constexpr coord_type GetTop() const
constexpr coord_type GetBottom() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
Class DIALOG_PAD_PROPERTIES_BASE.
wxStaticText * m_techLayersLabel
wxBoxSizer * m_padstackControls
wxStaticText * m_staticTextInfoPaste
wxCheckBox * m_cbBottomLeft
wxCheckBox * m_cbBottomRight1
wxStaticBitmap * m_legacyTeardropsIcon
wxStaticText * m_stLenPercentHint
wxSpinCtrlDouble * m_spTeardropHDPercent
wxCheckBox * m_cbTeardrops
wxCheckBox * m_cbTopRight1
wxCheckBox * m_cbPreferZoneConnection
wxPanel * m_boardViewPanel
wxStaticBitmap * m_stackupImage1
wxStaticText * m_offsetShapeOptLabel
wxChoice * m_ZoneConnectionChoice
wxStaticText * m_teardropShapeLabel
wxStaticBitmap * m_stackupImage2
wxFlexGridSizer * m_offsetCtrls
wxCheckBox * m_cbBottomLeft1
wxStaticText * m_stWidthPercentHint
wxSpinCtrlDouble * m_spTeardropSizePercent
wxCheckBox * m_layerBackSilk
wxSimplebook * m_shapePropsBook
wxBoxSizer * m_LeftBoxSizer
wxStaticText * m_parentInfo
wxCheckBox * m_layerFrontMask
wxStaticBitmap * m_stackupImage4
wxTextCtrl * m_clearanceCtrl
wxCheckBox * m_padToDieDelayOpt
wxGridBagSizer * m_gbSizerHole
wxChoice * m_PadShapeSelector
wxChoice * m_holeShapeCtrl
wxStaticText * m_padNumLabel
TEXT_CTRL_EVAL * m_mixedCornerRatioCtrl
wxCheckBox * m_layerFrontAdhesive
wxCheckBox * m_layerBackMask
wxCheckBox * m_layerFrontPaste
wxCheckBox * m_layerBackAdhesive
wxChoice * m_ZoneCustomPadShape
wxSimplebook * m_stackupImagesBook
wxCheckBox * m_cbTeardropsUseNextTrack
wxCheckBox * m_cbTopRight
wxCheckBox * m_layerFrontSilk
wxTextCtrl * m_thermalGapCtrl
wxStaticText * m_holeShapeLabel
wxCheckBox * m_padToDieOpt
wxStaticBitmap * m_stackupImage0
wxStaticText * m_nonCopperNote
NET_SELECTOR * m_padNetSelector
wxBoxSizer * m_FlippedWarningSizer
wxTextCtrl * m_padNumCtrl
wxStaticBitmap * m_stackupImage7
wxTextCtrl * m_cornerRadiusCtrl
wxCheckBox * m_curvedEdges
wxCheckBox * m_cbBottomRight
wxChoice * m_trapAxisCtrl
wxStaticText * m_minTrackWidthHint
wxStaticBitmap * m_stackupImage6
wxCheckBox * m_cbTopLeft1
TEXT_CTRL_EVAL * m_chamferRatioCtrl
wxStaticBitmap * m_FlippedWarningIcon
wxCheckBox * m_layerUserDwgs
TEXT_CTRL_EVAL * m_mixedChamferRatioCtrl
wxSpinCtrlDouble * m_spTeardropLenPercent
wxChoice * m_cbPadstackMode
wxStaticText * m_holeXLabel
wxStaticBitmap * m_stackupImage5
wxStaticText * m_sizeXLabel
wxBoxSizer * m_legacyTeardropsWarning
TEXT_CTRL_EVAL * m_cornerRatioCtrl
wxChoice * m_choiceFabProperty
wxCheckBox * m_offsetShapeOpt
wxStaticBitmap * m_nonCopperWarningIcon
wxBoxSizer * m_padPreviewSizer
wxStaticLine * m_staticline71
wxCheckBox * m_cbShowPadOutline
wxStaticText * m_padNetLabel
wxStaticBitmap * m_bitmapTeardrop
wxCheckBox * m_layerBackPaste
wxSimplebook * m_nonCopperWarningBook
wxChoice * m_rbCopperLayersSel
wxPanel * m_localSettingsPanel
void OnUpdateUINonCopperWarning(wxUpdateUIEvent &event) override
void OnInitDialog(wxInitDialogEvent &event) override
void PadTypeSelected(wxCommandEvent &event) override
void OnPadToDieDelayCheckbox(wxCommandEvent &event) override
void OnPadShapeSelection(wxCommandEvent &event) override
UNIT_BINDER m_teardropMaxHeightSetting
bool transferDataToPad(PAD *aPad)
Copy values from dialog field to aPad's members.
bool TransferDataFromWindow() override
Updates the different parameters for the component being edited.
std::map< int, PCB_LAYER_ID > m_editLayerCtrlMap
bool Show(bool aShow) override
void updateHoleControls()
void OnEditLayerChanged(wxCommandEvent &event) override
std::vector< std::shared_ptr< PCB_SHAPE > > m_primitives
UNIT_BINDER m_padToDieDelay
UNIT_BINDER m_teardropMaxLenSetting
bool padValuesOK()
test if all values are acceptable for the pad
void PadOrientEvent(wxCommandEvent &event) override
bool TransferDataToWindow() override
void OnResize(wxSizeEvent &event)
PCB_BASE_FRAME * m_parent
UNIT_BINDER m_mixedCornerRatio
void OnOffsetCheckbox(wxCommandEvent &event) override
PCB_DRAW_PANEL_GAL * m_padPreviewGAL
void OnValuesChanged(wxCommandEvent &event) override
Called when a dimension has changed.
void updateRoundRectCornerValues()
DIALOG_PAD_PROPERTIES(PCB_BASE_FRAME *aParent, PAD *aPad)
void initPadstackLayerValues()
void onTeardropsUpdateUi(wxUpdateUIEvent &event) override
void UpdateLayersDropdown()
void onChangePadMode(wxCommandEvent &event) override
UNIT_BINDER m_pasteMargin
std::vector< PCB_SHAPE * > m_highlight
void OnPadstackModeChanged(wxCommandEvent &event) override
UNIT_BINDER m_pasteMarginRatio
void afterPadstackModeChanged()
KIGFX::ORIGIN_VIEWITEM * m_axisOrigin
UNIT_BINDER m_mixedChamferRatio
UNIT_BINDER m_cornerRadius
void OnSetCopperLayers(wxCommandEvent &event) override
void OnCancel(wxCommandEvent &event) override
void onCornerRadiusChange(wxCommandEvent &event) override
void updatePadLayersList(LSET layer_mask, bool remove_unconnected, bool keep_top_bottom)
Updates the CheckBox states in pad layers list, based on the layer_mask (if non-empty) or the default...
PAD_PROP getSelectedProperty()
Return the pad property currently selected.
void OnSetLayers(wxCommandEvent &event) override
void updatePadSizeControls()
void onCornerSizePercentChange(wxCommandEvent &event) override
UNIT_BINDER m_pad_orientation
void OnPadToDieCheckbox(wxCommandEvent &event) override
static bool m_sketchPreview
void OnDrillShapeSelected(wxCommandEvent &event) override
void OnUpdateUI(wxUpdateUIEvent &event) override
UNIT_BINDER m_cornerRatio
void onModify(wxCommandEvent &aEvent) override
UNIT_BINDER m_chamferRatio
bool Show(bool show) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void resetSize()
Clear the existing dialog size and position.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
EDA_BASE_FRAME * m_parentFrame
bool IsType(FRAME_T aType) const
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
void StartDrawing()
Begin drawing if it was stopped previously.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual void SetParent(EDA_ITEM *aParent)
void ListSet(const wxString &aList)
Add a list of items.
A color representation with 4 components: red, green, blue, alpha.
bool m_forceDisplayCursor
The pixel scale factor (>1 for hi-DPI scaled displays)
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
void SetGridVisibility(bool aVisibility)
Set the visibility setting of the grid.
void SetPosition(const VECTOR2I &aPosition) override
void SetDrawAtZero(bool aDrawFlag)
Set the draw at zero flag.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
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.
bool m_ForcePadSketchModeOn
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
An interface for classes handling user events controlling the view behavior such as zooming,...
void ApplySettings(const VC_SETTINGS &aSettings)
Apply VIEW_CONTROLS settings from an object.
const VC_SETTINGS & GetSettings() const
Return the current VIEW_CONTROLS settings.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetViewport(const BOX2D &aViewport)
Set the visible area of the VIEW.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
void SetBoundary(const BOX2D &aBoundary)
Set limits for view area.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
void ClearTopLayers()
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
LSET is a set of PCB_LAYER_IDs.
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
void SetSelectedNetcode(int aNetcode)
void ForEachUniqueLayer(const std::function< void(PCB_LAYER_ID)> &aMethod) const
Runs the given callable for each active unique copper layer in this padstack, meaning F_Cu for MODE::...
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
@ NORMAL
Shape is the same on all layers.
@ CUSTOM
Shapes can be defined on arbitrary layers.
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
@ REMOVE_EXCEPT_START_AND_END
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
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)
void CheckPad(UNITS_PROVIDER *aUnitsProvider, bool aForPadProperties, const std::function< void(int aErrorCode, const wxString &aMsg)> &aErrorHandler) const
PAD_PROP GetProperty() const
bool GetRemoveUnconnected() const
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.
int GetRoundRectCornerRadius(PCB_LAYER_ID aLayer) const
void SetLocalThermalGapOverride(const std::optional< int > &aOverride)
std::optional< double > GetLocalSolderPasteMarginRatio() const
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
static LSET PTHMask()
layer set for a through hole pad
void SetThermalSpokeAngle(const EDA_ANGLE &aAngle)
The orientation of the thermal spokes.
const wxString & GetNumber() const
const VECTOR2I & GetDelta(PCB_LAYER_ID aLayer) const
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
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.
VECTOR2I GetPosition() const override
void SetProperty(PAD_PROP aProperty)
EDA_ANGLE GetThermalSpokeAngle() const
void Flip(const VECTOR2I &VECTOR2I, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
void SetDelta(PCB_LAYER_ID aLayer, const VECTOR2I &aSize)
void SetPadToDieDelay(int aDelay)
int GetDrillSizeX() const
double GetRoundRectRadiusRatio(PCB_LAYER_ID aLayer) const
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
void SetNumber(const wxString &aNumber)
Set the pad number (note that it can be alphanumeric, such as the array reference "AA12").
void SetDrillShape(PAD_DRILL_SHAPE aShape)
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 GetPadToDieDelay() const
std::optional< int > GetLocalClearance() const override
Return any local clearances set in the "classic" (ie: pre-rule) system.
void SetPadstack(const PADSTACK &aPadstack)
void SetPosition(const VECTOR2I &aPos) override
const PADSTACK & Padstack() const
const VECTOR2I & GetOffset(PCB_LAYER_ID aLayer) const
static LSET ConnSMDMask()
layer set for a SMD pad on Front layer used for edge board connectors
void SetDrillSize(const VECTOR2I &aSize)
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.
void SetRoundRectCornerRadius(PCB_LAYER_ID aLayer, double aRadius)
Has meaning only for rounded rectangle pads.
static LSET SMDMask()
layer set for a SMD pad on Front layer
std::optional< int > GetLocalSolderPasteMargin() const
void SetChamferPositions(PCB_LAYER_ID aLayer, int aPositions)
Has meaning only for chamfered rectangular pads.
std::optional< int > GetLocalSolderMaskMargin() const
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
EDA_ANGLE GetFPRelativeOrientation() const
double GetChamferRectRatio(PCB_LAYER_ID aLayer) const
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.
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
std::optional< int > GetLocalThermalSpokeWidthOverride() const
void SetLocalClearance(std::optional< int > aClearance)
ZONE_CONNECTION GetLocalZoneConnection() const
int GetLocalThermalGapOverride(wxString *aSource) const
void SetLayerSet(const LSET &aLayers) override
PAD_SHAPE GetAnchorPadShape(PCB_LAYER_ID aLayer) const
void SetRoundRectRadiusRatio(PCB_LAYER_ID aLayer, double aRadiusScale)
Has meaning only for rounded rectangle pads.
void SetPadToDieLength(int aLength)
int GetPadToDieLength() const
const VECTOR2I & GetSize(PCB_LAYER_ID aLayer) const
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void ShowPadPropertiesDialog(PAD *aPad)
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Return the BOARD_DESIGN_SETTINGS for the open project.
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
double m_BestWidthRatio
The height of a teardrop as ratio between height and size of pad/via.
int m_TdMaxLen
max allowed length for teardrops in IU. <= 0 to disable
bool m_AllowUseTwoTracks
True to create teardrops using 2 track segments if the first in too small.
int m_TdMaxWidth
max allowed height for teardrops in IU. <= 0 to disable
double m_BestLengthRatio
The length of a teardrop as ratio between length and size of pad/via.
double m_WidthtoSizeFilterRatio
The ratio (H/D) between the via/pad size and the track width max value to create a teardrop 1....
bool m_TdOnPadsInZones
A filter to exclude pads inside zone fills.
bool m_Enabled
Flag to enable teardrops.
bool m_CurvedEdges
True if the teardrop should be curved.
virtual void ChangeDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual EDA_ANGLE GetAngleValue()
virtual void SetNegativeZero()
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetAngleValue(const EDA_ANGLE &aValue)
virtual void ChangeAngleValue(const EDA_ANGLE &aValue)
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
bool IsNull() const
Return true if the control holds no value (ie: empty string, not 0).
This file is part of the common library.
@ RECT_CHAMFER_BOTTOM_RIGHT
@ RECT_CHAMFER_BOTTOM_LEFT
#define APERTURE_DLG_TYPE
static PAD_ATTRIB code_type[]
#define SELECTED_ITEMS_LAYER
static PAD_SHAPE code_shape[]
@ CHOICE_SHAPE_CUSTOM_RECT_ANCHOR
@ CHOICE_SHAPE_CHAMFERED_RECT
@ CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR
@ CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT
#define PAD_PROPERTIES_DLG_NAME
DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder.
@ DRCE_PAD_TH_WITH_NO_HOLE
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_45
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
@ LAYER_NON_PLATEDHOLES
Draw usual through hole vias.
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
KICOMMON_API wxFont GetStatusFont(wxWindow *aWindow)
KICOMMON_API wxFont GetSmallInfoFont(wxWindow *aWindow)
bool PadHasMeaningfulRoundingRadius(const PAD &aPad, PCB_LAYER_ID aLayer)
Returns true if the pad's rounding ratio is valid (i.e.
double GetDefaultIpcRoundingRatio(const PAD &aPad, PCB_LAYER_ID aLayer)
Get a sensible default for a rounded rectangle pad's rounding ratio.
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
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
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 ...
constexpr int mmToIU(double mm) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D