115 if( event.IsChecked() )
117 m_addTeardrops->SetLabel(
_(
"Set teardrops to default values for shape" ) );
122 m_addTeardrops->SetLabel(
_(
"Add teardrops with default values for shape" ) );
157 m_teardropHDPercent( aParent, m_stHDRatio, m_tcHDRatio, m_stHDRatioUnits ),
158 m_teardropLenPercent( aParent, m_stLenPercentLabel, m_tcLenPercent, nullptr ),
159 m_teardropMaxLen( aParent, m_stMaxLen, m_tcTdMaxLen, m_stMaxLenUnits ),
160 m_teardropHeightPercent( aParent, m_stHeightPercentLabel, m_tcHeightPercent, nullptr ),
161 m_teardropMaxHeight( aParent, m_stMaxHeight, m_tcMaxHeight, m_stMaxHeightUnits )
177 { wxID_CANCEL,
_(
"Close" ) } } );
227 wxArrayString netclassNames;
230 netclassNames.push_back( settings->GetDefaultNetclass()->GetName() );
232 for(
const auto& [
name, netclass] : settings->GetNetclasses() )
233 netclassNames.push_back(
name );
361 targetParams = &
static_cast<PAD*
>( aItem )->GetTeardropParams();
450 if( !
static_cast<PAD*
>( aItem )->GetTeardropParams().m_Enabled )
455 if( !
static_cast<PCB_VIA*
>( aItem )->GetTeardropParams().m_Enabled )
482 if(
m_vias->GetValue() || remove_all )
493 for(
PAD*
pad : footprint->Pads() )
501 if(
m_pthPads->GetValue() &&
pad->GetAttribute() == PAD_ATTRIB::PTH )
505 else if(
m_smdPads->GetValue() && (
pad->GetAttribute() == PAD_ATTRIB::SMD
506 ||
pad->GetAttribute() == PAD_ATTRIB::CONN ) )
548 commit.
Push(
_(
"Edit Teardrops" ) );
564 filler.
Fill( m_board->Zones() );
576 for(
ZONE* zone: m_createdTdList )
578 int half_min_width = zone->GetMinThickness() / 2;
588 zone->SetFilledPolysList( zone->GetFirstLayer(), filledPolys );
constexpr EDA_IU_SCALE pcbIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr) override
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.
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
TEARDROP_PARAMETERS & GetTeardropParams()
Container for design settings for a BOARD object.
TEARDROP_PARAMETERS_LIST * GetTeadropParamsList()
std::shared_ptr< NET_SETTINGS > m_NetSettings
const wxString & GetCurrentNetClassName() const
TEARDROP_PARAMETERS_LIST m_TeardropParamsList
The parameters of teardrops for the different teardrop targets (via/pad, track end) 3 set of paramete...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
PCB_GROUP * GetParentGroup() const
Information pertinent to a Pcbnew printed circuit board.
const NETINFO_LIST & GetNetInfo() const
const std::set< int > & GetHighLightNetCodes() const
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
void SetLegacyTeardrops(bool aFlag)
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Class DIALOG_GLOBAL_EDIT_TEARDROPS_BASE.
wxCheckBox * m_netFilterOpt
wxCheckBox * m_cbPreferZoneConnection
wxStaticBitmap * m_bitmapTeardrop
wxRadioButton * m_specifiedValues
wxRadioButton * m_removeTeardrops
wxCheckBox * m_roundPadsFilter
wxCheckBox * m_layerFilterOpt
wxCheckBox * m_curvedEdges
wxStaticText * m_minTrackWidthHint
wxCheckBox * m_selectedItemsFilter
NET_SELECTOR * m_netFilter
wxCheckBox * m_existingFilter
PCB_LAYER_BOX_SELECTOR * m_layerFilter
wxRadioButton * m_removeAllTeardrops
wxChoice * m_netclassFilter
wxRadioButton * m_addTeardrops
wxCheckBox * m_trackToTrack
wxCheckBox * m_cbTeardropsUseNextTrack
wxCheckBox * m_netclassFilterOpt
UNIT_BINDER m_teardropLenPercent
void processItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem)
void onCurvedEdgesUpdateUi(wxUpdateUIEvent &event) override
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...
KICAD_T Type() const
Returns the type of object.
int GetLayerSelection() const
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
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.
const wxString GetVariableSubstitutionName() const
Gets the name of this (maybe aggregate) netclass in a format for label variable substitutions.
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
void SetBoard(BOARD *aBoard)
void SetSelectedNetcode(int aNetcode)
void SetSelectedNet(const wxString &aNetname)
wxString GetSelectedNetname()
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
virtual PCB_LAYER_ID GetActiveLayer() const
The main frame for Pcbnew.
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString)
A set of BOARD_ITEMs (i.e., without duplicates).
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void SetNotAllowedLayerSet(LSET aMask)
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...
int m_CurveSegCount
True if the teardrop should be curved.
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.
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 double GetDoubleValue()
Return the current value in Internal Units.
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
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.
PCB_LAYER_ID GetFirstLayer() const
static bool g_filterByNet
static wxString g_netclassFilter
static bool g_filterByNetclass
@ ADD_TEARDROPS_WITH_SPEC_VALUES
@ REMOVE_TEARDROP_IN_SCOPE
static bool g_filterSelected
static bool g_trackToTrack
static wxString g_netFilter
static bool g_filterRoundPads
static bool g_filterByLayer
static constexpr EDA_ANGLE FULL_CIRCLE
int GetArcToSegmentCount(int aRadius, int aErrorMax, const EDA_ANGLE &aArcAngle)
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
Class to handle a set of BOARD_ITEMs.
std::vector< FAB_LAYER_COLOR > dummy
constexpr int mmToIU(double mm) const
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_PAD_T
class PAD, a pad in a footprint
#define INDETERMINATE_ACTION