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 (C) 2004-2024 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 <pad.h>
30#include <pcb_track.h>
31#include <pcb_marker.h>
32#include <pcb_dimension.h>
33#include <zone.h>
34#include <pcb_shape.h>
35#include <pcb_group.h>
36#include <macros.h>
37#include <math/util.h> // for KiROUND
38
39
40const std::vector<KICAD_T> GENERAL_COLLECTOR::AllBoardItems = {
41 PCB_MARKER_T, // in m_markers
42 PCB_TEXT_T, // in m_drawings
43 PCB_REFERENCE_IMAGE_T, // in m_drawings
44 PCB_TEXTBOX_T, // in m_drawings
45 PCB_TABLE_T, // in m_drawings
46 PCB_TABLECELL_T, // in tables
47 PCB_SHAPE_T, // in m_drawings
48 PCB_DIM_ALIGNED_T, // in m_drawings
49 PCB_DIM_CENTER_T, // in m_drawings
50 PCB_DIM_RADIAL_T, // in m_drawings
51 PCB_DIM_ORTHOGONAL_T, // in m_drawings
52 PCB_DIM_LEADER_T, // in m_drawings
53 PCB_TARGET_T, // in m_drawings
54 PCB_VIA_T, // in m_tracks
55 PCB_TRACE_T, // in m_tracks
56 PCB_ARC_T, // in m_tracks
57 PCB_PAD_T, // in footprints
58 PCB_FIELD_T, // in footprints
59 PCB_FOOTPRINT_T, // in m_footprints
60 PCB_GROUP_T, // in m_groups
61 PCB_ZONE_T, // in m_zones
62 PCB_GENERATOR_T // in m_generators
63};
64
65
66const std::vector<KICAD_T> GENERAL_COLLECTOR::BoardLevelItems = {
86};
87
88
89const std::vector<KICAD_T> GENERAL_COLLECTOR::Footprints = {
91};
92
93
94const std::vector<KICAD_T> GENERAL_COLLECTOR::PadsOrTracks = {
99};
100
101
102const std::vector<KICAD_T> GENERAL_COLLECTOR::FootprintItems = {
115 PCB_PAD_T,
119};
120
121
122const std::vector<KICAD_T> GENERAL_COLLECTOR::Tracks = {
124 PCB_ARC_T,
126};
127
128
129const std::vector<KICAD_T> GENERAL_COLLECTOR::Dimensions = {
135};
136
137
138const std::vector<KICAD_T> GENERAL_COLLECTOR::DraggableItems = {
140 PCB_VIA_T,
143};
144
145
147{
148 BOARD_ITEM* boardItem = nullptr;
149 FOOTPRINT* footprint = nullptr;
150 PCB_GROUP* group = nullptr;
151 PAD* pad = nullptr;
152 bool pad_through = false;
153 PCB_VIA* via = nullptr;
154 PCB_MARKER* marker = nullptr;
155 ZONE* zone = nullptr;
156 PCB_FIELD* field = nullptr;
157 PCB_TEXT* text = nullptr;
158 PCB_DIMENSION_BASE* dimension = nullptr;
159
160 switch( aTestItem->Type() )
161 {
162 case PCB_PAD_T:
163 // there are pad specific visibility controls.
164 // Criteria to select a pad is:
165 // for smd pads: the footprint parent must be visible, and pads on the corresponding
166 // board side must be visible
167 // if pad is a thru hole, then it can be visible when its parent footprint is not.
168 // for through pads: pads on Front or Back board sides must be visible
169 pad = static_cast<PAD*>( aTestItem );
170 boardItem = pad;
171
172 if( ( pad->GetAttribute() != PAD_ATTRIB::SMD ) &&
173 ( pad->GetAttribute() != PAD_ATTRIB::CONN ) ) // a hole is present, so multiple layers
174 {
175 // proceed to the common tests below, but without the parent footprint test,
176 // by leaving footprint==NULL, but having pad != null
177 pad_through = true;
178 }
179
180 break;
181
182 case PCB_VIA_T: // vias are on many layers, so layer test is specific
183 via = static_cast<PCB_VIA*>( aTestItem );
184 boardItem = via;
185 break;
186
187 case PCB_TRACE_T:
188 case PCB_ARC_T:
189 if( m_Guide->IgnoreTracks() )
190 return INSPECT_RESULT::CONTINUE;
191
192 boardItem = static_cast<PCB_TRACK*>( aTestItem );
193 break;
194
195 case PCB_ZONE_T:
196 zone = static_cast<ZONE*>( aTestItem );
197 boardItem = zone;
198 break;
199
200 case PCB_TEXTBOX_T:
201 case PCB_SHAPE_T:
202 case PCB_TABLE_T:
203 case PCB_TABLECELL_T:
204 boardItem = static_cast<BOARD_ITEM*>( aTestItem );
205 break;
206
208 case PCB_DIM_CENTER_T:
209 case PCB_DIM_RADIAL_T:
211 case PCB_DIM_LEADER_T:
212 dimension = static_cast<PCB_DIMENSION_BASE*>( aTestItem );
213 boardItem = dimension;
214 break;
215
216 case PCB_TARGET_T:
217 boardItem = static_cast<BOARD_ITEM*>( aTestItem );
218 break;
219
220 case PCB_FIELD_T:
221 field = static_cast<PCB_FIELD*>( aTestItem );
222
223 if( field->IsReference() && m_Guide->IgnoreFPReferences() )
224 return INSPECT_RESULT::CONTINUE;
225
226 if( field->IsValue() && m_Guide->IgnoreFPValues() )
227 return INSPECT_RESULT::CONTINUE;
228
230
231 case PCB_TEXT_T:
232 text = static_cast<PCB_TEXT*>( aTestItem );
233 boardItem = text;
234
235 if( text->GetParentFootprint() )
236 {
237 PCB_LAYER_ID layer = text->GetLayer();
238
239 if( !text->IsVisible() )
240 return INSPECT_RESULT::CONTINUE;
241
242 if( m_Guide->IgnoreFPTextOnBack() && IsBackLayer( layer ) )
243 return INSPECT_RESULT::CONTINUE;
244
245 if( m_Guide->IgnoreFPTextOnFront() && IsFrontLayer( layer ) )
246 return INSPECT_RESULT::CONTINUE;
247 }
248
249 break;
250
251 case PCB_FOOTPRINT_T:
252 footprint = static_cast<FOOTPRINT*>( aTestItem );
253 boardItem = footprint;
254 break;
255
256 case PCB_GROUP_T:
257 group = static_cast<PCB_GROUP*>( aTestItem );
258 boardItem = group;
259 break;
260
261 case PCB_MARKER_T:
262 marker = static_cast<PCB_MARKER*>( aTestItem );
263 boardItem = marker;
264 break;
265
266 default:
267 if( aTestItem->IsBOARD_ITEM() )
268 boardItem = static_cast<BOARD_ITEM*>( aTestItem );
269
270 break;
271 }
272
273 if( boardItem && !footprint )
274 footprint = boardItem->GetParentFootprint();
275
276 // common tests:
277
278 if( footprint )
279 {
280 if( m_Guide->IgnoreFootprintsOnBack() && footprint->GetSide() == B_Cu )
281 return INSPECT_RESULT::CONTINUE;
282
283 if( m_Guide->IgnoreFootprintsOnFront() && footprint->GetSide() == F_Cu )
284 return INSPECT_RESULT::CONTINUE;
285 }
286
287 // Pads are not sensitive to the layer visibility controls; they all have their own separate
288 // visibility controls.
289 if( pad )
290 {
291 if( m_Guide->IgnorePads() )
292 return INSPECT_RESULT::CONTINUE;
293
294 if( ! pad_through )
295 {
296 if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
297 return INSPECT_RESULT::CONTINUE;
298
299 if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
300 return INSPECT_RESULT::CONTINUE;
301 }
302 }
303
304 if( marker )
305 {
306 // Markers are not sensitive to the layer
307 if( marker->HitTest( m_refPos ) )
308 Append( aTestItem );
309
310 return INSPECT_RESULT::CONTINUE;
311 }
312
313 if( group )
314 {
315 // Groups are not sensitive to the layer ... ?
316 if( group->HitTest( m_refPos ) )
317 Append( aTestItem );
318
319 return INSPECT_RESULT::CONTINUE;
320 }
321
322 if( via )
323 {
324 auto type = via->GetViaType();
325
326 if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
327 || ( m_Guide->IgnoreBlindBuriedVias() && type == VIATYPE::BLIND_BURIED )
328 || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
329 {
330 return INSPECT_RESULT::CONTINUE;
331 }
332 }
333
334 if( boardItem
335 && ( boardItem->IsOnLayer( m_Guide->GetPreferredLayer() ) )
336 && ( !boardItem->IsLocked() || !m_Guide->IgnoreLockedItems() ) )
337 {
338 // Footprints and their subcomponents: reference, value and pads are not sensitive to the
339 // layer visibility controls; they all have their own separate visibility controls.
340 // For vias, GetLayer() has no meaning, but IsOnLayer() works fine.
341 // User text and fields in a footprint *are* sensitive to layer visibility but they were
342 // already handled.
343
344 int accuracy = m_Guide->Accuracy();
345
346 if( zone )
347 {
348 if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
349 || zone->HitTestForEdge( m_refPos, accuracy ) )
350 {
351 Append( aTestItem );
352 return INSPECT_RESULT::CONTINUE;
353 }
354 else if( !m_Guide->IgnoreZoneFills() )
355 {
356 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
357 {
358 if( m_Guide->IsLayerVisible( layer )
359 && zone->HitTestFilledArea( layer, m_refPos ) )
360 {
361 Append( aTestItem );
362 return INSPECT_RESULT::CONTINUE;
363 }
364 }
365 }
366 }
367 else if( aTestItem == footprint )
368 {
369 if( footprint->HitTest( m_refPos, accuracy )
370 && footprint->HitTestAccurate( m_refPos, accuracy ) )
371 {
372 Append( aTestItem );
373 return INSPECT_RESULT::CONTINUE;
374 }
375 }
376 else if( pad || via )
377 {
378 if( aTestItem->HitTest( m_refPos, accuracy ) )
379 {
380 Append( aTestItem );
381 return INSPECT_RESULT::CONTINUE;
382 }
383 }
384 else
385 {
386 PCB_LAYER_ID layer = boardItem->GetLayer();
387
388 if( m_Guide->IsLayerVisible( layer ) )
389 {
390 if( dimension )
391 {
392 // Dimensions feel particularly hard to select, probably due to their noisy
393 // shape making it feel like they should have a larger boundary.
394 accuracy = KiROUND( accuracy * 1.5 );
395 }
396
397 if( aTestItem->HitTest( m_refPos, accuracy ) )
398 {
399 Append( aTestItem );
400 return INSPECT_RESULT::CONTINUE;
401 }
402 }
403 }
404 }
405
407 && ( !boardItem || !boardItem->IsLocked() || !m_Guide->IgnoreLockedItems() ) )
408 {
409 // For now, "secondary" means "tolerate any visible layer". It has no effect on other
410 // criteria, since there is a separate "ignore" control for those in the COLLECTORS_GUIDE
411
412 // Footprints and their subcomponents: reference, value and pads are not sensitive to the
413 // layer visibility controls; they all have their own separate visibility controls.
414 // For vias, GetLayer() has no meaning, but IsOnLayer() works fine.
415 // User text and fields in a footprint *are* sensitive to layer visibility but they were
416 // already handled.
417
418 int accuracy = m_Guide->Accuracy();
419
420 if( zone )
421 {
422 if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
423 || zone->HitTestForEdge( m_refPos, accuracy ) )
424 {
425 Append2nd( aTestItem );
426 return INSPECT_RESULT::CONTINUE;
427 }
428 else if( !m_Guide->IgnoreZoneFills() )
429 {
430 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
431 {
432 if( m_Guide->IsLayerVisible( layer )
433 && zone->HitTestFilledArea( layer, m_refPos ) )
434 {
435 Append2nd( aTestItem );
436 return INSPECT_RESULT::CONTINUE;
437 }
438 }
439 }
440 }
441 else if( aTestItem->Type() == PCB_FOOTPRINT_T )
442 {
443 // Already tested above, but Coverity can't figure that out
444 wxCHECK( footprint, INSPECT_RESULT::CONTINUE );
445
446 if( footprint->HitTest( m_refPos, accuracy )
447 && footprint->HitTestAccurate( m_refPos, accuracy ) )
448 {
449 Append2nd( aTestItem );
450 return INSPECT_RESULT::CONTINUE;
451 }
452 }
453 else if( pad || via )
454 {
455 if( aTestItem->HitTest( m_refPos, accuracy ) )
456 {
457 Append2nd( aTestItem );
458 return INSPECT_RESULT::CONTINUE;
459 }
460 }
461 else if( boardItem && m_Guide->IsLayerVisible( boardItem->GetLayer() ) )
462 {
463 if( dimension )
464 {
465 // Dimensions feel particularly hard to select, probably due to their noisy shape
466 // making it feel like they should have a larger boundary.
467 accuracy = KiROUND( accuracy * 1.5 );
468 }
469
470 if( aTestItem->HitTest( m_refPos, accuracy ) )
471 {
472 Append2nd( aTestItem );
473 return INSPECT_RESULT::CONTINUE;
474 }
475 }
476 }
477
478 return INSPECT_RESULT::CONTINUE; // always when collecting
479}
480
481
482void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const std::vector<KICAD_T>& aScanTypes,
483 const VECTOR2I& aRefPos, const COLLECTORS_GUIDE& aGuide )
484{
485 Empty(); // empty the collection, primary criteria list
486 Empty2nd(); // empty the collection, secondary criteria list
487
488 // remember guide, pass it to Inspect()
489 SetGuide( &aGuide );
490
491 SetScanTypes( aScanTypes );
492
493 // remember where the snapshot was taken from and pass refPos to
494 // the Inspect() function.
495 SetRefPos( aRefPos );
496
497 wxCHECK_RET( aItem, "" );
498 aItem->Visit( m_inspector, nullptr, m_scanTypes );
499
500 // append 2nd list onto end of the first list
501 for( EDA_ITEM* item : m_List2nd )
502 Append( item );
503
504 Empty2nd();
505}
506
507
509{
510 // The Visit() function only visits the testItem if its type was in the the scanList,
511 // so therefore we can collect anything given to us here.
512 Append( testItem );
513
514 return INSPECT_RESULT::CONTINUE; // always when collecting
515}
516
517
518void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const std::vector<KICAD_T>& aTypes )
519{
520 Empty();
521 aBoard->Visit( m_inspector, nullptr, aTypes );
522}
523
524
526{
527 BOARD_ITEM* item = (BOARD_ITEM*) testItem;
528
529 if( item->IsOnLayer( m_layer_id ) )
530 Append( testItem );
531
532 return INSPECT_RESULT::CONTINUE;
533}
534
535
536void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const std::vector<KICAD_T>& aTypes )
537{
538 Empty();
539 aBoard->Visit( m_inspector, nullptr, aTypes );
540}
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:237
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:319
FOOTPRINT * GetParentFootprint() const
Definition: board_item.cpp:299
virtual bool IsLocked() const
Definition: board_item.cpp:75
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 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:244
void Empty()
Clear the list.
Definition: collector.h:89
VECTOR2I m_refPos
Definition: collector.h:246
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:211
void SetRefPos(const VECTOR2I &aRefPos)
Definition: collector.h:213
std::vector< KICAD_T > m_scanTypes
Definition: collector.h:243
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition: collector.h:99
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
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:94
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:216
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:1615
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1752
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:1745
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:233
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:286
static const std::vector< KICAD_T > PadsOrTracks
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:243
void Append2nd(EDA_ITEM *item)
Definition: collectors.h:276
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:146
std::vector< EDA_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
Definition: collectors.h:210
static const std::vector< KICAD_T > Footprints
A scan list for only FOOTPRINTs.
Definition: collectors.h:238
static const std::vector< KICAD_T > AllBoardItems
A scan list for all editable board items.
Definition: collectors.h:222
static const std::vector< KICAD_T > Tracks
A scan list for only TRACKs and ARCs.
Definition: collectors.h:253
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:482
static const std::vector< KICAD_T > Dimensions
A scan list for dimensions.
Definition: collectors.h:258
static const std::vector< KICAD_T > FootprintItems
A scan list for primary footprint items.
Definition: collectors.h:248
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
Definition: collectors.h:215
static const std::vector< KICAD_T > DraggableItems
A scan list for items that can be dragged.
Definition: collectors.h:263
bool IsBOARD_ITEM() const
Definition: view_item.h:100
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:410
Definition: pad.h:54
Abstract dimension API.
bool IsReference() const
Definition: pcb_field.h:70
bool IsValue() const
Definition: pcb_field.h:71
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:52
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:536
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:525
PCB_LAYER_ID m_layer_id
Definition: collectors.h:565
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:518
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:508
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
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:473
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:480
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:534
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: zone.h:130
INSPECT_RESULT
Definition: eda_item.h:43
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:621
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:644
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.
@ 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