65 std::vector<PCB_SHAPE*> shapes{
locked, free };
73 BOOST_CHECK_LE(
std::abs( segLength( free ) - 10.0 *
MM ), 5000.0 );
92 std::vector<PCB_SHAPE*> shapes{ free,
locked };
111 locked->SetLocked(
true );
117 std::vector<PCB_SHAPE*> modified;
126 BOOST_CHECK( std::find( modified.begin(), modified.end(),
locked ) == modified.end() );
129 BOOST_CHECK_LE(
std::abs( segLength( free ) - 10.0 *
MM ), 5000.0 );
143 locked->SetLocked(
true );
149 std::vector<PCB_SHAPE*> modified;
156 BOOST_CHECK_GT( segLength( free ), 1 *
MM );
159 BOOST_CHECK_LE(
std::abs( free->GetEnd().x - free->GetStart().x ), 1000 );
180 std::set<KIID> conflicting( d.conflicting.begin(), d.conflicting.end() );
182 BOOST_CHECK( conflicting.count( par->m_Uuid ) );
183 BOOST_CHECK( conflicting.count( perp->m_Uuid ) );
208 BOOST_CHECK( !d.conflicting.empty() );
211 BOOST_CHECK_GT( segLength( a ), 1 *
MM );
212 BOOST_CHECK_GT( segLength( b ), 1 *
MM );
228 BOOST_CHECK_GT( segLength( s ), 1 *
MM );
245 std::vector<PCB_SHAPE*> modified;
263 board.
Add( footprint );
269 footprint->
Add( child );
278 std::vector<PCB_SHAPE*> shapes{ child, free };
284 BOOST_CHECK_LE(
std::abs( segLength( free ) - 10.0 *
MM ), 5000.0 );
296 board.
Add( footprint );
302 footprint->
Add( child );
CONSTRAINT_DIAGNOSIS ApplyConstraintImmediately(BOARD *aBoard, const PCB_CONSTRAINT *aConstraint, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
Solve a just-created constraint's cluster so the geometry snaps to satisfy it (SolidWorks-style),...
bool ConstraintItemIsLocked(const BOARD_ITEM *aItem)
True when the solver must treat aItem as immovable, either locked itself or living inside a locked fo...
BOARD_CONSTRAINT_DIAGNOSTICS DiagnoseBoardConstraints(BOARD *aBoard)
Diagnose every constraint cluster on the board (validate only – geometry is not changed) and return t...
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.
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 SetEnd(const VECTOR2I &aEnd) override
void SetStart(const VECTOR2I &aStart) override
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).
@ VERTICAL
A segment (or two points) is vertical.
@ PERPENDICULAR
Two segments are perpendicular.
@ HORIZONTAL
A segment (or two points) is horizontal.
@ EQUAL_RADIUS
Two arcs/circles have equal radius.
@ PARALLEL
Two segments are parallel.
@ EQUAL_LENGTH
Two segments have equal length.
Board-wide diagnostics for the constraint overlay and info bar.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(LockedSegmentIsNotMoved)
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I