KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_board_item.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 The KiCad Developers, see AUTHORS.TXT for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
21#include <eda_item_test_utils.h>
22#include <core/typeinfo.h>
23#include <drc/drc_item.h>
24
25// Code under test
26#include <board.h>
28#include <board_item.h>
29#include <footprint.h>
30#include <pad.h>
31#include <pcb_shape.h>
32#include <pcb_barcode.h>
33#include <pcb_text.h>
34#include <pcb_textbox.h>
35#include <pcb_table.h>
36#include <pcb_tablecell.h>
37#include <pcb_reference_image.h>
38#include <zone.h>
39#include <pcb_track.h>
40#include <pcb_marker.h>
41#include <pcb_dimension.h>
42#include <pcb_point.h>
43#include <pcb_target.h>
44#include <pcb_group.h>
45#include <pcb_board_outline.h>
46#include <properties/property.h>
48
50{
51public:
54 std::shared_ptr<DRC_ITEM> m_drcItem;
56
64
66 {
67 m_text.SetParentGroup( nullptr );
68 }
69
71 {
72 if( !IsPcbnewType( aType ) )
73 return nullptr;
74
75 if( !IsInstantiableType( aType ) )
76 return nullptr;
77
78 switch( aType )
79 {
80 case PCB_FOOTPRINT_T: return new FOOTPRINT( &m_board );
81 case PCB_PAD_T: return new PAD( &m_footprint );
82 case PCB_FIELD_T: return new PCB_FIELD( &m_footprint, FIELD_T::USER );
83 case PCB_SHAPE_T: return new PCB_SHAPE( &m_board );
84
85 case PCB_BARCODE_T:
86 {
87 PCB_BARCODE* barcode = new PCB_BARCODE( &m_board );
88 barcode->SetText( "XXXX" );
89 barcode->AssembleBarcode();
90 return barcode;
91 }
92
93 case PCB_TEXT_T: return new PCB_TEXT( &m_board );
94 case PCB_TEXTBOX_T: return new PCB_TEXTBOX( &m_board );
95 case PCB_TABLECELL_T: return new PCB_TABLECELL( &m_board );
96
97 case PCB_TABLE_T:
98 {
99 PCB_TABLE* table = new PCB_TABLE( &m_board, pcbIUScale.mmToIU( 0.1 ) );
100
101 table->SetColCount( 2 );
102
103 for( int ii = 0; ii < 4; ++ii )
104 {
105 PCB_TABLECELL* cell = new PCB_TABLECELL( &m_board );
106 cell->SetRectangleHeight( 0 );
107 cell->SetRectangleWidth( 0 );
108 table->InsertCell( ii, cell );
109 }
110
111 return table;
112 }
113
115 case PCB_TRACE_T: return new PCB_TRACK( &m_board );
116 case PCB_VIA_T: return new PCB_VIA( &m_board );
117 case PCB_ARC_T: return new PCB_ARC( &m_board );
118 case PCB_MARKER_T: return new PCB_MARKER( m_drcItem, VECTOR2I( 0, 0 ) );
120 case PCB_DIM_LEADER_T: return new PCB_DIM_LEADER( &m_board );
121 case PCB_DIM_CENTER_T: return new PCB_DIM_CENTER( &m_board );
122 case PCB_DIM_RADIAL_T: return new PCB_DIM_RADIAL( &m_board );
124 case PCB_TARGET_T: return new PCB_TARGET( &m_board );
125 case PCB_POINT_T: return new PCB_POINT( &m_board );
126
127 case PCB_ZONE_T:
128 {
129 ZONE* zone = new ZONE( &m_board );
130
131 zone->AppendCorner( VECTOR2I( pcbIUScale.mmToIU( -100 ), pcbIUScale.mmToIU( -50 ) ), -1 );
132 zone->AppendCorner( VECTOR2I( pcbIUScale.mmToIU( -100 ), pcbIUScale.mmToIU( 50 ) ), -1 );
133 zone->AppendCorner( VECTOR2I( pcbIUScale.mmToIU( 100 ), pcbIUScale.mmToIU( 50 ) ), -1 );
134 zone->AppendCorner( VECTOR2I( pcbIUScale.mmToIU( 100 ), pcbIUScale.mmToIU( -50 ) ), -1 );
135
136 return zone;
137 }
138
139 case PCB_GROUP_T:
140 {
141 PCB_GROUP* group = new PCB_GROUP( &m_board );
142
143 // Group position only makes sense if there's at least one item in the group.
144 group->AddItem( &m_text );
145
146 return group;
147 }
148
149 case PCB_T:
150 case PCB_ITEM_LIST_T:
151 case PCB_NETINFO_T:
152 case PCB_GENERATOR_T:
153 case PCB_CONSTRAINT_T: // geometry-free; geometric behavior covered by ConstraintSolverItem
155 return nullptr;
156
157 default:
158 BOOST_FAIL( wxString::Format( "Unhandled type: %d (if you created a new type you need to handle it in "
159 "this switch statement)",
160 aType ) );
161 return nullptr;
162 }
163 }
164
165 static void CompareItems( BOARD_ITEM* aItem, BOARD_ITEM* aOriginalItem )
166 {
167 BOOST_CHECK_EQUAL( aItem->GetPosition(), aOriginalItem->GetPosition() );
168 BOOST_CHECK_EQUAL( aItem->GetBoundingBox().GetTop(), aOriginalItem->GetBoundingBox().GetTop() );
169 BOOST_CHECK_EQUAL( aItem->GetBoundingBox().GetLeft(), aOriginalItem->GetBoundingBox().GetLeft() );
170 BOOST_CHECK_EQUAL( aItem->GetBoundingBox().GetBottom(), aOriginalItem->GetBoundingBox().GetBottom() );
171 BOOST_CHECK_EQUAL( aItem->GetBoundingBox().GetRight(), aOriginalItem->GetBoundingBox().GetRight() );
172 }
173};
174
175
176BOOST_FIXTURE_TEST_SUITE( PcbItem, TEST_BOARD_ITEM_FIXTURE )
177
178
180{
181 for( int i = 0; i < MAX_STRUCT_TYPE_ID; i++ )
182 {
183 KICAD_T type = static_cast<KICAD_T>( i );
184
185 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
186
187 if( item == nullptr )
188 continue;
189
190 BOOST_TEST_CONTEXT( "Class: " << item->GetClass() )
191 {
192 BOOST_CHECK( !ENUM_MAP<KICAD_T>::Instance().ToString( type ).IsEmpty() );
193 }
194 }
195}
196
197
199{
200 for( int i = 0; i < MAX_STRUCT_TYPE_ID; i++ )
201 {
202 KICAD_T type = static_cast<KICAD_T>( i );
203
204 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
205
206 if( item == nullptr )
207 continue;
208
209 BOOST_TEST_CONTEXT( "Class: " << item->GetClass() )
210 {
212 item.get(),
213 []( BOARD_ITEM* aOriginalItem, VECTOR2I aRef )
214 {
215 // FIXME: Update() has to be called after SetPosition() to update dimension shapes.
216 if( PCB_DIMENSION_BASE* dimension = dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem ) )
217 dimension->Update();
218
219 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate( IGNORE_PARENT_GROUP ) );
220 VECTOR2I originalPos = item->GetPosition();
221
222 // Move to a point, then go back.
223 // This has to be an identity transformation.
224
225 item->Move( aRef );
226 BOOST_CHECK_EQUAL( item->GetPosition(), originalPos + aRef );
227
228 item->Move( -aRef );
229 CompareItems( item.get(), aOriginalItem );
230 } );
231 }
232 }
233}
234
235
237{
238 for( int i = 0; i < MAX_STRUCT_TYPE_ID; i++ )
239 {
240 KICAD_T type = static_cast<KICAD_T>( i );
241
242 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
243
244 if( item == nullptr )
245 continue;
246
247 BOOST_TEST_CONTEXT( "Class: " << item->GetClass() )
248 {
249 // Four same 90 degree rotations are an identity.
250
252 item.get(),
253 []( BOARD_ITEM* aOriginalItem, VECTOR2I aRef )
254 {
255 // FIXME: Update() has to be called after SetPosition() to update dimension shapes.
256 if( PCB_DIMENSION_BASE* dimension = dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem ) )
257 dimension->Update();
258 else if( PCB_BARCODE* barcode = dynamic_cast<PCB_BARCODE*>( aOriginalItem ) )
259 barcode->AssembleBarcode();
260
261 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate( IGNORE_PARENT_GROUP ) );
262
263 // Four equivalent 90 degree rotations are an identity.
264
265 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
266 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
267 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
268 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
269
270 CompareItems( item.get(), aOriginalItem );
271 } );
272 }
273 }
274}
275
276
277BOOST_AUTO_TEST_CASE( FlipLeftRight )
278{
279 for( int i = 0; i < MAX_STRUCT_TYPE_ID; i++ )
280 {
281 KICAD_T type = static_cast<KICAD_T>( i );
282
283 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
284
285 if( item == nullptr )
286 continue;
287
288 BOOST_TEST_CONTEXT( "Class: " << item->GetClass() )
289 {
291 item.get(),
292 []( BOARD_ITEM* aOriginalItem, VECTOR2I aRef )
293 {
294 // FIXME: Update() has to be called after SetPosition() to update dimension shapes.
295 if( PCB_DIMENSION_BASE* dimension = dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem ) )
296 dimension->Update();
297
298 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate( IGNORE_PARENT_GROUP ) );
299
300 // Two equivalent flips are an identity.
301
302 item->Flip( aRef, FLIP_DIRECTION::LEFT_RIGHT );
303 item->Flip( aRef, FLIP_DIRECTION::LEFT_RIGHT );
304
305 CompareItems( item.get(), aOriginalItem );
306 } );
307 }
308 }
309}
310
311
313{
314 for( int i = 0; i < MAX_STRUCT_TYPE_ID; i++ )
315 {
316 KICAD_T type = static_cast<KICAD_T>( i );
317
318 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
319
320 if( item == nullptr )
321 continue;
322
323 BOOST_TEST_CONTEXT( "Class: " << item->GetClass() )
324 {
326 item.get(),
327 []( BOARD_ITEM* aOriginalItem, VECTOR2I aRef )
328 {
329 // FIXME: Update() has to be called after SetPosition() to update dimension shapes.
330 if( PCB_DIMENSION_BASE* dimension = dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem ) )
331 dimension->Update();
332
333 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate( IGNORE_PARENT_GROUP ) );
334
335 // Two equivalent flips are an identity.
336
337 item->Flip( aRef, FLIP_DIRECTION::TOP_BOTTOM );
338 item->Flip( aRef, FLIP_DIRECTION::TOP_BOTTOM );
339
340 CompareItems( item.get(), aOriginalItem );
341 } );
342 }
343 }
344}
345
346
353BOOST_AUTO_TEST_CASE( Issue23234_CustomPadstackFlip )
354{
355 // Create a board with two copper layers so Flip works correctly
356 BOARD board;
357 FOOTPRINT footprint( &board );
358 PAD pad( &footprint );
359
360 // Set up a circular SMD pad on F_Cu (NORMAL padstack mode)
361 pad.SetAttribute( PAD_ATTRIB::SMD );
363 pad.SetSize( PADSTACK::ALL_LAYERS, VECTOR2I( 500000, 500000 ) );
364 LSET smd_layers;
365 smd_layers.set( F_Cu );
366 pad.SetLayerSet( smd_layers );
367
368 // Switch padstack to CUSTOM mode (as the dialog does when user selects "Custom")
369 pad.Padstack().SetMode( PADSTACK::MODE::CUSTOM );
370
371 // Now flip the pad (as TransferDataFromWindow does for pads on flipped footprints).
372 // This renames the F_Cu key in m_copperProps to B_Cu.
373 // After this, ALL_LAYERS (= F_Cu) is no longer in m_copperProps.
374 pad.Flip( VECTOR2I( 0, 0 ), FLIP_DIRECTION::TOP_BOTTOM );
375
376 // These calls must NOT throw std::out_of_range.
377 // Before the fix, CopperLayer( ALL_LAYERS ) called m_copperProps.at( F_Cu ) which threw
378 // because F_Cu was not in the map (it had been renamed to B_Cu by FlipLayers).
379 BOOST_CHECK_NO_THROW( pad.GetShape( PADSTACK::ALL_LAYERS ) );
380 BOOST_CHECK_NO_THROW( pad.GetSize( PADSTACK::ALL_LAYERS ) );
381 BOOST_CHECK_NO_THROW( pad.Padstack().EffectiveLayerFor( PADSTACK::ALL_LAYERS ) );
382
383 // Verify the returned shape is sane (the B_Cu props, which were originally F_Cu props)
384 BOOST_CHECK( pad.GetShape( PADSTACK::ALL_LAYERS ) == PAD_SHAPE::CIRCLE );
385}
386
387
388// Regression test for issue #24696: a grouped zone left its group after undo/redo of a fill.
389// SwapItemData() (used by undo/redo and commit revert) must not move group membership, which
390// is a structural back-reference rather than swappable item data.
391BOOST_AUTO_TEST_CASE( Issue24696_SwapItemDataKeepsGroupMembership )
392{
393 PCB_GROUP group( &m_board );
394 ZONE live( &m_board );
395 ZONE image( &m_board );
396
397 // Mirror the undo swap: BOARD::Remove() has already stripped the live item's group,
398 // while the undo image still carries the membership.
399 live.SetParentGroup( nullptr );
400 image.SetParentGroup( &group );
401
402 live.SwapItemData( &image );
403
404 BOOST_CHECK( live.GetParentGroup() == nullptr );
405 BOOST_CHECK( image.GetParentGroup() == &group );
406
407 image.SetParentGroup( nullptr );
408}
409
410
411// Partial hardening for the BOARD::RecordDRCExclusions crash family (Sentry KICAD-YT2,
412// KICAD-YTA). A PCB_MARKER may legitimately carry a null RC_ITEM (its ctor and dtor both guard
413// the member), but SerializeToString() dereferences it unconditionally, so recording exclusions
414// during a project save or window close faulted on such a marker.
415BOOST_AUTO_TEST_CASE( RecordDRCExclusionsSkipsMarkerWithoutRCItem )
416{
417 BOARD board;
418
419 PCB_MARKER* marker = new PCB_MARKER( nullptr, VECTOR2I( 0, 0 ) );
420 marker->SetExcluded( true );
421 board.Add( marker );
422
423 BOOST_CHECK_NO_THROW( board.RecordDRCExclusions() );
424
425 // The item-less marker has no violation to serialize, so nothing is persisted.
426 BOOST_CHECK( board.GetDesignSettings().m_DrcExclusions.empty() );
427}
428
429
430BOOST_AUTO_TEST_CASE( ResolveItemIdentityCachePurgedOnDestruction )
431{
432 BOARD board;
433
434 FOOTPRINT* footprint = new FOOTPRINT( &board );
435 board.Add( footprint );
436
437 PAD* pad = new PAD( footprint );
438 footprint->Pads().push_back( pad );
439 board.CacheItemById( pad );
440
441 const KIID padId = pad->m_Uuid;
442
444 BOOST_REQUIRE_EQUAL( board.ResolveItem( padId, true ), static_cast<BOARD_ITEM*>( pad ) );
445
446 // Detach the pad from the footprint without FOOTPRINT::Remove()'s surgical eviction, leaving it
447 // parented to the still-board-attached footprint, then free it directly. This stands in for the
448 // producer paths that free a board-parented item without touching the identity cache; only the
449 // ~BOARD_ITEM safety net can then keep ResolveItem() from returning a freed pointer.
450 std::deque<PAD*>& pads = footprint->Pads();
451 pads.erase( std::find( pads.begin(), pads.end(), pad ) );
452 delete pad;
453
454 BOOST_CHECK( board.ResolveItem( padId, true ) == nullptr );
455}
456
457
458// The per-item flag must track the board's identity cache across every mutation path.
459BOOST_AUTO_TEST_CASE( IndexMembershipFlagTracksCache )
460{
461 BOARD board;
462
463 FOOTPRINT* footprint = new FOOTPRINT( &board );
464 board.Add( footprint );
465
466 PAD* pad = new PAD( footprint );
467 footprint->Pads().push_back( pad );
468
469 BOOST_CHECK( !pad->IsIndexedInBoard() );
470
471 board.CacheItemById( pad );
472 BOOST_CHECK( pad->IsIndexedInBoard() );
473 BOOST_CHECK( board.IsItemIndexedById( pad ) );
474
475 // A clone is a distinct object, not itself indexed.
476 {
477 PAD copy( *pad );
478 BOOST_CHECK( !copy.IsIndexedInBoard() );
479 }
480
481 board.UncacheItemById( pad->m_Uuid );
482 BOOST_CHECK( !pad->IsIndexedInBoard() );
483 BOOST_CHECK( !board.IsItemIndexedById( pad ) );
484
485 board.CacheAndReturnItemById( pad->m_Uuid, pad );
486 BOOST_CHECK( pad->IsIndexedInBoard() );
487
488 board.UncacheItemByPtr( pad );
489 BOOST_CHECK( !pad->IsIndexedInBoard() );
490 BOOST_CHECK( !board.IsItemIndexedById( pad ) );
491
492 board.CacheItemById( pad );
493 BOOST_REQUIRE( pad->IsIndexedInBoard() );
494 board.ClearItemByIdCache();
495 BOOST_CHECK( !pad->IsIndexedInBoard() );
496}
497
498
499// A rejected Add() (here a track on a non-copper layer) must leave the item out of the cache.
500BOOST_AUTO_TEST_CASE( RejectedAddLeavesItemUnindexed )
501{
502 BOARD board;
503
504 PCB_TRACK* track = new PCB_TRACK( &board );
505 track->SetLayer( Edge_Cuts );
506
507 CHECK_WX_ASSERT( board.Add( track ) );
508
509 BOOST_CHECK( !track->IsIndexedInBoard() );
510 BOOST_CHECK( !board.IsItemIndexedById( track ) );
511
512 BOOST_CHECK_NO_THROW( delete track );
513}
514
515
516// A never-indexed item parented to a freed board must not touch that board on destruction, the
517// crash from the "KiCad master crashes" report (follow-up to ac12a1c820).
518BOOST_AUTO_TEST_CASE( UncachedItemSurvivesBoardDestruction )
519{
520 BOARD* board = new BOARD();
521 PCB_VIA* dummy = new PCB_VIA( board );
522
523 BOOST_REQUIRE( !dummy->IsIndexedInBoard() );
524
525 delete board;
526
527 BOOST_CHECK_NO_THROW( delete dummy );
528}
529
530
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:121
BASE_SET & set(size_t pos)
Definition base_set.h:116
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
std::set< wxString > m_DrcExclusions
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
void SwapItemData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
bool IsIndexedInBoard() const
Definition board_item.h:388
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
void CacheItemById(BOARD_ITEM *aItem) const
Add an item to the item-by-id cache.
Definition board.cpp:2077
void UncacheItemById(const KIID &aId) const
Remove an item from the item-by-id cache.
Definition board.cpp:2108
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition board.cpp:1355
void ClearItemByIdCache()
Definition board.cpp:2186
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
Definition board.cpp:392
void UncacheItemByPtr(const BOARD_ITEM *aItem)
Remove every cache entry that still points to aItem.
Definition board.cpp:2161
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1158
BOARD_ITEM * CacheAndReturnItemById(const KIID &aId, BOARD_ITEM *aItem) const
Definition board.cpp:2128
bool IsItemIndexedById(const BOARD_ITEM *aItem) const
Definition board.h:1569
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
Definition board.cpp:1928
constexpr coord_type GetLeft() const
Definition box2.h:224
constexpr coord_type GetRight() const
Definition box2.h:213
constexpr coord_type GetTop() const
Definition box2.h:225
constexpr coord_type GetBottom() const
Definition box2.h:218
virtual VECTOR2I GetPosition() const
Definition eda_item.h:282
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition eda_item.cpp:135
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:114
virtual void SetParentGroup(EDA_GROUP *aGroup)
Definition eda_item.h:113
void SetRectangleHeight(const int &aHeight)
void SetRectangleWidth(const int &aWidth)
static ENUM_MAP< T > & Instance()
Definition property.h:721
std::deque< PAD * > & Pads()
Definition footprint.h:375
Definition kiid.h:46
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
void SetExcluded(bool aExcluded, const wxString &aComment=wxEmptyString)
Definition marker_base.h:90
@ CUSTOM
Shapes can be defined on arbitrary layers.
Definition padstack.h:173
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition padstack.h:177
Definition pad.h:61
void AssembleBarcode() const
Assemble the barcode polygon and text polygons into a single polygonal representation.
void SetText(const wxString &aText)
Set the barcode content text to encode.
For better understanding of the points that make a dimension:
Mark the center of a circle or arc with a cross shape.
A leader is a dimension-like object pointing to a specific point.
An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the X or ...
A radial dimension indicates either the radius or diameter of an arc or circle.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:51
A PCB_POINT is a 0-dimensional point that is used to mark a position on a PCB, or more usually a foot...
Definition pcb_point.h:39
Object to handle a bitmap image that can be inserted in a PCB.
BOARD_ITEM * Instantiate(KICAD_T aType)
static void CompareItems(BOARD_ITEM *aItem, BOARD_ITEM *aOriginalItem)
std::shared_ptr< DRC_ITEM > m_drcItem
Handle a list of polygons defining a copper zone.
Definition zone.h:70
bool AppendCorner(VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
Definition zone.cpp:1410
@ DRCE_MALFORMED_COURTYARD
Definition drc_item.h:65
static void IterateOverPositionsAndReferences(T *aItem, void(*aCallback)(T *, VECTOR2I))
@ Edge_Cuts
Definition layer_ids.h:108
@ F_Cu
Definition layer_ids.h:60
@ TOP_BOTTOM
Flip top to bottom (around the X axis)
Definition mirror.h:25
@ SMD
Smd pad, appears on the solder paste layer (default)
Definition padstack.h:99
BARCODE class definition.
Class to handle a set of BOARD_ITEMs.
std::vector< FAB_LAYER_COLOR > dummy
@ USER
The field ID hasn't been set yet; field is invalid.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(Type)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:71
@ PCB_T
Definition typeinfo.h:75
@ PCB_CONSTRAINT_T
class PCB_CONSTRAINT, a geometric constraint between board items
Definition typeinfo.h:238
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:81
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition typeinfo.h:99
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition typeinfo.h:96
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition typeinfo.h:84
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:90
@ MAX_STRUCT_TYPE_ID
Definition typeinfo.h:241
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition typeinfo.h:97
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition typeinfo.h:104
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition typeinfo.h:86
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition typeinfo.h:101
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition typeinfo.h:85
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
Definition typeinfo.h:82
@ PCB_ITEM_LIST_T
class BOARD_ITEM_LIST, a list of board items
Definition typeinfo.h:102
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition typeinfo.h:83
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition typeinfo.h:92
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
Definition typeinfo.h:94
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
Definition typeinfo.h:100
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition typeinfo.h:88
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:79
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition typeinfo.h:95
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition typeinfo.h:80
@ PCB_BOARD_OUTLINE_T
class PCB_BOARD_OUTLINE_T, a pcb board outline item
Definition typeinfo.h:105
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:91
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition typeinfo.h:87
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition typeinfo.h:103
@ PCB_POINT_T
class PCB_POINT, a 0-dimensional point
Definition typeinfo.h:106
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:89
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition typeinfo.h:98
constexpr bool IsPcbnewType(const KICAD_T aType)
Definition typeinfo.h:434
constexpr bool IsInstantiableType(const KICAD_T aType)
Definition typeinfo.h:317
#define CHECK_WX_ASSERT(STATEMENT)
A test macro to check a wxASSERT is thrown.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683