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