91 if( event.IsChecked() )
93 m_addTeardrops->SetLabel(
_(
"Set teardrops to default values for shape" ) );
98 m_addTeardrops->SetLabel(
_(
"Add teardrops with default values for shape" ) );
113 m_parent->ShowBoardSetupDialog(
_(
"Teardrops" ) );
153 { wxID_CANCEL,
_(
"Close" ) } } );
179 if( !
m_brd->GetHighLightNetCodes().empty() )
183 wxArrayString netclassNames;
184 std::shared_ptr<NET_SETTINGS>& settings =
m_brd->GetDesignSettings().m_NetSettings;
186 netclassNames.push_back( settings->GetDefaultNetclass()->GetName() );
188 for(
const auto& [
name, netclass] : settings->GetNetclasses() )
189 netclassNames.push_back(
name );
262 targetParams = &
static_cast<PAD*
>( aItem )->GetTeardropParams();
264 targetParams = &
static_cast<PCB_VIA*
>( aItem )->GetTeardropParams();
303 while(
group && !
group->AsEdaItem()->IsSelected() )
350 if( !
static_cast<PAD*
>( aItem )->GetTeardropParams().m_Enabled )
355 if( !
static_cast<PCB_VIA*
>( aItem )->GetTeardropParams().m_Enabled )
366 m_brd->SetLegacyTeardrops(
false );
382 if(
m_vias->GetValue() || remove_all )
393 for(
PAD*
pad : footprint->Pads() )
449 commit.
Push(
_(
"Edit Teardrops" ) );
465 filler.
Fill( m_board->Zones() );
475 int allowed_error =
pcbIUScale.mmToIU( 0.005 );
477 for(
ZONE* zone: m_createdTdList )
479 int half_min_width = zone->GetMinThickness() / 2;
489 zone->SetFilledPolysList( zone->GetFirstLayer(), filledPolys );
constexpr EDA_IU_SCALE pcbIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE) override
Add a change of the item aItem of type aChangeType to the change list.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
Container for design settings for a BOARD object.
TEARDROP_PARAMETERS_LIST * GetTeadropParamsList()
TEARDROP_PARAMETERS_LIST m_TeardropParamsList
The parameters of teardrops for the different teardrop targets (via/pad, track end).
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Information pertinent to a Pcbnew printed circuit board.
wxStaticText * m_stHDRatioUnits
wxCheckBox * m_netFilterOpt
wxStaticText * m_stLenPercentLabel
wxCheckBox * m_cbPreferZoneConnection
wxStaticText * m_stHeightPercentLabel
wxStaticBitmap * m_bitmapTeardrop
wxRadioButton * m_specifiedValues
wxRadioButton * m_removeTeardrops
DIALOG_GLOBAL_EDIT_TEARDROPS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Set Teardrops"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxCheckBox * m_roundPadsFilter
wxCheckBox * m_layerFilterOpt
wxStaticText * m_stMaxHeightUnits
wxCheckBox * m_curvedEdges
wxStaticText * m_minTrackWidthHint
wxStaticText * m_stMaxLenUnits
wxCheckBox * m_selectedItemsFilter
NET_SELECTOR * m_netFilter
wxCheckBox * m_existingFilter
wxTextCtrl * m_tcTdMaxLen
PCB_LAYER_BOX_SELECTOR * m_layerFilter
wxTextCtrl * m_tcHeightPercent
wxTextCtrl * m_tcLenPercent
wxRadioButton * m_removeAllTeardrops
wxChoice * m_netclassFilter
wxRadioButton * m_addTeardrops
wxCheckBox * m_trackToTrack
wxStaticText * m_stMaxHeight
wxTextCtrl * m_tcMaxHeight
wxStaticText * m_stHDRatio
wxCheckBox * m_cbTeardropsUseNextTrack
wxStaticText * m_stMaxLen
wxCheckBox * m_netclassFilterOpt
UNIT_BINDER m_teardropLenPercent
void processItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem)
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
void visitItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem, bool aSelectAlways)
UNIT_BINDER m_teardropHeightPercent
void OnNetFilterSelect(wxCommandEvent &event)
PCB_SELECTION m_selection
void setSpecifiedParams(TEARDROP_PARAMETERS *targetParams)
void OnNetclassFilterSelect(wxCommandEvent &event) override
DIALOG_GLOBAL_EDIT_TEARDROPS(PCB_EDIT_FRAME *aParent)
~DIALOG_GLOBAL_EDIT_TEARDROPS() override
void onTrackToTrack(wxCommandEvent &event) override
PCB_EDIT_FRAME * m_parent
void onSpecifiedValuesUpdateUi(wxUpdateUIEvent &event) override
UNIT_BINDER m_teardropHDPercent
void OnExistingFilterSelect(wxCommandEvent &event) override
void onShowBoardSetup(wxHyperlinkEvent &event) override
void onFilterUpdateUi(wxUpdateUIEvent &event) override
UNIT_BINDER m_teardropMaxLen
UNIT_BINDER m_teardropMaxHeight
void OnLayerFilterSelect(wxCommandEvent &event) override
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...
A set of EDA_ITEMs (i.e., without duplicates).
virtual EDA_GROUP * GetParentGroup() const
KICAD_T Type() const
Returns the type of object.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
A collection of nets and the parameters used to route or test these nets.
bool ContainsNetclassWithName(const wxString &netclass) const
Determines if the given netclass name is a constituent of this (maybe aggregate) netclass.
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
The main frame for Pcbnew.
Represent a set of closed polygons.
void Inflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError, bool aSimplify=false)
Perform outline inflation/deflation.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
void Deflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError)
TEARDROP_MANAGER manage and build teardrop areas A teardrop area is a polygonal area (a copper ZONE) ...
static bool IsRound(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer)
void UpdateTeardrops(BOARD_COMMIT &aCommit, const std::vector< BOARD_ITEM * > *dirtyPadsAndVias, const std::set< PCB_TRACK * > *dirtyTracks, bool aForceFullUpdate=false)
Update teardrops on a list of items.
void AddTeardropsOnTracks(BOARD_COMMIT &aCommit, const std::set< PCB_TRACK * > *aTracks, bool aForceFullUpdate=false)
Add teardrop on tracks of different sizes connected by their end.
void DeleteTrackToTrackTeardrops(BOARD_COMMIT &aCommit)
TEARDROP_PARAMETERS_LIST is a helper class to handle the list of TEARDROP_PARAMETERS needed to build ...
bool m_UseRoundShapesOnly
True to create teardrops for round shapes only.
bool m_TargetVias
True to create teardrops for vias.
bool m_TargetPTHPads
True to create teardrops for pads with holes.
bool m_TargetTrack2Track
True to create teardrops at the end of a track connected to the end of another track having a differe...
TEARDROP_PARAMETERS * GetParameters(TARGET_TD aTdType)
bool m_TargetSMDPads
True to create teardrops for pads SMD, edge connectors,.
TEARDROP_PARAMETARS is a helper class to handle parameters needed to build teardrops for a board thes...
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.
void SetProgressReporter(PROGRESS_REPORTER *aReporter)
bool Fill(const std::vector< ZONE * > &aZones, bool aCheck=false, wxWindow *aParent=nullptr)
Fills the given list of zones.
Handle a list of polygons defining a copper zone.
static wxString g_netclassFilter
static wxString g_netFilter
static constexpr EDA_ANGLE FULL_CIRCLE
static wxString g_netFilter
int GetArcToSegmentCount(int aRadius, int aErrorMax, const EDA_ANGLE &aArcAngle)
KICOMMON_API wxFont GetStatusFont(wxWindow *aWindow)
@ 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...
Class to handle a set of BOARD_ITEMs.
std::vector< FAB_LAYER_COLOR > dummy
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_PAD_T
class PAD, a pad in a footprint
#define INDETERMINATE_ACTION