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
240 {
241 if( !text->IsVisible() )
242 return INSPECT_RESULT::CONTINUE;
243 }
244
245 if( m_Guide->IgnoreFPTextOnBack() && IsBackLayer( layer ) )
246 return INSPECT_RESULT::CONTINUE;
247
248 if( m_Guide->IgnoreFPTextOnFront() && IsFrontLayer( layer ) )
249 return INSPECT_RESULT::CONTINUE;
250 }
251
252 break;
253
254 case PCB_FOOTPRINT_T:
255 footprint = static_cast<FOOTPRINT*>( aTestItem );
256 boardItem = footprint;
257 break;
258
259 case PCB_GROUP_T:
260 group = static_cast<PCB_GROUP*>( aTestItem );
261 boardItem = group;
262 break;
263
264 case PCB_MARKER_T:
265 marker = static_cast<PCB_MARKER*>( aTestItem );
266 boardItem = marker;
267 break;
268
269 default:
270 boardItem = dynamic_cast<BOARD_ITEM*>( aTestItem );
271 break;
272 }
273
274 if( boardItem && !footprint )
275 footprint = boardItem->GetParentFootprint();
276
277 // common tests:
278
279 if( footprint )
280 {
281 if( m_Guide->IgnoreFootprintsOnBack() && footprint->GetSide() == B_Cu )
282 return INSPECT_RESULT::CONTINUE;
283
284 if( m_Guide->IgnoreFootprintsOnFront() && footprint->GetSide() == F_Cu )
285 return INSPECT_RESULT::CONTINUE;
286 }
287
288 // Pads are not sensitive to the layer visibility controls.
289 // They all have their own separate visibility controls
290 // skip them if not visible
291 if( pad )
292 {
293 if( m_Guide->IgnorePads() )
294 return INSPECT_RESULT::CONTINUE;
295
296 if( ! pad_through )
297 {
298 if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
299 return INSPECT_RESULT::CONTINUE;
300
301 if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
302 return INSPECT_RESULT::CONTINUE;
303 }
304 }
305
306 if( marker )
307 {
308 // Markers are not sensitive to the layer
309 if( marker->HitTest( m_refPos ) )
310 Append( aTestItem );
311
312 return INSPECT_RESULT::CONTINUE;
313 }
314
315 if( group )
316 {
317 // Groups are not sensitive to the layer ... ?
318 if( group->HitTest( m_refPos ) )
319 Append( aTestItem );
320
321 return INSPECT_RESULT::CONTINUE;
322 }
323
324 if( via )
325 {
326 auto type = via->GetViaType();
327
328 if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
329 || ( m_Guide->IgnoreBlindBuriedVias() && type == VIATYPE::BLIND_BURIED )
330 || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
331 {
332 return INSPECT_RESULT::CONTINUE;
333 }
334 }
335
336 if( boardItem
337 && ( boardItem->IsOnLayer( m_Guide->GetPreferredLayer() ) )
338 && ( !boardItem->IsLocked() || !m_Guide->IgnoreLockedItems() ) )
339 {
340 // footprints and their subcomponents: reference, value and pads are not sensitive
341 // to the layer visibility controls. They all have their own separate visibility
342 // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
343 // text in a footprint *is* sensitive to layer visibility but that was already handled.
344
345 int accuracy = m_Guide->Accuracy();
346
347 if( zone )
348 {
349 if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
350 || zone->HitTestForEdge( m_refPos, accuracy ) )
351 {
352 Append( aTestItem );
353 return INSPECT_RESULT::CONTINUE;
354 }
355 else if( !m_Guide->IgnoreZoneFills() )
356 {
357 for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
358 {
359 if( m_Guide->IsLayerVisible( layer )
360 && zone->HitTestFilledArea( layer, m_refPos ) )
361 {
362 Append( aTestItem );
363 return INSPECT_RESULT::CONTINUE;
364 }
365 }
366 }
367 }
368 else if( aTestItem == footprint )
369 {
370 if( footprint->HitTest( m_refPos, accuracy )
371 && footprint->HitTestAccurate( m_refPos, accuracy ) )
372 {
373 Append( aTestItem );
374 return INSPECT_RESULT::CONTINUE;
375 }
376 }
377 else if( pad || via )
378 {
379 if( aTestItem->HitTest( m_refPos, accuracy ) )
380 {
381 Append( aTestItem );
382 return INSPECT_RESULT::CONTINUE;
383 }
384 }
385 else
386 {
387 PCB_LAYER_ID layer = boardItem->GetLayer();
388
389 if( m_Guide->IsLayerVisible( layer ) )
390 {
391 if( dimension )
392 {
393 // Dimensions feel particularly hard to select, probably due to their
394 // noisy shape making it feel like they should have a larger boundary.
395 accuracy = KiROUND( accuracy * 1.5 );
396 }
397
398 if( aTestItem->HitTest( m_refPos, accuracy ) )
399 {
400 Append( aTestItem );
401 return INSPECT_RESULT::CONTINUE;
402 }
403 }
404 }
405 }
406
408 && ( !boardItem || !boardItem->IsLocked() || !m_Guide->IgnoreLockedItems() ) )
409 {
410 // for now, "secondary" means "tolerate any visible layer". It has no effect on other
411 // criteria, since there is a separate "ignore" control for those in the COLLECTORS_GUIDE
412
413 // footprints and their subcomponents: reference, value and pads are not sensitive
414 // to the layer visibility controls. They all have their own separate visibility
415 // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
416 // text in a footprint *is* sensitive to layer visibility but that was 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 wxCHECK( footprint, INSPECT_RESULT::CONTINUE );
444
445 if( footprint->HitTest( m_refPos, accuracy )
446 && footprint->HitTestAccurate( m_refPos, accuracy ) )
447 {
448 Append2nd( aTestItem );
449 return INSPECT_RESULT::CONTINUE;
450 }
451 }
452 else if( pad || via )
453 {
454 if( aTestItem->HitTest( m_refPos, accuracy ) )
455 {
456 Append2nd( aTestItem );
457 return INSPECT_RESULT::CONTINUE;
458 }
459 }
460 else if( boardItem && m_Guide->IsLayerVisible( boardItem->GetLayer() ) )
461 {
462 if( dimension )
463 {
464 // Dimensions feel particularly hard to select, probably due to their
465 // noisy shape making it feel like they should have a larger boundary.
466 accuracy = KiROUND( accuracy * 1.5 );
467 }
468
469 if( aTestItem->HitTest( m_refPos, accuracy ) )
470 {
471 Append2nd( aTestItem );
472 return INSPECT_RESULT::CONTINUE;
473 }
474 }
475 }
476
477 return INSPECT_RESULT::CONTINUE; // always when collecting
478}
479
480
481void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const std::vector<KICAD_T>& aScanTypes,
482 const VECTOR2I& aRefPos, const COLLECTORS_GUIDE& aGuide )
483{
484 Empty(); // empty the collection, primary criteria list
485 Empty2nd(); // empty the collection, secondary criteria list
486
487 // remember guide, pass it to Inspect()
488 SetGuide( &aGuide );
489
490 SetScanTypes( aScanTypes );
491
492 // remember where the snapshot was taken from and pass refPos to
493 // the Inspect() function.
494 SetRefPos( aRefPos );
495
496 wxCHECK_RET( aItem, "" );
497 aItem->Visit( m_inspector, nullptr, m_scanTypes );
498
499 // append 2nd list onto end of the first list
500 for( unsigned i = 0; i<m_List2nd.size(); ++i )
501 Append( m_List2nd[i] );
502
503 Empty2nd();
504}
505
506
508{
509 // The Visit() function only visits the testItem if its type was in the the scanList,
510 // so therefore we can collect anything given to us here.
511 Append( testItem );
512
513 return INSPECT_RESULT::CONTINUE; // always when collecting
514}
515
516
517void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const std::vector<KICAD_T>& aTypes )
518{
519 Empty();
520 aBoard->Visit( m_inspector, nullptr, aTypes );
521}
522
523
525{
526 BOARD_ITEM* item = (BOARD_ITEM*) testItem;
527
528 if( item->IsOnLayer( m_layer_id ) )
529 Append( testItem );
530
531 return INSPECT_RESULT::CONTINUE;
532}
533
534
535void PCB_LAYER_COLLECTOR::Collect( BOARD_ITEM* aBoard, const std::vector<KICAD_T>& aTypes )
536{
537 Empty();
538 aBoard->Visit( m_inspector, nullptr, aTypes );
539}
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:226
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:291
FOOTPRINT * GetParentFootprint() const
Definition: board_item.cpp:248
virtual bool IsLocked() const
Definition: board_item.cpp:74
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 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: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:88
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:100
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:215
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:1585
bool HitTestAccurate(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:1722
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:1715
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:237
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:290
static const std::vector< KICAD_T > PadsOrTracks
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:247
void Append2nd(EDA_ITEM *item)
Definition: collectors.h:280
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:214
static const std::vector< KICAD_T > Footprints
A scan list for only FOOTPRINTs.
Definition: collectors.h:242
static const std::vector< KICAD_T > AllBoardItems
A scan list for all editable board items.
Definition: collectors.h:226
static const std::vector< KICAD_T > Tracks
A scan list for only TRACKs and ARCs.
Definition: collectors.h:257
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:481
static const std::vector< KICAD_T > Dimensions
A scan list for dimensions.
Definition: collectors.h:262
static const std::vector< KICAD_T > FootprintItems
A scan list for primary footprint items.
Definition: collectors.h:252
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
Definition: collectors.h:219
static const std::vector< KICAD_T > DraggableItems
A scan list for items that can be dragged.
Definition: collectors.h:267
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:418
Definition: pad.h:59
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: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:535
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:524
PCB_LAYER_ID m_layer_id
Definition: collectors.h:577
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:517
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:507
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:435
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:442
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:496
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:43
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:954
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:977
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Cu
Definition: layer_ids.h:95
@ 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
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:118