106 if( event.IsChecked() )
108 m_addTeardrops->SetLabel(
_(
"Set teardrops to default values for shape" ) );
113 m_addTeardrops->SetLabel(
_(
"Add teardrops with default values for shape" ) );
148 m_teardropHDPercent( aParent, m_stHDRatio, m_tcHDRatio, m_stHDRatioUnits ),
149 m_teardropLenPercent( aParent, m_stLenPercentLabel, m_tcLenPercent, m_stLenPercentUnits ),
150 m_teardropMaxLen( aParent, m_stMaxLen, m_tcTdMaxLen, m_stMaxLenUnits ),
151 m_teardropHeightPercent( aParent, m_stHeightPercentLabel, m_tcHeightPercent, m_stHeightPercentUnits ),
152 m_teardropMaxHeight( aParent, m_stMaxHeight, m_tcMaxHeight, m_stMaxHeightUnits )
215 wxArrayString netclassNames;
218 netclassNames.push_back( settings->m_DefaultNetClass->GetName() );
220 for(
const auto& [
name, netclass ] : settings->m_NetClasses )
221 netclassNames.push_back(
name );
335 targetParams = &
static_cast<PAD*
>( aItem )->GetTeardropParams();
410 if( !
static_cast<PAD*
>( aItem )->GetTeardropParams().m_Enabled )
415 if( !
static_cast<PCB_VIA*
>( aItem )->GetTeardropParams().m_Enabled )
442 for(
PAD*
pad : footprint->Pads() )
444 if(
m_pthPads->GetValue() &&
pad->GetAttribute() == PAD_ATTRIB::PTH )
448 else if(
m_smdPads->GetValue() && (
pad->GetAttribute() == PAD_ATTRIB::SMD
449 ||
pad->GetAttribute() == PAD_ATTRIB::CONN ) )
491 commit.
Push(
_(
"Edit Teardrops" ) );
507 filler.
Fill( m_board->Zones() );
519 for(
ZONE* zone: m_createdTdList )
521 int half_min_width = zone->GetMinThickness() / 2;
531 zone->SetFilledPolysList( zone->GetFirstLayer(), filledPolys );
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...
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr) override
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
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
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.
FOOTPRINTS & Footprints()
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
wxChoice * m_netclassFilter
wxSpinCtrl * m_curvePointsCtrl
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
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
void visitItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem)
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.
const wxString GetName() const
void SetBoard(BOARD *aBoard)
void SetSelectedNetcode(int aNetcode)
void SetNetInfo(NETINFO_LIST *aNetInfoList)
void SetSelectedNet(const wxString &aNetname)
wxString GetSelectedNetname()
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) ...
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.
static bool IsRound(BOARD_ITEM *aItem)
void DeleteTrackToTrackTeardrops(BOARD_COMMIT &aCommit)
TEARDROP_PARAMETERS_LIST is a helper class to handle the list of TEARDROP_PARAMETERS needed to build ...
TEARDROP_PARAMETERS * GetParameters(TARGET_TD aTdType)
TEARDROP_PARAMETARS is a helper class to handle parameters needed to build teardrops for a board thes...
int m_CurveSegCount
number of segments to build the curved sides of a teardrop area must be > 2.
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.
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(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
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)
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