KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_global_edit_teardrops.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <algorithm>
25
26#include <widgets/unit_binder.h>
27#include <pcb_edit_frame.h>
28#include <board.h>
30#include <pcb_track.h>
31#include <pcb_group.h>
32#include <footprint.h>
33#include <teardrop/teardrop.h>
34#include <zone_filler.h>
37#include <tool/tool_manager.h>
40
42{
47};
48
49// Globals to remember control settings during a session
50static bool g_vias = true;
51static bool g_pthPads = true;
52static bool g_smdPads = true;
53static bool g_trackToTrack = false;
55static wxString g_netclassFilter;
56static bool g_filterByNet;
57static wxString g_netFilter;
58static bool g_filterByLayer;
59static int g_layerFilter;
60static bool g_filterRoundPads = false;
61static bool g_filterSelected = false;
63
64
66{
67public:
70
71protected:
72 void onSpecifiedValuesUpdateUi( wxUpdateUIEvent& event ) override
73 {
74 event.Enable( m_specifiedValues->GetValue() );
75 }
76 void onCurvedEdgesUpdateUi( wxUpdateUIEvent& event ) override
77 {
78 event.Enable( m_specifiedValues->GetValue()
79 && m_curvedEdges->GetValue() == wxCHK_CHECKED );
80 }
81 void onFilterUpdateUi( wxUpdateUIEvent& event ) override
82 {
83 event.Enable( !m_trackToTrack->GetValue() );
84 }
85
86 // Track-to-track teardrops always follow the document-wide settings (there are no teardrop
87 // properties on individual track segments as they're too ephemeral). Therefore we disable
88 // Set-to-specified-values when track-to-track is selected.
89 void onTrackToTrack( wxCommandEvent& event ) override
90 {
91 if( event.IsChecked() && m_specifiedValues->GetValue() )
92 {
93 m_specifiedValues->SetValue( false );
94 m_addTeardrops->SetValue( true );
95 }
96 }
97
98 // These just improve usability so that you don't have to click twice to enable a filter.
99 void OnNetclassFilterSelect( wxCommandEvent& event ) override
100 {
101 m_netclassFilterOpt->SetValue( true );
102 }
103 void OnLayerFilterSelect( wxCommandEvent& event ) override
104 {
105 m_layerFilterOpt->SetValue( true );
106 }
107 void OnNetFilterSelect( wxCommandEvent& event )
108 {
109 m_netFilterOpt->SetValue( true );
110 }
111
112 // Remove "add" terminology when updating only existing teardrops.
113 void OnExistingFilterSelect( wxCommandEvent& event ) override
114 {
115 if( event.IsChecked() )
116 {
117 m_addTeardrops->SetLabel( _( "Set teardrops to default values for shape" ) );
118 m_specifiedValues->SetLabel( _( "Set teardrops to specified values:" ) );
119 }
120 else
121 {
122 m_addTeardrops->SetLabel( _( "Add teardrops with default values for shape" ) );
123 m_specifiedValues->SetLabel( _( "Add teardrops with specified values:" ) );
124 }
125 }
126
127 void setSpecifiedParams( TEARDROP_PARAMETERS* targetParams );
128 void visitItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem,bool aSelectAlways );
129 void processItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem );
130
131 bool TransferDataToWindow() override;
132 bool TransferDataFromWindow() override;
133
134
135 void onShowBoardSetup( wxHyperlinkEvent& event ) override
136 {
137 m_parent->ShowBoardSetupDialog( _( "Teardrops" ) );
138 }
139
140 void buildFilterLists();
141
142private:
146
152};
153
154
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 )
162{
163 m_parent = aParent;
165
166 m_bitmapTeardrop->SetBitmap( KiBitmapBundle( BITMAPS::teardrop_sizes ) );
167
168 m_teardropHDPercent.SetUnits( EDA_UNITS::PERCENT );
169 m_teardropLenPercent.SetUnits( EDA_UNITS::PERCENT );
170 m_teardropHeightPercent.SetUnits( EDA_UNITS::PERCENT );
171
172 m_minTrackWidthHint->SetFont( KIUI::GetInfoFont( this ).Italic() );
173
175
176 SetupStandardButtons( { { wxID_OK, _( "Apply and Close" ) },
177 { wxID_CANCEL, _( "Close" ) } } );
178
179 m_netFilter->Connect( FILTERED_ITEM_SELECTED,
181 nullptr, this );
182
184}
185
186
188{
189 g_vias = m_vias->GetValue();
190 g_pthPads = m_pthPads->GetValue();
191 g_smdPads = m_smdPads->GetValue();
192 g_trackToTrack = m_trackToTrack->GetValue();
194 g_netclassFilter = m_netclassFilter->GetStringSelection();
195 g_filterByNet = m_netFilterOpt->GetValue();
197 g_filterByLayer = m_layerFilterOpt->GetValue();
201
202 if( m_removeTeardrops->GetValue() )
204 else if( m_removeAllTeardrops->GetValue() )
206 else if( m_specifiedValues->GetValue() )
208 else
210
211 m_netFilter->Disconnect( FILTERED_ITEM_SELECTED,
213 nullptr, this );
214}
215
216
218{
219 // Populate the net filter list with net names
222
223 if( !m_brd->GetHighLightNetCodes().empty() )
225
226 // Populate the netclass filter list with netclass names
227 wxArrayString netclassNames;
228 std::shared_ptr<NET_SETTINGS>& settings = m_brd->GetDesignSettings().m_NetSettings;
229
230 netclassNames.push_back( settings->GetDefaultNetclass()->GetName() );
231
232 for( const auto& [name, netclass] : settings->GetNetclasses() )
233 netclassNames.push_back( name );
234
235 m_netclassFilter->Set( netclassNames );
237
238 // Populate the layer filter list
244}
245
246
248{
250
255
256 #if 0 // I am not sure this is useful
258 #endif
259
261 m_selection = selTool->GetSelection();
263
264 m_vias->SetValue( g_vias );
265 m_pthPads->SetValue( g_pthPads );
266 m_smdPads->SetValue( g_smdPads );
267 m_trackToTrack->SetValue( g_trackToTrack );
268
269 if( g_filterByNetclass && m_netclassFilter->SetStringSelection( g_netclassFilter ) )
270 m_netclassFilterOpt->SetValue( true );
271 else if( item )
272 m_netclassFilter->SetStringSelection(
274
275 if( g_filterByNet && m_brd->FindNet( g_netFilter ) != nullptr )
276 {
278 m_netFilterOpt->SetValue( true );
279 }
280 else if( item )
281 {
283 }
284
286 {
287 m_layerFilterOpt->SetValue( true );
288 }
289 else if( item )
290 {
291 if( item->Type() == PCB_ZONE_T ) // a zone can be on more than one layer
292 m_layerFilter->SetLayerSelection( static_cast<ZONE*>(item)->GetFirstLayer() );
293 else
295 }
296
299
301 m_removeTeardrops->SetValue( true );
302 else if( g_action == REMOVE_ALL_TEARDROPS )
303 m_removeAllTeardrops->SetValue( true );
304 else if( g_action == ADD_TEARDROPS_DEFAULT )
305 m_addTeardrops->SetValue( true );
306 else //ADD_TEARDROPS_WITH_SPEC_VALUES
307 m_specifiedValues->SetValue( true );
308
309 m_cbPreferZoneConnection->Set3StateValue( wxCHK_UNDETERMINED );
310 m_cbTeardropsUseNextTrack->Set3StateValue( wxCHK_UNDETERMINED );
316 m_curvedEdges->Set3StateValue( wxCHK_UNDETERMINED );
317
318 return true;
319}
320
321
323{
324 if( m_cbPreferZoneConnection->Get3StateValue() != wxCHK_UNDETERMINED )
325 targetParams->m_TdOnPadsInZones = !m_cbPreferZoneConnection->GetValue();
326
327 if( m_cbTeardropsUseNextTrack->Get3StateValue() != wxCHK_UNDETERMINED )
328 targetParams->m_AllowUseTwoTracks = m_cbTeardropsUseNextTrack->GetValue();
329
332
334 targetParams->m_BestLengthRatio = m_teardropLenPercent.GetDoubleValue() / 100.0;
335
337 targetParams->m_TdMaxLen = m_teardropMaxLen.GetIntValue();
338
341
344
345 if( m_curvedEdges->Get3StateValue() != wxCHK_UNDETERMINED )
346 {
347 if( m_curvedEdges->GetValue() )
348 targetParams->m_CurveSegCount = 1;
349 else
350 targetParams->m_CurveSegCount = 0;
351 }
352}
353
354
356{
358 TEARDROP_PARAMETERS* targetParams = nullptr;
359
360 if( aItem->Type() == PCB_PAD_T )
361 targetParams = &static_cast<PAD*>( aItem )->GetTeardropParams();
362 else if( aItem->Type() == PCB_VIA_T )
363 targetParams = &static_cast<PCB_VIA*>( aItem )->GetTeardropParams();
364 else
365 return;
366
367 aCommit->Stage( aItem, CHT_MODIFY );
368
369 if( m_removeTeardrops->GetValue() || m_removeAllTeardrops->GetValue() )
370 {
371 targetParams->m_Enabled = false;
372 }
373 else if( m_addTeardrops->GetValue() )
374 {
375 // NOTE: This ignores possible padstack shape variation.
377 *targetParams = *brdSettings.GetTeadropParamsList()->GetParameters( TARGET_ROUND );
378 else
379 *targetParams = *brdSettings.GetTeadropParamsList()->GetParameters( TARGET_RECT );
380
381 targetParams->m_Enabled = true;
382 }
383 else if( m_specifiedValues->GetValue() )
384 {
385 setSpecifiedParams( targetParams );
386
387 if( !m_existingFilter->GetValue() )
388 targetParams->m_Enabled = true;
389 }
390}
391
392
395 bool aSelectAlways )
396{
397 if( m_selectedItemsFilter->GetValue() )
398 {
399 if( !aItem->IsSelected() )
400 {
401 PCB_GROUP* group = aItem->GetParentGroup();
402
403 while( group && !group->IsSelected() )
404 group = group->GetParentGroup();
405
406 if( !group )
407 return;
408 }
409 }
410
411 if( aSelectAlways )
412 {
413 processItem( aCommit, aItem );
414 return;
415 }
416
417
418 if( m_netFilterOpt->GetValue() && m_netFilter->GetSelectedNetcode() >= 0 )
419 {
420 if( aItem->GetNetCode() != m_netFilter->GetSelectedNetcode() )
421 return;
422 }
423
424 if( m_netclassFilterOpt->GetValue() && !m_netclassFilter->GetStringSelection().IsEmpty() )
425 {
426 wxString filterNetclass = m_netclassFilter->GetStringSelection();
427 NETCLASS* netclass = aItem->GetEffectiveNetClass();
428
429 if( !netclass->ContainsNetclassWithName( filterNetclass ) )
430 return;
431 }
432
434 {
435 if( aItem->GetLayer() != m_layerFilter->GetLayerSelection() )
436 return;
437 }
438
439 if( m_roundPadsFilter->GetValue() )
440 {
441 // TODO(JE) padstacks -- teardrops needs to support per-layer pad handling
443 return;
444 }
445
446 if( m_existingFilter->GetValue() )
447 {
448 if( aItem->Type() == PCB_PAD_T )
449 {
450 if( !static_cast<PAD*>( aItem )->GetTeardropParams().m_Enabled )
451 return;
452 }
453 else if( aItem->Type() == PCB_VIA_T )
454 {
455 if( !static_cast<PCB_VIA*>( aItem )->GetTeardropParams().m_Enabled )
456 return;
457 }
458 }
459
460 processItem( aCommit, aItem );
461}
462
463
465{
466 m_brd->SetLegacyTeardrops( false );
467
468 BOARD_COMMIT commit( m_parent );
469 wxBusyCursor dummy;
470
471 // Save some dialog options
473
474 bds.m_TeardropParamsList.m_TargetVias = m_vias->GetValue();
479
480 bool remove_all = m_removeAllTeardrops->GetValue();
481
482 if( m_vias->GetValue() || remove_all )
483 {
484 for( PCB_TRACK* track : m_brd->Tracks() )
485 {
486 if ( track->Type() == PCB_VIA_T )
487 visitItem( &commit, track, remove_all );
488 }
489 }
490
491 for( FOOTPRINT* footprint : m_brd->Footprints() )
492 {
493 for( PAD* pad : footprint->Pads() )
494 {
495 if( remove_all )
496 {
497 visitItem( &commit, pad, true );
498 continue;
499 }
500
501 if( m_pthPads->GetValue() && pad->GetAttribute() == PAD_ATTRIB::PTH )
502 {
503 visitItem( &commit, pad, false );
504 }
505 else if( m_smdPads->GetValue() && ( pad->GetAttribute() == PAD_ATTRIB::SMD
506 || pad->GetAttribute() == PAD_ATTRIB::CONN ) )
507 {
508 visitItem( &commit, pad, false );
509 }
510 }
511 }
512
513 if( m_trackToTrack->GetValue() )
514 {
516 TEARDROP_PARAMETERS* targetParams = paramsList->GetParameters( TARGET_TRACK );
517 TEARDROP_MANAGER teardropManager( m_brd, m_parent->GetToolManager() );
518
519 teardropManager.DeleteTrackToTrackTeardrops( commit );
520
521 if( m_removeTeardrops->GetValue() || m_removeAllTeardrops->GetValue() )
522 {
523 targetParams->m_Enabled = false; // JEY TODO: how does this get undone/redone?
524 }
525 else if( m_addTeardrops->GetValue() )
526 {
527 targetParams->m_Enabled = true; // JEY TODO: how does this get undone/redone?
528 teardropManager.AddTeardropsOnTracks( commit, nullptr, true );
529 }
530 }
531
532 // If there are no filters then a force-full-update is equivalent, and will be faster.
533 if( !m_netFilterOpt->GetValue()
534 && !m_netclassFilterOpt->GetValue()
535 && !m_layerFilterOpt->GetValue()
536 && !m_roundPadsFilter->GetValue()
537 && !m_existingFilter->GetValue()
538 && !m_selectedItemsFilter->GetValue() )
539 {
540 commit.Push( _( "Edit Teardrops" ), SKIP_TEARDROPS );
541
543 teardropMgr.UpdateTeardrops( commit, nullptr, nullptr, true /* forceFullUpdate */ );
544 commit.Push( _( "Edit Teardrops" ), SKIP_TEARDROPS | APPEND_UNDO );
545 }
546 else
547 {
548 commit.Push( _( "Edit Teardrops" ) );
549 }
550
551 // Showing the unfilled, fully cross-hatched teardrops seems to be working fairly well, and
552 // accurate fills can then be manually generated by doing a zone fill.
553 //
554 // But here's the old code which allowed for either "draft" fills or an automatic full zone
555 // fill in case we decide the current situation isn't good enough:
556#if 0
557 if( aFillAfter )
558 {
559 ZONE_FILLER filler( m_board, aCommit );
560
561 if( m_reporter )
562 filler.SetProgressReporter( m_reporter );
563
564 filler.Fill( m_board->Zones() );
565
566 if( aCommit )
567 aCommit->Push( _( "Edit Teardrops" ), APPEND_UNDO );
568 }
569 else
570 {
571 // Fill raw teardrop shapes. This is a rough calculation, just to show a filled
572 // shape on screen without the (potentially large) performance hit of a zone refill
573 int epsilon = pcbIUScale.mmToIU( 0.001 );
574 int allowed_error = pcbIUScale.mmToIU( 0.005 );
575
576 for( ZONE* zone: m_createdTdList )
577 {
578 int half_min_width = zone->GetMinThickness() / 2;
579 int numSegs = GetArcToSegmentCount( half_min_width, allowed_error, FULL_CIRCLE );
580 SHAPE_POLY_SET filledPolys = *zone->Outline();
581
582 filledPolys.Deflate( half_min_width - epsilon, numSegs );
583
584 // Re-inflate after pruning of areas that don't meet minimum-width criteria
585 if( half_min_width - epsilon > epsilon )
586 filledPolys.Inflate( half_min_width - epsilon, numSegs );
587
588 zone->SetFilledPolysList( zone->GetFirstLayer(), filledPolys );
589 }
590 }
591#endif
592
593 m_parent->Refresh();
594 return true;
595}
596
597
599{
600 PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
601 DIALOG_GLOBAL_EDIT_TEARDROPS dlg( editFrame );
602
603 dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR
604 return 0;
605}
606
const char * name
Definition: DXF_plotter.cpp:57
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
#define SKIP_TEARDROPS
Definition: board_commit.h:44
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.
Definition: board_item.h:237
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:90
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:290
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:871
const std::set< int > & GetHighLightNetCodes() const
Definition: board.h:532
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1918
const FOOTPRINTS & Footprints() const
Definition: board.h:331
const TRACKS & Tracks() const
Definition: board.h:329
void SetLegacyTeardrops(bool aFlag)
Definition: board.h:1262
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:892
Class DIALOG_GLOBAL_EDIT_TEARDROPS_BASE.
void processItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem)
void onCurvedEdgesUpdateUi(wxUpdateUIEvent &event) override
void visitItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem, bool aSelectAlways)
void OnNetFilterSelect(wxCommandEvent &event)
void setSpecifiedParams(TEARDROP_PARAMETERS *targetParams)
void OnNetclassFilterSelect(wxCommandEvent &event) override
DIALOG_GLOBAL_EDIT_TEARDROPS(PCB_EDIT_FRAME *aParent)
void onTrackToTrack(wxCommandEvent &event) override
void onSpecifiedValuesUpdateUi(wxUpdateUIEvent &event) override
void OnExistingFilterSelect(wxCommandEvent &event) override
void onShowBoardSetup(wxHyperlinkEvent &event) override
void onFilterUpdateUi(wxUpdateUIEvent &event) override
void OnLayerFilterSelect(wxCommandEvent &event) override
void SetupStandardButtons(std::map< int, wxString > aLabels={})
int ShowQuasiModal()
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.
Definition: eda_item.h:101
bool IsSelected() const
Definition: eda_item.h:110
int EditTeardrops(const TOOL_EVENT &aEvent)
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
Definition: lset.cpp:687
A collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:44
bool ContainsNetclassWithName(const wxString &netclass) const
Determines if the given netclass name is a constituent of this (maybe aggregate) netclass.
Definition: netclass.cpp:141
const wxString GetVariableSubstitutionName() const
Gets the name of this (maybe aggregate) netclass in a format for label variable substitutions.
Definition: netclass.cpp:179
NETCLASS * GetNetClass()
Definition: netinfo.h:101
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
void SetBoard(BOARD *aBoard)
int GetSelectedNetcode()
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
Definition: padstack.h:144
Definition: pad.h:54
virtual PCB_LAYER_ID GetActiveLayer() const
BOARD * GetBoard() const
The main frame for Pcbnew.
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString)
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:52
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void SetNotAllowedLayerSet(LSET aMask)
The selection tool: currently supports:
PCB_SELECTION & GetSelection()
EDA_ITEM * Front() const
Definition: selection.h:172
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) ...
Definition: teardrop.h:97
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.
Definition: teardrop.cpp:151
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.
Definition: teardrop.cpp:344
void DeleteTrackToTrackTeardrops(BOARD_COMMIT &aCommit)
Definition: teardrop.cpp:286
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.
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
Generic, UI-independent tool event.
Definition: tool_event.h:167
int GetIntValue()
Definition: unit_binder.h:129
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.
Definition: zone.h:73
PCB_LAYER_ID GetFirstLayer() const
Definition: zone.cpp:270
@ CHT_MODIFY
Definition: commit.h:44
static bool g_filterByNet
static wxString g_netclassFilter
static bool g_smdPads
static bool g_filterByNetclass
@ ADD_TEARDROPS_WITH_SPEC_VALUES
static bool g_vias
static int g_layerFilter
static bool g_filterSelected
static bool g_trackToTrack
static wxString g_netFilter
static bool g_pthPads
static int g_action
static bool g_filterRoundPads
static bool g_filterByLayer
#define _(s)
static constexpr EDA_ANGLE FULL_CIRCLE
Definition: eda_angle.h:399
int GetArcToSegmentCount(int aRadius, int aErrorMax, const EDA_ANGLE &aArcAngle)
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:154
Class to handle a set of BOARD_ITEMs.
const double epsilon
#define APPEND_UNDO
Definition: sch_commit.h:42
std::vector< FAB_LAYER_COLOR > dummy
constexpr int mmToIU(double mm) const
Definition: base_units.h:88
@ TARGET_ROUND
@ TARGET_RECT
@ TARGET_TRACK
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:107
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87
#define INDETERMINATE_ACTION
Definition: ui_common.h:47