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 <class_board_item.h> // class BOARD_ITEM
27 
28 #include <class_module.h>
29 #include <class_edge_mod.h>
30 #include <class_pad.h>
31 #include <class_track.h>
32 #include <class_marker_pcb.h>
33 #include <class_zone.h>
34 #include <class_drawsegment.h>
35 #include <macros.h>
36 #include <math/util.h> // for KiROUND
37 
38 
39 /* This module contains out of line member functions for classes given in
40  * collectors.h. Those classes augment the functionality of class PCB_EDIT_FRAME.
41  */
42 
43 
45  // there are some restrictions on the order of items in the general case.
46  // all items in m_Drawings for instance should be contiguous.
47  // *** all items in a same list (shown here) must be contiguous ****
48  PCB_MARKER_T, // in m_markers
49  PCB_TEXT_T, // in m_Drawings
50  PCB_LINE_T, // in m_Drawings
51  PCB_DIMENSION_T, // in m_Drawings
52  PCB_TARGET_T, // in m_Drawings
53  PCB_VIA_T, // in m_Tracks
54  PCB_TRACE_T, // in m_Tracks
55  PCB_ARC_T, // in m_Tracks
56  PCB_PAD_T, // in modules
57  PCB_MODULE_TEXT_T, // in modules
58  PCB_MODULE_T, // in m_Modules
59  PCB_ZONE_AREA_T, // in m_ZoneDescriptorList
60  EOT
61 };
62 
63 
66  PCB_TEXT_T,
67  PCB_LINE_T,
70  PCB_VIA_T,
71  PCB_ARC_T,
75  EOT
76 };
77 
78 
81  PCB_TEXT_T,
82  PCB_LINE_T,
85  PCB_VIA_T,
87  PCB_ARC_T,
88  PCB_PAD_T,
91  PCB_ZONE_AREA_T, // if it is visible on screen, it should be selectable
92  EOT
93 };
94 
95 
98  EOT
99 };
100 
101 
103  PCB_PAD_T,
104  PCB_MODULE_T,
105  EOT
106 };
107 
108 
110  PCB_PAD_T,
111  PCB_VIA_T,
112  PCB_TRACE_T,
113  PCB_ARC_T,
114  EOT
115 };
116 
117 
119  PCB_MODULE_T,
122  PCB_PAD_T,
124  EOT
125  };
126 
127 
131  PCB_PAD_T,
133  EOT
134  };
135 
136 
138  PCB_TRACE_T,
139  PCB_ARC_T,
140  PCB_VIA_T,
141  EOT
142 };
143 
144 
146  PCB_MODULE_T,
147  PCB_TRACE_T,
148  PCB_ARC_T,
149  PCB_VIA_T,
150  EOT
151 };
152 
153 
157  EOT
158 };
159 
160 
161 
163 {
164  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
165  MODULE* module = nullptr;
166  D_PAD* pad = nullptr;
167  bool pad_through = false;
168  VIA* via = nullptr;
169  MARKER_PCB* marker = nullptr;
170  ZONE_CONTAINER* zone = nullptr;
171  DRAWSEGMENT* drawSegment = nullptr;
172 
173 #if 0 // debugging
174  static int breakhere = 0;
175 
176  switch( item->Type() )
177  {
178  case PCB_PAD_T:
179  {
180  MODULE* m = (MODULE*) item->GetParent();
181 
182  if( m->GetReference() == wxT( "Y2" ) )
183  {
184  breakhere++;
185  }
186  }
187  break;
188 
189  case PCB_VIA_T:
190  breakhere++;
191  break;
192 
193  case PCB_TRACE_T:
194  case PCB_ARC_T:
195  breakhere++;
196  break;
197 
198  case PCB_TEXT_T:
199  breakhere++;
200  break;
201 
202  case PCB_LINE_T:
203  breakhere++;
204  break;
205 
206  case PCB_DIMENSION_T:
207  breakhere++;
208  break;
209 
210  case PCB_MODULE_TEXT_T:
211  {
212  TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
213 
214  if( tm->GetText() == wxT( "10uH" ) )
215  {
216  breakhere++;
217  }
218  }
219  break;
220 
221  case PCB_MODULE_T:
222  {
223  MODULE* m = (MODULE*) item;
224 
225  if( m->GetReference() == wxT( "C98" ) )
226  {
227  breakhere++;
228  }
229  }
230  break;
231 
232  case PCB_MARKER_T:
233  breakhere++;
234  break;
235 
236  default:
237  breakhere++;
238  break;
239  }
240 
241 #endif
242 
243 
244  switch( item->Type() )
245  {
246  case PCB_PAD_T:
247  // there are pad specific visibility controls.
248  // Criterias to select a pad is:
249  // for smd pads: the module parent must be seen, and pads on the corresponding
250  // board side must be seen
251  // if pad is a thru hole, then it can be visible when its parent module is not.
252  // for through pads: pads on Front or Back board sides must be seen
253  pad = (D_PAD*) item;
254 
255  if( (pad->GetAttribute() != PAD_ATTRIB_SMD) &&
256  (pad->GetAttribute() != PAD_ATTRIB_CONN) ) // a hole is present, so multiple layers
257  {
258  // proceed to the common tests below, but without the parent module test,
259  // by leaving module==NULL, but having pad != null
260  pad_through = true;
261  }
262  else // smd, so use pads test after module test
263  {
264  module = static_cast<MODULE*>( item->GetParent() );
265  }
266 
267  break;
268 
269  case PCB_VIA_T: // vias are on many layers, so layer test is specific
270  via = static_cast<VIA*>( item );
271  break;
272 
273  case PCB_TRACE_T:
274  case PCB_ARC_T:
275  if( m_Guide->IgnoreTracks() )
276  goto exit;
277  break;
278 
280  module = static_cast<MODULE*>( item->GetParent() );
281 
282  // Fallthrough to get the zone as well
284 
285  case PCB_ZONE_AREA_T:
286  zone = static_cast<ZONE_CONTAINER*>( item );
287  break;
288 
289  case PCB_TEXT_T:
290  break;
291 
292  case PCB_LINE_T:
293  drawSegment = static_cast<DRAWSEGMENT*>( item );
294  break;
295 
296  case PCB_DIMENSION_T:
297  break;
298 
299  case PCB_TARGET_T:
300  break;
301 
302  case PCB_MODULE_TEXT_T:
303  {
304  TEXTE_MODULE *text = static_cast<TEXTE_MODULE*>( item );
305  if( m_Guide->IgnoreMTextsMarkedNoShow() && !text->IsVisible() )
306  goto exit;
307 
308  if( m_Guide->IgnoreMTextsOnBack() && IsBackLayer( text->GetLayer() ) )
309  goto exit;
310 
311  if( m_Guide->IgnoreMTextsOnFront() && IsFrontLayer( text->GetLayer() ) )
312  goto exit;
313 
314  /* The three text types have different criteria: reference
315  * and value have their own ignore flags; user text instead
316  * follows their layer visibility. Checking this here is
317  * simpler than later (when layer visibility is checked for
318  * other entities) */
319 
320  switch( text->GetType() )
321  {
323  if( m_Guide->IgnoreModulesRefs() )
324  goto exit;
325  break;
326 
328  if( m_Guide->IgnoreModulesVals() )
329  goto exit;
330  break;
331 
333  if( !m_Guide->IsLayerVisible( text->GetLayer() )
335  goto exit;
336  break;
337  }
338 
339  // Extract the module since it could be hidden
340  module = static_cast<MODULE*>( item->GetParent() );
341  }
342  break;
343 
344  case PCB_MODULE_EDGE_T:
345  drawSegment = static_cast<EDGE_MODULE*>( item );
346  break;
347 
348  case PCB_MODULE_T:
349  module = static_cast<MODULE*>( item );
350  break;
351 
352  case PCB_MARKER_T:
353  marker = static_cast<MARKER_PCB*>( item );
354  break;
355 
356  default:
357  break;
358  }
359 
360  // common tests:
361 
362  if( module ) // true from case PCB_PAD_T, PCB_MODULE_TEXT_T, or PCB_MODULE_T
363  {
364  if( m_Guide->IgnoreModulesOnBack() && (module->GetLayer() == B_Cu) )
365  goto exit;
366 
367  if( m_Guide->IgnoreModulesOnFront() && (module->GetLayer() == F_Cu) )
368  goto exit;
369  }
370 
371  // Pads are not sensitive to the layer visibility controls.
372  // They all have their own separate visibility controls
373  // skip them if not visible
374  if( pad )
375  {
376  if( m_Guide->IgnorePads() )
377  goto exit;
378 
379  if( ! pad_through )
380  {
381  if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
382  goto exit;
383 
384  if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
385  goto exit;
386  }
387  }
388 
389  if( marker )
390  {
391  // Markers are not sensitive to the layer
392  if( marker->HitTest( m_RefPos ) )
393  Append( item );
394 
395  goto exit;
396  }
397 
398  if( via )
399  {
400  auto type = via->GetViaType();
401 
402  if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
404  || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
405  {
406  goto exit;
407  }
408  }
409 
411  {
412  PCB_LAYER_ID layer = item->GetLayer();
413 
414  // Modules and their subcomponents: reference, value and pads are not sensitive
415  // to the layer visibility controls. They all have their own separate visibility
416  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
417  // text in module *is* sensitive to layer visibility but that was already handled.
418 
419  if( via || module || pad || m_Guide->IsLayerVisible( layer )
421  {
422  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
423  {
424  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
425  {
426  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
427 
428  if( zone )
429  {
430  bool testFill = !m_Guide->IgnoreZoneFills();
431 
432  if( zone->HitTestForCorner( m_RefPos, accuracy * 2 )
433  || zone->HitTestForEdge( m_RefPos, accuracy )
434  || ( testFill && zone->HitTestFilledArea( layer, m_RefPos ) ) )
435  {
436  Append( item );
437  goto exit;
438  }
439  }
440  else if( item->Type() == PCB_MODULE_T )
441  {
442  if( module->HitTest( m_RefPos, accuracy )
443  && module->HitTestAccurate( m_RefPos, accuracy ) )
444  {
445  Append( item );
446  goto exit;
447  }
448  }
449  else if( drawSegment )
450  {
451  if( drawSegment->HitTest( m_RefPos, accuracy ) )
452  {
453  Append( item );
454  goto exit;
455  }
456  }
457  else
458  {
459  if( item->HitTest( m_RefPos, 0 ) )
460  {
461  Append( item );
462  goto exit;
463  }
464  }
465  }
466  }
467  }
468  }
469 
470  if( m_Guide->IncludeSecondary() )
471  {
472  // for now, "secondary" means "tolerate any layer". It has
473  // no effect on other criteria, since there is a separate "ignore" control for
474  // those in the COLLECTORS_GUIDE
475 
476  PCB_LAYER_ID layer = item->GetLayer();
477 
478  // Modules and their subcomponents: reference, value and pads are not sensitive
479  // to the layer visibility controls. They all have their own separate visibility
480  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
481  // text in module *is* sensitive to layer visibility but that was already handled.
482 
483  if( via || module || pad || zone || m_Guide->IsLayerVisible( layer )
485  {
486  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
487  {
488  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
489  {
490  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
491 
492  if( zone )
493  {
494  bool testFill = !m_Guide->IgnoreZoneFills();
495 
496  if( zone->HitTestForCorner( m_RefPos, accuracy * 2 )
497  || zone->HitTestForEdge( m_RefPos, accuracy )
498  || ( testFill && zone->HitTestFilledArea( layer, m_RefPos ) ) )
499  {
500  Append2nd( item );
501  goto exit;
502  }
503  }
504  else if( item->Type() == PCB_MODULE_T )
505  {
506  if( module->HitTest( m_RefPos, accuracy )
507  && module->HitTestAccurate( m_RefPos, accuracy ) )
508  {
509  Append( item );
510  goto exit;
511  }
512  }
513  else if( drawSegment )
514  {
515  if( drawSegment->HitTest( m_RefPos, accuracy ) )
516  {
517  Append( item );
518  goto exit;
519  }
520  }
521  else
522  {
523  if( item->HitTest( m_RefPos, 0 ) )
524  {
525  Append( item );
526  goto exit;
527  }
528  }
529  }
530  }
531  }
532  }
533 
534 exit:
535  return SEARCH_RESULT::CONTINUE; // always when collecting
536 }
537 
538 
539 void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
540  const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide )
541 {
542  Empty(); // empty the collection, primary criteria list
543  Empty2nd(); // empty the collection, secondary criteria list
544 
545  // remember guide, pass it to Inspect()
546  SetGuide( &aGuide );
547 
548  SetScanTypes( aScanList );
549 
550  // remember where the snapshot was taken from and pass refPos to
551  // the Inspect() function.
552  SetRefPos( aRefPos );
553 
554  aItem->Visit( m_inspector, NULL, m_ScanTypes );
555 
556  // record the length of the primary list before concatenating on to it.
557  m_PrimaryLength = m_List.size();
558 
559  // append 2nd list onto end of the first list
560  for( unsigned i = 0; i<m_List2nd.size(); ++i )
561  Append( m_List2nd[i] );
562 
563  Empty2nd();
564 }
565 
566 
568 {
569  // The Visit() function only visits the testItem if its type was in the
570  // the scanList, so therefore we can collect anything given to us here.
571  Append( testItem );
572 
573  return SEARCH_RESULT::CONTINUE; // always when collecting
574 }
575 
576 
577 void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
578 {
579  Empty(); // empty any existing collection
580 
581  aBoard->Visit( m_inspector, NULL, aScanList );
582 }
583 
584 
586 {
587  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
588 
589  if( item->Type() == PCB_PAD_T ) // multilayer
590  {
591  if( static_cast<D_PAD*>( item )->IsOnLayer( m_layer_id ) )
592  Append( testItem );
593  }
594  else if( item->GetLayer() == m_layer_id )
595  Append( testItem );
596 
598 }
599 
600 
601 void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
602 {
603  Empty();
604 
605  aBoard->Visit( m_inspector, NULL, aScanList );
606 }
void Empty()
Function Empty sets the list to empty.
Definition: collector.h:109
virtual bool IsLayerLocked(PCB_LAYER_ID layer) const =0
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:61
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
static const KICAD_T BoardLevelItems[]
A scan list for all primary board items, omitting items which are subordinate to a MODULE,...
Definition: collectors.h:283
virtual bool IgnoreBlindBuriedVias() const =0
#define KI_FALLTHROUGH
virtual bool IgnoreModulesOnFront() const =0
static const KICAD_T AllBoardItems[]
A scan list for all editable board items.
Definition: collectors.h:267
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
static const KICAD_T Tracks[]
A scan list for only TRACKS.
Definition: collectors.h:313
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const wxPoint &aRefPos) const
Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this z...
Definition: class_zone.cpp:559
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:585
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
static const KICAD_T Modules[]
A scan list for only MODULEs.
Definition: collectors.h:288
void SetScanTypes(const KICAD_T *scanTypes)
Function SetScanTypes records the list of KICAD_T types to consider for collection by the Inspect() f...
Definition: collector.h:201
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:539
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
virtual double OnePixelInIU() const =0
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
bool IsVisible() const
Definition: eda_text.h:185
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:473
virtual bool IgnoreZoneFills() const =0
virtual bool IgnoreNonVisibleLayers() const =0
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:102
void Append2nd(BOARD_ITEM *item)
Definition: collectors.h:335
class TEXTE_PCB, text on a layer
Definition: typeinfo.h:92
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
virtual PCB_LAYER_ID GetPreferredLayer() const =0
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:601
PCB_LAYER_ID m_layer_id
Definition: collectors.h:652
static const KICAD_T AllButZones[]
A scan list for all editable board items, except zones.
Definition: collectors.h:272
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:249
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
virtual bool IgnoreMicroVias() const =0
virtual bool IgnoreModulesVals() const =0
static const KICAD_T PadsOrTracks[]
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:298
int m_PrimaryLength
The number of items that were originally in the primary list before the m_List2nd was concatenated on...
Definition: collectors.h:260
virtual bool IgnorePreferredLayer() const =0
Provide wildcard behavior regarding the preferred layer.
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:332
A single base class (TRACK) represents both tracks and vias, with subclasses for curved tracks (ARC) ...
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
This file contains miscellaneous commonly used macros and functions.
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:433
static const KICAD_T ModulesAndTheirItems[]
A scan list for MODULEs and their items (for Modedit)
Definition: collectors.h:303
virtual bool IgnorePadsOnFront() const =0
void Append(EDA_ITEM *item)
Function Append adds an item to the end of the list.
Definition: collector.h:119
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:345
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: base_struct.h:307
class MODULE, a footprint
Definition: typeinfo.h:89
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:567
Markers used to show a drc problem on boards.
INSPECTOR_FUNC m_inspector
Definition: collector.h:61
PCB_LAYER_ID
A quick note on layer IDs:
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Function IsOnLayer tests to see if this object is on the given layer.
#define NULL
virtual bool IgnoreMTextsOnBack() const =0
void SetRefPos(const wxPoint &aRefPos)
Definition: collector.h:206
TEXT_TYPE GetType() const
static const KICAD_T Zones[]
A scan list for zones outlines only.
Definition: collectors.h:277
const COLLECTORS_GUIDE * m_Guide
Determines which items are to be collected by Inspect()
Definition: collectors.h:254
virtual bool IgnoreMTextsMarkedNoShow() const =0
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:100
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:577
virtual bool IgnoreThroughVias() const =0
Pad object description.
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:101
virtual bool IgnoreModulesRefs() const =0
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
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, MODULES.
Definition: collectors.h:318
bool HitTestAccurate(const wxPoint &aPosition, int aAccuracy=0) const
Tests if a point is inside the bounding polygon of the module.
virtual bool IsLocked() const
Function IsLocked.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
static const KICAD_T PadsOrModules[]
A scan list for PADs or MODULEs.
Definition: collectors.h:293
Class to handle a graphic segment.
virtual bool IgnorePads() const
Definition: collectors.h:152
static const KICAD_T ModuleItems[]
A scan list for primary module items.
Definition: collectors.h:308
VIATYPE GetViaType() const
Definition: class_track.h:368
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
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
virtual bool IsLayerVisible(PCB_LAYER_ID layer) const =0
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.
Definition: class_zone.cpp:487
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
virtual bool IgnorePadsOnBack() const =0
wxPoint m_RefPos
Definition: collector.h:62
An abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR, telling GENERAL_COLLEC...
Definition: collectors.h:59
virtual bool IgnoreLockedItems() const =0
class ZONE_CONTAINER, managed by a footprint
Definition: typeinfo.h:95
virtual bool IgnoreLockedLayers() const =0
SEARCH_RESULT
Definition: base_struct.h:51
std::vector< EDA_ITEM * > m_List
Definition: collector.h:58
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
Definition: class_pad.h:499
virtual bool IgnoreModulesOnBack() const =0
virtual bool IgnoreMTextsOnFront() const =0
EDGE_MODULE class definition.
class DRAWSEGMENT, a segment not on copper layers
Definition: typeinfo.h:91
virtual bool IncludeSecondary() const =0
Determine if the secondary criteria or 2nd choice items should be included.
BOARD_ITEM_CONTAINER * GetParent() const
const KICAD_T * m_ScanTypes
Definition: collector.h:60
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
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:162
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:126
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193