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 <math/util.h> // for KiROUND
36 
37 
38 /* This module contains out of line member functions for classes given in
39  * collectors.h. Those classes augment the functionality of class PCB_EDIT_FRAME.
40  */
41 
42 
44  // there are some restrictions on the order of items in the general case.
45  // all items in m_Drawings for instance should be contiguous.
46  // *** all items in a same list (shown here) must be contiguous ****
47  PCB_MARKER_T, // in m_markers
48  PCB_TEXT_T, // in m_Drawings
49  PCB_LINE_T, // in m_Drawings
50  PCB_DIMENSION_T, // in m_Drawings
51  PCB_TARGET_T, // in m_Drawings
52  PCB_VIA_T, // in m_Tracks
53  PCB_TRACE_T, // in m_Tracks
54  PCB_ARC_T, // in m_Tracks
55  PCB_PAD_T, // in modules
56  PCB_MODULE_TEXT_T, // in modules
57  PCB_MODULE_T, // in m_Modules
58  PCB_ZONE_AREA_T, // in m_ZoneDescriptorList
59  EOT
60 };
61 
62 
65  PCB_TEXT_T,
66  PCB_LINE_T,
69  PCB_VIA_T,
70  PCB_ARC_T,
74  EOT
75 };
76 
77 
80  PCB_TEXT_T,
81  PCB_LINE_T,
84  PCB_VIA_T,
86  PCB_ARC_T,
87  PCB_PAD_T,
90  PCB_ZONE_AREA_T, // if it is visible on screen, it should be selectable
91  EOT
92 };
93 
94 
97  EOT
98 };
99 
100 
102  PCB_PAD_T,
103  PCB_MODULE_T,
104  EOT
105 };
106 
107 
109  PCB_PAD_T,
110  PCB_VIA_T,
111  PCB_TRACE_T,
112  PCB_ARC_T,
113  EOT
114 };
115 
116 
118  PCB_MODULE_T,
121  PCB_PAD_T,
123  EOT
124  };
125 
126 
130  PCB_PAD_T,
132  EOT
133  };
134 
135 
137  PCB_TRACE_T,
138  PCB_ARC_T,
139  PCB_VIA_T,
140  EOT
141 };
142 
143 
145  PCB_MODULE_T,
146  PCB_TRACE_T,
147  PCB_ARC_T,
148  PCB_VIA_T,
149  EOT
150 };
151 
152 
156  EOT
157 };
158 
159 
160 
162 {
163  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
164  MODULE* module = nullptr;
165  D_PAD* pad = nullptr;
166  bool pad_through = false;
167  VIA* via = nullptr;
168  MARKER_PCB* marker = nullptr;
169  ZONE_CONTAINER* zone = nullptr;
170  DRAWSEGMENT* drawSegment = nullptr;
171 
172 #if 0 // debugging
173  static int breakhere = 0;
174 
175  switch( item->Type() )
176  {
177  case PCB_PAD_T:
178  {
179  MODULE* m = (MODULE*) item->GetParent();
180 
181  if( m->GetReference() == wxT( "Y2" ) )
182  {
183  breakhere++;
184  }
185  }
186  break;
187 
188  case PCB_VIA_T:
189  breakhere++;
190  break;
191 
192  case PCB_TRACE_T:
193  case PCB_ARC_T:
194  breakhere++;
195  break;
196 
197  case PCB_TEXT_T:
198  breakhere++;
199  break;
200 
201  case PCB_LINE_T:
202  breakhere++;
203  break;
204 
205  case PCB_DIMENSION_T:
206  breakhere++;
207  break;
208 
209  case PCB_MODULE_TEXT_T:
210  {
211  TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
212 
213  if( tm->GetText() == wxT( "10uH" ) )
214  {
215  breakhere++;
216  }
217  }
218  break;
219 
220  case PCB_MODULE_T:
221  {
222  MODULE* m = (MODULE*) item;
223 
224  if( m->GetReference() == wxT( "C98" ) )
225  {
226  breakhere++;
227  }
228  }
229  break;
230 
231  case PCB_MARKER_T:
232  breakhere++;
233  break;
234 
235  default:
236  breakhere++;
237  break;
238  }
239 
240 #endif
241 
242 
243  switch( item->Type() )
244  {
245  case PCB_PAD_T:
246  // there are pad specific visibility controls.
247  // Criterias to select a pad is:
248  // for smd pads: the module parent must be seen, and pads on the corresponding
249  // board side must be seen
250  // if pad is a thru hole, then it can be visible when its parent module is not.
251  // for through pads: pads on Front or Back board sides must be seen
252  pad = (D_PAD*) item;
253 
254  if( (pad->GetAttribute() != PAD_ATTRIB_SMD) &&
255  (pad->GetAttribute() != PAD_ATTRIB_CONN) ) // a hole is present, so multiple layers
256  {
257  // proceed to the common tests below, but without the parent module test,
258  // by leaving module==NULL, but having pad != null
259  pad_through = true;
260  }
261  else // smd, so use pads test after module test
262  {
263  module = static_cast<MODULE*>( item->GetParent() );
264  }
265 
266  break;
267 
268  case PCB_VIA_T: // vias are on many layers, so layer test is specific
269  via = static_cast<VIA*>( item );
270  break;
271 
272  case PCB_TRACE_T:
273  case PCB_ARC_T:
274  if( m_Guide->IgnoreTracks() )
275  goto exit;
276  break;
277 
279  module = static_cast<MODULE*>( item->GetParent() );
280  // Fall through
281  case PCB_ZONE_AREA_T:
282  zone = static_cast<ZONE_CONTAINER*>( item );
283  break;
284 
285  case PCB_TEXT_T:
286  break;
287 
288  case PCB_LINE_T:
289  drawSegment = static_cast<DRAWSEGMENT*>( item );
290  break;
291 
292  case PCB_DIMENSION_T:
293  break;
294 
295  case PCB_TARGET_T:
296  break;
297 
298  case PCB_MODULE_TEXT_T:
299  {
300  TEXTE_MODULE *text = static_cast<TEXTE_MODULE*>( item );
301  if( m_Guide->IgnoreMTextsMarkedNoShow() && !text->IsVisible() )
302  goto exit;
303 
304  if( m_Guide->IgnoreMTextsOnBack() && IsBackLayer( text->GetLayer() ) )
305  goto exit;
306 
307  if( m_Guide->IgnoreMTextsOnFront() && IsFrontLayer( text->GetLayer() ) )
308  goto exit;
309 
310  /* The three text types have different criteria: reference
311  * and value have their own ignore flags; user text instead
312  * follows their layer visibility. Checking this here is
313  * simpler than later (when layer visibility is checked for
314  * other entities) */
315 
316  switch( text->GetType() )
317  {
319  if( m_Guide->IgnoreModulesRefs() )
320  goto exit;
321  break;
322 
324  if( m_Guide->IgnoreModulesVals() )
325  goto exit;
326  break;
327 
329  if( !m_Guide->IsLayerVisible( text->GetLayer() )
331  goto exit;
332  break;
333  }
334 
335  // Extract the module since it could be hidden
336  module = static_cast<MODULE*>( item->GetParent() );
337  }
338  break;
339 
340  case PCB_MODULE_EDGE_T:
341  drawSegment = static_cast<EDGE_MODULE*>( item );
342  break;
343 
344  case PCB_MODULE_T:
345  module = static_cast<MODULE*>( item );
346  break;
347 
348  case PCB_MARKER_T:
349  marker = static_cast<MARKER_PCB*>( item );
350  break;
351 
352  default:
353  break;
354  }
355 
356  // common tests:
357 
358  if( module ) // true from case PCB_PAD_T, PCB_MODULE_TEXT_T, or PCB_MODULE_T
359  {
360  if( m_Guide->IgnoreModulesOnBack() && (module->GetLayer() == B_Cu) )
361  goto exit;
362 
363  if( m_Guide->IgnoreModulesOnFront() && (module->GetLayer() == F_Cu) )
364  goto exit;
365  }
366 
367  // Pads are not sensitive to the layer visibility controls.
368  // They all have their own separate visibility controls
369  // skip them if not visible
370  if( pad )
371  {
372  if( m_Guide->IgnorePads() )
373  goto exit;
374 
375  if( ! pad_through )
376  {
377  if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
378  goto exit;
379 
380  if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
381  goto exit;
382  }
383  }
384 
385  if( marker )
386  {
387  // Markers are not sensitive to the layer
388  if( marker->HitTest( m_RefPos ) )
389  Append( item );
390 
391  goto exit;
392  }
393 
394  if( via )
395  {
396  auto type = via->GetViaType();
397 
398  if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
400  || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
401  {
402  goto exit;
403  }
404  }
405 
407  {
408  PCB_LAYER_ID layer = item->GetLayer();
409 
410  // Modules and their subcomponents: reference, value and pads are not sensitive
411  // to the layer visibility controls. They all have their own separate visibility
412  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
413  // text in module *is* sensitive to layer visibility but that was already handled.
414 
415  if( via || module || pad || m_Guide->IsLayerVisible( layer )
417  {
418  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
419  {
420  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
421  {
422  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
423 
424  if( zone )
425  {
426  bool testFill = !m_Guide->IgnoreZoneFills();
427 
428  if( zone->HitTestForCorner( m_RefPos, accuracy * 2 )
429  || zone->HitTestForEdge( m_RefPos, accuracy )
430  || ( testFill && zone->HitTestFilledArea( m_RefPos ) ) )
431  {
432  Append( item );
433  goto exit;
434  }
435  }
436  else if( item->Type() == PCB_MODULE_T )
437  {
438  if( module->HitTest( m_RefPos, accuracy )
439  && module->HitTestAccurate( m_RefPos, accuracy ) )
440  {
441  Append( item );
442  goto exit;
443  }
444  }
445  else if( drawSegment )
446  {
447  if( drawSegment->HitTest( m_RefPos, accuracy ) )
448  {
449  Append( item );
450  goto exit;
451  }
452  }
453  else
454  {
455  if( item->HitTest( m_RefPos, 0 ) )
456  {
457  Append( item );
458  goto exit;
459  }
460  }
461  }
462  }
463  }
464  }
465 
466  if( m_Guide->IncludeSecondary() )
467  {
468  // for now, "secondary" means "tolerate any layer". It has
469  // no effect on other criteria, since there is a separate "ignore" control for
470  // those in the COLLECTORS_GUIDE
471 
472  PCB_LAYER_ID layer = item->GetLayer();
473 
474  // Modules and their subcomponents: reference, value and pads are not sensitive
475  // to the layer visibility controls. They all have their own separate visibility
476  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
477  // text in module *is* sensitive to layer visibility but that was already handled.
478 
479  if( via || module || pad || zone || m_Guide->IsLayerVisible( layer )
481  {
482  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
483  {
484  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
485  {
486  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
487 
488  if( zone )
489  {
490  bool testFill = !m_Guide->IgnoreZoneFills();
491 
492  if( zone->HitTestForCorner( m_RefPos, accuracy * 2 )
493  || zone->HitTestForEdge( m_RefPos, accuracy )
494  || ( testFill && zone->HitTestFilledArea( m_RefPos ) ) )
495  {
496  Append2nd( item );
497  goto exit;
498  }
499  }
500  else if( item->Type() == PCB_MODULE_T )
501  {
502  if( module->HitTest( m_RefPos, accuracy )
503  && module->HitTestAccurate( m_RefPos, accuracy ) )
504  {
505  Append( item );
506  goto exit;
507  }
508  }
509  else if( drawSegment )
510  {
511  if( drawSegment->HitTest( m_RefPos, accuracy ) )
512  {
513  Append( item );
514  goto exit;
515  }
516  }
517  else
518  {
519  if( item->HitTest( m_RefPos, 0 ) )
520  {
521  Append( item );
522  goto exit;
523  }
524  }
525  }
526  }
527  }
528  }
529 
530 exit:
531  return SEARCH_RESULT::CONTINUE; // always when collecting
532 }
533 
534 
535 void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
536  const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide )
537 {
538  Empty(); // empty the collection, primary criteria list
539  Empty2nd(); // empty the collection, secondary criteria list
540 
541  // remember guide, pass it to Inspect()
542  SetGuide( &aGuide );
543 
544  SetScanTypes( aScanList );
545 
546  // remember where the snapshot was taken from and pass refPos to
547  // the Inspect() function.
548  SetRefPos( aRefPos );
549 
550  aItem->Visit( m_inspector, NULL, m_ScanTypes );
551 
552  // record the length of the primary list before concatenating on to it.
553  m_PrimaryLength = m_List.size();
554 
555  // append 2nd list onto end of the first list
556  for( unsigned i = 0; i<m_List2nd.size(); ++i )
557  Append( m_List2nd[i] );
558 
559  Empty2nd();
560 }
561 
562 
564 {
565  // The Visit() function only visits the testItem if its type was in the
566  // the scanList, so therefore we can collect anything given to us here.
567  Append( testItem );
568 
569  return SEARCH_RESULT::CONTINUE; // always when collecting
570 }
571 
572 
573 void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
574 {
575  Empty(); // empty any existing collection
576 
577  aBoard->Visit( m_inspector, NULL, aScanList );
578 }
579 
580 
582 {
583  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
584 
585  if( item->Type() == PCB_PAD_T ) // multilayer
586  {
587  if( static_cast<D_PAD*>( item )->IsOnLayer( m_layer_id ) )
588  Append( testItem );
589  }
590  else if( item->GetLayer() == m_layer_id )
591  Append( testItem );
592 
594 }
595 
596 
597 void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
598 {
599  Empty();
600 
601  aBoard->Visit( m_inspector, NULL, aScanList );
602 }
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:60
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
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
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:581
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:535
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:170
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:585
virtual bool IgnoreZoneFills() const =0
virtual bool IgnoreNonVisibleLayers() const =0
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:62
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
bool HitTestFilledArea(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:684
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:597
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:449
Definitions for tracks, vias and zones.
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:436
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:332
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:563
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:63
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:573
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:416
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:61
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166
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:599
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
Module description (excepted pads)
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:54
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:746
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:161
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212