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) 2023 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 );
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
177
178 m_netFilter->Connect( NET_SELECTED,
180 nullptr, this );
181
183}
184
185
187{
188 g_vias = m_vias->GetValue();
189 g_pthPads = m_pthPads->GetValue();
190 g_smdPads = m_smdPads->GetValue();
191 g_trackToTrack = m_trackToTrack->GetValue();
193 g_netclassFilter = m_netclassFilter->GetStringSelection();
194 g_filterByNet = m_netFilterOpt->GetValue();
196 g_filterByLayer = m_layerFilterOpt->GetValue();
200
201 if( m_removeTeardrops->GetValue() )
203 else if( m_removeAllTeardrops->GetValue() )
205 else if( m_specifiedValues->GetValue() )
207 else
209
210 m_netFilter->Disconnect( NET_SELECTED,
212 nullptr, this );
213}
214
215
217{
218 // Populate the net filter list with net names
221
222 if( !m_brd->GetHighLightNetCodes().empty() )
224
225 // Populate the netclass filter list with netclass names
226 wxArrayString netclassNames;
227 std::shared_ptr<NET_SETTINGS>& settings = m_brd->GetDesignSettings().m_NetSettings;
228
229 netclassNames.push_back( settings->GetDefaultNetclass()->GetName() );
230
231 for( const auto& [name, netclass] : settings->GetNetclasses() )
232 netclassNames.push_back( name );
233
234 m_netclassFilter->Set( netclassNames );
236
237 // Populate the layer filter list
243}
244
245
247{
249
254
255 #if 0 // I am not sure this is useful
257 #endif
258
260 m_selection = selTool->GetSelection();
262
263 m_vias->SetValue( g_vias );
264 m_pthPads->SetValue( g_pthPads );
265 m_smdPads->SetValue( g_smdPads );
266 m_trackToTrack->SetValue( g_trackToTrack );
267
268 if( g_filterByNetclass && m_netclassFilter->SetStringSelection( g_netclassFilter ) )
269 m_netclassFilterOpt->SetValue( true );
270 else if( item )
271 m_netclassFilter->SetStringSelection(
273
274 if( g_filterByNet && m_brd->FindNet( g_netFilter ) != nullptr )
275 {
277 m_netFilterOpt->SetValue( true );
278 }
279 else if( item )
280 {
282 }
283
285 {
286 m_layerFilterOpt->SetValue( true );
287 }
288 else if( item )
289 {
290 if( item->Type() == PCB_ZONE_T ) // a zone can be on more than one layer
291 m_layerFilter->SetLayerSelection( static_cast<ZONE*>(item)->GetFirstLayer() );
292 else
294 }
295
298
300 m_removeTeardrops->SetValue( true );
301 else if( g_action == REMOVE_ALL_TEARDROPS )
302 m_removeAllTeardrops->SetValue( true );
303 else if( g_action == ADD_TEARDROPS_DEFAULT )
304 m_addTeardrops->SetValue( true );
305 else //ADD_TEARDROPS_WITH_SPEC_VALUES
306 m_specifiedValues->SetValue( true );
307
308 m_cbPreferZoneConnection->Set3StateValue( wxCHK_UNDETERMINED );
309 m_cbTeardropsUseNextTrack->Set3StateValue( wxCHK_UNDETERMINED );
315 m_curvedEdges->Set3StateValue( wxCHK_UNDETERMINED );
316
317 return true;
318}
319
320
322{
323 if( m_cbPreferZoneConnection->Get3StateValue() != wxCHK_UNDETERMINED )
324 targetParams->m_TdOnPadsInZones = !m_cbPreferZoneConnection->GetValue();
325
326 if( m_cbTeardropsUseNextTrack->Get3StateValue() != wxCHK_UNDETERMINED )
327 targetParams->m_AllowUseTwoTracks = m_cbTeardropsUseNextTrack->GetValue();
328
331
333 targetParams->m_BestLengthRatio = m_teardropLenPercent.GetDoubleValue() / 100.0;
334
336 targetParams->m_TdMaxLen = m_teardropMaxLen.GetIntValue();
337
340
343
344 if( m_curvedEdges->Get3StateValue() != wxCHK_UNDETERMINED )
345 {
346 if( m_curvedEdges->GetValue() )
347 targetParams->m_CurveSegCount = 1;
348 else
349 targetParams->m_CurveSegCount = 0;
350 }
351}
352
353
355{
357 TEARDROP_PARAMETERS* targetParams = nullptr;
358
359 if( aItem->Type() == PCB_PAD_T )
360 targetParams = &static_cast<PAD*>( aItem )->GetTeardropParams();
361 else if( aItem->Type() == PCB_VIA_T )
362 targetParams = &static_cast<PCB_VIA*>( aItem )->GetTeardropParams();
363 else
364 return;
365
366 aCommit->Stage( aItem, CHT_MODIFY );
367
368 if( m_removeTeardrops->GetValue() || m_removeAllTeardrops->GetValue() )
369 {
370 targetParams->m_Enabled = false;
371 }
372 else if( m_addTeardrops->GetValue() )
373 {
374 if( TEARDROP_MANAGER::IsRound( aItem ) )
375 *targetParams = *brdSettings.GetTeadropParamsList()->GetParameters( TARGET_ROUND );
376 else
377 *targetParams = *brdSettings.GetTeadropParamsList()->GetParameters( TARGET_RECT );
378
379 targetParams->m_Enabled = true;
380 }
381 else if( m_specifiedValues->GetValue() )
382 {
383 setSpecifiedParams( targetParams );
384
385 if( !m_existingFilter->GetValue() )
386 targetParams->m_Enabled = true;
387 }
388}
389
390
392{
393 if( m_selectedItemsFilter->GetValue() )
394 {
395 if( !aItem->IsSelected() )
396 {
397 PCB_GROUP* group = aItem->GetParentGroup();
398
399 while( group && !group->IsSelected() )
400 group = group->GetParentGroup();
401
402 if( !group )
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 if( !TEARDROP_MANAGER::IsRound( aItem ) )
431 return;
432 }
433
434 if( m_existingFilter->GetValue() )
435 {
436 if( aItem->Type() == PCB_PAD_T )
437 {
438 if( !static_cast<PAD*>( aItem )->GetTeardropParams().m_Enabled )
439 return;
440 }
441 else if( aItem->Type() == PCB_VIA_T )
442 {
443 if( !static_cast<PCB_VIA*>( aItem )->GetTeardropParams().m_Enabled )
444 return;
445 }
446 }
447
448 processItem( aCommit, aItem );
449}
450
451
453{
454 m_brd->SetLegacyTeardrops( false );
455
456 BOARD_COMMIT commit( m_parent );
457 wxBusyCursor dummy;
458
459 // Save some dialog options
461
462 bds.m_TeardropParamsList.m_TargetVias = m_vias->GetValue();
467
468 if( m_vias->GetValue() )
469 {
470 for( PCB_TRACK* track : m_brd->Tracks() )
471 {
472 if ( track->Type() == PCB_VIA_T )
473 visitItem( &commit, track );
474 }
475 }
476
477 for( FOOTPRINT* footprint : m_brd->Footprints() )
478 {
479 for( PAD* pad : footprint->Pads() )
480 {
481 if( m_pthPads->GetValue() && pad->GetAttribute() == PAD_ATTRIB::PTH )
482 {
483 visitItem( &commit, pad );
484 }
485 else if( m_smdPads->GetValue() && ( pad->GetAttribute() == PAD_ATTRIB::SMD
486 || pad->GetAttribute() == PAD_ATTRIB::CONN ) )
487 {
488 visitItem( &commit, pad );
489 }
490 }
491 }
492
493 if( m_trackToTrack->GetValue() )
494 {
496 TEARDROP_PARAMETERS* targetParams = paramsList->GetParameters( TARGET_TRACK );
497 TEARDROP_MANAGER teardropManager( m_brd, m_parent->GetToolManager() );
498
499 teardropManager.DeleteTrackToTrackTeardrops( commit );
500
501 if( m_removeTeardrops->GetValue() || m_removeAllTeardrops->GetValue() )
502 {
503 targetParams->m_Enabled = false; // JEY TODO: how does this get undone/redone?
504 }
505 else if( m_addTeardrops->GetValue() )
506 {
507 targetParams->m_Enabled = true; // JEY TODO: how does this get undone/redone?
508 teardropManager.AddTeardropsOnTracks( commit, nullptr, true );
509 }
510 }
511
512 // If there are no filters then a force-full-update is equivalent, and will be faster.
513 if( !m_netFilterOpt->GetValue()
514 && !m_netclassFilterOpt->GetValue()
515 && !m_layerFilterOpt->GetValue()
516 && !m_roundPadsFilter->GetValue()
517 && !m_existingFilter->GetValue()
518 && !m_selectedItemsFilter->GetValue() )
519 {
520 commit.Push( _( "Edit Teardrops" ), SKIP_TEARDROPS );
521
523 teardropMgr.UpdateTeardrops( commit, nullptr, nullptr, true /* forceFullUpdate */ );
524 commit.Push( _( "Edit Teardrops" ), SKIP_TEARDROPS | APPEND_UNDO );
525 }
526 else
527 {
528 commit.Push( _( "Edit Teardrops" ) );
529 }
530
531 // Showing the unfilled, fully cross-hatched teardrops seems to be working fairly well, and
532 // accurate fills can then be manually generated by doing a zone fill.
533 //
534 // But here's the old code which allowed for either "draft" fills or an automatic full zone
535 // fill in case we decide the current situation isn't good enough:
536#if 0
537 if( aFillAfter )
538 {
539 ZONE_FILLER filler( m_board, aCommit );
540
541 if( m_reporter )
542 filler.SetProgressReporter( m_reporter );
543
544 filler.Fill( m_board->Zones() );
545
546 if( aCommit )
547 aCommit->Push( _( "Edit Teardrops" ), APPEND_UNDO );
548 }
549 else
550 {
551 // Fill raw teardrop shapes. This is a rough calculation, just to show a filled
552 // shape on screen without the (potentially large) performance hit of a zone refill
553 int epsilon = pcbIUScale.mmToIU( 0.001 );
554 int allowed_error = pcbIUScale.mmToIU( 0.005 );
555
556 for( ZONE* zone: m_createdTdList )
557 {
558 int half_min_width = zone->GetMinThickness() / 2;
559 int numSegs = GetArcToSegmentCount( half_min_width, allowed_error, FULL_CIRCLE );
560 SHAPE_POLY_SET filledPolys = *zone->Outline();
561
562 filledPolys.Deflate( half_min_width - epsilon, numSegs );
563
564 // Re-inflate after pruning of areas that don't meet minimum-width criteria
565 if( half_min_width - epsilon > epsilon )
566 filledPolys.Inflate( half_min_width - epsilon, numSegs );
567
568 zone->SetFilledPolysList( zone->GetFirstLayer(), filledPolys );
569 }
570 }
571#endif
572
573 return true;
574}
575
576
578{
579 PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
580 DIALOG_GLOBAL_EDIT_TEARDROPS dlg( editFrame );
581
582 dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR
583 return 0;
584}
585
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:1916
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:890
Class DIALOG_GLOBAL_EDIT_TEARDROPS_BASE.
void processItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem)
void onCurvedEdgesUpdateUi(wxUpdateUIEvent &event) override
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 visitItem(BOARD_COMMIT *aCommit, BOARD_CONNECTED_ITEM *aItem)
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()
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
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
static bool IsRound(BOARD_ITEM *aItem)
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