KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
5 * Copyright The 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 <netinfo.h>
30#include <pad.h>
31#include <pcb_track.h>
32#include <pcb_marker.h>
33#include <pcb_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
41const std::vector<KICAD_T> GENERAL_COLLECTOR::AllBoardItems = {
42 PCB_MARKER_T, // in m_markers
43 PCB_TEXT_T, // in m_drawings
44 PCB_REFERENCE_IMAGE_T, // in m_drawings
45 PCB_TEXTBOX_T, // in m_drawings
46 PCB_TABLE_T, // in m_drawings
47 PCB_TABLECELL_T, // in tables
48 PCB_SHAPE_T, // in m_drawings
49 PCB_DIM_ALIGNED_T, // in m_drawings
50 PCB_DIM_CENTER_T, // in m_drawings
51 PCB_DIM_RADIAL_T, // in m_drawings
52 PCB_DIM_ORTHOGONAL_T, // in m_drawings
53 PCB_DIM_LEADER_T, // in m_drawings
54 PCB_TARGET_T, // in m_drawings
55 PCB_VIA_T, // in m_tracks
56 PCB_TRACE_T, // in m_tracks
57 PCB_ARC_T, // in m_tracks
58 PCB_PAD_T, // in footprints
59 PCB_FIELD_T, // in footprints
60 PCB_FOOTPRINT_T, // in m_footprints
61 PCB_GROUP_T, // in m_groups
62 PCB_ZONE_T, // in m_zones
63 PCB_GENERATOR_T // in m_generators
64};
65
66
67const std::vector<KICAD_T> GENERAL_COLLECTOR::BoardLevelItems = {
87};
88
89
90const std::vector<KICAD_T> GENERAL_COLLECTOR::Footprints = {
92};
93
94
95const std::vector<KICAD_T> GENERAL_COLLECTOR::PadsOrTracks = {
100};
101
102
103const std::vector<KICAD_T> GENERAL_COLLECTOR::FootprintItems = {
116 PCB_PAD_T,
120};
121
122
123const std::vector<KICAD_T> GENERAL_COLLECTOR::Tracks = {
125 PCB_ARC_T,
127};
128
129
130const std::vector<KICAD_T> GENERAL_COLLECTOR::Dimensions = {
136};
137
138
139const std::vector<KICAD_T> GENERAL_COLLECTOR::DraggableItems = {
141 PCB_VIA_T,
144};
145
146
148{
149 BOARD_ITEM* boardItem = nullptr;
150 FOOTPRINT* footprint = nullptr;
151 PCB_GROUP* group = nullptr;
152 PAD* pad = nullptr;
153 bool pad_through = false;
154 PCB_VIA* via = nullptr;
155 PCB_MARKER* marker = nullptr;
156 ZONE* zone = nullptr;
157 PCB_FIELD* field = nullptr;
158 PCB_TEXT* text = nullptr;
159 PCB_DIMENSION_BASE* dimension = nullptr;
160 PCB_SHAPE* shape = nullptr;
161
162 switch( aTestItem->Type() )
163 {
164 case PCB_PAD_T:
165 // there are pad specific visibility controls.
166 // Criteria to select a pad is:
167 // for smd pads: the footprint parent must be visible, and pads on the corresponding
168 // board side must be visible
169 // if pad is a thru hole, then it can be visible when its parent footprint is not.
170 // for through pads: pads on Front or Back board sides must be visible
171 pad = static_cast<PAD*>( aTestItem );
172 boardItem = pad;
173
174 if( ( pad->GetAttribute() != PAD_ATTRIB::SMD ) &&
175 ( pad->GetAttribute() != PAD_ATTRIB::CONN ) ) // a hole is present, so multiple layers
176 {
177 // proceed to the common tests below, but without the parent footprint test,
178 // by leaving footprint==NULL, but having pad != null
179 pad_through = true;
180 }
181
182 break;
183
184 case PCB_VIA_T: // vias are on many layers, so layer test is specific
185 via = static_cast<PCB_VIA*>( aTestItem );
186 boardItem = via;
187 break;
188
189 case PCB_TRACE_T:
190 case PCB_ARC_T:
191 if( m_Guide->IgnoreTracks() )
192 return INSPECT_RESULT::CONTINUE;
193
194 boardItem = static_cast<PCB_TRACK*>( aTestItem );
195 break;
196
197 case PCB_ZONE_T:
198 zone = static_cast<ZONE*>( aTestItem );
199
201 return INSPECT_RESULT::CONTINUE;
202
203 boardItem = zone;
204 break;
205
206 case PCB_SHAPE_T:
207 shape = static_cast<PCB_SHAPE*>( aTestItem );
208
210 return INSPECT_RESULT::CONTINUE;
211
212 boardItem = shape;
213 break;
214
215 case PCB_TEXTBOX_T:
216 case PCB_TABLE_T:
217 case PCB_TABLECELL_T:
218 if( m_Guide->IgnoreNoNets() )
219 return INSPECT_RESULT::CONTINUE;
220
221 boardItem = static_cast<BOARD_ITEM*>( aTestItem );
222 break;
223
225 case PCB_DIM_CENTER_T:
226 case PCB_DIM_RADIAL_T:
228 case PCB_DIM_LEADER_T:
229 if( m_Guide->IgnoreNoNets() )
230 return INSPECT_RESULT::CONTINUE;
231
232 dimension = static_cast<PCB_DIMENSION_BASE*>( aTestItem );
233 boardItem = dimension;
234 break;
235
236 case PCB_TARGET_T:
237 if( m_Guide->IgnoreNoNets() )
238 return INSPECT_RESULT::CONTINUE;
239
240 boardItem = static_cast<BOARD_ITEM*>( aTestItem );
241 break;
242
243 case PCB_FIELD_T:
244 if( m_Guide->IgnoreNoNets() )
245 return INSPECT_RESULT::CONTINUE;
246
247 field = static_cast<PCB_FIELD*>( aTestItem );
248
249 if( !field->IsVisible() )
250 return INSPECT_RESULT::CONTINUE;
251
252 if( field->IsReference() && m_Guide->IgnoreFPReferences() )
253 return INSPECT_RESULT::CONTINUE;
254
255 if( field->IsValue() && m_Guide->IgnoreFPValues() )
256 return INSPECT_RESULT::CONTINUE;
257
259
260 case PCB_TEXT_T:
261 if( m_Guide->IgnoreNoNets() )
262 return INSPECT_RESULT::CONTINUE;
263
264 text = static_cast<PCB_TEXT*>( aTestItem );
265 boardItem = text;
266
267 if( text->GetParentFootprint() )
268 {
269 PCB_LAYER_ID layer = text->GetLayer();
270
271 if( m_Guide->IgnoreFPTextOnBack() && IsBackLayer( layer ) )
272 return INSPECT_RESULT::CONTINUE;
273
274 if( m_Guide->IgnoreFPTextOnFront() && IsFrontLayer( layer ) )
275 return INSPECT_RESULT::CONTINUE;
276 }
277
278 break;
279
280 case PCB_FOOTPRINT_T:
281 footprint = static_cast<FOOTPRINT*>( aTestItem );
282 boardItem = footprint;
283 break;
284
285 case PCB_GROUP_T:
286 group = static_cast<PCB_GROUP*>( aTestItem );
287 boardItem = group;
288 break;
289
290 case PCB_MARKER_T:
291 marker = static_cast<PCB_MARKER*>( aTestItem );
292 boardItem = marker;
293 break;
294
295 default:
296 if( aTestItem->IsBOARD_ITEM() )
297 boardItem = static_cast<BOARD_ITEM*>( aTestItem );
298
299 break;
300 }
301
302 if( boardItem && !footprint )
303 footprint = boardItem->GetParentFootprint();
304
305 // common tests:
306
307 if( footprint )
308 {
309 if( m_Guide->IgnoreFootprintsOnBack() && footprint->GetSide() == B_Cu )
310 return INSPECT_RESULT::CONTINUE;
311
312 if( m_Guide->IgnoreFootprintsOnFront() && footprint->GetSide() == F_Cu )
313 return INSPECT_RESULT::CONTINUE;
314 }
315
316 // Pads are not sensitive to the layer visibility controls; they all have their own separate
317 // visibility controls.
318 if( pad )
319 {
320 if( m_Guide->IgnorePads() )
321 return INSPECT_RESULT::CONTINUE;
322
323 if( ! pad_through )
324 {
325 if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
326 return INSPECT_RESULT::CONTINUE;
327
328 if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
329 return INSPECT_RESULT::CONTINUE;
330 }
331 }
332
333 if( marker )
334 {
335 // Markers are not sensitive to the layer
336 if( marker->HitTest( m_refPos ) )
337 Append( aTestItem );
338
339 return INSPECT_RESULT::CONTINUE;
340 }
341
342 if( group )
343 {
344 // Groups are not sensitive to the layer ... ?
345 if( group->HitTest( m_refPos ) )
346 Append( aTestItem );
347
348 return INSPECT_RESULT::CONTINUE;
349 }
350
351 if( via )
352 {
353 auto type = via->GetViaType();
354
355 if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
356 || ( m_Guide->IgnoreBlindBuriedVias() && type == VIATYPE::BLIND_BURIED )
357 || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
358 {
359 return INSPECT_RESULT::CONTINUE;
360 }
361 }
362
363 if( boardItem
364 && ( boardItem->IsOnLayer( m_Guide->GetPreferredLayer() ) )
365 && ( !boardItem->IsLocked() || !m_Guide->IgnoreLockedItems() ) )
366 {
367 // Footprints and their subcomponents: reference, value and pads are not sensitive to the
368 // layer visibility controls; they all have their own separate visibility controls.
369 // For vias, GetLayer() has no meaning, but IsOnLayer() works fine.
370 // User text and fields in a footprint *are* sensitive to layer visibility but they were
371 // already handled.
372
373 int accuracy = m_Guide->Accuracy();
374
375 if( zone )
376 {
377 if( zone->HitTestForCorner( m_refPos, accuracy * 2 ) || zone->HitTestForEdge( m_refPos, accuracy ) )
378 {
379 Append( aTestItem );
380 return INSPECT_RESULT::CONTINUE;
381 }
382 else if( !m_Guide->IgnoreZoneFills() )
383 {
384 for( PCB_LAYER_ID layer : zone->GetLayerSet() )
385 {
386 if( m_Guide->IsLayerVisible( layer ) && zone->HitTestFilledArea( layer, m_refPos ) )
387 {
388 Append( aTestItem );
389 return INSPECT_RESULT::CONTINUE;
390 }
391 }
392 }
393 }
394 else if( aTestItem == footprint )
395 {
396 if( footprint->HitTest( m_refPos, accuracy ) && footprint->HitTestAccurate( m_refPos, accuracy ) )
397 {
398 Append( aTestItem );
399 return INSPECT_RESULT::CONTINUE;
400 }
401 }
402 else if( pad || via )
403 {
404 if( aTestItem->HitTest( m_refPos, accuracy ) )
405 {
406 Append( aTestItem );
407 return INSPECT_RESULT::CONTINUE;
408 }
409 }
410 else
411 {
412 PCB_LAYER_ID layer = boardItem->GetLayer();
413
414 if( m_Guide->IsLayerVisible( layer ) )
415 {
416 if( dimension )
417 {
418 // Dimensions feel particularly hard to select, probably due to their noisy
419 // shape making it feel like they should have a larger boundary.
420 accuracy = KiROUND( accuracy * 1.5 );
421 }
422
423 if( aTestItem->HitTest( m_refPos, accuracy ) )
424 {
425 Append( aTestItem );
426 return INSPECT_RESULT::CONTINUE;
427 }
428 }
429 }
430 }
431
433 && ( !boardItem || !boardItem->IsLocked() || !m_Guide->IgnoreLockedItems() ) )
434 {
435 // For now, "secondary" means "tolerate any visible layer". It has no effect on other
436 // criteria, since there is a separate "ignore" control for those in the COLLECTORS_GUIDE
437
438 // Footprints and their subcomponents: reference, value and pads are not sensitive to the
439 // layer visibility controls; they all have their own separate visibility controls.
440 // For vias, GetLayer() has no meaning, but IsOnLayer() works fine.
441 // User text and fields in a footprint *are* sensitive to layer visibility but they were
442 // already handled.
443
444 int accuracy = m_Guide->Accuracy();
445
446 if( zone )
447 {
448 if( zone->HitTestForCorner( m_refPos, accuracy * 2 ) || zone->HitTestForEdge( m_refPos, accuracy ) )
449 {
450 Append2nd( aTestItem );
451 return INSPECT_RESULT::CONTINUE;
452 }
453 else if( !m_Guide->IgnoreZoneFills() )
454 {
455 for( PCB_LAYER_ID layer : zone->GetLayerSet() )
456 {
457 if( m_Guide->IsLayerVisible( layer ) && zone->HitTestFilledArea( layer, m_refPos ) )
458 {
459 Append2nd( aTestItem );
460 return INSPECT_RESULT::CONTINUE;
461 }
462 }
463 }
464 }
465 else if( aTestItem->Type() == PCB_FOOTPRINT_T )
466 {
467 // Already tested above, but Coverity can't figure that out
468 wxCHECK( footprint, INSPECT_RESULT::CONTINUE );
469
470 if( footprint->HitTest( m_refPos, accuracy ) && footprint->HitTestAccurate( m_refPos, accuracy ) )
471 {
472 Append2nd( aTestItem );
473 return INSPECT_RESULT::CONTINUE;
474 }
475 }
476 else if( pad || via )
477 {
478 if( aTestItem->HitTest( m_refPos, accuracy ) )
479 {
480 Append2nd( aTestItem );
481 return INSPECT_RESULT::CONTINUE;
482 }
483 }
484 else if( boardItem && m_Guide->IsLayerVisible( boardItem->GetLayer() ) )
485 {
486 if( dimension )
487 {
488 // Dimensions feel particularly hard to select, probably due to their noisy shape
489 // making it feel like they should have a larger boundary.
490 accuracy = KiROUND( accuracy * 1.5 );
491 }
492
493 if( aTestItem->HitTest( m_refPos, accuracy ) )
494 {
495 Append2nd( aTestItem );
496 return INSPECT_RESULT::CONTINUE;
497 }
498 }
499 }
500
501 return INSPECT_RESULT::CONTINUE; // always when collecting
502}
503
504
505void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const std::vector<KICAD_T>& aScanTypes,
506 const VECTOR2I& aRefPos, const COLLECTORS_GUIDE& aGuide )
507{
508 Empty(); // empty the collection, primary criteria list
509 Empty2nd(); // empty the collection, secondary criteria list
510
511 // remember guide, pass it to Inspect()
512 SetGuide( &aGuide );
513
514 SetScanTypes( aScanTypes );
515
516 // remember where the snapshot was taken from and pass refPos to
517 // the Inspect() function.
518 SetRefPos( aRefPos );
519
520 wxCHECK_RET( aItem, "" );
521 aItem->Visit( m_inspector, nullptr, m_scanTypes );
522
523 // append 2nd list onto end of the first list
524 for( EDA_ITEM* item : m_List2nd )
525 Append( item );
526
527 Empty2nd();
528}
529
530
532{
533 // The Visit() function only visits the testItem if its type was in the the scanList,
534 // so therefore we can collect anything given to us here.
535 Append( testItem );
536
537 return INSPECT_RESULT::CONTINUE; // always when collecting
538}
539
540
541void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const std::vector<KICAD_T>& aTypes )
542{
543 Empty();
544 aBoard->Visit( m_inspector, nullptr, aTypes );
545}
546
547
549{
550 BOARD_ITEM* item = (BOARD_ITEM*) testItem;
551
552 if( item->IsOnLayer( m_layer_id ) )
553 Append( testItem );
554
555 return INSPECT_RESULT::CONTINUE;
556}
557
558
559void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const std::vector<KICAD_T>& aTypes )
560{
561 Empty();
562 aBoard->Visit( m_inspector, nullptr, aTypes );
563}
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition: box2.h:990
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:232
bool IsLocked() const override
Definition: board_item.cpp:103
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:314
FOOTPRINT * GetParentFootprint() const
Definition: board_item.cpp:97
An abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR telling it what should ...
Definition: collectors.h:54
virtual bool IgnoreThroughVias() const =0
virtual bool IgnoreNoNets() const =0
virtual bool IsLayerVisible(PCB_LAYER_ID layer) const =0
virtual bool IgnoreFPTextOnFront() const =0
virtual bool IgnoreFPTextOnBack() const =0
virtual bool IgnoreLockedItems() const =0
virtual bool IgnoreZoneFills() const =0
virtual bool IgnoreMicroVias() const =0
virtual bool IgnoreFootprintsOnBack() const =0
virtual bool IgnoreBlindBuriedVias() const =0
virtual int Accuracy() const =0
virtual bool IgnorePadsOnBack() const =0
virtual bool IgnoreFPReferences() const =0
virtual bool IgnorePadsOnFront() const =0
virtual bool IgnoreFootprintsOnFront() const =0
virtual bool IgnorePads() const
Definition: collectors.h:118
virtual bool IgnoreTracks() const =0
virtual bool IncludeSecondary() const =0
Determine if the secondary criteria or 2nd choice items should be included.
virtual bool IgnoreFPValues() const =0
virtual PCB_LAYER_ID GetPreferredLayer() const =0
INSPECTOR_FUNC m_inspector
Definition: collector.h:246
void Empty()
Clear the list.
Definition: collector.h:91
VECTOR2I m_refPos
Definition: collector.h:248
void SetScanTypes(const std::vector< KICAD_T > &aTypes)
Record the list of KICAD_T types to consider for collection by the Inspect() function.
Definition: collector.h:213
void SetRefPos(const VECTOR2I &aRefPos)
Definition: collector.h:215
std::vector< KICAD_T > m_scanTypes
Definition: collector.h:245
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition: collector.h:101
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:98
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:110
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:127
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
Definition: eda_item.h:233
virtual bool IsVisible() const
Definition: eda_text.h:184
PCB_LAYER_ID GetSide() const
Use instead of IsFlipped() when you also need to account for unsided footprints (those purely on user...
Definition: footprint.cpp:1772
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1909
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: footprint.cpp:1902
static const std::vector< KICAD_T > BoardLevelItems
A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT,...
Definition: collectors.h:238
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:291
static const std::vector< KICAD_T > PadsOrTracks
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:248
void Append2nd(EDA_ITEM *item)
Definition: collectors.h:281
INSPECT_RESULT Inspect(EDA_ITEM *aTestItem, void *aTestData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
Definition: collectors.cpp:147
std::vector< EDA_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
Definition: collectors.h:215
static const std::vector< KICAD_T > Footprints
A scan list for only FOOTPRINTs.
Definition: collectors.h:243
static const std::vector< KICAD_T > AllBoardItems
A scan list for all editable board items.
Definition: collectors.h:227
static const std::vector< KICAD_T > Tracks
A scan list for only TRACKs and ARCs.
Definition: collectors.h:258
void Collect(BOARD_ITEM *aItem, const std::vector< KICAD_T > &aScanList, const VECTOR2I &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:505
static const std::vector< KICAD_T > Dimensions
A scan list for dimensions.
Definition: collectors.h:263
static const std::vector< KICAD_T > FootprintItems
A scan list for primary footprint items.
Definition: collectors.h:253
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
Definition: collectors.h:220
static const std::vector< KICAD_T > DraggableItems
A scan list for items that can be dragged.
Definition: collectors.h:268
bool IsBOARD_ITEM() const
Definition: view_item.h:102
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
Definition: netinfo.h:381
Definition: pad.h:54
Abstract dimension API.
bool IsReference() const
Definition: pcb_field.h:68
bool IsValue() const
Definition: pcb_field.h:69
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:53
void Collect(BOARD_ITEM *aBoard, const std::vector< KICAD_T > &aTypes)
Test a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:559
INSPECT_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the iterate function.
Definition: collectors.cpp:548
PCB_LAYER_ID m_layer_id
Definition: collectors.h:575
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: pcb_marker.h:77
void Collect(BOARD_ITEM *aBoard, const std::vector< KICAD_T > &aTypes)
Collect BOARD_ITEM objects using this class's Inspector method, which does the collection.
Definition: collectors.cpp:541
INSPECT_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
Definition: collectors.cpp:531
Handle a list of polygons defining a copper zone.
Definition: zone.h:74
bool HitTestForCorner(const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
Test if the given VECTOR2I is near a corner.
Definition: zone.cpp:713
bool HitTestForEdge(const VECTOR2I &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX *aCornerHit=nullptr) const
Test if the given VECTOR2I is near a segment defined by 2 corners.
Definition: zone.cpp:720
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const VECTOR2I &aRefPos, int aAccuracy=0) const
Test if the given VECTOR2I is within the bounds of a filled area of this zone.
Definition: zone.cpp:820
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: zone.h:136
INSPECT_RESULT
Definition: eda_item.h:44
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:767
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:790
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Cu
Definition: layer_ids.h:65
@ F_Cu
Definition: layer_ids.h:64
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
Class to handle a set of BOARD_ITEMs.
const int accuracy
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:105
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:102
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition: typeinfo.h:91
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:103
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:110
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition: typeinfo.h:93
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:107
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:92
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
Definition: typeinfo.h:89
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition: typeinfo.h:90
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:99
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:106
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition: typeinfo.h:95
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:101
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition: typeinfo.h:94
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition: typeinfo.h:104