52 TEST_GENERATOR( BOARD_ITEM* aParent,
const wxString& aGeneratorType ) :
53 PCB_GENERATOR( aParent,
F_Cu ),
54 m_testGeneratorType( aGeneratorType )
58 wxString GetGeneratorType()
const override {
return m_testGeneratorType; }
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 {}
66 wxString GetPluralName()
const override {
return wxT(
"Test Generators" ); }
67 wxString GetCommitMessage()
const override {
return wxT(
"Test Generator" ); }
70 wxString m_testGeneratorType;
93 board.
Add( footprint );
113 board.
Add( footprint );
135 for(
PCB_SHAPE* shape : { segment, poly,
rect, arc,
circle, bezier, ellipse, ellipseArc } )
156 board.
Add( constrained );
161 board.
Add( constraint );
178 footprint->
Add( shape );
179 board.
Add( footprint );
183 footprint->
Add( constraint );
197 footprint->
Add( childShape );
198 board.
Add( footprint );
211 ZONE* childZone =
new ZONE( footprint );
213 footprint->
Add( childShape );
214 footprint->
Add( childZone );
215 board.
Add( footprint );
227 ZONE* childZone =
new ZONE( footprint );
229 footprint->
Add( childZone );
230 board.
Add( footprint );
248 board.
Add( textbox );
249 board.
Add( dimension );
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" ) );
275 board.
Add( viaStack );
276 board.
Add( viaStitch );
310 board.
Add( nestedShape );
320 std::vector<BOARD_ITEM*> selection{ shapeA, outer };
326 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), nestedShape ), 1 );
362 footprint->
Add( silk );
363 board.
Add( footprint );
364 board.
Add( standalone );
366 std::vector<BOARD_ITEM*> expanded =
370 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), footprint ), 1 );
371 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), standalone ), 1 );
383 board.
Add( footprint );
384 board.
Add( standalone );
391 BOOST_CHECK_EQUAL( std::count( expanded.begin(), expanded.end(), reference ), 1 );
404 board.
Add( footprint );
406 group->AddItem( footprint );
419 TEST_GENERATOR* generator =
new TEST_GENERATOR( &board, wxS(
"tuning_pattern" ) );
422 board.
Add( generator );
423 board.
Add( memberTrack );
424 generator->AddItem( memberTrack );
426 std::vector<BOARD_ITEM*> selection{ generator };
439 board.
Add( measured );
444 board.
Add( reference );
462 board.
Add( dangling );
484 board.
Add( follower );
489 board.
Add( coincident );
494 std::vector<PCB_SHAPE*> solverMoved;
495 std::vector<BOARD_ITEM*> staged;
500 staged.push_back( aItem );
505 BOOST_CHECK_LE( ( follower->
GetStart() -
VECTOR2I( 110000, 10000 ) ).EuclideanNorm(), 5000.0 );
509 BOOST_CHECK( std::find( staged.begin(), staged.end(), follower ) != staged.end() );
551 TEST_GENERATOR*
unknown =
new TEST_GENERATOR( &board, wxS(
"future_generator" ) );
560 group->AddItem( shape );
586 group->AddItem( member );
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.
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...
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
void AddItem(EDA_ITEM *aItem)
Add item to group.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
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).
void SetEnd(const VECTOR2I &aEnd) override
void SetStart(const VECTOR2I &aStart) override
Handle a list of polygons defining a copper zone.
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
@ 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)
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()
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
VECTOR2< int32_t > VECTOR2I
static PIECE rect(double aLeft, double aTop, double aRight, double aBottom, bool aMixed=false)