51#include <wx/choicdlg.h>
100#define CONN_DLG_TYPE 2
101#define NPTH_DLG_TYPE 3
102#define APERTURE_DLG_TYPE 4
116 m_canUpdate( false ),
117 m_posX( aParent, m_posXLabel, m_posXCtrl, m_posXUnits ),
118 m_posY( aParent, m_posYLabel, m_posYCtrl, m_posYUnits ),
119 m_sizeX( aParent, m_sizeXLabel, m_sizeXCtrl, m_sizeXUnits ),
120 m_sizeY( aParent, m_sizeYLabel, m_sizeYCtrl, m_sizeYUnits ),
121 m_offsetX( aParent, m_offsetXLabel, m_offsetXCtrl, m_offsetXUnits ),
122 m_offsetY( aParent, m_offsetYLabel, m_offsetYCtrl, m_offsetYUnits ),
123 m_padToDie( aParent, m_padToDieLabel, m_padToDieCtrl, m_padToDieUnits ),
124 m_trapDelta( aParent, m_trapDeltaLabel, m_trapDeltaCtrl, m_trapDeltaUnits ),
125 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
126 m_cornerRatio( aParent, m_cornerRatioLabel, m_cornerRatioCtrl, m_cornerRatioUnits ),
127 m_chamferRatio( aParent, m_chamferRatioLabel, m_chamferRatioCtrl, m_chamferRatioUnits ),
128 m_mixedCornerRatio( aParent, m_mixedCornerRatioLabel, m_mixedCornerRatioCtrl,
129 m_mixedCornerRatioUnits ),
130 m_mixedChamferRatio( aParent, m_mixedChamferRatioLabel, m_mixedChamferRatioCtrl,
131 m_mixedChamferRatioUnits ),
132 m_holeX( aParent, m_holeXLabel, m_holeXCtrl, m_holeXUnits ),
133 m_holeY( aParent, m_holeYLabel, m_holeYCtrl, m_holeYUnits ),
134 m_clearance( aParent, m_clearanceLabel, m_clearanceCtrl, m_clearanceUnits ),
135 m_maskMargin( aParent, m_maskMarginLabel, m_maskMarginCtrl, m_maskMarginUnits ),
136 m_pasteMargin( aParent, m_pasteMarginLabel, m_pasteMarginCtrl, m_pasteMarginUnits ),
137 m_pasteMarginRatio( aParent, m_pasteMarginRatioLabel, m_pasteMarginRatioCtrl,
138 m_pasteMarginRatioUnits ),
139 m_thermalGap( aParent, m_thermalGapLabel, m_thermalGapCtrl, m_thermalGapUnits ),
140 m_spokeWidth( aParent, m_spokeWidthLabel, m_spokeWidthCtrl, m_spokeWidthUnits ),
141 m_spokeAngle( aParent, m_spokeAngleLabel, m_spokeAngleCtrl, m_spokeAngleUnits ),
142 m_pad_orientation( aParent, m_PadOrientText, m_cb_padrotation, m_orientationUnits )
169 SetTitle(
_(
"Pad Properties" ) );
176 SetTitle(
_(
"Default Pad Properties for Add Pad Tool" ) );
213 infoFont.SetStyle( wxFONTSTYLE_ITALIC );
246 wxUpdateUIEvent dummyUI;
337 settings->SetHighContrast(
false );
398 wxObject* ctrl =
event.GetEventObject();
399 wxString value =
event.GetString();
400 bool changed =
false;
406 if( value.ToDouble( &ratioPercent ) )
409 if( ratioPercent < 0.0 )
414 else if( ratioPercent > 50.0 )
432 if( value.ToDouble( &ratioPercent ) )
435 if( ratioPercent < 0.0 )
440 else if( ratioPercent > 50.0 )
494 msg.Printf(
_(
"Footprint %s (%s), %s, rotated %g deg"),
497 footprint->
IsFlipped() ?
_(
"back side (mirrored)" ) :
_(
"front side" ),
663 wxCommandEvent cmd_event;
684 itemCol.SetImage(-1);
686 for(
int ii = 0; ii < 5; ++ii )
693 const std::shared_ptr<PCB_SHAPE>& primitive =
m_primitives[ii];
695 for( wxString& s : bs_info )
699 primitive->GetWidth() );
701 switch( primitive->GetShape() )
704 bs_info[0] =
_(
"Segment" );
710 bs_info[0] =
_(
"Bezier" );
716 bs_info[0] =
_(
"Arc" );
723 if( primitive->GetWidth() )
724 bs_info[0] =
_(
"Ring" );
726 bs_info[0] =
_(
"Circle" );
730 primitive->GetRadius() );
734 bs_info[0] =
_(
"Polygon" );
736 primitive->GetPolyShape().Outline( 0 ).PointCount() );
740 if( primitive->IsAnnotationProxy() )
741 bs_info[0] =
_(
"Number box" );
743 bs_info[0] =
_(
"Rectangle" );
750 bs_info[0] =
_(
"Unknown primitive" );
757 for(
int jj = 0, col = 0; jj < 5; ++jj )
762 for(
unsigned ii = 0; ii < 5; ++ii )
784 settings->SetHighContrast(
false );
903 for(
size_t i = 0; i <
m_notebook->GetPageCount(); ++i )
970 bool hasConnection =
true;
971 bool hasProperty =
true;
975 case PTH_DLG_TYPE: hasHole =
true; hasConnection =
true; hasProperty =
true;
break;
976 case SMD_DLG_TYPE: hasHole =
false; hasConnection =
true; hasProperty =
true;
break;
977 case CONN_DLG_TYPE: hasHole =
false; hasConnection =
true; hasProperty =
true;
break;
978 case NPTH_DLG_TYPE: hasHole =
true; hasConnection =
false; hasProperty =
false;
break;
979 case APERTURE_DLG_TYPE: hasHole =
false; hasConnection =
false; hasProperty =
true;
break;
1025 bool hasHole =
true;
1026 bool hasConnection =
true;
1030 case PTH_DLG_TYPE: hasHole =
true; hasConnection =
true;
break;
1031 case SMD_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1032 case CONN_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1033 case NPTH_DLG_TYPE: hasHole =
true; hasConnection =
false;
break;
1084 if( cu_set.test(
F_Cu ) && cu_set.test(
B_Cu ) )
1086 else if( cu_set.test(
F_Cu ) )
1088 else if( cu_set.test(
B_Cu ) )
1112 bool keep_top_bottom )
1119 if( !layer_mask.any() )
1124 else if( !remove_unconnected )
1126 else if( keep_top_bottom )
1134 if( !layer_mask.any() )
1137 if( layer_mask.test(
F_Cu ) )
1145 if( !layer_mask.any() )
1148 if( layer_mask.test(
F_Cu ) )
1156 if( !layer_mask.any() )
1159 if( layer_mask.test(
F_Cu ) && layer_mask.test(
B_Cu ) )
1161 else if( layer_mask.test(
F_Cu ) )
1163 else if( layer_mask.test(
B_Cu ) )
1171 if( !layer_mask.any() )
1239 wxArrayString error_msgs;
1240 wxArrayString warning_msgs;
1250 if( pad_size.
x <= 0 )
1251 error_msgs.Add(
_(
"Error: Pad must have a positive size." ) );
1255 if( pad_size.
x <= 0 || pad_size.
y <= 0 )
1256 error_msgs.Add(
_(
"Error: Pad must have a positive size." ) );
1270 warning_msgs.Add(
_(
"Warning: Pad hole not inside pad shape." ) );
1283 warning_msgs.Add(
_(
"Warning: Pad hole will leave no copper." ) );
1288 warning_msgs.Add(
_(
"Warning: Negative local clearance values will have no effect." ) );
1301 BOX2I shapeBBox = shape->GetBoundingBox();
1305 warning_msgs.Add(
_(
"Warning: Negative solder mask clearances larger than "
1306 "some shape primitives. Results may be surprising." ) );
1312 else if( absMargin > pad_size.
x || absMargin > pad_size.
y )
1314 warning_msgs.Add(
_(
"Warning: Negative solder mask clearance larger than pad. No "
1315 "solder mask will be generated." ) );
1328 paste_size.x = pad_size.
x + paste_margin +
KiROUND( pad_size.
x * paste_ratio );
1329 paste_size.y = pad_size.
y + paste_margin +
KiROUND( pad_size.
y * paste_ratio );
1331 if( paste_size.x <= 0 || paste_size.y <= 0 )
1333 warning_msgs.Add(
_(
"Warning: Negative solder paste margins larger than pad. No solder "
1334 "paste mask will be generated." ) );
1339 if( padlayers_mask == 0 )
1340 error_msgs.Add(
_(
"Error: pad has no layer." ) );
1342 if( !padlayers_mask[
F_Cu] && !padlayers_mask[
B_Cu] )
1346 warning_msgs.Add(
_(
"Warning: Plated through holes should normally have a copper pad "
1347 "on at least one layer." ) );
1352 error_msgs.Add(
_(
"Error: Trapazoid delta is too large." ) );
1358 if( drill_size.
x <= 0
1361 error_msgs.Add(
_(
"Error: Through hole pad has no hole." ) );
1368 warning_msgs.Add(
_(
"Warning: Connector pads normally have no solder paste. Use a "
1369 "SMD pad instead." ) );
1375 if( drill_size.
x > 0 || drill_size.
y > 0 )
1377 error_msgs.Add(
_(
"Error: SMD pad has a hole." ) );
1382 if( ( padlayers_mask[
F_Cu] && padlayers_mask[
B_Cu] ) || innerlayers_mask.count() != 0 )
1383 warning_msgs.Add(
_(
"Warning: SMD pad has no outer layers." ) );
1392 warning_msgs.Add(
_(
"Warning: Fiducial property makes no sense on NPTH pads." ) );
1398 warning_msgs.Add(
_(
"Warning: Testpoint property makes no sense on NPTH pads." ) );
1404 warning_msgs.Add(
_(
"Warning: Heatsink property makes no sense of NPTH pads." ) );
1410 warning_msgs.Add(
_(
"Warning: Castellated property is for PTH pads." ) );
1416 warning_msgs.Add(
_(
"Warning: BGA property is for SMD pads." ) );
1425 error_msgs.Add(
_(
"Error: Negative corner size." ) );
1427 warning_msgs.Add(
_(
"Warning: Corner size will make pad circular." ) );
1437 error_msgs.Add(
_(
"Error: Custom pad shape must resolve to a single polygon." ) );
1441 if( error_msgs.GetCount() || warning_msgs.GetCount() )
1443 wxString title = error_msgs.GetCount() ?
_(
"Pad Properties Errors" )
1444 :
_(
"Pad Properties Warnings" );
1447 wxArrayString msgs = error_msgs;
1449 for(
const wxString& msg : warning_msgs )
1457 return error_msgs.GetCount() == 0;
1471 #define SELECTED_ITEMS_LAYER Dwgs_User
1490 while( select >= 0 )
1497 view->
Add( dummyShape );
1514 if( maxXExtent > INT_MAX / 4 )
1515 maxXExtent = INT_MAX / 4;
1517 if( maxYExtent > INT_MAX / 4 )
1518 maxYExtent = INT_MAX / 4;
1522 viewBox.
Inflate( maxXExtent * 1.4, maxYExtent * 1.4 );
1523 canvasBox.
Inflate( maxXExtent * 2.0, maxYExtent * 2.0 );
1538 if( !wxDialog::TransferDataToWindow() )
1555 if( !wxDialog::TransferDataFromWindow() )
1669 commit.
Push(
_(
"Modify pad" ) );
1697 :
_(
"Hole size X:" ) );
1709 :
_(
"Pad size X:" ) );
1783 wxSize
delta( 0, 0 );
1907 wxFAIL_MSG( wxT(
"DIALOG_PAD_PROPERTIES::transferDataToPad: unknown pad type" ) );
1940 switch( copperLayersChoice )
1968 switch( copperLayersChoice )
1970 case 0: padLayerMask.set(
F_Cu ).set(
B_Cu );
break;
1971 case 1: padLayerMask.set(
F_Cu );
break;
1972 case 2: padLayerMask.set(
B_Cu );
break;
1980 switch( copperLayersChoice )
1982 case 0: padLayerMask.set(
F_Cu );
break;
1983 case 1: padLayerMask.set(
B_Cu );
break;
2012 padLayerMask.set(
F_Mask );
2015 padLayerMask.set(
B_Mask );
2044 for(
size_t i = 0; i <
m_notebook->GetPageCount(); ++i )
2080 wxMessageBox(
_(
"No shape selected" ) );
2084 std::shared_ptr<PCB_SHAPE>& shape =
m_primitives[select];
2090 if( dlg.ShowModal() != wxID_OK )
2100 if( dlg.ShowModal() != wxID_OK )
2141 std::vector<long> indexes;
2142 indexes.push_back( select );
2145 indexes.push_back( select );
2148 for(
unsigned ii = indexes.size(); ii > 0; --ii )
2161 wxString shapelist[] = {
2170 int type = wxGetSingleChoiceIndex(
_(
"Shape type:" ),
_(
"Add Primitive" ),
2171 arrayDim( shapelist ), shapelist, 0,
this );
2181 primitive->
SetShape( listtype[type] );
2183 if( type ==
static_cast<int>(
arrayDim( shapelist ) ) - 1 )
2194 if( dlg.ShowModal() != wxID_OK )
2201 if( dlg.ShowModal() != wxID_OK )
2220 wxMessageBox(
_(
"No shape selected" ) );
2225 std::vector<std::shared_ptr<PCB_SHAPE>> shapeList;
2233 if( dlg.ShowModal() != wxID_OK )
2251 wxMessageBox(
_(
"No shape selected" ) );
2256 std::vector<std::shared_ptr<PCB_SHAPE>> shapeList;
2264 if( dlg.ShowModal() != wxID_OK )
2270 std::vector<std::shared_ptr<PCB_SHAPE>> duplicates;
2272 std::move( duplicates.begin(), duplicates.end(), std::back_inserter(
m_primitives ) );
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
constexpr EDA_IU_SCALE pcbIUScale
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
@ pads_remove_unused_keep_bottom
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
std::unique_ptr< PAD > m_Pad_Master
int GetLineThickness(PCB_LAYER_ID aLayer) const
Return the default graphic segment thickness from the layer class for the given layer.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
const NETINFO_LIST & GetNetInfo() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
coord_type GetTop() const
coord_type GetHeight() const
coord_type GetWidth() const
void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
coord_type GetRight() const
coord_type GetLeft() const
const Vec & GetSize() const
coord_type GetBottom() const
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
A dialog to edit basic shape parameters.
bool TransferDataFromWindow() override
Transfer data out of the GUI.
A dialog to edit basic polygonal shape parameters.
bool TransferDataFromWindow() override
Transfer data out of the GUI.
Class DIALOG_PAD_PROPERTIES_BASE.
wxStaticText * m_techLayersLabel
wxStaticText * m_staticTextInfoPaste
wxCheckBox * m_cbBottomLeft
wxCheckBox * m_cbBottomRight1
wxCheckBox * m_PadLayerSilkCu
wxCheckBox * m_cbTopRight1
wxPanel * m_boardViewPanel
wxStaticBitmap * m_stackupImage1
wxCheckBox * m_PadLayerSilkCmp
wxStaticText * m_offsetShapeOptLabel
wxCheckBox * m_PadLayerMaskCu
wxChoice * m_ZoneConnectionChoice
wxStaticBitmap * m_stackupImage2
wxFlexGridSizer * m_offsetCtrls
wxCheckBox * m_cbBottomLeft1
wxButton * m_buttonGeometry
wxCheckBox * m_PadLayerDraft
wxSimplebook * m_shapePropsBook
wxCheckBox * m_PadLayerAdhCu
wxBoxSizer * m_LeftBoxSizer
wxStaticText * m_parentInfo
wxStaticBitmap * m_stackupImage4
wxStaticText * m_copperLayersLabel
wxGridBagSizer * m_gbSizerHole
wxStaticLine * m_staticline6
wxChoice * m_PadShapeSelector
wxCheckBox * m_PadLayerECO2
wxButton * m_buttonEditShape
wxChoice * m_holeShapeCtrl
wxStaticText * m_padNumLabel
TEXT_CTRL_EVAL * m_mixedCornerRatioCtrl
wxChoice * m_ZoneCustomPadShape
wxSimplebook * m_stackupImagesBook
wxButton * m_buttonAddShape
wxCheckBox * m_cbTopRight
wxCheckBox * m_PadLayerPateCu
wxStaticText * m_holeShapeLabel
wxCheckBox * m_PadLayerAdhCmp
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_cbBottomRight
wxChoice * m_trapAxisCtrl
wxStaticBitmap * m_stackupImage6
wxCheckBox * m_cbTopLeft1
TEXT_CTRL_EVAL * m_chamferRatioCtrl
wxCheckBox * m_PadLayerPateCmp
wxStaticBitmap * m_FlippedWarningIcon
wxListView * m_listCtrlPrimitives
TEXT_CTRL_EVAL * m_mixedChamferRatioCtrl
wxStaticText * m_holeXLabel
wxStaticBitmap * m_stackupImage5
wxCheckBox * m_PadLayerMaskCmp
wxStaticText * m_sizeXLabel
TEXT_CTRL_EVAL * m_cornerRatioCtrl
wxChoice * m_choiceFabProperty
wxCheckBox * m_offsetShapeOpt
wxStaticBitmap * m_nonCopperWarningIcon
wxBoxSizer * m_padPreviewSizer
wxCheckBox * m_cbShowPadOutline
wxStaticText * m_padNetLabel
wxCheckBox * m_PadLayerECO1
wxSimplebook * m_nonCopperWarningBook
wxChoice * m_rbCopperLayersSel
wxStaticText * m_staticTextPrimitiveListWarning
wxPanel * m_localSettingsPanel
void OnUpdateUINonCopperWarning(wxUpdateUIEvent &event) override
void OnInitDialog(wxInitDialogEvent &event) override
void PadTypeSelected(wxCommandEvent &event) override
void OnPadShapeSelection(wxCommandEvent &event) override
bool transferDataToPad(PAD *aPad)
Copy values from dialog field to aPad's members.
void onAddPrimitive(wxCommandEvent &event) override
bool TransferDataFromWindow() override
Updates the different parameters for the component being edited.
bool Show(bool aShow) override
void updateHoleControls()
std::vector< std::shared_ptr< PCB_SHAPE > > m_primitives
bool padValuesOK()
test if all values are acceptable for the pad
void onPrimitiveDClick(wxMouseEvent &event) override
Called on a double click on the basic shapes list.
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 displayPrimitivesList()
void UpdateLayersDropdown()
void onEditPrimitive(wxCommandEvent &event) override
void onChangePadMode(wxCommandEvent &event) override
UNIT_BINDER m_pasteMargin
void OnPrimitiveSelection(wxListEvent &event) override
Called on selection/deselection of a basic shape.
std::vector< PCB_SHAPE * > m_highlight
UNIT_BINDER m_pasteMarginRatio
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
void enablePrimitivePage(bool aEnable)
enable (or disable) the primitive page editor
UNIT_BINDER m_pad_orientation
void OnPadToDieCheckbox(wxCommandEvent &event) override
void onGeometryTransform(wxCommandEvent &event) override
void onDuplicatePrimitive(wxCommandEvent &event) override
static bool m_sketchPreview
void OnDrillShapeSelected(wxCommandEvent &event) override
void onDeletePrimitive(wxCommandEvent &event) override
Event handlers of basic shapes list panel.
void OnUpdateUI(wxUpdateUIEvent &event) override
UNIT_BINDER m_cornerRatio
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 finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
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.
KIGFX::GAL_DISPLAY_OPTIONS & 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
Update the board display after modifying it by a python script (note: it is automatically called by a...
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 SetFilled(bool aFlag)
void SetShape(SHAPE_T aShape)
void SetIsAnnotationProxy(bool aIsProxy=true)
virtual wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
void ListSet(const wxString &aList)
Add a list of items.
A color representation with 4 components: red, green, blue, alpha.
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
void SetGridVisibility(bool aVisibility)
Set the visibility setting of the grid.
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.
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)
Load new settings from program common settings.
const VC_SETTINGS & GetSettings() const
Apply VIEW_CONTROLS settings from an object.
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.
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.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
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 forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
void SetBoard(BOARD *aBoard)
void SetSelectedNetcode(int aNetcode)
void SetNetInfo(NETINFO_LIST *aNetInfoList)
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)
void SetLayerSet(LSET aLayers) override
PAD_PROP GetProperty() const
bool GetRemoveUnconnected() const
PAD_DRILL_SHAPE_T GetDrillShape() const
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
void SetLocalSolderPasteMargin(int aMargin)
static LSET PTHMask()
layer set for a through hole pad
ZONE_CONNECTION GetZoneConnection() const
void SetRemoveUnconnected(bool aSet)
Set the unconnected removal property.
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.
void SetThermalGap(int aGap)
void SetThermalSpokeAngle(const EDA_ANGLE &aAngle)
The orientation of the thermal spokes.
const wxString & GetNumber() const
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
void DeletePrimitivesList()
Clear the basic shapes list.
void SetDrillShape(PAD_DRILL_SHAPE_T aShape)
VECTOR2I GetPosition() const override
void SetProperty(PAD_PROP aProperty)
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)
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
void SetRoundRectCornerRadius(double aRadius)
Has meaning only for rounded rectangle pads.
void SetLocalClearance(int aClearance)
void SetKeepTopBottom(bool aSet)
Set whether we keep the top and bottom connections even if they are not connected.
void SetNumber(const wxString &aNumber)
Set the pad number (note that it can be alphanumeric, such as the array reference "AA12").
void SetZoneConnection(ZONE_CONNECTION aType)
int GetLocalSolderMaskMargin() const
bool GetKeepTopBottom() const
CUST_PAD_SHAPE_IN_ZONE GetCustomShapeInZoneOpt() const
FOOTPRINT * GetParent() const
void SetDelta(const VECTOR2I &aSize)
bool IsOnCopperLayer() const override
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)
PAD_SHAPE GetShape() const
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
void Flip(const VECTOR2I &VECTOR2I, bool aFlipLeftRight) override
Flip this object, i.e.
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.
static LSET SMDMask()
layer set for a SMD pad on Front layer
void SetLocalSolderPasteMarginRatio(double aRatio)
void SetShape(PAD_SHAPE aShape)
Set the new shape of this pad.
int GetThermalSpokeWidth() const
int GetLocalSolderPasteMargin() const
void SetPos0(const VECTOR2I &aPos)
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.
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
int GetChamferPositions() const
void ReplacePrimitives(const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
void SetLocalSolderMaskMargin(int aMargin)
void SetThermalSpokeWidth(int aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
void SetSize(const VECTOR2I &aSize)
double GetRoundRectRadiusRatio() const
int GetThermalGap() const
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const override
Return a SHAPE_SEGMENT object representing the pad's hole.
const VECTOR2I & GetSize() const
void SetChamferPositions(int aPositions)
Has meaning only for chamfered rectangular pads.
PAD_SHAPE GetAnchorPadShape() const
double GetChamferRectRatio() const
void SetPadToDieLength(int aLength)
int GetPadToDieLength() 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
Returns the BOARD_DESIGN_SETTINGS for the open project.
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.
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
virtual void Move(const VECTOR2I &aMoveVector) override
Move this object.
void SetStroke(const STROKE_PARAMS &aStroke) override
Represent a set of closed polygons.
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset intersection For aFastMode meaning, see function booleanOp.
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
int OutlineCount() const
Return the number of vertices in a given outline/hole.
Simple container to manage line stroke parameters.
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.
This file is part of the common library.
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.
@ RECT_CHAMFER_BOTTOM_RIGHT
@ RECT_CHAMFER_BOTTOM_LEFT
#define APERTURE_DLG_TYPE
static wxString formatCoord(EDA_UNITS aUnits, VECTOR2I aCoord)
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.
static constexpr EDA_ANGLE & ANGLE_45
static constexpr EDA_ANGLE & ANGLE_90
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
wxString MessageTextFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.
std::string FormatAngle(const EDA_ANGLE &aAngle)
Converts aAngle from board units to a string appropriate for writing to file.
wxFont GetInfoFont(wxWindow *aWindow)
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ CUST_PAD_SHAPE_IN_ZONE_OUTLINE
@ CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
@ NPTH
like PAD_PTH, but not plated
@ 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)
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 ...
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
@ NONE
no special fabrication property
@ TESTPOINT
a test point pad
@ CASTELLATED
a pad with a castellated through hole
@ BGA
Smd pad, used in BGA footprints.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
constexpr int mmToIU(double mm) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
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
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper