56 if( c->GetConstraintType() == aType )
69 auto board = std::make_unique<BOARD>();
94 PCB_SHAPE* dupSeg1 = duplicateShape( *board, seg1 );
95 PCB_SHAPE* dupSeg2 = duplicateShape( *board, seg2 );
96 PCB_SHAPE* dupArc = duplicateShape( *board, arc );
98 std::map<KIID, KIID> idMap;
99 idMap[seg1->
m_Uuid] = dupSeg1->m_Uuid;
100 idMap[seg2->m_Uuid] = dupSeg2->
m_Uuid;
101 idMap[arc->m_Uuid] = dupArc->
m_Uuid;
128 BOOST_CHECK_CLOSE( arcAngleClone->
GetValue().value(), 90.0, 1e-9 );
139 auto board = std::make_unique<BOARD>();
150 PCB_SHAPE* dupOther = duplicateShape( *board, other );
152 std::map<KIID, KIID> idMap;
153 idMap[other->m_Uuid] = dupOther->m_Uuid;
165 auto board = std::make_unique<BOARD>();
172 group->AddItem( seg1 );
173 group->AddItem( seg2 );
179 std::map<KIID, KIID> idMap;
191 if( member->m_Uuid == dupId )
192 return static_cast<const PCB_SHAPE*
>( member );
198 const PCB_SHAPE* dupSeg1 = dupeByOrig( seg1 );
199 const PCB_SHAPE* dupSeg2 = dupeByOrig( seg2 );
230 auto board = std::make_unique<BOARD>();
245 PCB_SHAPE* a = addFpSegment( { 0, 0 }, { 10 *
MM, 0 } );
257 std::set<KIID> dupeChildIds;
258 dupe->RunOnChildren( [&](
BOARD_ITEM* aChild ) { dupeChildIds.insert( aChild->
m_Uuid ); },
261 const PCB_CONSTRAINT* dupeConstraint = dupe->Constraints().front();
267 BOOST_CHECK( dupeChildIds.count( member.m_item ) > 0 );
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.
std::unordered_set< EDA_ITEM * > & GetItems()
A base class for most all the KiCad significant classes used in schematics and boards.
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
A geometric constraint between board items (issue #2329).
const std::vector< CONSTRAINT_MEMBER > & GetMembers() const
std::optional< double > GetValue() const
bool IsDriving() const
A driving constraint forces its value; a reference (non-driving) one only measures it.
void SetDriving(bool aDriving)
A set of BOARD_ITEMs (i.e., without duplicates).
void SetEnd(const VECTOR2I &aEnd) override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetStart(const VECTOR2I &aStart) override
std::vector< PCB_CONSTRAINT * > CloneFullySelectedConstraints(const CONSTRAINTS &aSource, const std::map< KIID, KIID > &aIdMap)
Clone the constraints in aSource that a duplicate should carry.
#define IGNORE_PARENT_GROUP
Test utilities for timestamps.
PCB_SHAPE * addSegment(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aEnd)
PCB_SHAPE * addArc(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
PCB_CONSTRAINT * addConstraint(BOARD &aBoard, PCB_CONSTRAINT_TYPE aType, const std::vector< CONSTRAINT_MEMBER > &aMembers, std::optional< double > aValue=std::nullopt)
@ 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.
PCB_CONSTRAINT_TYPE
The geometric relationship a PCB_CONSTRAINT enforces between its members.
@ COINCIDENT
Two points are made to coincide.
@ ARC_ANGLE
An arc has a driving or reference swept-angle value.
@ PARALLEL
Two segments are parallel.
Class to handle a set of BOARD_ITEMs.
One participant in a constraint: a referenced board item plus the feature of that item that participa...
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(DuplicateCarriesFullyContainedConstraints)
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