KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew/widgets/search_handlers.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 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <footprint.h>
22#include <pcb_edit_frame.h>
23#include <pcb_marker.h>
24#include <pcb_painter.h>
25#include <pcb_group.h>
26#include <pcb_textbox.h>
27#include <pcb_text.h>
28#include <pcb_dimension.h>
29#include <pcbnew_settings.h>
31#include <string_utils.h>
32#include <tool/tool_manager.h>
33#include <tools/pcb_actions.h>
34#include <zone.h>
35#include "search_handlers.h"
36
37
39{
40 std::vector<long> item = { aItemRow };
41 SelectItems( item );
42
44}
45
46
47void PCB_SEARCH_HANDLER::Sort( int aCol, bool aAscending, std::vector<long>* aSelection )
48{
49 std::vector<BOARD_ITEM*> selection;
50
51 for( long i = 0; i < (long) m_hitlist.size(); ++i )
52 {
53 if( alg::contains( *aSelection, i ) )
54 selection.push_back( m_hitlist[i] );
55 }
56
57 int col = std::max( 0, aCol ); // Provide a stable order by sorting on first column if no
58 // sort column provided.
59
60 std::sort( m_hitlist.begin(), m_hitlist.end(),
61 [&]( BOARD_ITEM* a, BOARD_ITEM* b ) -> bool
62 {
63 // N.B. To meet the iterator sort conditions, we cannot simply invert the truth
64 // to get the opposite sort. i.e. ~(a<b) != (a>b)
65 if( aAscending )
66 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
67 else
68 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
69 } );
70
71
72 aSelection->clear();
73
74 for( long i = 0; i < (long) m_hitlist.size(); ++i )
75 {
76 if( alg::contains( selection, m_hitlist[i] ) )
77 aSelection->push_back( i );
78 }
79}
80
81
82void PCB_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
83{
85 std::vector<EDA_ITEM*> selectedItems;
86
87 for( long row : aItemRows )
88 {
89 if( row >= 0 && row < (long) m_hitlist.size() )
90 selectedItems.push_back( m_hitlist[row] );
91 }
92
94
95 if( selectedItems.size() )
96 {
98
99 switch( settings.selection_zoom )
100 {
103 break;
106 break;
108 break;
109 }
110 }
111
112 m_frame->GetCanvas()->Refresh( false );
113}
114
115
117 PCB_SEARCH_HANDLER( _HKI( "Footprints" ), aFrame )
118{
119 m_columns.emplace_back( _HKI( "Reference" ), 2, wxLIST_FORMAT_LEFT );
120 m_columns.emplace_back( _HKI( "Value" ), 6, wxLIST_FORMAT_LEFT );
121 m_columns.emplace_back( _HKI( "Layer" ), 2, wxLIST_FORMAT_CENTER );
122 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
123 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
124 m_columns.emplace_back( _HKI( "Library Link" ), 8, wxLIST_FORMAT_LEFT );
125 m_columns.emplace_back( _HKI( "Library Description" ), 10, wxLIST_FORMAT_LEFT );
126}
127
128
129int FOOTPRINT_SEARCH_HANDLER::Search( const wxString& aQuery )
130{
131 m_hitlist.clear();
132 BOARD* board = m_frame->GetBoard();
133
134 if( board == nullptr )
135 return 0;
136
138 EDA_SEARCH_DATA frp;
139
141 frp.searchMetadata = settings.search_metadata;
142 frp.findString = aQuery;
143
144 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
145 frp.matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
146
147 for( FOOTPRINT* fp : board->Footprints() )
148 {
149 bool found = false;
150
151 if( frp.findString.IsEmpty() )
152 found = true;
153
154 if( !found && fp->Matches( frp, nullptr ) )
155 found = true;
156
157 if( !found )
158 {
159 for( PCB_FIELD* field : fp->GetFields() )
160 {
161 if( field->Matches( frp, nullptr ) )
162 {
163 found = true;
164 break;
165 }
166 }
167 }
168
169 if( found )
170 m_hitlist.push_back( fp );
171 }
172
173 return (int) m_hitlist.size();
174}
175
176
178{
179 FOOTPRINT* fp = static_cast<FOOTPRINT*>( aItem );
180
181 if( aCol == 0 )
182 return fp->GetReference();
183 else if( aCol == 1 )
184 return UnescapeString( fp->GetValue() );
185 else if( aCol == 2 )
186 return fp->GetLayerName();
187 else if( aCol == 3 )
189 else if( aCol == 4 )
191 else if( aCol == 5 )
192 return fp->GetFPID().Format();
193 else if( aCol == 6 )
194 return fp->GetLibDescription();
195
196 return wxEmptyString;
197}
198
199
201 PCB_SEARCH_HANDLER( _HKI( "Zones" ), aFrame )
202{
203 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
204 m_columns.emplace_back( _HKI( "Net" ), 6, wxLIST_FORMAT_LEFT);
205 m_columns.emplace_back( _HKI( "Layer" ), 3, wxLIST_FORMAT_CENTER );
206 m_columns.emplace_back( _HKI( "Priority" ), 2, wxLIST_FORMAT_CENTER );
207 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
208 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
209 m_columns.emplace_back( _HKI( "Area" ), 3, wxLIST_FORMAT_RIGHT );
210}
211
212
213int ZONE_SEARCH_HANDLER::Search( const wxString& aQuery )
214{
215 m_hitlist.clear();
216 BOARD* board = m_frame->GetBoard();
217
219 EDA_SEARCH_DATA frp;
220
222 frp.searchMetadata = settings.search_metadata;
223 frp.findString = aQuery;
224
225 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
226 frp.matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
227
228 for( BOARD_ITEM* item : board->Zones() )
229 {
230 if( frp.findString.IsEmpty() || item->Matches( frp, nullptr ) )
231 m_hitlist.push_back( item );
232 }
233
234 return (int) m_hitlist.size();
235}
236
237
239{
240 ZONE* zone = static_cast<ZONE*>( aItem );
241
242 if( aCol == 0 )
243 return zone->GetZoneName();
244 else if( aCol == 1 )
245 return UnescapeString( zone->GetNetname() );
246 else if( aCol == 2 )
247 {
248 wxArrayString layers;
249 BOARD* board = m_frame->GetBoard();
250
251 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
252 layers.Add( board->GetLayerName( layer ) );
253
254 return wxJoin( layers, ',' );
255 }
256 else if( aCol == 3 )
257 return wxString::Format( "%d", zone->GetAssignedPriority() );
258 else if( aCol == 4 )
260 else if( aCol == 5 )
262 else if( aCol == 6 )
263 {
264 return m_frame->MessageTextFromValue( zone->GetIsRuleArea() ? zone->GetOutlineArea() : zone->GetFilledArea(),
265 true, EDA_DATA_TYPE::AREA );
266 }
267
268
269 return wxEmptyString;
270}
271
272
274 PCB_SEARCH_HANDLER( _HKI( "Text" ), aFrame )
275{
276 m_columns.emplace_back( _HKI( "Type" ), 2, wxLIST_FORMAT_LEFT );
277 m_columns.emplace_back( _HKI( "Text" ), 12, wxLIST_FORMAT_LEFT );
278 m_columns.emplace_back( _HKI( "Layer" ), 3, wxLIST_FORMAT_CENTER );
279 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
280 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
281}
282
283
284int TEXT_SEARCH_HANDLER::Search( const wxString& aQuery )
285{
286 m_hitlist.clear();
287 BOARD* board = m_frame->GetBoard();
288
290 EDA_SEARCH_DATA frp;
291
293 frp.searchMetadata = settings.search_metadata;
294 frp.findString = aQuery;
295
296 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
297 frp.matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
298
299 for( BOARD_ITEM* item : board->Drawings() )
300 {
301 if( item->Type() == PCB_TEXT_T
302 || BaseType( item->Type() ) == PCB_DIMENSION_T
303 || item->Type() == PCB_TEXTBOX_T
304 || item->Type() == PCB_TABLECELL_T )
305 {
306 if( frp.findString.IsEmpty() || item->Matches( frp, nullptr ) )
307 m_hitlist.push_back( item );
308 }
309 }
310
311 return (int) m_hitlist.size();
312}
313
314
316{
317 if( aCol == 0 )
318 {
319 if( PCB_TEXT::ClassOf( aItem ) )
320 return _( "Text" );
321 else if( PCB_TEXTBOX::ClassOf( aItem ) )
322 return _( "Textbox" );
323 else if( dynamic_cast<PCB_DIMENSION_BASE*>( aItem ) )
324 return _( "Dimension" );
325 }
326 else if( aCol == 1 )
327 {
328 if( PCB_TEXT::ClassOf( aItem ) )
329 return UnescapeString( static_cast<PCB_TEXT*>( aItem )->GetText() );
330 else if( PCB_TEXTBOX::ClassOf( aItem ) )
331 return UnescapeString( static_cast<PCB_TEXTBOX*>( aItem )->GetText() );
332 else if( PCB_DIMENSION_BASE* dimension = dynamic_cast<PCB_DIMENSION_BASE*>( aItem ) )
333 return UnescapeString( dimension->GetText() );
334 }
335 else if( aCol == 2 )
336 return aItem->GetLayerName();
337 else if( aCol == 3 )
338 return m_frame->MessageTextFromCoord( aItem->GetX(), ORIGIN_TRANSFORMS::ABS_X_COORD );
339 else if( aCol == 4 )
340 return m_frame->MessageTextFromCoord( aItem->GetY(), ORIGIN_TRANSFORMS::ABS_Y_COORD );
341
342 return wxEmptyString;
343}
344
345
347 PCB_SEARCH_HANDLER( _HKI( "Groups" ), aFrame )
348{
349 m_columns.emplace_back( _HKI( "Type" ), 2, wxLIST_FORMAT_LEFT );
350 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
351 m_columns.emplace_back( wxT( "X" ), 3, wxLIST_FORMAT_CENTER );
352 m_columns.emplace_back( wxT( "Y" ), 3, wxLIST_FORMAT_CENTER );
353}
354
355
356int GROUP_SEARCH_HANDLER::Search( const wxString& aQuery )
357{
358 m_hitlist.clear();
359 BOARD* board = m_frame->GetBoard();
360
362 EDA_SEARCH_DATA frp;
363
365 frp.searchMetadata = settings.search_metadata;
366 frp.findString = aQuery;
367
368 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
369 frp.matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
370
371 for( BOARD_ITEM* item : board->Groups() )
372 {
373 // Skip generators, they are for internal use, not user-facing grouping
374 if( item->Type() == PCB_GENERATOR_T )
375 continue;
376
377 if( frp.findString.IsEmpty() || item->Matches( frp, nullptr ) )
378 m_hitlist.push_back( item );
379 }
380
381 return (int) m_hitlist.size();
382}
383
384
386{
387 if( aCol == 0 )
388 {
389 if( aItem->Type() == PCB_GROUP_T )
390 return _( "Group" );
391 else if( aItem->Type() == PCB_GENERATOR_T )
392 return _( "Generator" );
393 }
394 else if( aCol == 1 )
395 return static_cast<PCB_GROUP*>( aItem )->GetName();
396 else if( aCol == 2 )
397 return m_frame->MessageTextFromCoord( aItem->GetX(), ORIGIN_TRANSFORMS::ABS_X_COORD );
398 else if( aCol == 3 )
399 return m_frame->MessageTextFromCoord( aItem->GetY(), ORIGIN_TRANSFORMS::ABS_Y_COORD );
400
401 return wxEmptyString;
402}
403
404
406 PCB_SEARCH_HANDLER( _HKI( "Nets" ), aFrame )
407{
408 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
409 m_columns.emplace_back( _HKI( "Class" ), 6, wxLIST_FORMAT_LEFT );
410}
411
412
413int NETS_SEARCH_HANDLER::Search( const wxString& aQuery )
414{
415 m_hitlist.clear();
416
418 EDA_SEARCH_DATA frp;
419
421 frp.searchMetadata = settings.search_metadata;
422 frp.findString = aQuery;
423
424 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
425 frp.matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
426
427 BOARD* board = m_frame->GetBoard();
428
429 for( NETINFO_ITEM* net : board->GetNetInfo() )
430 {
431 if( net && ( aQuery.IsEmpty() || net->Matches( frp, nullptr ) ) )
432 m_hitlist.push_back( net );
433 }
434
435 return (int) m_hitlist.size();
436}
437
438
440{
441 NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( aItem );
442
443 if( net->GetNetCode() == 0 )
444 {
445 if( aCol == 0 )
446 return _( "No Net" );
447 else if( aCol == 1 )
448 return wxT( "" );
449 }
450
451 if( aCol == 0 )
452 return UnescapeString( net->GetNetname() );
453 else if( aCol == 1 )
454 return net->GetNetClass()->GetName();
455
456 return wxEmptyString;
457}
458
459
460void NETS_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
461{
463 ps->SetHighlight( false );
464
465 std::vector<NETINFO_ITEM*> selectedItems;
466
467 for( long row : aItemRows )
468 {
469 if( row >= 0 && row < (long) m_hitlist.size() )
470 {
471 NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( m_hitlist[row] );
472
473 ps->SetHighlight( true, net->GetNetCode(), true );
474 }
475 }
476
479}
480
481
483{
484 m_frame->ShowBoardSetupDialog( _( "Net Classes" ) );
485}
486
487
489 PCB_SEARCH_HANDLER( _HKI( "Ratsnest" ), aFrame )
490{
491 m_columns.emplace_back( _HKI( "Name" ), 6, wxLIST_FORMAT_LEFT );
492 m_columns.emplace_back( _HKI( "Class" ), 6, wxLIST_FORMAT_LEFT );
493}
494
495
496int RATSNEST_SEARCH_HANDLER::Search( const wxString& aQuery )
497{
498 m_hitlist.clear();
499
501 EDA_SEARCH_DATA frp;
502
504 frp.searchMetadata = settings.search_metadata;
505 frp.findString = aQuery;
506
507 // Try to handle whatever the user throws at us (substring, wildcards, regex, etc.)
508 frp.matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
509
510 BOARD* board = m_frame->GetBoard();
511
512 for( NETINFO_ITEM* net : board->GetNetInfo() )
513 {
514 if( net == nullptr || !net->Matches( frp, nullptr ) )
515 continue;
516
517 RN_NET* rn = board->GetConnectivity()->GetRatsnestForNet( net->GetNetCode() );
518
519 if( rn && !rn->GetEdges().empty() )
520 m_hitlist.push_back( net );
521 }
522
523 return (int) m_hitlist.size();
524}
525
526
528{
529 NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( aItem );
530
531 if( net->GetNetCode() == 0 )
532 {
533 if( aCol == 0 )
534 return _( "No Net" );
535 else if( aCol == 1 )
536 return wxT( "" );
537 }
538
539 if( aCol == 0 )
540 return UnescapeString( net->GetNetname() );
541 else if( aCol == 1 )
542 return net->GetNetClass()->GetName();
543
544 return wxEmptyString;
545}
546
547
548void RATSNEST_SEARCH_HANDLER::SelectItems( std::vector<long>& aItemRows )
549{
551 ps->SetHighlight( false );
552
553 std::vector<NETINFO_ITEM*> selectedItems;
554
555 for( long row : aItemRows )
556 {
557 if( row >= 0 && row < (long) m_hitlist.size() )
558 {
559 NETINFO_ITEM* net = static_cast<NETINFO_ITEM*>( m_hitlist[row] );
560
561 ps->SetHighlight( true, net->GetNetCode(), true );
562 }
563 }
564
567}
568
569
571{
572 m_frame->ShowBoardSetupDialog( _( "Net Classes" ) );
573}
static TOOL_ACTION zoomFitSelection
Definition: actions.h:143
static TOOL_ACTION centerSelection
Definition: actions.h:149
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: actions.h:221
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
Definition: actions.h:229
SEARCH_PANE m_SearchPane
Definition: app_settings.h:227
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
int GetY() const
Definition: board_item.h:101
int GetX() const
Definition: board_item.h:95
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Definition: board_item.cpp:180
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:317
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:934
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:1147
const ZONES & Zones() const
Definition: board.h:362
const GROUPS & Groups() const
The groups must maintain the following invariants.
Definition: board.h:389
const FOOTPRINTS & Footprints() const
Definition: board.h:358
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:680
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:522
const DRAWINGS & Drawings() const
Definition: board.h:360
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:110
FOOTPRINT_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
wxString GetLibDescription() const
Definition: footprint.h:260
const LIB_ID & GetFPID() const
Definition: footprint.h:251
const wxString & GetValue() const
Definition: footprint.h:649
const wxString & GetReference() const
Definition: footprint.h:627
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
int Search(const wxString &aQuery) override
GROUP_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
Definition: view.cpp:775
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:220
UTF8 Format() const
Definition: lib_id.cpp:119
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:296
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:322
Handle the data for a net.
Definition: netinfo.h:56
const wxString & GetNetname() const
Definition: netinfo.h:114
NETCLASS * GetNetClass()
Definition: netinfo.h:101
int GetNetCode() const
Definition: netinfo.h:108
void ActivateItem(long aItemRow) override
int Search(const wxString &aQuery) override
NETS_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
void SelectItems(std::vector< long > &aItemRows) override
static TOOL_ACTION properties
Activation of the edit tool.
Definition: pcb_actions.h:168
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
BOARD * GetBoard() const
wxString MessageTextFromCoord(int aValue, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType) const
Abstract dimension API.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
The main frame for Pcbnew.
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString)
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:53
void ActivateItem(long aItemRow) override
void Sort(int aCol, bool aAscending, std::vector< long > *aSelection) override
void SelectItems(std::vector< long > &aItemRows) override
std::vector< BOARD_ITEM * > m_hitlist
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_textbox.h:48
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_text.h:51
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
RATSNEST_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
void SelectItems(std::vector< long > &aItemRows) override
void ActivateItem(long aItemRow) override
Describe ratsnest for a single net.
Definition: ratsnest_data.h:64
const std::vector< CN_EDGE > & GetEdges() const
Definition: ratsnest_data.h:97
std::vector< SCH_SEARCH_HIT > m_hitlist
std::vector< std::tuple< wxString, int, wxListColumnFormat > > m_columns
Definition: search_pane.h:61
wxString GetName() const
Definition: search_pane.h:45
TEXT_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:150
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
ZONE_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
int Search(const wxString &aQuery) override
Handle a list of polygons defining a copper zone.
Definition: zone.h:74
double GetOutlineArea()
This area is cached from the most recent call to CalculateOutlineArea().
Definition: zone.h:275
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
Definition: zone.h:704
double GetFilledArea()
This area is cached from the most recent call to CalculateFilledArea().
Definition: zone.h:265
const wxString & GetZoneName() const
Definition: zone.h:163
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: zone.h:136
unsigned GetAssignedPriority() const
Definition: zone.h:126
#define _HKI(x)
#define _(s)
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:100
Class to handle a set of BOARD_ITEMs.
Class that computes missing connections on a PCB.
wxString UnescapeString(const wxString &aSource)
EDA_SEARCH_MATCH_MODE matchMode
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
Definition: typeinfo.h:251
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition: typeinfo.h:91
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:110
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition: typeinfo.h:93
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:92
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition: typeinfo.h:95
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:100