43constexpr int MM = 1000000;
54 return { aKind, targetId( aName ) };
62 KI_TEST::DUMMY_TOOL* tool;
65 tool( new KI_TEST::DUMMY_TOOL() )
67 mgr.SetEnvironment( &board,
nullptr,
nullptr,
nullptr,
nullptr );
68 mgr.RegisterTool( tool );
106 PCB_SHAPE*
addPoly(
const std::vector<VECTOR2I>& aPoints )
114 PCB_CONSTRAINT* addCoincident( PCB_SHAPE* aA,
CONSTRAINT_ANCHOR aAnchorA, PCB_SHAPE* aB,
130 std::vector<PCB_SHAPE*>* aModified )
137 aShape->
SetEnd( aCursor );
144 aCommit.
Modify( aNeighbor );
163 const VECTOR2I bStart0 = b->GetStart();
165 std::vector<PCB_SHAPE*> modified;
171 BOOST_CHECK_LE( ( a->
GetEnd() - b->GetStart() ).EuclideanNorm(), 100 );
172 BOOST_CHECK( std::find( modified.begin(), modified.end(), b ) != modified.end() );
173 BOOST_CHECK( a->
GetEnd() != aEnd0 );
190 std::vector<PCB_SHAPE*> modified;
193 const VECTOR2I originalBStart = b->GetStart();
196 BOOST_CHECK( session.
Matches( dragged ) );
200 { 12 *
MM, 2 *
MM }, &modified,
207 BOOST_CHECK_LE( ( a->
GetEnd() - b->GetStart() ).EuclideanNorm(), 100 );
210 { 14 *
MM, 4 *
MM }, &modified,
217 BOOST_CHECK_LE( ( a->
GetEnd() - b->GetStart() ).EuclideanNorm(), 100 );
232 length->SetValue( 10.0 *
MM );
250 length->SetValue( 10.0 *
MM );
255 board.
Add( horizontal );
269 BOOST_REQUIRE_EQUAL(
result.quantizedResiduals.size(), 1 );
294 BOOST_REQUIRE_EQUAL(
result.quantizedResiduals.size(), 1 );
300 std::vector<PCB_SHAPE*> modified;
313 ellipse->SetEllipseCenter( { 30 *
MM, 0 } );
314 ellipse->SetEllipseMajorRadius( 6 *
MM );
315 ellipse->SetEllipseMinorRadius( 3 *
MM );
316 board.
Add( ellipse );
318 const int circleRadius =
circle->GetRadius();
319 const int arcRadius = arc->GetRadius();
320 const int ellipseMinorRadius = ellipse->GetEllipseMinorRadius();
325 adapter.
SolveRigidTranslation( { circle->m_Uuid, arc->m_Uuid, ellipse->m_Uuid }, { 3 * MM, 2 * MM } ) );
352 locked->SetLocked(
true );
373 locked->SetLocked(
true );
376 auto session = std::make_shared<BOARD_CONSTRAINT_MOVE_SESSION>();
377 BOOST_REQUIRE( session->Build( &board, { moved }, { 0, 0 } ) );
385 [session](
const SNAP_SOURCE_CONTEXT& aContext,
const std::vector<SNAP_CANDIDATE>& aCandidates )
387 return session->ResolveCandidates( aContext, aCandidates );
397 BOOST_CHECK( !
result.Accepted( objectId ) );
398 BOOST_CHECK(
result.Accepted( gridId ) );
409 auto session = std::make_shared<BOARD_CONSTRAINT_MOVE_SESSION>();
410 BOOST_REQUIRE( session->Build( &board, { moved }, { 0, 0 } ) );
421 [session](
const SNAP_SOURCE_CONTEXT& aContext,
const std::vector<SNAP_CANDIDATE>& aCandidates )
423 return session->ResolveCandidates( aContext, aCandidates );
454 { 0.0, 40.0 *
MM }, 0.0 );
462 BOOST_REQUIRE_EQUAL(
result.quantizedResiduals.size(), 1 );
476 secondGuide->SetLocked(
true );
481 board.
Add( firstOnLine );
486 board.
Add( secondOnLine );
506 board.
Add( horizontal );
515 { 0.0, 40.0 *
MM }, 0.0 );
536 length->SetValue( 10.0 *
MM );
545 BOOST_CHECK( !diagnosis.
solved );
563 std::vector<PCB_SHAPE*> modified;
569 BOOST_CHECK_LE( ( a->
GetCenter() - b->GetCenter() ).EuclideanNorm(), 2000 );
570 BOOST_CHECK( std::find( modified.begin(), modified.end(), b ) != modified.end() );
590 const VECTOR2I bStart0 = b->GetStart();
593 std::vector<PCB_SHAPE*> modified;
598 BOOST_CHECK( modified.empty() );
621 BOOST_REQUIRE_EQUAL( board.
Constraints().size(), 1 );
625 commit.
Push( wxT(
"delete segment" ) );
628 BOOST_REQUIRE_EQUAL( board.
Constraints().size(), 1 );
630 BOOST_REQUIRE_EQUAL( survivor->
GetMembers().size(), 2 );
632 bool referencesDeleted =
false;
636 if( m.m_item == aId )
637 referencesDeleted =
true;
640 BOOST_CHECK( referencesDeleted );
641 BOOST_CHECK( board.
ResolveItem( aId,
true ) ==
nullptr );
665 seg->Move( { 0, 3 *
MM } );
668 std::vector<PCB_SHAPE*> modified;
672 BOOST_CHECK_LE(
std::abs( seg->GetEnd().y ), 5000 );
673 BOOST_CHECK_LE( ( seg->GetStart() -
VECTOR2I( 2 *
MM, 8 *
MM ) ).EuclideanNorm(), 5000.0 );
676 BOOST_CHECK( std::find( modified.begin(), modified.end(), seg ) != modified.end() );
691 const VECTOR2I bStart0 = b->GetStart();
696 std::vector<PCB_SHAPE*> modified;
705 BOOST_CHECK_LE( ( a->
GetEnd() - b->GetStart() ).EuclideanNorm(), 100 );
706 BOOST_CHECK( b->GetStart() != bStart0 );
726 std::vector<PCB_SHAPE*> modified;
737 const std::array<VECTOR2I, 4> painted = { a->
GetStart(), a->
GetEnd(), b->GetStart(), b->GetEnd() };
739 commit.
Push( wxT(
"Move" ) );
741 const std::array<VECTOR2I, 4> committed = { a->
GetStart(), a->
GetEnd(), b->GetStart(), b->GetEnd() };
743 BOOST_CHECK_EQUAL_COLLECTIONS( committed.begin(), committed.end(), painted.begin(), painted.end() );
757 const VECTOR2I bStart0 = b->GetStart();
760 std::vector<PCB_SHAPE*> modified;
767 BOOST_CHECK( modified.empty() );
769 BOOST_CHECK( commit.
Empty() );
782 len->SetValue( 10.0 *
MM );
787 std::vector<PCB_SHAPE*> modified;
795 BOOST_CHECK_LE( ( seg->
GetStart() - start0 ).EuclideanNorm(), 5000.0 );
799 BOOST_CHECK_LE( ( seg->
GetEnd() -
VECTOR2I( 6 *
MM, 8 *
MM ) ).EuclideanNorm(), 20000.0 );
813 len->SetValue( 10.0 *
MM );
818 std::vector<PCB_SHAPE*> modified;
824 BOOST_CHECK_LE( ( seg->
GetStart() - start0 ).EuclideanNorm(), 5000.0 );
826 BOOST_CHECK_LE( ( seg->
GetEnd() -
VECTOR2I( 10 *
MM, 0 ) ).EuclideanNorm(), 20000.0 );
836 PCB_SHAPE* arc = addArc( { 10 *
MM, 0 }, { 7071068, 7071068 }, { 0, 10 *
MM } );
846 std::vector<PCB_SHAPE*> modified;
851 BOOST_CHECK_LE( ( arc->
GetCenter() - center0 ).EuclideanNorm(), 20000.0 );
853 BOOST_CHECK_LE( ( arc->
GetEnd() - end0 ).EuclideanNorm(), 20000.0 );
854 BOOST_CHECK( ( arc->
GetStart() -
VECTOR2I( 10 *
MM, 0 ) ).EuclideanNorm() > 20000.0 );
862 PCB_SHAPE* arc = addArc( { 10 *
MM, 0 }, { 7071068, 7071068 }, { 0, 10 *
MM } );
866 r->SetValue( 12.0 *
MM );
869 std::vector<PCB_SHAPE*> modified;
896 std::vector<PCB_SHAPE*> modified;
907 BOOST_CHECK_LE( (
VECTOR2I( br.
x, tl.y ) -
cursor ).EuclideanNorm(), 5000.0 );
908 BOOST_CHECK_LE( ( seg->GetStart() -
cursor ).EuclideanNorm(), 5000.0 );
911 BOOST_CHECK_LE( (
VECTOR2I( tl.x, br.
y ) -
VECTOR2I( 0, 10 *
MM ) ).EuclideanNorm(), 5000.0 );
919 const std::vector<VECTOR2I> points{ { 0, 0 },
923 { -3 *
MM, 8 *
MM } };
936 std::vector<PCB_SHAPE*> modified;
943 BOOST_REQUIRE_EQUAL( outline.PointCount(), 5 );
944 BOOST_CHECK_LE( ( outline.CPoint( 2 ) -
cursor ).EuclideanNorm(), 5000.0 );
946 for(
int i : { 0, 1, 3, 4 } )
947 BOOST_CHECK_LE( ( outline.CPoint( i ) - points[i] ).EuclideanNorm(), 5000.0 );
957 PCB_SHAPE* swapped = addRect( { 10 *
MM, 10 *
MM }, { 0, 0 } );
959 for(
PCB_SHAPE* shape : { rect, swapped } )
961 const std::vector<VECTOR2I> corners{ { 0, 0 },
963 { 10 *
MM, 10 *
MM },
966 for(
size_t i = 0; i < corners.size(); ++i )
973 BOOST_CHECK( vertex->pos == corners[i] );
990 const std::vector<VECTOR2I> points{ { 0, 0 },
994 { -3 *
MM, 8 *
MM } };
998 for(
size_t i = 0; i < points.size(); ++i )
1005 BOOST_CHECK( vertex->pos == points[i] );
1017 chain.SetClosed(
true );
1020 board.
Add( arcPoly );
1033 PCB_SHAPE* rect = addRect( { 0, 0 }, { 10 *
MM, 10 *
MM } );
1049 BOOST_CHECK( vertex->pos ==
cursor );
1051 std::vector<PCB_SHAPE*> modified;
1053 SolveCluster( &board, { rect->
m_Uuid, vertex->anchor, vertex->index }, vertex->pos, &modified,
1056 BOOST_CHECK_LE( ( seg->GetStart() -
cursor ).EuclideanNorm(), 5000.0 );
1064 PCB_SHAPE* rect = addRect( { 0, 0 }, { 10 *
MM, 10 *
MM } );
1075 const int minWidth = 25400;
1076 const VECTOR2I clamped( minWidth, rawCursor.
y );
1084 BOOST_CHECK( vertex->pos == clamped );
1085 BOOST_CHECK( vertex->pos != rawCursor );
1087 std::vector<PCB_SHAPE*> modified;
1089 SolveCluster( &board, { rect->
m_Uuid, vertex->anchor, vertex->index }, vertex->pos, &modified,
1092 BOOST_CHECK_LE( ( seg->GetStart() - clamped ).EuclideanNorm(), 5000.0 );
1130 PCB_SHAPE* rect = addRect( { 0, 0 }, { 10 *
MM, 10 *
MM } );
1132 addDrivingVertexLength( board, rect, 0, 1, 10.0 *
MM );
1141 BOOST_CHECK( corner->pos ==
VECTOR2I( 15 *
MM, 0 ) );
1143 std::vector<PCB_SHAPE*> modified;
1145 SolveCluster( &board, { rect->
m_Uuid, corner->anchor, corner->index }, corner->pos, &modified,
1148 const VECTOR2I tl = dragRectTopLeft( rect );
1149 const VECTOR2I br = dragRectBotRight( rect );
1152 BOOST_CHECK_LE(
std::abs( ( br.
x - tl.x ) - 10 *
MM ), 20000 );
1153 BOOST_CHECK_LE(
std::abs( ( br.
y - tl.y ) - 10 *
MM ), 20000 );
1156 BOOST_CHECK_GT( tl.x, 1 *
MM );
1157 BOOST_CHECK_LT( br.
x, 14 *
MM );
1159 BOOST_TEST_MESSAGE(
"side drag under driving width settled TL at " << tl.x <<
"," << tl.y );
1164 BOOST_REQUIRE_EQUAL( corners.size(), 4 );
1174 PCB_SHAPE* rect = addRect( { 0, 0 }, { 10 *
MM, 10 *
MM } );
1176 addDrivingVertexLength( board, rect, 0, 1, 10.0 *
MM );
1184 BOOST_CHECK( corner->pos ==
VECTOR2I( 10 *
MM, 15 *
MM ) );
1186 std::vector<PCB_SHAPE*> modified;
1188 SolveCluster( &board, { rect->
m_Uuid, corner->anchor, corner->index }, corner->pos, &modified,
1191 const VECTOR2I tl = dragRectTopLeft( rect );
1192 const VECTOR2I br = dragRectBotRight( rect );
1194 BOOST_CHECK_LE( tl.EuclideanNorm(), 5000.0 );
1195 BOOST_CHECK_LE(
std::abs( ( br.
x - tl.x ) - 10 *
MM ), 5000 );
1196 BOOST_CHECK_LE(
std::abs( ( br.
y - tl.y ) - 15 *
MM ), 5000 );
1204 PCB_SHAPE* rect = addRect( { 0, 0 }, { 10 *
MM, 10 *
MM } );
1218 std::vector<PCB_SHAPE*> modified;
1220 SolveCluster( &board, { rect->
m_Uuid, corner->anchor, corner->index }, corner->pos, &modified,
1223 BOOST_CHECK_LE( dragRectTopLeft( rect ).EuclideanNorm(), 5000.0 );
1224 BOOST_CHECK_LE( ( dragRectBotRight( rect ) -
VECTOR2I( 15 *
MM, 10 *
MM ) ).EuclideanNorm(), 5000.0 );
1225 BOOST_CHECK_LE( seg->GetStart().EuclideanNorm(), 5000.0 );
1233 const std::vector<VECTOR2I> points{ { 0, 0 },
1235 { 13 *
MM, 8 *
MM },
1236 { 5 *
MM, 14 *
MM },
1237 { -3 *
MM, 8 *
MM } };
1240 const double edgeLen = std::hypot( 3.0, 8.0 ) *
MM;
1242 addDrivingVertexLength( board, poly, 1, 2, edgeLen );
1245 std::vector<VECTOR2I> dragged = points;
1246 dragged[1] = { 8 *
MM, -2 *
MM };
1247 dragged[2] = { 16 *
MM, 9 *
MM };
1250 std::vector<PCB_SHAPE*> modified;
1259 double solvedLen = ( outline.CPoint( 2 ) - outline.CPoint( 1 ) ).EuclideanNorm();
1261 BOOST_CHECK_LE(
std::abs( solvedLen - edgeLen ), 20000.0 );
1265 const VECTOR2I midBefore = ( points[1] + points[2] ) / 2;
1266 const VECTOR2I midTarget = ( dragged[1] + dragged[2] ) / 2;
1267 const VECTOR2I midSolved = ( outline.CPoint( 1 ) + outline.CPoint( 2 ) ) / 2;
1269 BOOST_CHECK_LT( ( midSolved - midTarget ).EuclideanNorm(), ( midBefore - midTarget ).EuclideanNorm() );
1270 BOOST_CHECK_GT( ( midSolved - midBefore ).EuclideanNorm(), 250000.0 );
1272 for(
int i : { 0, 3, 4 } )
1273 BOOST_CHECK_LE( ( outline.CPoint( i ) - points[i] ).EuclideanNorm(), 5000.0 );
1281 const std::vector<VECTOR2I> points{ { 0, 0 },
1283 { 13 *
MM, 8 *
MM },
1284 { 5 *
MM, 14 *
MM },
1285 { -3 *
MM, 8 *
MM } };
1296 std::vector<VECTOR2I> dragged = points;
1301 std::vector<PCB_SHAPE*> modified;
1310 BOOST_CHECK_LE( ( outline.CPoint( 1 ) - dragged[1] ).EuclideanNorm(), 5000.0 );
1311 BOOST_CHECK_LE( ( outline.CPoint( 2 ) - dragged[2] ).EuclideanNorm(), 5000.0 );
1312 BOOST_CHECK_LE( ( seg->
GetStart() - dragged[1] ).EuclideanNorm(), 5000.0 );
1313 BOOST_CHECK( std::find( modified.begin(), modified.end(), seg ) != modified.end() );
1315 for(
int i : { 0, 3, 4 } )
1316 BOOST_CHECK_LE( ( outline.CPoint( i ) - points[i] ).EuclideanNorm(), 5000.0 );
1323 PCB_SHAPE* arc = addArc( { 10 *
MM, 0 }, { 7071068, 7071068 }, { 0, 10 *
MM } );
1331 std::vector<PCB_SHAPE*> modified;
1339 BOOST_CHECK_LE( ( arc->
GetStart() - start0 ).EuclideanNorm(), 20000.0 );
1340 BOOST_CHECK_LE( ( arc->
GetEnd() - end0 ).EuclideanNorm(), 20000.0 );
1341 BOOST_CHECK( ( arc->
GetCenter() -
VECTOR2I( 0, 0 ) ).EuclideanNorm() > 100000.0 );
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, const std::set< KIID > &aFixedShapes, bool aHoldDraggedRigid)
Gather the cluster of shapes transitively constrained with the dragged shape, solve with the dragged ...
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.
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
virtual void Revert() override
Revert the commit by restoring the modified items state.
Translates KiCad board geometry to and from the planegcs solver (issue #2329).
bool SolveRigidTranslation(const std::set< KIID > &aEditedShapes, const VECTOR2I &aTranslation)
bool Build(const std::vector< PCB_SHAPE * > &aShapes, const std::vector< PCB_CONSTRAINT * > &aConstraints, const std::set< KIID > *aFixedShapes=nullptr, const std::vector< PCB_DIMENSION_BASE * > &aDimensions={})
Translate a cluster into a planegcs system.
std::vector< PCB_SHAPE * > Apply(const std::function< void(BOARD_ITEM *)> &aBeforeWrite={})
Write the solved coordinates back into the shapes, de-normalized to IU.
bool IsExactFeasible(const VECTOR2I &aTarget)
bool Build(BOARD *aBoard, const CONSTRAINT_MEMBER &aDragged)
CONSTRAINT_DIAGNOSIS Solve(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=std::nullopt)
SNAP_RESULT ResolveCandidates(const SNAP_SOURCE_CONTEXT &aContext, const std::vector< SNAP_CANDIDATE > &aCandidates)
bool Matches(const CONSTRAINT_MEMBER &aDragged) const
bool Solve(const VECTOR2I &aTarget, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
bool Build(BOARD *aBoard, const std::vector< PCB_SHAPE * > &aEditedShapes, const VECTOR2I &aReference)
SNAP_RESULT ResolveCandidates(const SNAP_SOURCE_CONTEXT &aContext, const std::vector< SNAP_CANDIDATE > &aCandidates)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetLocked(bool aLocked) override
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.
const CONSTRAINTS & Constraints() const
Geometric constraints (#2329) owned by this board.
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
void SetCenter(const VECTOR2I &aCenter)
SHAPE_POLY_SET & GetPolyShape()
virtual void SetBottom(int val)
virtual void SetTop(int val)
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
virtual void SetRight(int val)
std::array< uint8_t, 16 > AsBytes() const
static KIID FromName(const std::string &aName)
Return a KIID derived from a name, the same name always gives the same KIID.
A geometric constraint between board items (issue #2329).
const std::vector< CONSTRAINT_MEMBER > & GetMembers() const
void AddMember(const KIID &aItem, CONSTRAINT_ANCHOR aAnchor=CONSTRAINT_ANCHOR::WHOLE, int aIndex=-1)
void SetValue(std::optional< double > aValue)
void SetDriving(bool aDriving)
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
void SetEnd(const VECTOR2I &aEnd) override
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
void Move(const VECTOR2I &aMoveVector) override
Move this object.
void SetStart(const VECTOR2I &aStart) override
void SetRadius(int aRadius)
void SetCenter(const VECTOR2I &aCenter)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
std::optional< CONSTRAINT_ANCHOR_POINT > ConstraintShapeVertex(const PCB_SHAPE *aShape, int aIndex)
VERTEX anchor at ordinal aIndex of a rectangle or eligible polygon or std::nullopt if the shape has n...
std::vector< CONSTRAINT_ANCHOR_POINT > ConstraintShapeAnchors(const PCB_SHAPE *aShape)
Enumerate a shape constraint anchors with positions segment and arc endpoints arc centre circle centr...
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
static FILENAME_RESOLVER * resolver
PCB_SHAPE * addPoly(BOARD &aBoard, const std::vector< VECTOR2I > &aPoints)
PCB_SHAPE * addArc(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
PCB_SHAPE * addCircle(BOARD &aBoard, const VECTOR2I &aCenter, int aRadius)
PCB_SHAPE * addRect(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aEnd)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
CONSTRAINT_ANCHOR
Which feature of a referenced board item participates in a constraint.
@ VERTEX
An indexed rectangle corner or polygon outline vertex; pairs with CONSTRAINT_MEMBER::m_index.
@ 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.
@ CENTER
Center of an arc or circle.
@ CONCENTRIC
Two arcs/circles share a center.
@ FIXED_POSITION
A point is locked at its current location.
@ COINCIDENT
Two points are made to coincide.
@ FIXED_RADIUS
An arc/circle has a driving radius value.
@ HORIZONTAL
A segment (or two points) is horizontal.
@ POINT_ON_LINE
A point lies on a segment's supporting line.
@ FIXED_LENGTH
A segment has a driving length value.
static bool addSegment(VRML_LAYER &model, IDF_SEGMENT *seg, int icont, int iseg)
std::array< uint8_t, 16 > SNAP_TARGET_ID
The outcome of a constraint solve, in plain data so callers need not know planegcs.
bool solved
Solver reached Success or Converged.
One participant in a constraint: a referenced board item plus the feature of that item that participa...
static SNAP_CANDIDATE Point(SNAP_STABLE_ID aId, SNAP_PRIORITY_TIER aPriority, SNAP_CANDIDATE_SUBTYPE aSubtype, const VECTOR2I &aPoint, double aResidual)
static SNAP_CANDIDATE Line(SNAP_STABLE_ID aId, SNAP_PRIORITY_TIER aPriority, SNAP_CANDIDATE_SUBTYPE aSubtype, const VECTOR2I &aOrigin, const VECTOR2D &aDirection, double aResidual)
static SNAP_CANDIDATE AxisX(SNAP_STABLE_ID aId, SNAP_PRIORITY_TIER aPriority, SNAP_CANDIDATE_SUBTYPE aSubtype, int aCoordinate, double aResidual)
std::vector< SNAP_GUIDE > guides
SNAP_RESULT_STATUS status
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_FIXTURE_TEST_CASE(DragReDerivesNeighborRevertRestores, DRAG_FIXTURE)
BOOST_AUTO_TEST_CASE(UnbuiltMoveSessionRejectsCandidates)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
static const long long MM
const SHAPE_LINE_CHAIN chain
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I