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 <class_pcb_group.h>
36 #include <macros.h>
37 #include <math/util.h> // for KiROUND
38 
39 
40 /* This module contains out of line member functions for classes given in
41  * collectors.h. Those classes augment the functionality of class PCB_EDIT_FRAME.
42  */
43 
44 
46  // there are some restrictions on the order of items in the general case.
47  // all items in m_Drawings for instance should be contiguous.
48  // *** all items in a same list (shown here) must be contiguous ****
49  PCB_MARKER_T, // in m_markers
50  PCB_TEXT_T, // in m_drawings
51  PCB_LINE_T, // in m_drawings
52  PCB_DIM_ALIGNED_T, // in m_drawings
53  PCB_DIM_CENTER_T, // in m_drawings
54  PCB_DIM_ORTHOGONAL_T, // in m_drawings
55  PCB_DIM_LEADER_T, // in m_drawings
56  PCB_TARGET_T, // in m_drawings
57  PCB_VIA_T, // in m_tracks
58  PCB_TRACE_T, // in m_tracks
59  PCB_ARC_T, // in m_tracks
60  PCB_PAD_T, // in modules
61  PCB_MODULE_TEXT_T, // in modules
62  PCB_MODULE_T, // in m_modules
63  PCB_GROUP_T, // in m_groups
64  PCB_ZONE_AREA_T, // in m_zones
65  EOT
66 };
67 
68 
71  PCB_TEXT_T,
72  PCB_LINE_T,
76  PCB_VIA_T,
77  PCB_ARC_T,
82  EOT
83 };
84 
85 
88  PCB_TEXT_T,
89  PCB_LINE_T,
93  PCB_VIA_T,
95  PCB_ARC_T,
96  PCB_PAD_T,
100  PCB_ZONE_AREA_T, // if it is visible on screen, it should be selectable
101  EOT
102 };
103 
104 
106  PCB_MODULE_T,
107  EOT
108 };
109 
110 
112  PCB_PAD_T,
113  PCB_MODULE_T,
114  EOT
115 };
116 
117 
119  PCB_PAD_T,
120  PCB_VIA_T,
121  PCB_TRACE_T,
122  PCB_ARC_T,
123  EOT
124 };
125 
126 
128  PCB_MODULE_T,
131  PCB_PAD_T,
133  EOT
134  };
135 
136 
140  PCB_PAD_T,
142  EOT
143  };
144 
145 
147  PCB_TRACE_T,
148  PCB_ARC_T,
149  PCB_VIA_T,
150  EOT
151 };
152 
153 
155  PCB_MODULE_T,
156  PCB_GROUP_T, // Can a group be locked?
157  PCB_TRACE_T,
158  PCB_ARC_T,
159  PCB_VIA_T,
160  EOT
161 };
162 
163 
167  EOT
168 };
169 
170 
174  EOT
175 };
176 
177 
178 
179 
181 {
182  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
183  MODULE* module = nullptr;
184  PCB_GROUP* group = nullptr;
185  D_PAD* pad = nullptr;
186  bool pad_through = false;
187  VIA* via = nullptr;
188  MARKER_PCB* marker = nullptr;
189  ZONE_CONTAINER* zone = nullptr;
190  DRAWSEGMENT* drawSegment = nullptr;
191 
192 #if 0 // debugging
193  static int breakhere = 0;
194 
195  switch( item->Type() )
196  {
197  case PCB_PAD_T:
198  {
199  MODULE* m = (MODULE*) item->GetParent();
200 
201  if( m->GetReference() == wxT( "Y2" ) )
202  {
203  breakhere++;
204  }
205  }
206  break;
207 
208  case PCB_VIA_T:
209  breakhere++;
210  break;
211 
212  case PCB_TRACE_T:
213  case PCB_ARC_T:
214  breakhere++;
215  break;
216 
217  case PCB_TEXT_T:
218  breakhere++;
219  break;
220 
221  case PCB_LINE_T:
222  breakhere++;
223  break;
224 
225  case PCB_DIM_ALIGNED_T:
226  breakhere++;
227  break;
228 
229  case PCB_MODULE_TEXT_T:
230  {
231  TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
232 
233  if( tm->GetText() == wxT( "10uH" ) )
234  {
235  breakhere++;
236  }
237  }
238  break;
239 
240  case PCB_MODULE_T:
241  {
242  MODULE* m = (MODULE*) item;
243 
244  if( m->GetReference() == wxT( "C98" ) )
245  {
246  breakhere++;
247  }
248  }
249  break;
250 
251  case PCB_MARKER_T:
252  breakhere++;
253  break;
254 
255  default:
256  breakhere++;
257  break;
258  }
259 
260 #endif
261 
262 
263  switch( item->Type() )
264  {
265  case PCB_PAD_T:
266  // there are pad specific visibility controls.
267  // Criterias to select a pad is:
268  // for smd pads: the module parent must be seen, and pads on the corresponding
269  // board side must be seen
270  // if pad is a thru hole, then it can be visible when its parent module is not.
271  // for through pads: pads on Front or Back board sides must be seen
272  pad = (D_PAD*) item;
273 
274  if( (pad->GetAttribute() != PAD_ATTRIB_SMD) &&
275  (pad->GetAttribute() != PAD_ATTRIB_CONN) ) // a hole is present, so multiple layers
276  {
277  // proceed to the common tests below, but without the parent module test,
278  // by leaving module==NULL, but having pad != null
279  pad_through = true;
280  }
281  else // smd, so use pads test after module test
282  {
283  module = static_cast<MODULE*>( item->GetParent() );
284  }
285 
286  break;
287 
288  case PCB_VIA_T: // vias are on many layers, so layer test is specific
289  via = static_cast<VIA*>( item );
290  break;
291 
292  case PCB_TRACE_T:
293  case PCB_ARC_T:
294  if( m_Guide->IgnoreTracks() )
295  goto exit;
296  break;
297 
299  module = static_cast<MODULE*>( item->GetParent() );
300 
301  // Fallthrough to get the zone as well
303 
304  case PCB_ZONE_AREA_T:
305  zone = static_cast<ZONE_CONTAINER*>( item );
306  break;
307 
308  case PCB_TEXT_T:
309  break;
310 
311  case PCB_LINE_T:
312  drawSegment = static_cast<DRAWSEGMENT*>( item );
313  break;
314 
315  case PCB_DIM_ALIGNED_T:
316  case PCB_DIM_CENTER_T:
318  case PCB_DIM_LEADER_T:
319  break;
320 
321  case PCB_TARGET_T:
322  break;
323 
324  case PCB_MODULE_TEXT_T:
325  {
326  TEXTE_MODULE *text = static_cast<TEXTE_MODULE*>( item );
327  if( m_Guide->IgnoreMTextsMarkedNoShow() && !text->IsVisible() )
328  goto exit;
329 
330  if( m_Guide->IgnoreMTextsOnBack() && IsBackLayer( text->GetLayer() ) )
331  goto exit;
332 
333  if( m_Guide->IgnoreMTextsOnFront() && IsFrontLayer( text->GetLayer() ) )
334  goto exit;
335 
336  /* The three text types have different criteria: reference
337  * and value have their own ignore flags; user text instead
338  * follows their layer visibility. Checking this here is
339  * simpler than later (when layer visibility is checked for
340  * other entities) */
341 
342  switch( text->GetType() )
343  {
345  if( m_Guide->IgnoreModulesRefs() )
346  goto exit;
347  break;
348 
350  if( m_Guide->IgnoreModulesVals() )
351  goto exit;
352  break;
353 
355  if( !m_Guide->IsLayerVisible( text->GetLayer() )
357  goto exit;
358  break;
359  }
360 
361  // Extract the module since it could be hidden
362  module = static_cast<MODULE*>( item->GetParent() );
363  }
364  break;
365 
366  case PCB_MODULE_EDGE_T:
367  drawSegment = static_cast<EDGE_MODULE*>( item );
368  break;
369 
370  case PCB_MODULE_T:
371  module = static_cast<MODULE*>( item );
372  break;
373 
374  case PCB_GROUP_T:
375  group = static_cast<PCB_GROUP*>( item );
376  break;
377 
378  case PCB_MARKER_T:
379  marker = static_cast<MARKER_PCB*>( item );
380  break;
381 
382  default:
383  break;
384  }
385 
386  // common tests:
387 
388  if( module ) // true from case PCB_PAD_T, PCB_MODULE_TEXT_T, or PCB_MODULE_T
389  {
390  if( m_Guide->IgnoreModulesOnBack() && (module->GetLayer() == B_Cu) )
391  goto exit;
392 
393  if( m_Guide->IgnoreModulesOnFront() && (module->GetLayer() == F_Cu) )
394  goto exit;
395  }
396 
397  // Pads are not sensitive to the layer visibility controls.
398  // They all have their own separate visibility controls
399  // skip them if not visible
400  if( pad )
401  {
402  if( m_Guide->IgnorePads() )
403  goto exit;
404 
405  if( ! pad_through )
406  {
407  if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
408  goto exit;
409 
410  if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
411  goto exit;
412  }
413  }
414 
415  if( marker )
416  {
417  // Markers are not sensitive to the layer
418  if( marker->HitTest( m_RefPos ) )
419  Append( item );
420 
421  goto exit;
422  }
423 
424  if( group )
425  {
426  // Groups are not sensitive to the layer ... ?
427  if( group->HitTest( m_RefPos ) )
428  Append( item );
429 
430  goto exit;
431  }
432 
433  if( via )
434  {
435  auto type = via->GetViaType();
436 
437  if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
439  || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
440  {
441  goto exit;
442  }
443  }
444 
446  {
447  PCB_LAYER_ID layer = item->GetLayer();
448 
449  // Modules and their subcomponents: reference, value and pads are not sensitive
450  // to the layer visibility controls. They all have their own separate visibility
451  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
452  // text in module *is* sensitive to layer visibility but that was already handled.
453 
454  if( via || module || pad || m_Guide->IsLayerVisible( layer )
456  {
457  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
458  {
459  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
460  {
461  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
462 
463  if( zone )
464  {
465  bool testFill = !m_Guide->IgnoreZoneFills();
466 
467  if( zone->HitTestForCorner( m_RefPos, accuracy * 2 )
468  || zone->HitTestForEdge( m_RefPos, accuracy )
469  || ( testFill && zone->HitTestFilledArea( layer, m_RefPos ) ) )
470  {
471  Append( item );
472  goto exit;
473  }
474  }
475  else if( item->Type() == PCB_MODULE_T )
476  {
477  if( module->HitTest( m_RefPos, accuracy )
478  && module->HitTestAccurate( m_RefPos, accuracy ) )
479  {
480  Append( item );
481  goto exit;
482  }
483  }
484  else if( drawSegment )
485  {
486  if( drawSegment->HitTest( m_RefPos, accuracy ) )
487  {
488  Append( item );
489  goto exit;
490  }
491  }
492  else
493  {
494  if( item->HitTest( m_RefPos, 0 ) )
495  {
496  Append( item );
497  goto exit;
498  }
499  }
500  }
501  }
502  }
503  }
504 
505  if( m_Guide->IncludeSecondary() )
506  {
507  // for now, "secondary" means "tolerate any layer". It has
508  // no effect on other criteria, since there is a separate "ignore" control for
509  // those in the COLLECTORS_GUIDE
510 
511  PCB_LAYER_ID layer = item->GetLayer();
512 
513  // Modules and their subcomponents: reference, value and pads are not sensitive
514  // to the layer visibility controls. They all have their own separate visibility
515  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
516  // text in module *is* sensitive to layer visibility but that was already handled.
517 
518  if( via || module || pad || zone || m_Guide->IsLayerVisible( layer )
520  {
521  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
522  {
523  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
524  {
525  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
526 
527  if( zone )
528  {
529  bool testFill = !m_Guide->IgnoreZoneFills();
530 
531  if( zone->HitTestForCorner( m_RefPos, accuracy * 2 )
532  || zone->HitTestForEdge( m_RefPos, accuracy )
533  || ( testFill && zone->HitTestFilledArea( layer, m_RefPos ) ) )
534  {
535  Append2nd( item );
536  goto exit;
537  }
538  }
539  else if( item->Type() == PCB_MODULE_T )
540  {
541  if( module->HitTest( m_RefPos, accuracy )
542  && module->HitTestAccurate( m_RefPos, accuracy ) )
543  {
544  Append( item );
545  goto exit;
546  }
547  }
548  else if( drawSegment )
549  {
550  if( drawSegment->HitTest( m_RefPos, accuracy ) )
551  {
552  Append( item );
553  goto exit;
554  }
555  }
556  else
557  {
558  if( item->HitTest( m_RefPos, 0 ) )
559  {
560  Append( item );
561  goto exit;
562  }
563  }
564  }
565  }
566  }
567  }
568 
569 exit:
570  return SEARCH_RESULT::CONTINUE; // always when collecting
571 }
572 
573 
574 void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
575  const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide )
576 {
577  Empty(); // empty the collection, primary criteria list
578  Empty2nd(); // empty the collection, secondary criteria list
579 
580  // remember guide, pass it to Inspect()
581  SetGuide( &aGuide );
582 
583  SetScanTypes( aScanList );
584 
585  // remember where the snapshot was taken from and pass refPos to
586  // the Inspect() function.
587  SetRefPos( aRefPos );
588 
589  aItem->Visit( m_inspector, NULL, m_ScanTypes );
590 
591  // record the length of the primary list before concatenating on to it.
592  m_PrimaryLength = m_List.size();
593 
594  // append 2nd list onto end of the first list
595  for( unsigned i = 0; i<m_List2nd.size(); ++i )
596  Append( m_List2nd[i] );
597 
598  Empty2nd();
599 }
600 
601 
603 {
604  // The Visit() function only visits the testItem if its type was in the
605  // the scanList, so therefore we can collect anything given to us here.
606  Append( testItem );
607 
608  return SEARCH_RESULT::CONTINUE; // always when collecting
609 }
610 
611 
612 void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
613 {
614  Empty(); // empty any existing collection
615 
616  aBoard->Visit( m_inspector, NULL, aScanList );
617 }
618 
619 
621 {
622  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
623 
624  if( item->IsOnLayer( m_layer_id ) )
625  Append( testItem );
626 
628 }
629 
630 
631 void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
632 {
633  Empty();
634 
635  aBoard->Visit( m_inspector, NULL, aScanList );
636 }
void Empty()
Function Empty sets the list to empty.
Definition: collector.h:110
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
class ALIGNED_DIMENSION, a linear dimension (graphic item)
Definition: typeinfo.h:101
class LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:102
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:620
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
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:109
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:247
PCB_GROUP is a set of BOARD_ITEMs (i.e., without duplicates)
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:574
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:186
class CENTER_DIMENSION, a center point marking (graphic item)
Definition: typeinfo.h:103
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:391
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:106
void Append2nd(BOARD_ITEM *item)
Definition: collectors.h:340
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:631
PCB_LAYER_ID m_layer_id
Definition: collectors.h:657
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
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:88
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:334
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:444
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:120
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:350
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:602
Markers used to show a drc problem on boards.
INSPECTOR_FUNC m_inspector
Definition: collector.h:62
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:252
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
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
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:612
virtual bool IgnoreThroughVias() const =0
Pad object description.
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:105
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
static const KICAD_T Dimensions[]
A scan list for dimensions.
Definition: collectors.h:323
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:381
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 HitTestFilledArea(PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy=0) const
Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this z...
Definition: class_zone.cpp:472
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:405
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
Definition: typeinfo.h:104
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:63
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:527
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:61
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:180
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:127
Class to handle a set of BOARD_ITEMs.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193