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 
148 
149 
151 {
152  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
153  FOOTPRINT* footprint = nullptr;
154  PCB_GROUP* group = nullptr;
155  PAD* pad = nullptr;
156  bool pad_through = false;
157  VIA* via = nullptr;
158  PCB_MARKER* marker = nullptr;
159  ZONE* zone = nullptr;
160  PCB_SHAPE* shape = nullptr;
161  DIMENSION_BASE* dimension = nullptr;
162 
163 #if 0 // debugging
164  static int breakhere = 0;
165 
166  switch( item->Type() )
167  {
168  case PCB_PAD_T:
169  {
170  FOOTPRINT* footprint = (FOOTPRINT*) item->GetParent();
171 
172  if( footprint->GetReference() == wxT( "Y2" ) )
173  breakhere++;
174  }
175  break;
176 
177  case PCB_VIA_T:
178  breakhere++;
179  break;
180 
181  case PCB_TRACE_T:
182  case PCB_ARC_T:
183  breakhere++;
184  break;
185 
186  case PCB_TEXT_T:
187  breakhere++;
188  break;
189 
190  case PCB_SHAPE_T:
191  breakhere++;
192  break;
193 
194  case PCB_DIM_ALIGNED_T:
195  breakhere++;
196  break;
197 
198  case PCB_FP_TEXT_T:
199  {
200  FP_TEXT* fpText = (FP_TEXT*) item;
201 
202  if( fpText->GetText() == wxT( "10uH" ) )
203  breakhere++;
204  }
205  break;
206 
207  case PCB_FOOTPRINT_T:
208  {
209  FOOTPRINT* footprint = (FOOTPRINT*) item;
210 
211  if( footprint->GetReference() == wxT( "C98" ) )
212  breakhere++;
213  }
214  break;
215 
216  case PCB_MARKER_T:
217  breakhere++;
218  break;
219 
220  default:
221  breakhere++;
222  break;
223  }
224 
225 #endif
226 
227 
228  switch( item->Type() )
229  {
230  case PCB_PAD_T:
231  // there are pad specific visibility controls.
232  // Criterias to select a pad is:
233  // for smd pads: the footprint parent must be visible, and pads on the corresponding
234  // board side must be visible
235  // if pad is a thru hole, then it can be visible when its parent footprint is not.
236  // for through pads: pads on Front or Back board sides must be visible
237  pad = static_cast<PAD*>( item );
238 
239  if( (pad->GetAttribute() != PAD_ATTRIB_SMD) &&
240  (pad->GetAttribute() != PAD_ATTRIB_CONN) ) // a hole is present, so multiple layers
241  {
242  // proceed to the common tests below, but without the parent footprint test,
243  // by leaving footprint==NULL, but having pad != null
244  pad_through = true;
245  }
246  else // smd, so use pads test after footprint test
247  {
248  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
249  }
250 
251  break;
252 
253  case PCB_VIA_T: // vias are on many layers, so layer test is specific
254  via = static_cast<VIA*>( item );
255  break;
256 
257  case PCB_TRACE_T:
258  case PCB_ARC_T:
259  if( m_Guide->IgnoreTracks() )
260  goto exit;
261  break;
262 
263  case PCB_FP_ZONE_T:
264  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
265 
266  // Fallthrough to get the zone as well
268 
269  case PCB_ZONE_T:
270  zone = static_cast<ZONE*>( item );
271  break;
272 
273  case PCB_TEXT_T:
274  break;
275 
276  case PCB_SHAPE_T:
277  shape = static_cast<PCB_SHAPE*>( item );
278  break;
279 
280  case PCB_DIM_ALIGNED_T:
281  case PCB_DIM_CENTER_T:
283  case PCB_DIM_LEADER_T:
284  dimension = static_cast<DIMENSION_BASE*>( item );
285  break;
286 
287  case PCB_TARGET_T:
288  break;
289 
290  case PCB_FP_TEXT_T:
291  {
292  FP_TEXT *text = static_cast<FP_TEXT*>( item );
293  if( m_Guide->IgnoreHiddenFPText() && !text->IsVisible() )
294  goto exit;
295 
296  if( m_Guide->IgnoreFPTextOnBack() && IsBackLayer( text->GetLayer() ) )
297  goto exit;
298 
299  if( m_Guide->IgnoreFPTextOnFront() && IsFrontLayer( text->GetLayer() ) )
300  goto exit;
301 
302  /* The three text types have different criteria: reference
303  * and value have their own ignore flags; user text instead
304  * follows their layer visibility. Checking this here is
305  * simpler than later (when layer visibility is checked for
306  * other entities) */
307 
308  switch( text->GetType() )
309  {
311  if( m_Guide->IgnoreFPReferences() )
312  goto exit;
313  break;
314 
316  if( m_Guide->IgnoreFPValues() )
317  goto exit;
318  break;
319 
321  if( !m_Guide->IsLayerVisible( text->GetLayer() )
323  goto exit;
324  break;
325  }
326 
327  // Extract the footprint since it could be hidden
328  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
329  }
330  break;
331 
332  case PCB_FP_SHAPE_T:
333  shape = static_cast<FP_SHAPE*>( item );
334  break;
335 
336  case PCB_FOOTPRINT_T:
337  footprint = static_cast<FOOTPRINT*>( item );
338  break;
339 
340  case PCB_GROUP_T:
341  group = static_cast<PCB_GROUP*>( item );
342  break;
343 
344  case PCB_MARKER_T:
345  marker = static_cast<PCB_MARKER*>( item );
346  break;
347 
348  default:
349  break;
350  }
351 
352  // common tests:
353 
354  if( footprint ) // true from case PCB_PAD_T, PCB_FP_TEXT_T, or PCB_FOOTPRINT_T
355  {
356  if( m_Guide->IgnoreFootprintsOnBack() && ( footprint->GetLayer() == B_Cu) )
357  goto exit;
358 
359  if( m_Guide->IgnoreFootprintsOnFront() && ( footprint->GetLayer() == F_Cu) )
360  goto exit;
361  }
362 
363  // Pads are not sensitive to the layer visibility controls.
364  // They all have their own separate visibility controls
365  // skip them if not visible
366  if( pad )
367  {
368  if( m_Guide->IgnorePads() )
369  goto exit;
370 
371  if( ! pad_through )
372  {
373  if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
374  goto exit;
375 
376  if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
377  goto exit;
378  }
379  }
380 
381  if( marker )
382  {
383  // Markers are not sensitive to the layer
384  if( marker->HitTest( m_refPos ) )
385  Append( item );
386 
387  goto exit;
388  }
389 
390  if( group )
391  {
392  // Groups are not sensitive to the layer ... ?
393  if( group->HitTest( m_refPos ) )
394  Append( item );
395 
396  goto exit;
397  }
398 
399  if( via )
400  {
401  auto type = via->GetViaType();
402 
403  if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
405  || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
406  {
407  goto exit;
408  }
409  }
410 
412  {
413  PCB_LAYER_ID layer = item->GetLayer();
414 
415  // footprints and their subcomponents: reference, value and pads are not sensitive
416  // to the layer visibility controls. They all have their own separate visibility
417  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
418  // text in a footprint *is* sensitive to layer visibility but that was already handled.
419 
420  if( via || footprint || pad || m_Guide->IsLayerVisible( layer )
422  {
423  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
424  {
425  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
426  {
427  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
428 
429  if( zone )
430  {
431  bool testFill = !m_Guide->IgnoreZoneFills();
432 
433  if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
434  || zone->HitTestForEdge( m_refPos, accuracy )
435  || ( testFill && zone->HitTestFilledArea( layer, m_refPos ) ) )
436  {
437  Append( item );
438  goto exit;
439  }
440  }
441  else if( item->Type() == PCB_FOOTPRINT_T )
442  {
443  if( footprint->HitTest( m_refPos, accuracy )
444  && footprint->HitTestAccurate( m_refPos, accuracy ) )
445  {
446  Append( item );
447  goto exit;
448  }
449  }
450  else if( shape )
451  {
452  if( shape->HitTest( m_refPos, accuracy ) )
453  {
454  Append( shape );
455  goto exit;
456  }
457  }
458  else if( dimension )
459  {
460  // Dimensions feels particularly hard to select, probably due to their
461  // noisy shape making it feel like they should have a larger bounary.
462  if( dimension->HitTest( m_refPos, KiROUND( accuracy * 1.5 ) ) )
463  {
464  Append( dimension );
465  goto exit;
466  }
467  }
468  else
469  {
470  if( item->HitTest( m_refPos, 0 ) )
471  {
472  Append( item );
473  goto exit;
474  }
475  }
476  }
477  }
478  }
479  }
480 
481  if( m_Guide->IncludeSecondary() )
482  {
483  // for now, "secondary" means "tolerate any layer". It has
484  // no effect on other criteria, since there is a separate "ignore" control for
485  // those in the COLLECTORS_GUIDE
486 
487  PCB_LAYER_ID layer = item->GetLayer();
488 
489  // footprints and their subcomponents: reference, value and pads are not sensitive
490  // to the layer visibility controls. They all have their own separate visibility
491  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
492  // text in a footprint *is* sensitive to layer visibility but that was already handled.
493 
494  if( via || footprint || pad || zone || m_Guide->IsLayerVisible( layer )
496  {
497  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
498  {
499  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
500  {
501  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
502 
503  if( zone )
504  {
505  bool testFill = !m_Guide->IgnoreZoneFills();
506 
507  if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
508  || zone->HitTestForEdge( m_refPos, accuracy )
509  || ( testFill && zone->HitTestFilledArea( layer, m_refPos ) ) )
510  {
511  Append2nd( item );
512  goto exit;
513  }
514  }
515  else if( item->Type() == PCB_FOOTPRINT_T )
516  {
517  if( footprint->HitTest( m_refPos, accuracy )
518  && footprint->HitTestAccurate( m_refPos, accuracy ) )
519  {
520  Append( item );
521  goto exit;
522  }
523  }
524  else if( shape )
525  {
526  if( shape->HitTest( m_refPos, accuracy ) )
527  {
528  Append( shape );
529  goto exit;
530  }
531  }
532  else if( dimension )
533  {
534  // Dimensions feels particularly hard to select, probably due to their
535  // noisy shape making it feel like they should have a larger bounary.
536  if( dimension->HitTest( m_refPos, KiROUND( accuracy * 1.5 ) ) )
537  {
538  Append( dimension );
539  goto exit;
540  }
541  }
542  else
543  {
544  if( item->HitTest( m_refPos, 0 ) )
545  {
546  Append( item );
547  goto exit;
548  }
549  }
550  }
551  }
552  }
553  }
554 
555 exit:
556  return SEARCH_RESULT::CONTINUE; // always when collecting
557 }
558 
559 
560 void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
561  const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide )
562 {
563  Empty(); // empty the collection, primary criteria list
564  Empty2nd(); // empty the collection, secondary criteria list
565 
566  // remember guide, pass it to Inspect()
567  SetGuide( &aGuide );
568 
569  SetScanTypes( aScanList );
570 
571  // remember where the snapshot was taken from and pass refPos to
572  // the Inspect() function.
573  SetRefPos( aRefPos );
574 
575  aItem->Visit( m_inspector, NULL, m_scanTypes );
576 
577  // record the length of the primary list before concatenating on to it.
578  m_PrimaryLength = m_list.size();
579 
580  // append 2nd list onto end of the first list
581  for( unsigned i = 0; i<m_List2nd.size(); ++i )
582  Append( m_List2nd[i] );
583 
584  Empty2nd();
585 }
586 
587 
589 {
590  // The Visit() function only visits the testItem if its type was in the
591  // the scanList, so therefore we can collect anything given to us here.
592  Append( testItem );
593 
594  return SEARCH_RESULT::CONTINUE; // always when collecting
595 }
596 
597 
598 void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
599 {
600  Empty(); // empty any existing collection
601 
602  aBoard->Visit( m_inspector, NULL, aScanList );
603 }
604 
605 
607 {
608  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
609 
610  if( item->IsOnLayer( m_layer_id ) )
611  Append( testItem );
612 
614 }
615 
616 
617 void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
618 {
619  Empty();
620 
621  aBoard->Visit( m_inspector, NULL, aScanList );
622 }
void Empty()
Function Empty sets the list to empty.
Definition: collector.h:113
virtual bool IsLayerLocked(PCB_LAYER_ID layer) const =0
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...
Definition: eda_item.cpp:107
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:354
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
class FP_TEXT, text in a footprint
Definition: typeinfo.h:93
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:606
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
Definition: board_item.h:86
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:237
PCB_GROUP is 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:560
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:192
class CENTER_DIMENSION, a center point marking (graphic item)
Definition: typeinfo.h:103
virtual bool IgnoreFootprintsOnBack() const =0
virtual bool IgnoreZoneFills() const =0
virtual bool IgnoreNonVisibleLayers() const =0
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
void Append2nd(BOARD_ITEM *item)
Definition: collectors.h:326
class PCB_TEXT, text on a layer
Definition: typeinfo.h:92
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Function IsOnLayer tests to see if this object is on the given layer.
Definition: pad.h:544
virtual PCB_LAYER_ID GetPreferredLayer() const =0
virtual bool IgnoreFPTextOnFront() const =0
std::vector< EDA_ITEM * > m_list
Definition: collector.h:57
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:617
PCB_LAYER_ID m_layer_id
Definition: collectors.h:643
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:94
class 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: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
Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this z...
Definition: zone.cpp:503
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
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: zone.cpp:422
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
This file contains miscellaneous commonly used macros and functions.
virtual bool IgnorePadsOnFront() const =0
PAD_ATTR_T GetAttribute() const
Definition: pad.h:348
void Append(EDA_ITEM *item)
Function Append adds an item to the end of the list.
Definition: collector.h:123
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:336
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: eda_item.h:295
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.
Definition: pcb_shape.cpp:620
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:588
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.
Definition: board_item.h:239
#define NULL
void SetRefPos(const wxPoint &aRefPos)
Definition: collector.h:242
TEXT_TYPE GetType() const
Definition: fp_text.h:139
wxPoint m_refPos
Definition: collector.h:62
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Definition: pcb_group.cpp:166
static const KICAD_T Zones[]
A scan list for zones outlines only.
Definition: collectors.h:273
ZONE handles a list of polygons defining a copper zone.
Definition: zone.h:57
class ZONE, a copper pour area
Definition: typeinfo.h:106
const wxString GetReference() const
Function GetReference.
Definition: footprint.h:440
const COLLECTORS_GUIDE * m_Guide
Determines which items are to be collected by Inspect()
Definition: collectors.h:255
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
const KICAD_T * m_scanTypes
Definition: collector.h:60
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:598
virtual bool IgnoreThroughVias() const =0
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:105
class FOOTPRINT, a footprint
Definition: typeinfo.h:89
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
virtual bool IgnoreFPTextOnBack() const =0
virtual bool IsLocked() const
Function IsLocked.
Definition: board_item.h:259
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:99
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: zone.cpp:436
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
Function HitTest tests 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:95
VIATYPE GetViaType() const
Definition: track.h:384
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
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: dimension.cpp:383
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:104
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
virtual bool IgnorePadsOnBack() const =0
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.
Definition: footprint.cpp:816
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:59
SEARCH_RESULT
Definition: eda_item.h:40
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:179
Abstract dimension API.
Definition: dimension.h:95
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:91
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
Definition: board_item.h:185
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:150
bool HitTestAccurate(const wxPoint &aPosition, int aAccuracy=0) const
Tests if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:823
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181