57 BOOST_CHECK_NO_THROW( c.
Move(
VECTOR2I( 1000, 1000 ) ) );
81 BOOST_CHECK_CLOSE( *c.
GetValue(), 5.0, 1e-9 );
93 std::unique_ptr<BOARD_ITEM> clone(
static_cast<BOARD_ITEM*
>( c.
Clone() ) );
96 BOOST_CHECK( clone->m_Uuid == c.
m_Uuid );
98 BOOST_CHECK( c == *clone );
114 BOOST_CHECK( c1 == c2 );
115 BOOST_CHECK_CLOSE( c1.
Similarity( c2 ), 1.0, 1e-9 );
121 BOOST_CHECK( !( c1 == cPerp ) );
127 BOOST_CHECK( !( c1 == c3 ) );
182 BOOST_CHECK( a == b );
183 BOOST_CHECK( !( a == c ) );
192 auto make = [&](
int aFirstIndex,
int aSecondIndex )
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
KICAD_T Type() const
Returns the type of object.
LSET is a set of PCB_LAYER_IDs.
A geometric constraint between board items (issue #2329).
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
const std::vector< CONSTRAINT_MEMBER > & GetMembers() const
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
std::optional< double > GetValue() const
bool IsDriving() const
A driving constraint forces its value; a reference (non-driving) one only measures it.
PCB_CONSTRAINT_TYPE GetConstraintType() const
void AddMember(const KIID &aItem, CONSTRAINT_ANCHOR aAnchor=CONSTRAINT_ANCHOR::WHOLE, int aIndex=-1)
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void SetValue(std::optional< double > aValue)
void SetDriving(bool aDriving)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void Move(const VECTOR2I &aMoveVector) override
Move this object.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Empty shape so any generic GetItemSet()/RunOnChildren consumer stays safe.
static constexpr EDA_ANGLE ANGLE_90
bool ConstraintsAreDuplicate(const PCB_CONSTRAINT &aA, const PCB_CONSTRAINT &aB)
True if two constraints express the same relation, meaning the same type and the same members compare...
CONSTRAINT_ANCHOR ConstraintAnchorFromToken(const wxString &aToken)
Parse an anchor token; returns WHOLE for an unknown token.
@ VERTEX
An indexed rectangle corner or polygon outline vertex; pairs with CONSTRAINT_MEMBER::m_index.
@ RADIUS
The radius (scalar feature) of an arc or circle.
@ 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.
@ PERPENDICULAR
Two segments are perpendicular.
@ EQUAL_RADIUS
Two arcs/circles have equal radius.
@ FIXED_LENGTH
A segment has a driving length value.
@ PARALLEL
Two segments are parallel.
@ SH_COMPOUND
compound shape, consisting of multiple simple shapes
One participant in a constraint: a referenced board item plus the feature of that item that participa...
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(BasicProperties)
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_CONSTRAINT_T
class PCB_CONSTRAINT, a geometric constraint between board items
VECTOR2< int32_t > VECTOR2I