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 The 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 onFilterUpdateUi( wxUpdateUIEvent& event ) override
77 {
78 event.Enable( !m_trackToTrack->GetValue() );
79 }
80
81 // Track-to-track teardrops always follow the document-wide settings (there are no teardrop
82 // properties on individual track segments as they're too ephemeral). Therefore we disable
83 // Set-to-specified-values when track-to-track is selected.
84 void onTrackToTrack( wxCommandEvent& event ) override
85 {
86 if( event.IsChecked() && m_specifiedValues->GetValue() )
87 {
88 m_specifiedValues->SetValue( false );
89 m_addTeardrops->SetValue( true );
90 }
91 }
92
93 // These just improve usability so that you don't have to click twice to enable a filter.
94 void OnNetclassFilterSelect( wxCommandEvent& event ) override
95 {
96 m_netclassFilterOpt->SetValue( true );
97 }
98 void OnLayerFilterSelect( wxCommandEvent& event ) override
99 {
100 m_layerFilterOpt->SetValue( true );
101 }
102 void OnNetFilterSelect( wxCommandEvent& event )
103 {
104 m_netFilterOpt->SetValue( true );
105 }
106
107 // Remove "add" terminology when updating only existing teardrops.
108 void OnExistingFilterSelect( wxCommandEvent& event ) override
109 {
110 if( event.IsChecked() )
111 {
112 m_addTeardrops->SetLabel( _( "Set teardrops to default values for shape" ) );
113 m_specifiedValues->SetLabel( _( "Set teardrops to specified values:" ) );
114 }
115 else
116 {
117 m_addTeardrops->SetLabel( _( "Add teardrops with default values for shape" ) );
118 m_specifiedValues->SetLabel( _( "Add teardrops with specified values:" ) );
119 }
120 }
121
122 void setSpecifiedParams( TEARDROP_PARAMETERS* targetParams );
123 void visitItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem,bool aSelectAlways );
124 void processItem( BOARD_COMMIT* aCommit, BOARD_CONNECTED_ITEM* aItem );
125
126 bool TransferDataToWindow() override;
127 bool TransferDataFromWindow() override;
128
129
130 void onShowBoardSetup( wxHyperlinkEvent& event ) override
131 {
132 m_parent->ShowBoardSetupDialog( _( "Teardrops" ) );
133 }
134
135 void buildFilterLists();
136
137private:
141
147};
148
149
152 m_teardropHDPercent( aParent, m_stHDRatio, m_tcHDRatio, m_stHDRatioUnits ),
153 m_teardropLenPercent( aParent, m_stLenPercentLabel, m_tcLenPercent, nullptr ),
154 m_teardropMaxLen( aParent, m_stMaxLen, m_tcTdMaxLen, m_stMaxLenUnits ),
155 m_teardropHeightPercent( aParent, m_stHeightPercentLabel, m_tcHeightPercent, nullptr ),
156 m_teardropMaxHeight( aParent, m_stMaxHeight, m_tcMaxHeight, m_stMaxHeightUnits )
157{
158 m_parent = aParent;
160
161 m_bitmapTeardrop->SetBitmap( KiBitmapBundle( BITMAPS::teardrop_sizes ) );
162
163 m_teardropHDPercent.SetUnits( EDA_UNITS::PERCENT );
164 m_teardropLenPercent.SetUnits( EDA_UNITS::PERCENT );
165 m_teardropHeightPercent.SetUnits( EDA_UNITS::PERCENT );
166
167 m_minTrackWidthHint->SetFont( KIUI::GetInfoFont( this ).Italic() );
168
170
171 SetupStandardButtons( { { wxID_OK, _( "Apply and Close" ) },
172 { wxID_CANCEL, _( "Close" ) } } );
173
174 m_netFilter->Connect( FILTERED_ITEM_SELECTED,
176 nullptr, this );
177
179}
180
181
183{
184 g_vias = m_vias->GetValue();
185 g_pthPads = m_pthPads->GetValue();
186 g_smdPads = m_smdPads->GetValue();
187 g_trackToTrack = m_trackToTrack->GetValue();
189 g_netclassFilter = m_netclassFilter->GetStringSelection();
190 g_filterByNet = m_netFilterOpt->GetValue();
192 g_filterByLayer = m_layerFilterOpt->GetValue();
196
197 if( m_removeTeardrops->GetValue() )
199 else if( m_removeAllTeardrops->GetValue() )
201 else if( m_specifiedValues->GetValue() )
203 else
205
206 m_netFilter->Disconnect( FILTERED_ITEM_SELECTED,
208 nullptr, this );
209}
210
211
213{
214 // Populate the net filter list with net names
217
218 if( !m_brd->GetHighLightNetCodes().empty() )
220
221 // Populate the netclass filter list with netclass names
222 wxArrayString netclassNames;
223 std::shared_ptr<NET_SETTINGS>& settings = m_brd->GetDesignSettings().m_NetSettings;
224
225 netclassNames.push_back( settings->GetDefaultNetclass()->GetName() );
226
227 for( const auto& [name, netclass] : settings->GetNetclasses() )
228 netclassNames.push_back( name );
229
230 m_netclassFilter->Set( netclassNames );
232
233 // Populate the layer filter list
239}
240
241
243{
245
250
251 #if 0 // I am not sure this is useful
253 #endif
254
256 m_selection = selTool->GetSelection();
258
259 m_vias->SetValue( g_vias );
260 m_pthPads->SetValue( g_pthPads );
261 m_smdPads->SetValue( g_smdPads );
262 m_trackToTrack->SetValue( g_trackToTrack );
263
264 if( g_filterByNetclass && m_netclassFilter->SetStringSelection( g_netclassFilter ) )
265 m_netclassFilterOpt->SetValue( true );
266 else if( item )
267 m_netclassFilter->SetStringSelection( item->GetNet()->GetNetClass()->GetName() );
268
269 if( g_filterByNet && m_brd->FindNet( g_netFilter ) != nullptr )
270 {
272 m_netFilterOpt->SetValue( true );
273 }
274 else if( item )
275 {
277 }
278
280 {
281 m_layerFilterOpt->SetValue( true );
282 }
283 else if( item )
284 {
285 if( item->Type() == PCB_ZONE_T ) // a zone can be on more than one layer
286 m_layerFilter->SetLayerSelection( static_cast<ZONE*>(item)->GetFirstLayer() );
287 else
289 }
290
293
295 m_removeTeardrops->SetValue( true );
296 else if( g_action == REMOVE_ALL_TEARDROPS )
297 m_removeAllTeardrops->SetValue( true );
298 else if( g_action == ADD_TEARDROPS_DEFAULT )
299 m_addTeardrops->SetValue( true );
300 else //ADD_TEARDROPS_WITH_SPEC_VALUES
301 m_specifiedValues->SetValue( true );
302
303 m_cbPreferZoneConnection->Set3StateValue( wxCHK_UNDETERMINED );
304 m_cbTeardropsUseNextTrack->Set3StateValue( wxCHK_UNDETERMINED );
310 m_curvedEdges->Set3StateValue( wxCHK_UNDETERMINED );
311
312 return true;
313}
314
315
317{
318 if( m_cbPreferZoneConnection->Get3StateValue() != wxCHK_UNDETERMINED )
319 targetParams->m_TdOnPadsInZones = !m_cbPreferZoneConnection->GetValue();
320
321 if( m_cbTeardropsUseNextTrack->Get3StateValue() != wxCHK_UNDETERMINED )
322 targetParams->m_AllowUseTwoTracks = m_cbTeardropsUseNextTrack->GetValue();
323
326
328 targetParams->m_BestLengthRatio = m_teardropLenPercent.GetDoubleValue() / 100.0;
329
331 targetParams->m_TdMaxLen = m_teardropMaxLen.GetIntValue();
332
335
338
339 if( m_curvedEdges->Get3StateValue() != wxCHK_UNDETERMINED )
340 targetParams->m_CurvedEdges = m_curvedEdges->GetValue();
341}
342
343
345{
347 TEARDROP_PARAMETERS* targetParams = nullptr;
348
349 if( aItem->Type() == PCB_PAD_T )
350 targetParams = &static_cast<PAD*>( aItem )->GetTeardropParams();
351 else if( aItem->Type() == PCB_VIA_T )
352 targetParams = &static_cast<PCB_VIA*>( aItem )->GetTeardropParams();
353 else
354 return;
355
356 aCommit->Stage( aItem, CHT_MODIFY );
357
358 if( m_removeTeardrops->GetValue() || m_removeAllTeardrops->GetValue() )
359 {
360 targetParams->m_Enabled = false;
361 }
362 else if( m_addTeardrops->GetValue() )
363 {
364 // NOTE: This ignores possible padstack shape variation.
366 *targetParams = *brdSettings.GetTeadropParamsList()->GetParameters( TARGET_ROUND );
367 else
368 *targetParams = *brdSettings.GetTeadropParamsList()->GetParameters( TARGET_RECT );
369
370 targetParams->m_Enabled = true;
371 }
372 else if( m_specifiedValues->GetValue() )
373 {
374 setSpecifiedParams( targetParams );
375
376 if( !m_existingFilter->GetValue() )
377 targetParams->m_Enabled = true;
378 }
379}
380
381
384 bool aSelectAlways )
385{
386 if( m_selectedItemsFilter->GetValue() )
387 {
388 if( !aItem->IsSelected() )
389 {
390 PCB_GROUP* group = aItem->GetParentGroup();
391
392 while( group && !group->IsSelected() )
393 group = group->GetParentGroup();
394
395 if( !group )
396 return;
397 }
398 }
399
400 if( aSelectAlways )
401 {
402 processItem( aCommit, aItem );
403 return;
404 }
405
406
407 if( m_netFilterOpt->GetValue() && m_netFilter->GetSelectedNetcode() >= 0 )
408 {
409 if( aItem->GetNetCode() != m_netFilter->GetSelectedNetcode() )
410 return;
411 }
412
413 if( m_netclassFilterOpt->GetValue() && !m_netclassFilter->GetStringSelection().IsEmpty() )
414 {
415 wxString filterNetclass = m_netclassFilter->GetStringSelection();
416 NETCLASS* netclass = aItem->GetEffectiveNetClass();
417
418 if( !netclass->ContainsNetclassWithName( filterNetclass ) )
419 return;
420 }
421
423 {
424 if( aItem->GetLayer() != m_layerFilter->GetLayerSelection() )
425 return;
426 }
427
428 if( m_roundPadsFilter->GetValue() )
429 {
430 // TODO(JE) padstacks -- teardrops needs to support per-layer pad handling
432 return;
433 }
434
435 if( m_existingFilter->GetValue() )
436 {
437 if( aItem->Type() == PCB_PAD_T )
438 {
439 if( !static_cast<PAD*>( aItem )->GetTeardropParams().m_Enabled )
440 return;
441 }
442 else if( aItem->Type() == PCB_VIA_T )
443 {
444 if( !static_cast<PCB_VIA*>( aItem )->GetTeardropParams().m_Enabled )
445 return;
446 }
447 }
448
449 processItem( aCommit, aItem );
450}
451
452
454{
455 m_brd->SetLegacyTeardrops( false );
456
457 BOARD_COMMIT commit( m_parent );
458 wxBusyCursor dummy;
459
460 // Save some dialog options
462
463 bds.m_TeardropParamsList.m_TargetVias = m_vias->GetValue();
468
469 bool remove_all = m_removeAllTeardrops->GetValue();
470
471 if( m_vias->GetValue() || remove_all )
472 {
473 for( PCB_TRACK* track : m_brd->Tracks() )
474 {
475 if ( track->Type() == PCB_VIA_T )
476 visitItem( &commit, track, remove_all );
477 }
478 }
479
480 for( FOOTPRINT* footprint : m_brd->Footprints() )
481 {
482 for( PAD* pad : footprint->Pads() )
483 {
484 if( remove_all )
485 {
486 visitItem( &commit, pad, true );
487 continue;
488 }
489
490 if( m_pthPads->GetValue() && pad->GetAttribute() == PAD_ATTRIB::PTH )
491 {
492 visitItem( &commit, pad, false );
493 }
494 else if( m_smdPads->GetValue() && ( pad->GetAttribute() == PAD_ATTRIB::SMD
495 || pad->GetAttribute() == PAD_ATTRIB::CONN ) )
496 {
497 visitItem( &commit, pad, false );
498 }
499 }
500 }
501
502 if( m_trackToTrack->GetValue() )
503 {
505 TEARDROP_PARAMETERS* targetParams = paramsList->GetParameters( TARGET_TRACK );
506 TEARDROP_MANAGER teardropManager( m_brd, m_parent->GetToolManager() );
507
508 teardropManager.DeleteTrackToTrackTeardrops( commit );
509
510 if( m_removeTeardrops->GetValue() || m_removeAllTeardrops->GetValue() )
511 {
512 targetParams->m_Enabled = false; // JEY TODO: how does this get undone/redone?
513 }
514 else if( m_addTeardrops->GetValue() )
515 {
516 targetParams->m_Enabled = true; // JEY TODO: how does this get undone/redone?
517 teardropManager.AddTeardropsOnTracks( commit, nullptr, true );
518 }
519 }
520
521 // If there are no filters then a force-full-update is equivalent, and will be faster.
522 if( !m_netFilterOpt->GetValue()
523 && !m_netclassFilterOpt->GetValue()
524 && !m_layerFilterOpt->GetValue()
525 && !m_roundPadsFilter->GetValue()
526 && !m_existingFilter->GetValue()
527 && !m_selectedItemsFilter->GetValue() )
528 {
529 commit.Push( _( "Edit Teardrops" ), SKIP_TEARDROPS );
530
532 teardropMgr.UpdateTeardrops( commit, nullptr, nullptr, true /* forceFullUpdate */ );
533 commit.Push( _( "Edit Teardrops" ), SKIP_TEARDROPS | APPEND_UNDO );
534 }
535 else
536 {
537 commit.Push( _( "Edit Teardrops" ) );
538 }
539
540 // Showing the unfilled, fully cross-hatched teardrops seems to be working fairly well, and
541 // accurate fills can then be manually generated by doing a zone fill.
542 //
543 // But here's the old code which allowed for either "draft" fills or an automatic full zone
544 // fill in case we decide the current situation isn't good enough:
545#if 0
546 if( aFillAfter )
547 {
548 ZONE_FILLER filler( m_board, aCommit );
549
550 if( m_reporter )
551 filler.SetProgressReporter( m_reporter );
552
553 filler.Fill( m_board->Zones() );
554
555 if( aCommit )
556 aCommit->Push( _( "Edit Teardrops" ), APPEND_UNDO );
557 }
558 else
559 {
560 // Fill raw teardrop shapes. This is a rough calculation, just to show a filled
561 // shape on screen without the (potentially large) performance hit of a zone refill
562 int epsilon = pcbIUScale.mmToIU( 0.001 );
563 int allowed_error = pcbIUScale.mmToIU( 0.005 );
564
565 for( ZONE* zone: m_createdTdList )
566 {
567 int half_min_width = zone->GetMinThickness() / 2;
568 int numSegs = GetArcToSegmentCount( half_min_width, allowed_error, FULL_CIRCLE );
569 SHAPE_POLY_SET filledPolys = *zone->Outline();
570
571 filledPolys.Deflate( half_min_width - epsilon, numSegs );
572
573 // Re-inflate after pruning of areas that don't meet minimum-width criteria
574 if( half_min_width - epsilon > epsilon )
575 filledPolys.Inflate( half_min_width - epsilon, numSegs );
576
577 zone->SetFilledPolysList( zone->GetFirstLayer(), filledPolys );
578 }
579 }
580#endif
581
582 m_parent->Refresh();
583 return true;
584}
585
586
588{
589 PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
590 DIALOG_GLOBAL_EDIT_TEARDROPS dlg( editFrame );
591
592 dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR
593 return 0;
594}
595
const char * name
Definition: DXF_plotter.cpp:59
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
Execute the changes.
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr) 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.
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).
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:239
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:90
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:295
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:879
const std::set< int > & GetHighLightNetCodes() const
Definition: board.h:540
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1961
const FOOTPRINTS & Footprints() const
Definition: board.h:336
const TRACKS & Tracks() const
Definition: board.h:334
void SetLegacyTeardrops(bool aFlag)
Definition: board.h:1270
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:934
Class DIALOG_GLOBAL_EDIT_TEARDROPS_BASE.
void processItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem)
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:573
A collection of nets and the parameters used to route or test these nets.
Definition: netclass.h:45
bool ContainsNetclassWithName(const wxString &netclass) const
Determines if the given netclass name is a constituent of this (maybe aggregate) netclass.
Definition: netclass.cpp:276
const wxString GetName() const
Gets the name of this (maybe aggregate) netclass in a format for internal usage or for export to exte...
Definition: netclass.cpp:314
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...
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.
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
Generic, UI-independent tool event.
Definition: tool_event.h:168
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:458
@ 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:155
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