KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_api_proto.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) 2024 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <boost/test/unit_test.hpp>
22#include <memory>
23#include <limits>
24#include <import_export.h>
29
30#include <api/board/board_types.pb.h>
31#include <api/common/types/embedded_files.pb.h>
32
33#include <board.h>
34#include <embedded_files.h>
35#include <footprint.h>
36#include <pcb_barcode.h>
37#include <pcb_3d_body.h>
38#include <pcb_dimension.h>
39#include <pcb_drill_chart.h>
40#include <pcb_drill_map.h>
41#include <pcb_grid_item.h>
42#include <pad.h>
43#include <pcb_reference_image.h>
44#include <pcb_shape.h>
45#include <pcb_table.h>
46#include <pcb_text.h>
47#include <pcb_textbox.h>
48#include <pcb_track.h>
49#include <zone.h>
50
51
52BOOST_AUTO_TEST_SUITE( ApiProto )
53
62
63
65{
66 KI_TEST::LoadBoard( m_settingsManager, "api_kitchen_sink", m_board );
67
68 int barcodeCount = 0;
69 int drillChartCount = 0;
70 int drillMapCount = 0;
71 int referenceImageCount = 0;
72 int tableCount = 0;
73 int textCount = 0;
74 int textBoxCount = 0;
75 int shapeCount = 0;
76
77 for( PCB_TRACK* track : m_board->Tracks() )
78 {
79 switch( track->Type() )
80 {
81 case PCB_TRACE_T:
83 break;
84
85 case PCB_ARC_T:
87 m_board.get() );
88 break;
89
90 case PCB_VIA_T:
92 m_board.get() );
93 break;
94
95 default:
96 wxFAIL;
97 }
98 }
99
100 for( FOOTPRINT* footprint : m_board->Footprints() )
102
103 for( ZONE* zone : m_board->Zones() )
105
106 for( BOARD_ITEM* item : m_board->Drawings() )
107 {
108 switch( item->Type() )
109 {
112 static_cast<PCB_DIM_ALIGNED*>( item ), m_board.get() );
113 break;
114
117 static_cast<PCB_DIM_ORTHOGONAL*>( item ), m_board.get() );
118 break;
119
120 case PCB_DIM_CENTER_T:
122 static_cast<PCB_DIM_CENTER*>( item ), m_board.get() );
123 break;
124
125 case PCB_DIM_LEADER_T:
127 static_cast<PCB_DIM_LEADER*>( item ), m_board.get() );
128 break;
129
130 case PCB_DIM_RADIAL_T:
132 static_cast<PCB_DIM_RADIAL*>( item ), m_board.get() );
133 break;
134
135 case PCB_BARCODE_T:
137 static_cast<PCB_BARCODE*>( item ), m_board.get() );
138 ++barcodeCount;
139 break;
140
143 static_cast<PCB_REFERENCE_IMAGE*>( item ), m_board.get() );
144 ++referenceImageCount;
145 break;
146
149 static_cast<PCB_DRILL_CHART*>( item ), m_board.get() );
150 ++drillChartCount;
151 break;
152
153 case PCB_DRILL_MAP_T:
155 static_cast<PCB_DRILL_MAP*>( item ), m_board.get() );
156 ++drillMapCount;
157 break;
158
159 case PCB_TABLE_T:
160 testProtoFromKiCadObject<kiapi::board::types::Table>( static_cast<PCB_TABLE*>( item ), m_board.get() );
161 ++tableCount;
162 break;
163
164 case PCB_TEXT_T:
166 static_cast<PCB_TEXT*>( item ), m_board.get() );
167 ++textCount;
168 break;
169
170 case PCB_TEXTBOX_T:
172 static_cast<PCB_TEXTBOX*>( item ), m_board.get() );
173 ++textBoxCount;
174 break;
175
176 case PCB_SHAPE_T:
178 static_cast<PCB_SHAPE*>( item ), m_board.get() );
179 ++shapeCount;
180 break;
181
182 default: break;
183 }
184 }
185
186 BOOST_CHECK_GT( barcodeCount, 0 );
187 BOOST_CHECK_GT( drillChartCount, 0 );
188 BOOST_CHECK_GT( drillMapCount, 0 );
189 BOOST_CHECK_GT( referenceImageCount, 0 );
190 BOOST_CHECK_GT( tableCount, 0 );
191 BOOST_CHECK_GT( textCount, 0 );
192 BOOST_CHECK_GT( textBoxCount, 0 );
193 BOOST_CHECK_GT( shapeCount, 0 );
194}
195
196
197BOOST_AUTO_TEST_CASE( FootprintExcludeFromSimulationRoundTrip )
198{
199 BOARD board;
200 FOOTPRINT footprint( &board );
201
202 footprint.SetExcludedFromSim( true );
203
205}
206
207
209{
210 KI_TEST::LoadBoard( m_settingsManager, "api_kitchen_sink", m_board );
211
212 PCB_DRILL_CHART* chart = nullptr;
213
214 for( BOARD_ITEM* item : m_board->Drawings() )
215 {
216 if( item->Type() == PCB_DRILL_CHART_T )
217 {
218 chart = static_cast<PCB_DRILL_CHART*>( item );
219 break;
220 }
221 }
222
223 BOOST_REQUIRE( chart );
224
225 google::protobuf::Any any;
226 chart->Serialize( any );
227 kiapi::board::types::DrillChart proto;
228 BOOST_REQUIRE( any.UnpackTo( &proto ) );
229 BOOST_REQUIRE_GT( proto.columns_size(), 0 );
230 BOOST_CHECK_EQUAL( proto.columns( 0 ).width().value_nm(), 16000000 );
231
232 for( int64_t width : { int64_t( 0 ), int64_t( GENERATED_TABLE_MAX_COLUMN_WIDTH ) } )
233 {
234 proto.mutable_columns( 0 )->mutable_width()->set_value_nm( width );
235 any.PackFrom( proto );
236 PCB_DRILL_CHART restored( m_board.get() );
237 BOOST_REQUIRE( restored.Deserialize( any ) );
238 BOOST_CHECK_EQUAL( restored.Columns().front().m_Width, width );
239 }
240
241 for( int64_t width : { int64_t( -1 ), int64_t( GENERATED_TABLE_MAX_COLUMN_WIDTH ) + 1,
242 std::numeric_limits<int64_t>::max() } )
243 {
244 proto.mutable_columns( 0 )->mutable_width()->set_value_nm( width );
245 any.PackFrom( proto );
246 PCB_DRILL_CHART restored( m_board.get() );
247 BOOST_REQUIRE( restored.Deserialize( any ) );
248 BOOST_CHECK_EQUAL( restored.Columns().front().m_Width,
249 width < 0 ? 0 : GENERATED_TABLE_MAX_COLUMN_WIDTH );
250 }
251}
252
253
255{
256 KI_TEST::LoadBoard( m_settingsManager, "padstacks", m_board );
257
258 for( PCB_TRACK* track : m_board->Tracks() )
259 {
260 switch( track->Type() )
261 {
262 case PCB_VIA_T:
263 testProtoFromKiCadObject<kiapi::board::types::Via>( static_cast<PCB_VIA*>( track ), m_board.get() );
264 break;
265
266 default:
267 wxFAIL;
268 }
269 }
270
271 for( FOOTPRINT* footprint : m_board->Footprints() )
273}
274
275
277{
278 KI_TEST::LoadBoard( m_settingsManager, "api_kitchen_sink", m_board );
279
280 for( const FOOTPRINT* fp : m_board->Footprints() )
281 {
282 if( fp->EmbeddedFileMap().empty() )
283 continue;
284
285 BOOST_TEST_CONTEXT( wxString::Format( wxS( "Footprint %s embedded files" ), fp->m_Uuid.AsStdString() ) )
286 {
287 google::protobuf::Any any;
288 fp->Serialize( any );
289
290 kiapi::board::types::FootprintInstance proto;
291 BOOST_CHECK( any.UnpackTo( &proto ) );
292
293 BOOST_CHECK_GT( proto.embedded_files().files_size(), 0 );
294
295 const kiapi::common::types::EmbeddedFile& file = proto.embedded_files().files( 0 );
296 BOOST_CHECK( !file.data().empty() );
297
298 std::unique_ptr<FOOTPRINT> roundTripped = std::make_unique<FOOTPRINT>( m_board.get() );
299 BOOST_CHECK( roundTripped->Deserialize( any ) );
300
301 for( const auto& [name, expected] : fp->EmbeddedFileMap() )
302 {
303 const EMBEDDED_FILES::EMBEDDED_FILE* actual = roundTripped->GetEmbeddedFile( name );
304 BOOST_CHECK_MESSAGE( actual, wxString::Format( wxS( "Embedded file '%s' missing after round-trip" ), name ).c_str() );
305 BOOST_CHECK_EQUAL( magic_enum::enum_name( expected->type ), magic_enum::enum_name( actual->type ) );
306 BOOST_CHECK_EQUAL( expected->data_hash, actual->data_hash );
307 BOOST_CHECK_EQUAL( expected->compressedEncodedData, actual->compressedEncodedData );
308 }
309 }
310 }
311}
312
313
320BOOST_FIXTURE_TEST_CASE( CopperThievingZoneRoundTrip, PROTO_TEST_FIXTURE )
321{
322 m_board = std::make_unique<BOARD>();
323
324 ZONE* zone = new ZONE( m_board.get() );
325 zone->SetLayer( F_Cu );
326 zone->AppendCorner( VECTOR2I( 0, 0 ), -1 );
327 zone->AppendCorner( VECTOR2I( pcbIUScale.mmToIU( 5 ), 0 ), -1 );
328 zone->AppendCorner( VECTOR2I( pcbIUScale.mmToIU( 5 ), pcbIUScale.mmToIU( 5 ) ), -1 );
329 zone->AppendCorner( VECTOR2I( 0, pcbIUScale.mmToIU( 5 ) ), -1 );
331
332 THIEVING_SETTINGS thieving;
334 thieving.element_size = pcbIUScale.mmToIU( 0.75 );
335 thieving.gap = pcbIUScale.mmToIU( 2.0 );
336 thieving.line_width = pcbIUScale.mmToIU( 0.4 );
337 thieving.stagger = true;
338 thieving.orientation = EDA_ANGLE( 15.0, DEGREES_T );
339 zone->SetThievingSettings( thieving );
340
341 m_board->Add( zone );
342
343 google::protobuf::Any any;
344 BOOST_REQUIRE_NO_THROW( zone->Serialize( any ) );
345
346 kiapi::board::types::Zone proto;
347 BOOST_REQUIRE( any.UnpackTo( &proto ) );
348 BOOST_REQUIRE( proto.has_copper_settings() );
349 BOOST_REQUIRE( proto.copper_settings().has_thieving_settings() );
350
351 std::unique_ptr<ZONE> roundTripped = std::make_unique<ZONE>( m_board.get() );
352 BOOST_REQUIRE( roundTripped->Deserialize( any ) );
353
354 BOOST_CHECK( roundTripped->GetFillMode() == ZONE_FILL_MODE::COPPER_THIEVING );
355 // A board with no netinfo list returns GetNetCode() == -1 for an unbound zone.
356 // The invariant we want is "no real net assigned"; netcode > 0 would mean a leak.
357 BOOST_CHECK_LE( roundTripped->GetNetCode(), 0 );
358
359 const THIEVING_SETTINGS& loaded = roundTripped->GetThievingSettings();
360 BOOST_CHECK( loaded.pattern == THIEVING_PATTERN::SQUARES );
361 BOOST_CHECK_EQUAL( loaded.element_size, thieving.element_size );
362 BOOST_CHECK_EQUAL( loaded.gap, thieving.gap );
363 BOOST_CHECK_EQUAL( loaded.line_width, thieving.line_width );
364 BOOST_CHECK_EQUAL( loaded.stagger, true );
365 BOOST_CHECK( loaded.orientation.GetAngle() == EDA_ANGLE( 15.0, DEGREES_T ) );
366}
367
368
370{
371 const auto makeGridItem =
372 []()
373 {
374 return std::make_unique<PCB_GRID_ITEM>( nullptr );
375 };
376
377 PCB_GRID_ITEM cartesian( nullptr );
379 cartesian.SetPosition( VECTOR2I( 1000000, -2000000 ) );
380 cartesian.SetOrientationDegrees( 30.0 );
381 cartesian.SetExtent( VECTOR2I( 5000000, 4000000 ) );
382 cartesian.SetSpacing( VECTOR2I( 250000, 500000 ) );
383 cartesian.SetAssignedPriority( 3 );
384 cartesian.SetTickInterval( 5 );
385 cartesian.SetAffectsRouting( false );
386 cartesian.SetLocked( true );
387
389
390 PCB_GRID_ITEM polar( nullptr );
392 polar.SetPosition( VECTOR2I( -750000, 125000 ) );
393 polar.SetRadiusExtent( 8000000 );
394 polar.SetRadiusSpacing( 1000000 );
395 polar.SetPhiExtentDegrees( 270.0 );
396 polar.SetPhiSpacingDegrees( 7.5 );
397 polar.SetAssignedPriority( 1 );
398 polar.SetAffectsCursor( false );
399 polar.SetAffectsPlacement( false );
400
402
403 // The polar half of the grid must survive, not just the shared linear fields.
404 google::protobuf::Any any;
405 polar.Serialize( any );
406
407 std::unique_ptr<PCB_GRID_ITEM> roundTripped = makeGridItem();
408 BOOST_REQUIRE( roundTripped->Deserialize( any ) );
409
410 BOOST_CHECK( roundTripped->GetGridItemType() == PCB_GRID_TYPE::POLAR );
411 BOOST_CHECK_EQUAL( roundTripped->GetRadiusExtent(), 8000000 );
412 BOOST_CHECK_EQUAL( roundTripped->GetRadiusSpacing(), 1000000 );
413 BOOST_CHECK( roundTripped->GetPhiExtent() == EDA_ANGLE( 270.0, DEGREES_T ) );
414 BOOST_CHECK( roundTripped->GetPhiSpacing() == EDA_ANGLE( 7.5, DEGREES_T ) );
415 BOOST_CHECK_EQUAL( roundTripped->GetAffectsCursor(), false );
416 BOOST_CHECK_EQUAL( roundTripped->GetAffectsRouting(), true );
417 BOOST_CHECK_EQUAL( roundTripped->GetAffectsPlacement(), false );
418 BOOST_CHECK_EQUAL( roundTripped->IsLocked(), false );
419}
420
421
423{
424 const auto makeBody =
425 []()
426 {
427 return std::make_unique<PCB_3D_BODY>();
428 };
429
430 // Populated body, including both layer sentinels
431 PCB_3D_BODY populated;
432 EXTRUDED_3D_BODY& extruded = *populated.MutableExtruded();
433 extruded.m_height = pcbIUScale.mmToIU( 2.5 );
434 extruded.m_standoff = pcbIUScale.mmToIU( 0.1 );
435 extruded.m_layer = F_CrtYd;
437 extruded.m_color = KIGFX::COLOR4D( 0.8, 0.4, 0.0, 0.9 );
438 extruded.m_offset = VECTOR3D( 1.0, -0.5, 0.2 );
439 extruded.m_scale = VECTOR3D( 1.5, 0.8, 2.0 );
440 extruded.m_rotation = VECTOR3D( 10.0, 20.0, 45.0 );
441 extruded.m_show = false;
442
444
445 PCB_3D_BODY autoLayer;
447
449
450 PCB_3D_BODY padBBox;
452
454
455 // No color set: the optional must stay absent across the round trip
456 google::protobuf::Any any;
457 autoLayer.Serialize( any );
458
459 kiapi::board::types::Body3D msg;
460 BOOST_REQUIRE( any.UnpackTo( &msg ) );
461 BOOST_CHECK( !msg.extruded().has_color() );
462
463 // A model-kind body is reserved and must be rejected on deserialize
464 msg.set_kind( kiapi::board::types::BDK_MODEL );
465 any.PackFrom( msg );
466
467 std::unique_ptr<PCB_3D_BODY> modelBody = makeBody();
468 BOOST_CHECK( !modelBody->Deserialize( any ) );
469
470 // A body whose parent names a different footprint is still imported as a child
471 BOARD board;
472 FOOTPRINT target( &board );
473
474 kiapi::board::types::Footprint definition;
475
476 msg.Clear();
477 msg.set_kind( kiapi::board::types::BDK_EXTRUDED );
478 msg.mutable_id()->set_value( KIID().AsStdString() );
479 msg.mutable_parent()->set_value( "00000000-0000-0000-0000-000000000001" );
480 msg.mutable_extruded()->mutable_height()->set_value_nm( pcbIUScale.mmToIU( 2 ) );
481 any.PackFrom( msg );
482 *definition.add_items() = any;
483
484 BOOST_CHECK( target.DeserializeDefinition( definition ) );
485 BOOST_CHECK( target.HasBody() );
486 BOOST_CHECK_EQUAL( target.GetBody()->GetParentFootprint(), &target );
487
488}
489
490BOOST_AUTO_TEST_CASE( PadCustomShapeProxyItems )
491{
492 BOARD board;
493 FOOTPRINT footprint( &board );
494 PAD pad( &footprint );
495
496 auto numberBox = std::make_shared<PCB_SHAPE>( &pad, SHAPE_T::RECTANGLE );
497 numberBox->SetIsProxyItem();
498
499 auto spokeTemplate = std::make_shared<PCB_SHAPE>( &pad, SHAPE_T::SEGMENT );
500 spokeTemplate->SetIsProxyItem();
501
502 auto plainShape = std::make_shared<PCB_SHAPE>( &pad, SHAPE_T::SEGMENT );
503
504 google::protobuf::Any numberBoxAny;
505 numberBox->Serialize( numberBoxAny );
506
507 kiapi::board::types::BoardGraphicShape numberBoxProto;
508 BOOST_REQUIRE( numberBoxAny.UnpackTo( &numberBoxProto ) );
509 BOOST_REQUIRE( numberBoxProto.has_pad_custom_shape_options() );
510 BOOST_CHECK( numberBoxProto.pad_custom_shape_options().is_number_box() );
511
512 google::protobuf::Any spokeAny;
513 spokeTemplate->Serialize( spokeAny );
514
515 kiapi::board::types::BoardGraphicShape spokeProto;
516 BOOST_REQUIRE( spokeAny.UnpackTo( &spokeProto ) );
517 BOOST_REQUIRE( spokeProto.has_pad_custom_shape_options() );
518 BOOST_CHECK( spokeProto.pad_custom_shape_options().is_thermal_spoke_template() );
519
520 google::protobuf::Any plainAny;
521 plainShape->Serialize( plainAny );
522
523 kiapi::board::types::BoardGraphicShape plainProto;
524 BOOST_REQUIRE( plainAny.UnpackTo( &plainProto ) );
525 BOOST_CHECK( !plainProto.has_pad_custom_shape_options() );
526
527 // A role arriving on a mismatched shape type is ignored
528 google::protobuf::Any mismatchedAny;
529 spokeTemplate->Serialize( mismatchedAny );
530
531 kiapi::board::types::BoardGraphicShape mismatchedProto;
532 BOOST_REQUIRE( mismatchedAny.UnpackTo( &mismatchedProto ) );
533 mismatchedProto.clear_shape();
534 mismatchedProto.mutable_shape()->mutable_rectangle()->mutable_top_left()->set_x_nm( 0 );
535 mismatchedProto.mutable_shape()->mutable_rectangle()->mutable_top_left()->set_y_nm( 0 );
536 mismatchedProto.mutable_shape()->mutable_rectangle()->mutable_bottom_right()->set_x_nm( 1 );
537 mismatchedProto.mutable_shape()->mutable_rectangle()->mutable_bottom_right()->set_y_nm( 1 );
538 mismatchedAny.PackFrom( mismatchedProto );
539
540 PCB_SHAPE mismatched( &pad, SHAPE_T::RECTANGLE );
541 BOOST_REQUIRE( mismatched.Deserialize( mismatchedAny ) );
542 BOOST_CHECK( !mismatched.IsProxyItem() );
543}
544
545
const char * name
void testProtoFromKiCadObject(KiCadClass *aInput, Factory &&aCreateOutput)
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:128
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:85
void SetLocked(bool aLocked) override
Definition board_item.h:427
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
EDA_ANGLE GetAngle() const
Definition eda_angle.h:533
KIGFX::COLOR4D m_color
Definition pcb_3d_body.h:46
VECTOR3D m_offset
Definition pcb_3d_body.h:52
PCB_LAYER_ID m_layer
Definition pcb_3d_body.h:45
VECTOR3D m_rotation
Definition pcb_3d_body.h:51
EXTRUSION_MATERIAL m_material
Definition pcb_3d_body.h:47
void SetExcludedFromSim(bool aExclude=true)
Definition footprint.h:939
const PCB_3D_BODY * GetBody() const
Definition footprint.h:427
bool DeserializeDefinition(const kiapi::board::types::Footprint &aInput)
bool HasBody() const
Convenience accessors for now while we restrict to only one body per footprint.
Definition footprint.h:426
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
Definition kiid.h:46
Definition pad.h:61
A 3D body attached to a footprint (or, later, placed on a board).
Definition pcb_3d_body.h:93
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
EXTRUDED_3D_BODY * MutableExtruded()
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 drill chart placed on the board, kept in step with the holes.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Turns on drill symbols at the holes, for one layer.
std::vector< GENERATED_TABLE_COLUMN > & Columns()
void SetRadiusExtent(int aR)
void SetAffectsRouting(bool aOn)
void SetPosition(const VECTOR2I &aPos) override
void SetRadiusSpacing(int aR)
void SetGridItemType(PCB_GRID_TYPE aType)
void SetExtent(const VECTOR2I &aExtent)
void SetTickInterval(unsigned aInterval)
void SetOrientationDegrees(double aDeg)
void SetSpacing(const VECTOR2I &aSpacing)
void SetPhiExtentDegrees(double aDeg)
void SetAffectsPlacement(bool aOn)
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void SetPhiSpacingDegrees(double aDeg)
void SetAssignedPriority(unsigned aPriority)
Priority 0 is reserved for the global background grid; user-assigned 0 is bumped to 1.
void SetAffectsCursor(bool aOn)
Object to handle a bitmap image that can be inserted in a PCB.
bool IsProxyItem() const override
Definition pcb_shape.h:155
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Handle a list of polygons defining a copper zone.
Definition zone.h:70
bool AppendCorner(const 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:1496
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition zone.cpp:675
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition zone.cpp:282
void SetFillMode(ZONE_FILL_MODE aFillMode)
Definition zone.cpp:681
void SetThievingSettings(const THIEVING_SETTINGS &aSettings)
Definition zone.h:352
A type-safe container of any type.
Definition ki_any.h:92
@ DEGREES_T
Definition eda_angle.h:30
@ SEGMENT
Definition eda_shape.h:56
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
Definition eda_shape.h:57
constexpr int GENERATED_TABLE_MAX_COLUMN_WIDTH
A column can be no wider than this.
@ F_CrtYd
Definition layer_ids.h:112
@ UNSELECTED_LAYER
Definition layer_ids.h:58
@ UNDEFINED_LAYER
Definition layer_ids.h:57
@ F_Cu
Definition layer_ids.h:60
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
BARCODE class definition.
std::unique_ptr< BOARD > m_board
SETTINGS_MANAGER m_settingsManager
Parameters that drive copper-thieving fill generation.
THIEVING_PATTERN pattern
EDA_ORIENTATION orientation
BOOST_FIXTURE_TEST_CASE(BoardTypes, PROTO_TEST_FIXTURE)
BOOST_AUTO_TEST_CASE(FootprintExcludeFromSimulationRoundTrip)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
VECTOR3I expected(15, 30, 45)
BOOST_TEST_CONTEXT("Test Clearance")
int actual
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:80
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition typeinfo.h:98
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition typeinfo.h:95
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:89
@ PCB_DRILL_MAP_T
class PCB_DRILL_MAP, drill symbols drawn at the holes
Definition typeinfo.h:240
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition typeinfo.h:96
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition typeinfo.h:85
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition typeinfo.h:84
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
Definition typeinfo.h:81
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
Definition typeinfo.h:93
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition typeinfo.h:94
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:90
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition typeinfo.h:86
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:88
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition typeinfo.h:97
@ PCB_DRILL_CHART_T
class PCB_DRILL_CHART, a live drill chart derived from PCB_TABLE
Definition typeinfo.h:239
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
VECTOR3< double > VECTOR3D
Definition vector3.h:230