70 std::vector<BOARD_ITEM*> staged;
74 [&](
BOARD_ITEM* i ) { staged.push_back( i ); } );
77 BOOST_CHECK_LE(
std::abs( *len->GetValue() - 6.0 *
MM ), 5000.0 );
78 BOOST_CHECK( std::find( staged.begin(), staged.end(), len ) != staged.end() );
95 std::vector<BOARD_ITEM*> staged;
99 [&](
BOARD_ITEM* i ) { staged.push_back( i ); } );
102 BOOST_CHECK_LE(
std::abs( *len->GetValue() - 6.0 *
MM ), 5000.0 );
103 BOOST_CHECK( std::find( staged.begin(), staged.end(), len ) != staged.end() );
118 std::vector<BOARD_ITEM*> staged;
121 [&](
BOARD_ITEM* i ) { staged.push_back( i ); } );
125 BOOST_CHECK( std::find( staged.begin(), staged.end(), len ) == staged.end() );
144 std::vector<BOARD_ITEM*> staged;
147 [&](
BOARD_ITEM* i ) { staged.push_back( i ); } );
150 BOOST_CHECK_LE(
std::abs( *rad->GetValue() - 8.0 *
MM ), 5000.0 );
151 BOOST_CHECK( std::find( staged.begin(), staged.end(), rad ) != staged.end() );
165 std::vector<BOARD_ITEM*> staged;
169 [&](
BOARD_ITEM* i ) { staged.push_back( i ); } );
171 BOOST_CHECK( std::find( staged.begin(), staged.end(), len ) == staged.end() );
193 BOOST_CHECK_CLOSE( cornerAngleOf( a, b ), 120.0, 0.5 );
214 BOOST_CHECK_CLOSE( cornerAngleOf( a, b ), 60.0, 0.5 );
231 b->SetEnd( { -5 *
MM, 8660254 } );
233 std::vector<BOARD_ITEM*> staged;
237 BOOST_CHECK_CLOSE( *angle->GetValue(), 120.0, 0.5 );
238 BOOST_CHECK( std::find( staged.begin(), staged.end(), angle ) != staged.end() );
void ReSolveAfterShapeResize(BOARD *aBoard, PCB_SHAPE *aShape, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
Re-solve after a resize, e.g. a circle radius edit. Holds aShape fixed so its neighbors adjust.
void ReSolveShapeClusters(BOARD *aBoard, const std::vector< PCB_SHAPE * > &aShapes, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
Re-solve the clusters of shapes edited outside the solver, e.g.
CONSTRAINT_DIAGNOSIS SolveCluster(BOARD *aBoard, const CONSTRAINT_MEMBER &aDragged, const VECTOR2I &aCursor, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify, bool aIncludeDragged, bool aStabilize, const std::set< KIID > &aEdited, const std::optional< std::pair< CONSTRAINT_MEMBER, VECTOR2I > > &aCoDragged)
Gather the cluster of shapes transitively constrained with the dragged shape, solve with the dragged ...
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.
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).
void SetDriving(bool aDriving)
EDA_ANGLE MeasureCornerAngle(const SEG &aA, const SEG &aB)
The corner angle between two segments, in the closed range [0, 180] degrees.
PCB_SHAPE * addSegment(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aEnd)
PCB_SHAPE * addCircle(BOARD &aBoard, const VECTOR2I &aCenter, int aRadius)
void solveAndApply(BOARD &aBoard, const std::vector< PCB_SHAPE * > &aShapes)
Build the cluster of aShapes against every constraint on aBoard, solve it, and write the result back ...
PCB_CONSTRAINT * addConstraint(BOARD &aBoard, PCB_CONSTRAINT_TYPE aType, const std::vector< CONSTRAINT_MEMBER > &aMembers, std::optional< double > aValue=std::nullopt)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ 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.
@ COINCIDENT
Two points are made to coincide.
@ FIXED_RADIUS
An arc/circle has a driving radius value.
@ FIXED_LENGTH
A segment has a driving length value.
@ ANGULAR_DIMENSION
An angle between members (driving or reference).
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(ReferenceLengthTracksGeometry)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
BOOST_CHECK_EQUAL(result, "25.4")