KiCad PCB EDA Suite
collectors.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) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
5  * Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <collectors.h>
26 #include <board_item.h> // class BOARD_ITEM
27 
28 #include <footprint.h>
29 #include <fp_shape.h>
30 #include <pad.h>
31 #include <track.h>
32 #include <pcb_marker.h>
33 #include <dimension.h>
34 #include <zone.h>
35 #include <pcb_shape.h>
36 #include <pcb_group.h>
37 #include <macros.h>
38 #include <math/util.h> // for KiROUND
39 
40 /*
41  * This module contains out of line member functions for classes given in
42  * collectors.h. Those classes augment the functionality of class PCB_EDIT_FRAME.
43  */
44 
45 
47  // there are some restrictions on the order of items in the general case.
48  // all items in m_Drawings for instance should be contiguous.
49  // *** all items in a same list (shown here) must be contiguous ****
50  PCB_MARKER_T, // in m_markers
51  PCB_TEXT_T, // in m_drawings
52  PCB_SHAPE_T, // in m_drawings
53  PCB_DIM_ALIGNED_T, // in m_drawings
54  PCB_DIM_CENTER_T, // in m_drawings
55  PCB_DIM_ORTHOGONAL_T, // in m_drawings
56  PCB_DIM_LEADER_T, // in m_drawings
57  PCB_TARGET_T, // in m_drawings
58  PCB_VIA_T, // in m_tracks
59  PCB_TRACE_T, // in m_tracks
60  PCB_ARC_T, // in m_tracks
61  PCB_PAD_T, // in footprints
62  PCB_FP_TEXT_T, // in footprints
63  PCB_FOOTPRINT_T, // in m_footprints
64  PCB_GROUP_T, // in m_groups
65  PCB_ZONE_T, // in m_zones
66  EOT
67 };
68 
69 
72  PCB_TEXT_T,
79  PCB_VIA_T,
80  PCB_ARC_T,
84  PCB_ZONE_T,
85  EOT
86 };
87 
88 
91  EOT
92 };
93 
94 
96  PCB_PAD_T,
97  PCB_VIA_T,
99  PCB_ARC_T,
100  EOT
101 };
102 
103 
107  PCB_PAD_T,
109  PCB_GROUP_T,
110  EOT
111  };
112 
113 
115  PCB_TRACE_T,
116  PCB_ARC_T,
117  PCB_VIA_T,
118  EOT
119 };
120 
121 
124  PCB_GROUP_T, // Can a group be locked?
125  PCB_TRACE_T,
126  PCB_ARC_T,
127  PCB_VIA_T,
128  EOT
129 };
130 
131 
133  PCB_ZONE_T,
135  EOT
136 };
137 
138 
144  EOT
145 };
146 
147 
149  PCB_TRACE_T,
150  PCB_VIA_T,
152  PCB_ARC_T,
153  EOT
154 };
155 
156 
158 {
159  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
160  FOOTPRINT* footprint = nullptr;
161  PCB_GROUP* group = nullptr;
162  PAD* pad = nullptr;
163  bool pad_through = false;
164  VIA* via = nullptr;
165  PCB_MARKER* marker = nullptr;
166  ZONE* zone = nullptr;
167  PCB_SHAPE* shape = nullptr;
168  DIMENSION_BASE* dimension = nullptr;
169 
170 #if 0 // debugging
171  static int breakhere = 0;
172 
173  switch( item->Type() )
174  {
175  case PCB_PAD_T:
176  {
177  FOOTPRINT* footprint = (FOOTPRINT*) item->GetParent();
178 
179  if( footprint->GetReference() == wxT( "Y2" ) )
180  breakhere++;
181  }
182  break;
183 
184  case PCB_VIA_T:
185  breakhere++;
186  break;
187 
188  case PCB_TRACE_T:
189  case PCB_ARC_T:
190  breakhere++;
191  break;
192 
193  case PCB_TEXT_T:
194  breakhere++;
195  break;
196 
197  case PCB_SHAPE_T:
198  breakhere++;
199  break;
200 
201  case PCB_DIM_ALIGNED_T:
202  breakhere++;
203  break;
204 
205  case PCB_FP_TEXT_T:
206  {
207  FP_TEXT* fpText = (FP_TEXT*) item;
208 
209  if( fpText->GetText() == wxT( "10uH" ) )
210  breakhere++;
211  }
212  break;
213 
214  case PCB_FOOTPRINT_T:
215  {
216  FOOTPRINT* footprint = (FOOTPRINT*) item;
217 
218  if( footprint->GetReference() == wxT( "C98" ) )
219  breakhere++;
220  }
221  break;
222 
223  case PCB_MARKER_T:
224  breakhere++;
225  break;
226 
227  default:
228  breakhere++;
229  break;
230  }
231 
232 #endif
233 
234 
235  switch( item->Type() )
236  {
237  case PCB_PAD_T:
238  // there are pad specific visibility controls.
239  // Criterias to select a pad is:
240  // for smd pads: the footprint parent must be visible, and pads on the corresponding
241  // board side must be visible
242  // if pad is a thru hole, then it can be visible when its parent footprint is not.
243  // for through pads: pads on Front or Back board sides must be visible
244  pad = static_cast<PAD*>( item );
245 
246  if( (pad->GetAttribute() != PAD_ATTRIB::SMD) &&
247  (pad->GetAttribute() != PAD_ATTRIB::CONN) ) // a hole is present, so multiple layers
248  {
249  // proceed to the common tests below, but without the parent footprint test,
250  // by leaving footprint==NULL, but having pad != null
251  pad_through = true;
252  }
253  else // smd, so use pads test after footprint test
254  {
255  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
256  }
257 
258  break;
259 
260  case PCB_VIA_T: // vias are on many layers, so layer test is specific
261  via = static_cast<VIA*>( item );
262  break;
263 
264  case PCB_TRACE_T:
265  case PCB_ARC_T:
266  if( m_Guide->IgnoreTracks() )
267  goto exit;
268  break;
269 
270  case PCB_FP_ZONE_T:
271  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
272 
273  // Fallthrough to get the zone as well
275 
276  case PCB_ZONE_T:
277  zone = static_cast<ZONE*>( item );
278  break;
279 
280  case PCB_TEXT_T:
281  break;
282 
283  case PCB_SHAPE_T:
284  shape = static_cast<PCB_SHAPE*>( item );
285  break;
286 
287  case PCB_DIM_ALIGNED_T:
288  case PCB_DIM_CENTER_T:
290  case PCB_DIM_LEADER_T:
291  dimension = static_cast<DIMENSION_BASE*>( item );
292  break;
293 
294  case PCB_TARGET_T:
295  break;
296 
297  case PCB_FP_TEXT_T:
298  {
299  FP_TEXT *text = static_cast<FP_TEXT*>( item );
300  if( m_Guide->IgnoreHiddenFPText() && !text->IsVisible() )
301  goto exit;
302 
303  if( m_Guide->IgnoreFPTextOnBack() && IsBackLayer( text->GetLayer() ) )
304  goto exit;
305 
306  if( m_Guide->IgnoreFPTextOnFront() && IsFrontLayer( text->GetLayer() ) )
307  goto exit;
308 
309  /* The three text types have different criteria: reference
310  * and value have their own ignore flags; user text instead
311  * follows their layer visibility. Checking this here is
312  * simpler than later (when layer visibility is checked for
313  * other entities) */
314 
315  switch( text->GetType() )
316  {
318  if( m_Guide->IgnoreFPReferences() )
319  goto exit;
320  break;
321 
323  if( m_Guide->IgnoreFPValues() )
324  goto exit;
325  break;
326 
328  if( !m_Guide->IsLayerVisible( text->GetLayer() )
330  goto exit;
331  break;
332  }
333 
334  // Extract the footprint since it could be hidden
335  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
336  }
337  break;
338 
339  case PCB_FP_SHAPE_T:
340  shape = static_cast<FP_SHAPE*>( item );
341  break;
342 
343  case PCB_FOOTPRINT_T:
344  footprint = static_cast<FOOTPRINT*>( item );
345  break;
346 
347  case PCB_GROUP_T:
348  group = static_cast<PCB_GROUP*>( item );
349  break;
350 
351  case PCB_MARKER_T:
352  marker = static_cast<PCB_MARKER*>( item );
353  break;
354 
355  default:
356  break;
357  }
358 
359  // common tests:
360 
361  if( footprint ) // true from case PCB_PAD_T, PCB_FP_TEXT_T, or PCB_FOOTPRINT_T
362  {
363  if( m_Guide->IgnoreFootprintsOnBack() && ( footprint->GetLayer() == B_Cu) )
364  goto exit;
365 
366  if( m_Guide->IgnoreFootprintsOnFront() && ( footprint->GetLayer() == F_Cu) )
367  goto exit;
368  }
369 
370  // Pads are not sensitive to the layer visibility controls.
371  // They all have their own separate visibility controls
372  // skip them if not visible
373  if( pad )
374  {
375  if( m_Guide->IgnorePads() )
376  goto exit;
377 
378  if( ! pad_through )
379  {
380  if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
381  goto exit;
382 
383  if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
384  goto exit;
385  }
386  }
387 
388  if( marker )
389  {
390  // Markers are not sensitive to the layer
391  if( marker->HitTest( m_refPos ) )
392  Append( item );
393 
394  goto exit;
395  }
396 
397  if( group )
398  {
399  // Groups are not sensitive to the layer ... ?
400  if( group->HitTest( m_refPos ) )
401  Append( item );
402 
403  goto exit;
404  }
405 
406  if( via )
407  {
408  auto type = via->GetViaType();
409 
410  if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
412  || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
413  {
414  goto exit;
415  }
416  }
417 
419  {
420  PCB_LAYER_ID layer = item->GetLayer();
421 
422  // footprints and their subcomponents: reference, value and pads are not sensitive
423  // to the layer visibility controls. They all have their own separate visibility
424  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
425  // text in a footprint *is* sensitive to layer visibility but that was already handled.
426 
427  if( via || footprint || pad || m_Guide->IsLayerVisible( layer )
429  {
430  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
431  {
432  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
433  {
434  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
435 
436  if( zone )
437  {
438  bool testFill = !m_Guide->IgnoreZoneFills();
439 
440  if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
441  || zone->HitTestForEdge( m_refPos, accuracy )
442  || ( testFill && zone->HitTestFilledArea( layer, m_refPos ) ) )
443  {
444  Append( item );
445  goto exit;
446  }
447  }
448  else if( item->Type() == PCB_FOOTPRINT_T )
449  {
450  if( footprint->HitTest( m_refPos, accuracy )
451  && footprint->HitTestAccurate( m_refPos, accuracy ) )
452  {
453  Append( item );
454  goto exit;
455  }
456  }
457  else if( shape )
458  {
459  if( shape->HitTest( m_refPos, accuracy ) )
460  {
461  Append( shape );
462  goto exit;
463  }
464  }
465  else if( dimension )
466  {
467  // Dimensions feel particularly hard to select, probably due to their
468  // noisy shape making it feel like they should have a larger bounary.
469  if( dimension->HitTest( m_refPos, KiROUND( accuracy * 1.5 ) ) )
470  {
471  Append( dimension );
472  goto exit;
473  }
474  }
475  else
476  {
477  if( item->HitTest( m_refPos, accuracy ) )
478  {
479  Append( item );
480  goto exit;
481  }
482  }
483  }
484  }
485  }
486  }
487 
488  if( m_Guide->IncludeSecondary() )
489  {
490  // for now, "secondary" means "tolerate any layer". It has
491  // no effect on other criteria, since there is a separate "ignore" control for
492  // those in the COLLECTORS_GUIDE
493 
494  PCB_LAYER_ID layer = item->GetLayer();
495 
496  // footprints and their subcomponents: reference, value and pads are not sensitive
497  // to the layer visibility controls. They all have their own separate visibility
498  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
499  // text in a footprint *is* sensitive to layer visibility but that was already handled.
500 
501  if( via || footprint || pad || zone || m_Guide->IsLayerVisible( layer )
503  {
504  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
505  {
506  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
507  {
508  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
509 
510  if( zone )
511  {
512  bool testFill = !m_Guide->IgnoreZoneFills();
513 
514  if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
515  || zone->HitTestForEdge( m_refPos, accuracy )
516  || ( testFill && zone->HitTestFilledArea( layer, m_refPos ) ) )
517  {
518  Append2nd( item );
519  goto exit;
520  }
521  }
522  else if( item->Type() == PCB_FOOTPRINT_T )
523  {
524  if( footprint->HitTest( m_refPos, accuracy )
525  && footprint->HitTestAccurate( m_refPos, accuracy ) )
526  {
527  Append2nd( item );
528  goto exit;
529  }
530  }
531  else if( shape )
532  {
533  if( shape->HitTest( m_refPos, accuracy ) )
534  {
535  Append2nd( shape );
536  goto exit;
537  }
538  }
539  else if( dimension )
540  {
541  // Dimensions feels particularly hard to select, probably due to their
542  // noisy shape making it feel like they should have a larger bounary.
543  if( dimension->HitTest( m_refPos, KiROUND( accuracy * 1.5 ) ) )
544  {
545  Append2nd( dimension );
546  goto exit;
547  }
548  }
549  else
550  {
551  if( item->HitTest( m_refPos, 0 ) )
552  {
553  Append2nd( item );
554  goto exit;
555  }
556  }
557  }
558  }
559  }
560  }
561 
562 exit:
563  return SEARCH_RESULT::CONTINUE; // always when collecting
564 }
565 
566 
567 void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
568  const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide )
569 {
570  Empty(); // empty the collection, primary criteria list
571  Empty2nd(); // empty the collection, secondary criteria list
572 
573  // remember guide, pass it to Inspect()
574  SetGuide( &aGuide );
575 
576  SetScanTypes( aScanList );
577 
578  // remember where the snapshot was taken from and pass refPos to
579  // the Inspect() function.
580  SetRefPos( aRefPos );
581 
582  aItem->Visit( m_inspector, NULL, m_scanTypes );
583 
584  // record the length of the primary list before concatenating on to it.
585  m_PrimaryLength = m_list.size();
586 
587  // append 2nd list onto end of the first list
588  for( unsigned i = 0; i<m_List2nd.size(); ++i )
589  Append( m_List2nd[i] );
590 
591  Empty2nd();
592 }
593 
594 
596 {
597  // The Visit() function only visits the testItem if its type was in the
598  // the scanList, so therefore we can collect anything given to us here.
599  Append( testItem );
600 
601  return SEARCH_RESULT::CONTINUE; // always when collecting
602 }
603 
604 
605 void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
606 {
607  Empty(); // empty any existing collection
608 
609  aBoard->Visit( m_inspector, NULL, aScanList );
610 }
611 
612 
614 {
615  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
616 
617  if( item->IsOnLayer( m_layer_id ) )
618  Append( testItem );
619 
621 }
622 
623 
624 void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
625 {
626  Empty();
627 
628  aBoard->Visit( m_inspector, NULL, aScanList );
629 }
void Empty()
Clear the list.
Definition: collector.h:95
virtual bool IsLayerLocked(PCB_LAYER_ID layer) const =0
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:91
static const KICAD_T FootprintItems[]
A scan list for primary footprint items.
Definition: collectors.h:294
static const KICAD_T BoardLevelItems[]
A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT,...
Definition: collectors.h:279
Definition: track.h:343
virtual bool IgnoreBlindBuriedVias() const =0
class ALIGNED_DIMENSION, a linear dimension (graphic item)
Definition: typeinfo.h:100
class LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
static const KICAD_T AllBoardItems[]
A scan list for all editable board items.
Definition: collectors.h:268
static const KICAD_T Tracks[]
A scan list for only TRACKs.
Definition: collectors.h:299
static const KICAD_T Footprints[]
A scan list for only FOOTPRINTs.
Definition: collectors.h:284
SEARCH_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the iterate function.
Definition: collectors.cpp:613
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:108
void SetScanTypes(const KICAD_T *scanTypes)
Record the list of KICAD_T types to consider for collection by the Inspect() function.
Definition: collector.h:220
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:50
void Collect(BOARD_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:567
virtual double OnePixelInIU() const =0
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
class CENTER_DIMENSION, a center point marking (graphic item)
Definition: typeinfo.h:102
virtual bool IgnoreFootprintsOnBack() const =0
Like smd, does not appear on the solder paste layer (default)
virtual bool IgnoreZoneFills() const =0
Smd pad, appears on the solder paste layer (default)
virtual bool IgnoreNonVisibleLayers() const =0
void Append2nd(BOARD_ITEM *item)
Definition: collectors.h:331
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
virtual PCB_LAYER_ID GetPreferredLayer() const =0
virtual bool IgnoreFPTextOnFront() const =0
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Tests a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:624
PCB_LAYER_ID m_layer_id
Definition: collectors.h:649
virtual bool IgnoreTracks() const =0
std::vector< BOARD_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
Definition: collectors.h:250
virtual bool IgnoreFootprintsOnFront() const =0
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
class PAD, a pad in a footprint
Definition: typeinfo.h:89
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
virtual bool IgnoreMicroVias() const =0
static const KICAD_T PadsOrTracks[]
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:289
int m_PrimaryLength
The number of items that were originally in the primary list before the m_List2nd was concatenated on...
Definition: collectors.h:261
virtual bool IgnoreHiddenFPText() const =0
virtual bool IgnorePreferredLayer() const =0
Provide wildcard behavior regarding the preferred layer.
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy=0) const
Test if the given wxPoint is within the bounds of a filled area of this zone.
Definition: zone.cpp:504
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a corner.
Definition: zone.cpp:423
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
This file contains miscellaneous commonly used macros and functions.
virtual bool IgnorePadsOnFront() const =0
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition: collector.h:105
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:341
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const
Test if aPosition is contained within or on the bounding box of an item.
Definition: eda_item.h:275
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: pcb_shape.cpp:642
SEARCH_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
Definition: collectors.cpp:595
INSPECTOR_FUNC m_inspector
Definition: collector.h:258
PCB_LAYER_ID
A quick note on layer IDs:
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:231
#define NULL
void SetRefPos(const wxPoint &aRefPos)
Definition: collector.h:225
wxPoint m_refPos
Definition: collector.h:259
static const KICAD_T Zones[]
A scan list for zones outlines only.
Definition: collectors.h:273
const wxString & GetReference() const
Definition: footprint.h:426
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
class ZONE, a copper pour area
Definition: typeinfo.h:105
const COLLECTORS_GUIDE * m_Guide
Determines which items are to be collected by Inspect()
Definition: collectors.h:255
const KICAD_T * m_scanTypes
Definition: collector.h:257
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Collect BOARD_ITEM objects using this class's Inspector method, which does the collection.
Definition: collectors.cpp:605
virtual bool IgnoreThroughVias() const =0
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
static const KICAD_T LockableItems[]
A scan list for TRACKs, VIAs, FOOTPRINTs.
Definition: collectors.h:304
static const KICAD_T DraggableItems[]
A scan list for items that can be dragged.
Definition: collectors.h:314
virtual bool IgnoreFPTextOnBack() const =0
virtual bool IsLocked() const
Definition: board_item.h:249
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:98
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a segment defined by 2 corners.
Definition: zone.cpp:437
static const KICAD_T Dimensions[]
A scan list for dimensions.
Definition: collectors.h:309
virtual bool IgnorePads() const
Definition: collectors.h:153
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: pcb_marker.h:75
class ZONE, managed by a footprint
Definition: typeinfo.h:94
virtual bool IgnoreFPValues() const =0
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: dimension.cpp:367
virtual bool IsLayerVisible(PCB_LAYER_ID layer) const =0
virtual bool IgnoreFPReferences() const =0
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
Definition: typeinfo.h:103
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
virtual bool IgnorePadsOnBack() const =0
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: footprint.cpp:904
An abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR, telling GENERAL_COLLEC...
Definition: collectors.h:60
virtual bool IgnoreLockedItems() const =0
virtual bool IgnoreLockedLayers() const =0
Definition: pad.h:60
SEARCH_RESULT
Definition: eda_item.h:41
virtual bool IncludeSecondary() const =0
Determine if the secondary criteria or 2nd choice items should be included.
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
Abstract dimension API.
Definition: dimension.h:95
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173
SEARCH_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
Definition: collectors.cpp:157
bool HitTestAccurate(const wxPoint &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:911
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163