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" ) );
133 m_teardropHDPercent( aParent, m_stHDRatio, m_tcHDRatio, m_stHDRatioUnits ),
134 m_teardropLenPercent( aParent, m_stLenPercentLabel, m_tcLenPercent, nullptr ),
135 m_teardropMaxLen( aParent, m_stMaxLen, m_tcTdMaxLen, m_stMaxLenUnits ),
136 m_teardropHeightPercent( aParent, m_stHeightPercentLabel, m_tcHeightPercent, nullptr ),
137 m_teardropMaxHeight( aParent, m_stMaxHeight, m_tcMaxHeight, m_stMaxHeightUnits )
153 { wxID_CANCEL,
_(
"Close" ) } } );
183 wxArrayString netclassNames;
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();
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 )
382 if(
m_vias->GetValue() || remove_all )
393 for(
PAD*
pad : footprint->Pads() )
401 if(
m_pthPads->GetValue() &&
pad->GetAttribute() == PAD_ATTRIB::PTH )
405 else if(
m_smdPads->GetValue() && (
pad->GetAttribute() == PAD_ATTRIB::SMD
406 ||
pad->GetAttribute() == PAD_ATTRIB::CONN ) )
448 commit.
Push(
_(
"Edit Teardrops" ) );
464 filler.
Fill( m_board->Zones() );
476 for(
ZONE* zone: m_createdTdList )
478 int half_min_width = zone->GetMinThickness() / 2;
488 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.
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).
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Information pertinent to a Pcbnew printed circuit board.
const NETINFO_LIST & GetNetInfo() const
const std::set< int > & GetHighLightNetCodes() const
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)
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.
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.
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
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)
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void SetNotAllowedLayerSet(const 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...
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 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.
static wxString g_netclassFilter
static wxString g_netFilter
static constexpr EDA_ANGLE FULL_CIRCLE
int GetArcToSegmentCount(int aRadius, int aErrorMax, const EDA_ANGLE &aArcAngle)
KICOMMON_API wxFont GetStatusFont(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_PAD_T
class PAD, a pad in a footprint
#define INDETERMINATE_ACTION