41 TEST_POLY_GENERATOR( BOARD_ITEM* aParent,
const wxString& aGeneratorType ) :
42 PCB_GENERATOR_POLY( aParent,
F_Cu ),
43 m_testGeneratorType( aGeneratorType )
47 wxString GetGeneratorType()
const override {
return m_testGeneratorType; }
49 void EditStart( GENERATOR_TOOL* aTool,
BOARD* aBoard, BOARD_COMMIT* aCommit )
override {}
50 bool Update( GENERATOR_TOOL* aTool,
BOARD* aBoard, BOARD_COMMIT* aCommit )
override {
return true; }
51 void EditFinish( GENERATOR_TOOL* aTool,
BOARD* aBoard, BOARD_COMMIT* aCommit )
override {}
52 void EditCancel( GENERATOR_TOOL* aTool,
BOARD* aBoard, BOARD_COMMIT* aCommit )
override {}
53 void Remove( GENERATOR_TOOL* aTool,
BOARD* aBoard, BOARD_COMMIT* aCommit )
override {}
55 wxString GetPluralName()
const override {
return wxT(
"Test Generators" ); }
56 wxString GetCommitMessage()
const override {
return wxT(
"Test Generator" ); }
59 wxString m_testGeneratorType;
63std::shared_ptr<EDIT_POINTS> makeCollection(
EDA_ITEM* aParent )
65 std::shared_ptr<EDIT_POINTS> points = std::make_shared<EDIT_POINTS>( aParent );
67 points->AddPoint(
VECTOR2I( 0, 0 ) );
68 points->AddPoint(
VECTOR2I( 100, 0 ) );
69 points->AddPoint(
VECTOR2I( 100, 100 ) );
70 points->AddLine( points->Point( 0 ), points->Point( 1 ) );
93 std::shared_ptr<EDIT_POINTS> zonePoints = makeCollection( zone );
94 std::shared_ptr<EDIT_POINTS> polyPoints = makeCollection( poly );
95 std::shared_ptr<EDIT_POINTS> arcPoints = makeCollection( arc );
116 TEST_POLY_GENERATOR* stitch =
new TEST_POLY_GENERATOR( &board, wxS(
"via_stitch" ) );
117 TEST_POLY_GENERATOR* tuning =
new TEST_POLY_GENERATOR( &board, wxS(
"tuning_pattern" ) );
121 std::shared_ptr<EDIT_POINTS> stitchPoints = makeCollection( stitch );
122 std::shared_ptr<EDIT_POINTS> tuningPoints = makeCollection( tuning );
144 board.
Add( segment );
146 std::shared_ptr<EDIT_POINTS> rectPoints = makeCollection(
rect );
147 std::shared_ptr<EDIT_POINTS> segmentPoints = makeCollection( segment );
170 std::shared_ptr<EDIT_POINTS> points = makeCollection(
rect );
175 points->Point( 1 ).SetDrivesWholeShape();
195 board.
Add( ellipse );
225 board.
Add( segment );
229 board.
Add( constraint );
231 std::shared_ptr<EDIT_POINTS> points = makeCollection( segment );
243 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
251 std::set<PCB_HANDLE_KEY> picked{ *key0, *key1 };
259 picked = { *key0, *key1 };
273 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
280 std::set<PCB_HANDLE_KEY> picked;
301 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
309 std::set<PCB_HANDLE_KEY> picked{ *key2 };
331 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
338 std::set<PCB_HANDLE_KEY> picked{ *key2 };
363 std::shared_ptr<EDIT_POINTS> zonePoints = makeCollection( zone );
364 std::shared_ptr<EDIT_POINTS> arcPoints = makeCollection( arc );
366 std::set<PCB_HANDLE_KEY> picked;
385 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
392 std::set<PCB_HANDLE_KEY> picked;
412 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
414 std::set<PCB_HANDLE_KEY> picked;
428 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
434 std::set<PCB_HANDLE_KEY> picked{ *key0 };
459 std::shared_ptr<EDIT_POINTS> points = makeCollection( zone );
465 std::set<PCB_HANDLE_KEY> picked{ *key0 };
BLOCK_DRAG_CAPABILITY BlockDragCapability(const BOARD_ITEM &aItem)
Classify one board item for a block drag.
@ DEFORMABLE
Shows handles, and reshapes as the user drags the ones they picked.
@ RIGID
Moves with the block using its own move operation.
SHAPE_LINE_CHAIN BlockDragPickRect(const VECTOR2I &aFirst, const VECTOR2I &aSecond)
The closed rectangle a box pick covers, built from two opposite corners.
bool BlockDragHandlePickable(const EDIT_POINTS &aCollection, const EDIT_POINT &aPoint)
True when the user is allowed to pick this handle.
void BlockDragApplyPick(std::set< PCB_HANDLE_KEY > &aPicked, const PCB_HANDLE_KEY &aKey, bool aAccumulate)
Add one clicked handle to the picked set.
void BlockDragLassoPick(const std::vector< EDIT_POINTS * > &aCollections, const SHAPE_LINE_CHAIN &aLasso, bool aAccumulate, std::set< PCB_HANDLE_KEY > &aPicked)
Add the handles a lasso surrounds to the picked set.
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.
Edit behavior for ELLIPSE and ELLIPSE_ARC shapes.
void MakePoints(EDIT_POINTS &aPoints) override
Construct the initial set of edit points for the item and append to the given list.
A base class for most all the KiCad significant classes used in schematics and boards.
EDIT_POINTS is a VIEW_ITEM that manages EDIT_POINTs and EDIT_LINEs and draws them.
unsigned int PointsSize() const
Return number of stored EDIT_POINTs.
EDIT_POINT & Point(unsigned int aIndex)
Represent a single point that can be used for modifying items.
bool DrivesWholeShape() const
Whether dragging this handle rebuilds the whole shape instead of placing one of its points,...
A geometric constraint between board items (issue #2329).
void AddMember(const KIID &aItem, CONSTRAINT_ANCHOR aAnchor=CONSTRAINT_ANCHOR::WHOLE, int aIndex=-1)
Lasting name for one handle in an EDIT_POINTS collection.
static std::optional< PCB_HANDLE_KEY > Make(const EDIT_POINTS &aPoints, const EDIT_POINT *aPoint)
Build the key for a handle in a collection.
void SetEllipseCenter(const VECTOR2I &aPt) override
void SetEllipseMinorRadius(int aR) override
void SetEllipseMajorRadius(int aR) override
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
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).
@ HORIZONTAL
A segment (or two points) is horizontal.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(PickableFollowsCapabilityAndHandleKind)
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_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
VECTOR2< int32_t > VECTOR2I
static PIECE rect(double aLeft, double aTop, double aRight, double aBottom, bool aMixed=false)