KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_block_drag_capability.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
22#include <algorithm>
23
24#include <board.h>
25#include <footprint.h>
26#include <pad.h>
27#include <pcb_field.h>
28#include <pcb_track.h>
29#include <drc/drc_item.h>
30#include <pcb_marker.h>
31#include <pcb_shape.h>
32#include <pcb_text.h>
33#include <pcb_table.h>
34#include <pcb_tablecell.h>
35#include <pcb_textbox.h>
36#include <pcb_dimension.h>
37#include <pcb_target.h>
38#include <pcb_group.h>
39#include <zone.h>
40#include <pcb_generator.h>
44
45
46namespace
47{
48
49class TEST_GENERATOR : public PCB_GENERATOR
50{
51public:
52 TEST_GENERATOR( BOARD_ITEM* aParent, const wxString& aGeneratorType ) :
53 PCB_GENERATOR( aParent, F_Cu ),
54 m_testGeneratorType( aGeneratorType )
55 {
56 }
57
58 wxString GetGeneratorType() const override { return m_testGeneratorType; }
59
60 void EditStart( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override {}
61 bool Update( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override { return true; }
62 void EditFinish( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override {}
63 void EditCancel( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override {}
64 void Remove( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) override {}
65
66 wxString GetPluralName() const override { return wxT( "Test Generators" ); }
67 wxString GetCommitMessage() const override { return wxT( "Test Generator" ); }
68
69private:
70 wxString m_testGeneratorType;
71};
72
73} // namespace
74
75
76BOOST_AUTO_TEST_SUITE( BlockDragCapabilityTests )
77
78
79BOOST_AUTO_TEST_CASE( RouterItemsInBoardEditor )
80{
81 BOARD board;
82
83 PCB_TRACK* track = new PCB_TRACK( &board );
84 PCB_ARC* arc = new PCB_ARC( &board );
85 PCB_VIA* via = new PCB_VIA( &board );
86 FOOTPRINT* footprint = new FOOTPRINT( &board );
87 PAD* pad = new PAD( footprint );
88
89 footprint->Add( pad );
90 board.Add( track );
91 board.Add( arc );
92 board.Add( via );
93 board.Add( footprint );
94
100}
101
102
103BOOST_AUTO_TEST_CASE( FootprintHolderHasNoRouter )
104{
105 BOARD board;
107
108 FOOTPRINT* footprint = new FOOTPRINT( &board );
109 PAD* pad = new PAD( footprint );
110 PCB_TRACK* track = new PCB_TRACK( &board );
111
112 footprint->Add( pad );
113 board.Add( footprint );
114 board.Add( track );
115
119}
120
121
122BOOST_AUTO_TEST_CASE( ShapeKindsSplitDeformableFromRigid )
123{
124 BOARD board;
125
126 PCB_SHAPE* segment = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
127 PCB_SHAPE* poly = new PCB_SHAPE( &board, SHAPE_T::POLY );
128 PCB_SHAPE* rect = new PCB_SHAPE( &board, SHAPE_T::RECTANGLE );
129 PCB_SHAPE* arc = new PCB_SHAPE( &board, SHAPE_T::ARC );
130 PCB_SHAPE* circle = new PCB_SHAPE( &board, SHAPE_T::CIRCLE );
131 PCB_SHAPE* bezier = new PCB_SHAPE( &board, SHAPE_T::BEZIER );
132 PCB_SHAPE* ellipse = new PCB_SHAPE( &board, SHAPE_T::ELLIPSE );
133 PCB_SHAPE* ellipseArc = new PCB_SHAPE( &board, SHAPE_T::ELLIPSE_ARC );
134
135 for( PCB_SHAPE* shape : { segment, poly, rect, arc, circle, bezier, ellipse, ellipseArc } )
136 board.Add( shape );
137
146}
147
148
149BOOST_AUTO_TEST_CASE( ConstrainedShapeIsDeformable )
150{
151 BOARD board;
152
153 PCB_SHAPE* constrained = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
154 PCB_SHAPE* free = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
155
156 board.Add( constrained );
157 board.Add( free );
158
160 constraint->AddMember( constrained->m_Uuid, CONSTRAINT_ANCHOR::WHOLE );
161 board.Add( constraint );
162
163 BOOST_CHECK( BlockDragIsConstraintMember( *constrained ) );
167}
168
169
170BOOST_AUTO_TEST_CASE( FootprintOwnedConstraintIsFound )
171{
172 BOARD board;
174
175 FOOTPRINT* footprint = new FOOTPRINT( &board );
176 PCB_SHAPE* shape = new PCB_SHAPE( footprint, SHAPE_T::SEGMENT );
177
178 footprint->Add( shape );
179 board.Add( footprint );
180
181 PCB_CONSTRAINT* constraint = new PCB_CONSTRAINT( footprint, PCB_CONSTRAINT_TYPE::VERTICAL );
182 constraint->AddMember( shape->m_Uuid, CONSTRAINT_ANCHOR::WHOLE );
183 footprint->Add( constraint );
184
187}
188
189
190BOOST_AUTO_TEST_CASE( FootprintChildShapeIsRigidInBoardEditor )
191{
192 BOARD board;
193
194 FOOTPRINT* footprint = new FOOTPRINT( &board );
195 PCB_SHAPE* childShape = new PCB_SHAPE( footprint, SHAPE_T::SEGMENT );
196
197 footprint->Add( childShape );
198 board.Add( footprint );
199
201}
202
203
204BOOST_AUTO_TEST_CASE( FootprintChildrenAreDeformableInFootprintEditor )
205{
206 BOARD board;
208
209 FOOTPRINT* footprint = new FOOTPRINT( &board );
210 PCB_SHAPE* childShape = new PCB_SHAPE( footprint, SHAPE_T::POLY );
211 ZONE* childZone = new ZONE( footprint );
212
213 footprint->Add( childShape );
214 footprint->Add( childZone );
215 board.Add( footprint );
216
219}
220
221
222BOOST_AUTO_TEST_CASE( FootprintChildZoneIsRigidInBoardEditor )
223{
224 BOARD board;
225
226 FOOTPRINT* footprint = new FOOTPRINT( &board );
227 ZONE* childZone = new ZONE( footprint );
228
229 footprint->Add( childZone );
230 board.Add( footprint );
231
233}
234
235
236BOOST_AUTO_TEST_CASE( RigidOnlyTypes )
237{
238 BOARD board;
239
240 PCB_TEXT* text = new PCB_TEXT( &board );
241 PCB_TEXTBOX* textbox = new PCB_TEXTBOX( &board );
242 PCB_DIM_ALIGNED* dimension = new PCB_DIM_ALIGNED( &board );
243 PCB_TARGET* target = new PCB_TARGET( &board );
244 PCB_TABLE* table = new PCB_TABLE( &board, 0 );
245 PCB_TABLECELL* cell = new PCB_TABLECELL( table );
246
247 board.Add( text );
248 board.Add( textbox );
249 board.Add( dimension );
250 board.Add( target );
251 board.Add( table );
252
257
259
260 // A cell cannot travel on its own, the table owns its rectangle
262}
263
264
265BOOST_AUTO_TEST_CASE( GeneratorSafetyAllowList )
266{
267 BOARD board;
268
269 TEST_GENERATOR* tuning = new TEST_GENERATOR( &board, wxS( "tuning_pattern" ) );
270 TEST_GENERATOR* viaStack = new TEST_GENERATOR( &board, wxS( "via_stack" ) );
271 TEST_GENERATOR* viaStitch = new TEST_GENERATOR( &board, wxS( "via_stitch" ) );
272 TEST_GENERATOR* unknown = new TEST_GENERATOR( &board, wxS( "future_generator" ) );
273
274 board.Add( tuning );
275 board.Add( viaStack );
276 board.Add( viaStitch );
277 board.Add( unknown );
278
283}
284
285
286BOOST_AUTO_TEST_CASE( GroupContainerMustBeExpanded )
287{
288 BOARD board;
289
290 PCB_GROUP* group = new PCB_GROUP( &board );
291 board.Add( group );
292
294}
295
296
297BOOST_AUTO_TEST_CASE( GroupExpansionFlattensAndDeduplicates )
298{
299 BOARD board;
300
301 PCB_SHAPE* shapeA = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
302 PCB_SHAPE* shapeB = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
303 PCB_SHAPE* nestedShape = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
304
305 PCB_GROUP* inner = new PCB_GROUP( &board );
306 PCB_GROUP* outer = new PCB_GROUP( &board );
307
308 board.Add( shapeA );
309 board.Add( shapeB );
310 board.Add( nestedShape );
311 board.Add( inner );
312 board.Add( outer );
313
314 inner->AddItem( nestedShape );
315 outer->AddItem( shapeA );
316 outer->AddItem( shapeB );
317 outer->AddItem( inner );
318
319 // shapeA selected both directly and through the group
320 std::vector<BOARD_ITEM*> selection{ shapeA, outer };
321 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( selection );
322
323 BOOST_REQUIRE_EQUAL( expanded.size(), 3 );
324 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), shapeA ), 1 );
325 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), shapeB ), 1 );
326 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), nestedShape ), 1 );
327
328 for( BOARD_ITEM* item : expanded )
329 BOOST_CHECK( item->Type() != PCB_GROUP_T );
330}
331
332
333BOOST_AUTO_TEST_CASE( MarkerIsDroppedFromTheExpansion )
334{
335 BOARD board;
336
337 PCB_SHAPE* shape = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
338 PCB_MARKER* marker = new PCB_MARKER( DRC_ITEM::Create( DRCE_CLEARANCE ), VECTOR2I( 0, 0 ) );
339
340 board.Add( shape );
341 board.Add( marker );
342
343 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( { shape, marker } );
344
345 BOOST_REQUIRE_EQUAL( expanded.size(), 1 );
346 BOOST_CHECK( expanded.front() == shape );
347}
348
349
350// A footprint carries its own children, so a child that is selected next to its parent
351// has to leave the moving set or it takes the displacement twice
352BOOST_AUTO_TEST_CASE( FootprintChildIsDroppedWhenItsParentMovesToo )
353{
354 BOARD board;
355
356 FOOTPRINT* footprint = new FOOTPRINT( &board );
357 PAD* pad = new PAD( footprint );
358 PCB_SHAPE* silk = new PCB_SHAPE( footprint, SHAPE_T::SEGMENT );
359 PCB_SHAPE* standalone = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
360
361 footprint->Add( pad );
362 footprint->Add( silk );
363 board.Add( footprint );
364 board.Add( standalone );
365
366 std::vector<BOARD_ITEM*> expanded =
367 BlockDragExpandSelection( { &footprint->Reference(), pad, silk, footprint, standalone } );
368
369 BOOST_REQUIRE_EQUAL( expanded.size(), 2 );
370 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), footprint ), 1 );
371 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), standalone ), 1 );
372}
373
374
375// The same child on its own still moves, because nothing else is carrying it
376BOOST_AUTO_TEST_CASE( FootprintChildSurvivesWithoutItsParent )
377{
378 BOARD board;
379
380 FOOTPRINT* footprint = new FOOTPRINT( &board );
381 PCB_SHAPE* standalone = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
382
383 board.Add( footprint );
384 board.Add( standalone );
385
386 PCB_FIELD* reference = &footprint->Reference();
387
388 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( { reference, standalone } );
389
390 BOOST_REQUIRE_EQUAL( expanded.size(), 2 );
391 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), reference ), 1 );
392}
393
394
395// A group holding the footprint flattens to the footprint, which then has to drop the
396// separately selected child just the same
397BOOST_AUTO_TEST_CASE( FootprintChildIsDroppedWhenTheParentArrivesThroughAGroup )
398{
399 BOARD board;
400
401 FOOTPRINT* footprint = new FOOTPRINT( &board );
402 PCB_GROUP* group = new PCB_GROUP( &board );
403
404 board.Add( footprint );
405 board.Add( group );
406 group->AddItem( footprint );
407
408 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( { &footprint->Reference(), group } );
409
410 BOOST_REQUIRE_EQUAL( expanded.size(), 1 );
411 BOOST_CHECK( expanded.front() == footprint );
412}
413
414
415BOOST_AUTO_TEST_CASE( GeneratorIsNotExpanded )
416{
417 BOARD board;
418
419 TEST_GENERATOR* generator = new TEST_GENERATOR( &board, wxS( "tuning_pattern" ) );
420 PCB_TRACK* memberTrack = new PCB_TRACK( &board );
421
422 board.Add( generator );
423 board.Add( memberTrack );
424 generator->AddItem( memberTrack );
425
426 std::vector<BOARD_ITEM*> selection{ generator };
427 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( selection );
428
429 BOOST_REQUIRE_EQUAL( expanded.size(), 1 );
430 BOOST_CHECK( expanded.front() == generator );
431}
432
433
434BOOST_AUTO_TEST_CASE( ReferenceOnlyConstraintIsDeformable )
435{
436 BOARD board;
437
438 PCB_SHAPE* measured = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
439 board.Add( measured );
440
442 reference->SetDriving( false );
443 reference->AddMember( measured->m_Uuid, CONSTRAINT_ANCHOR::WHOLE );
444 board.Add( reference );
445
448}
449
450
451BOOST_AUTO_TEST_CASE( MalformedConstraintIsDeformable )
452{
453 BOARD board;
454
455 PCB_SHAPE* listed = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
456 board.Add( listed );
457
458 // The other member never resolves to a real item, so the constraint is broken
460 dangling->AddMember( listed->m_Uuid, CONSTRAINT_ANCHOR::WHOLE );
462 board.Add( dangling );
463
466}
467
468
469// Solve with the edited geometry held fixed. The constrained neighbour follows it, and
470// the caller hears about it through the before-modify callback
471BOOST_AUTO_TEST_CASE( HeldEditNeighborFollows )
472{
473 BOARD board;
474
475 PCB_SHAPE* moved = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
476 moved->SetStart( VECTOR2I( 0, 0 ) );
477 moved->SetEnd( VECTOR2I( 100000, 0 ) );
478
479 PCB_SHAPE* follower = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
480 follower->SetStart( VECTOR2I( 100000, 0 ) );
481 follower->SetEnd( VECTOR2I( 300000, 50000 ) );
482
483 board.Add( moved );
484 board.Add( follower );
485
487 coincident->AddMember( moved->m_Uuid, CONSTRAINT_ANCHOR::END );
488 coincident->AddMember( follower->m_Uuid, CONSTRAINT_ANCHOR::START );
489 board.Add( coincident );
490
491 moved->SetStart( VECTOR2I( 10000, 10000 ) );
492 moved->SetEnd( VECTOR2I( 110000, 10000 ) );
493
494 std::vector<PCB_SHAPE*> solverMoved;
495 std::vector<BOARD_ITEM*> staged;
496
497 bool solved = ReSolveShapeClustersHoldingEdited( &board, { moved }, &solverMoved,
498 [&]( BOARD_ITEM* aItem )
499 {
500 staged.push_back( aItem );
501 } );
502
503 BOOST_REQUIRE( solved );
504 BOOST_CHECK( moved->GetEnd() == VECTOR2I( 110000, 10000 ) );
505 BOOST_CHECK_LE( ( follower->GetStart() - VECTOR2I( 110000, 10000 ) ).EuclideanNorm(), 5000.0 );
506
507 BOOST_REQUIRE_EQUAL( solverMoved.size(), 1 );
508 BOOST_CHECK( solverMoved.front() == follower );
509 BOOST_CHECK( std::find( staged.begin(), staged.end(), follower ) != staged.end() );
510}
511
512
513// EDA_GROUP::AddItem asserts if a group is added to its own descendant, so the case
514// to test is a selection naming both a group and a subgroup inside it
515BOOST_AUTO_TEST_CASE( NestedGroupSelectedTwiceExpandsOnce )
516{
517 BOARD board;
518
519 PCB_SHAPE* shapeA = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
520 PCB_SHAPE* shapeB = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
521 PCB_GROUP* inner = new PCB_GROUP( &board );
522 PCB_GROUP* outer = new PCB_GROUP( &board );
523
524 board.Add( shapeA );
525 board.Add( shapeB );
526 board.Add( inner );
527 board.Add( outer );
528
529 inner->AddItem( shapeB );
530 outer->AddItem( shapeA );
531 outer->AddItem( inner );
532
533 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( { outer, inner } );
534
535 BOOST_REQUIRE_EQUAL( expanded.size(), 2 );
536 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), shapeA ), 1 );
537 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), shapeB ), 1 );
538
539 std::vector<BOARD_ITEM*> reversed = BlockDragExpandSelection( { inner, outer } );
540
541 BOOST_REQUIRE_EQUAL( reversed.size(), 2 );
542 BOOST_CHECK_EQUAL( std::count( reversed.begin(), reversed.end(), shapeA ), 1 );
543 BOOST_CHECK_EQUAL( std::count( reversed.begin(), reversed.end(), shapeB ), 1 );
544}
545
546
547BOOST_AUTO_TEST_CASE( UnsupportedGroupMemberSurvivesExpansion )
548{
549 BOARD board;
550
551 TEST_GENERATOR* unknown = new TEST_GENERATOR( &board, wxS( "future_generator" ) );
552 PCB_SHAPE* shape = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
553 PCB_GROUP* group = new PCB_GROUP( &board );
554
555 board.Add( unknown );
556 board.Add( shape );
557 board.Add( group );
558
559 group->AddItem( unknown );
560 group->AddItem( shape );
561
562 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( { group } );
563
564 // The unsupported member stays in the list, so the caller can refuse the whole block
565 // and name it
566 BOOST_REQUIRE_EQUAL( expanded.size(), 2 );
567 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), unknown ), 1 );
569}
570
571
572BOOST_AUTO_TEST_CASE( ExpansionPreservesDirectItemOrder )
573{
574 BOARD board;
575
576 PCB_SHAPE* first = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
577 PCB_SHAPE* member = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
578 PCB_SHAPE* last = new PCB_SHAPE( &board, SHAPE_T::SEGMENT );
579 PCB_GROUP* group = new PCB_GROUP( &board );
580
581 board.Add( first );
582 board.Add( member );
583 board.Add( last );
584 board.Add( group );
585
586 group->AddItem( member );
587
588 std::vector<BOARD_ITEM*> expanded = BlockDragExpandSelection( { first, group, last } );
589
590 BOOST_REQUIRE_EQUAL( expanded.size(), 3 );
591 BOOST_CHECK( expanded.front() == first );
592 BOOST_CHECK( expanded[1] == member );
593 BOOST_CHECK( expanded.back() == last );
594}
595
596
bool BlockDragIsConstraintMember(const BOARD_ITEM &aItem)
True when the item belongs to any geometric constraint on its board or inside one of its footprints.
BLOCK_DRAG_CAPABILITY BlockDragCapability(const BOARD_ITEM &aItem)
Classify one board item for a block drag.
std::vector< BOARD_ITEM * > BlockDragExpandSelection(const std::vector< BOARD_ITEM * > &aSelection)
Replace group containers with their members, through nested groups, and drop duplicates.
@ UNSUPPORTED
Stops the drag with a message before anything moves.
@ DEFORMABLE
Shows handles, and reshapes as the user drags the ones they picked.
@ ROUTER
Moves with the block through the router, which repairs the copper at the edge of the block.
@ RIGID
Moves with the block using its own move operation.
@ FPHOLDER
Definition board.h:403
bool ReSolveShapeClustersHoldingEdited(BOARD *aBoard, const std::vector< PCB_SHAPE * > &aEditedShapes, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
Re-solve clusters whose new geometry is authoritative holding every edited shape fully fixed so only ...
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:99
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition board.cpp:1548
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition board.h:423
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
Definition drc_item.cpp:505
void AddItem(EDA_ITEM *aItem)
Add item to group.
Definition eda_group.cpp:58
const KIID m_Uuid
Definition eda_item.h:599
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition eda_shape.h:284
PCB_FIELD & Reference()
Definition footprint.h:832
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Adds an item to the container.
Definition kiid.h:46
Definition pad.h:61
A geometric constraint between board items (issue #2329).
void AddMember(const KIID &aItem, CONSTRAINT_ANCHOR aAnchor=CONSTRAINT_ANCHOR::WHOLE, int aIndex=-1)
void SetDriving(bool aDriving)
For better understanding of the points that make a dimension:
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:51
void SetEnd(const VECTOR2I &aEnd) override
void SetStart(const VECTOR2I &aStart) override
Handle a list of polygons defining a copper zone.
Definition zone.h:70
@ DRCE_CLEARANCE
Definition drc_item.h:52
@ ELLIPSE
Definition eda_shape.h:63
@ SEGMENT
Definition eda_shape.h:57
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
Definition eda_shape.h:58
@ ELLIPSE_ARC
Definition eda_shape.h:64
@ F_Cu
Definition layer_ids.h:60
@ WHOLE
The item as a whole (a segment as a line, a circle).
@ START
First endpoint of a segment or arc.
@ END
Second endpoint of a segment or arc.
@ VERTICAL
A segment (or two points) is vertical.
@ COINCIDENT
Two points are made to coincide.
@ HORIZONTAL
A segment (or two points) is horizontal.
@ PARALLEL
Two segments are parallel.
Class to handle a set of BOARD_ITEMs.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(RouterItemsInBoardEditor)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
const std::string table
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
bool moved
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition typeinfo.h:103
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
static PIECE rect(double aLeft, double aTop, double aRight, double aBottom, bool aMixed=false)