62 if( aIncludeInChangedArea )
69 PNS_DBG(
Dbg(), AddShape, &r,
BLUE, 0, wxT(
"shove-changed-area" ) );
76 bool foundPredecessor =
false;
77 LINE* rootLine =
nullptr;
92 rootLine = oldLineIter->second;
93 foundPredecessor =
true;
99 if( !foundPredecessor )
104 rootLine = aOld.
Clone();
166 std::unordered_set<LINE*> alreadyDeleted;
170 auto it2 = alreadyDeleted.find( it.second );
172 if( it2 == alreadyDeleted.end() )
174 alreadyDeleted.insert( it.second );
196 const LINE& aShovedLine )
const
220 int obstacleLineWidth = aObstacleLine.
Width();
224 int holeClearance =
getClearance( viaHole, &aObstacleLine );
226 if( holeClearance +
via.Drill() / 2 > clearance +
via.Diameter() / 2 )
227 clearance = holeClearance +
via.Drill() / 2 -
via.Diameter() / 2;
233 if( ! aObstacleLine.
Walkaround( hull, path_cw,
true ) )
236 if( ! aObstacleLine.
Walkaround( hull, path_ccw,
false ) )
244 if( aObstacleLine.
CPoint( -1 ) != shortest.
CPoint( -1 ) )
269 PNS_DBG(
Dbg(), BeginGroup,
"shove-details", 1 );
271 for( attempt = 0; attempt < 4; attempt++ )
273 bool invertTraversal = ( attempt >= 2 );
274 bool clockwise = attempt % 2;
275 int vFirst = -1, vLast = -1;
277 LINE l( aObstacleLine );
280 for(
int i = 0; i < (int) aHulls.size(); i++ )
282 const SHAPE_LINE_CHAIN& hull = aHulls[invertTraversal ? aHulls.size() - 1 - i : i];
284 PNS_DBG(
Dbg(), AddShape, &hull,
YELLOW, 10000, wxString::Format(
"hull[%d]", i ) );
290 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"Fail-Walk %s %s %d\n" ),
308 for(
int i = 0; i < std::min(
path.PointCount(), obs.
PointCount() ); i++ )
319 for(
int i =
path.PointCount() - 1; i >= 0 && k >= 0; i--, k-- )
328 if( ( vFirst < 0 || vLast < 0 ) && !
path.CompareGeometry( aObstacleLine.
CLine() ) )
330 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail vfirst-last" ),
337 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail vend-start\n" ),
344 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail direction-check" ),
350 if(
path.SelfIntersecting() )
352 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail self-intersect" ),
372 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail coll-check" ),
399 bool obstacleIsHead =
false;
405 obstacleIsHead =
true;
413 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"shove process-single: voe1 %d voe2 %d" ),
429 int obstacleLineWidth = aObstacleLine.
Width();
430 int clearance =
getClearance( &aCurLine, &aObstacleLine );
434 hulls.reserve( currentLineSegmentCount + 1 );
436 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"shove process-single: cur net %d obs %d cl %d" ),
441 for(
int i = 0; i < currentLineSegmentCount; i++ )
448 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"shove add-extra-clearance %d" ),
455 hulls.push_back( hull );
463 int holeClearance =
getClearance( viaHole, &aObstacleLine );
465 if( holeClearance +
via.Drill() / 2 > viaClearance +
via.Diameter() / 2 )
466 viaClearance = holeClearance +
via.Drill() / 2 -
via.Diameter() / 2;
468 hulls.push_back( aCurLine.
Via().
Hull( viaClearance, obstacleLineWidth ) );
488 LINE shovedLine( obstacleLine );
493 PNS_DBG(
Dbg(), Message,
"try walk (locked segments)");
499 const double extensionWalkThreshold = 1.0;
503 double extensionFactor = 0.0;
506 extensionFactor = shovedLen / obsLen - 1.0;
508 if( extensionFactor > extensionWalkThreshold )
515 PNS_DBG(
Dbg(), AddItem, aObstacleSeg,
BLUE, 0, wxT(
"shove-changed-area" ) );
517 PNS_DBG(
Dbg(), AddItem, &obstacleLine,
GREEN, 10000, wxString::Format(
"obstacle-line [l %d v %d]", obstacleLine.
Layer(), obstacleLine.
EndsWithVia() ) );
518 PNS_DBG(
Dbg(), AddItem, &shovedLine,
BLUE, 10000, wxT(
"shoved-line" ) );
531 int rank = aCurrent.
Rank();
532 shovedLine.
SetRank( rank - 1 );
552 LINE shovedLine( obstacleLine );
553 ARC tmp( *aObstacleArc );
560 const double extensionWalkThreshold = 1.0;
564 double extensionFactor = 0.0;
567 extensionFactor = shovedLen / obsLen - 1.0;
569 if( extensionFactor > extensionWalkThreshold )
575 PNS_DBG(
Dbg(), AddItem, &aCurrent,
RED, 10000, wxT(
"current-line" ) );
576 PNS_DBG(
Dbg(), AddItem, &obstacleLine,
GREEN, 10000, wxT(
"obstacle-line" ) );
577 PNS_DBG(
Dbg(), AddItem, &shovedLine,
BLUE, 10000, wxT(
"shoved-line" ) );
589 int rank = aCurrent.
Rank();
590 shovedLine.
SetRank( rank - 1 );
608 LINE shovedLine( aObstacle );
612 PNS_DBG(
Dbg(), AddItem, &aObstacle,
RED, 100000, wxT(
"obstacle-line" ) );
613 PNS_DBG(
Dbg(), AddItem, &aCurrent,
GREEN, 150000, wxT(
"current-line" ) );
614 PNS_DBG(
Dbg(), AddItem, &shovedLine,
BLUE, 200000, wxT(
"shoved-line" ) );
629 int rank = aObstacle.
Rank();
630 shovedLine.
SetRank( rank - 1 );
649 LINE walkaroundLine( aCurrent );
678 PNS_DBG(
Dbg(), BeginGroup,
"walk-cluster", 1 );
680 for(
ITEM* item : cluster )
681 PNS_DBG(
Dbg(), AddItem, item,
RED, 10000, wxT(
"cl-item" ) );
691 int currentRank = aCurrent.
Rank();
694 bool success =
false;
696 for(
int attempt = 0; attempt < 2; attempt++ )
698 if( attempt == 1 ||
Settings().JumpOverObstacles() )
699 nextRank = currentRank - 1;
701 nextRank = currentRank + 10000;
753 walkaroundLine.
SetRank( nextRank );
755 PNS_DBG(
Dbg(), AddItem, &aCurrent,
RED, 10000, wxT(
"current-line" ) );
756 PNS_DBG(
Dbg(), AddItem, &walkaroundLine,
BLUE, 10000, wxT(
"walk-line" ) );
787 aDraggedVia.
valid =
true;
853 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"via force [%d %d]\n" ), aForce.
x, aForce.
y ) );
856 if ( aForce.
x == 0 && aForce.
y == 0 )
861 PNS_DBG(
Dbg(), Message, wxT(
"weird, can't find the center-of-via joint\n" ) );
879 p0_pushed += aForce.
Resize( 2 );
882 std::unique_ptr<VIA> pushedVia =
Clone( *aVia );
883 pushedVia->SetPos( p0_pushed );
884 pushedVia->Mark( aVia->
Marker() );
896 if( lp.first.HasLockedSegments() )
899 assert( segIndex == 0 || ( segIndex == ( lp.first.SegmentCount() - 1 ) ) );
904 lp.second = lp.first;
905 lp.second.ClearLinks();
906 lp.second.DragCorner( p0_pushed, lp.second.CLine().Find( p0 ) );
907 lp.second.AppendVia( *pushedVia );
908 draggedLines.push_back( lp );
912 pushedVia->SetRank( aCurrentRank - 1 );
913 PNS_DBG(
Dbg(), Message, wxString::Format(
"PushViaRank %d\n", pushedVia->Rank() ) );
932 if( lp.first.Marker() &
MK_HEAD )
944 if( lp.second.SegmentCount() )
947 lp.second.SetRank( aCurrentRank - 1 );
949 PNS_DBG(
Dbg(), Message, wxString::Format(
"PushViaF %p %d\n", &lp.second, lp.second.SegmentCount() ) );
973 assert( aObstacleVia );
979 bool lineCollision =
false;
980 bool viaCollision =
false;
983 PNS_DBG(
Dbg(), BeginGroup,
"push-via-by-line", 1 );
987 VIA vtmp ( *aObstacleVia );
994 LINE* currentLine = (
LINE*) aCurrent;
1006 clearance + currentLine->
Width() / 2,
1012 const VIA& currentVia = currentLine->
Via();
1015 viaCollision = currentVia.
Shape()->
Collide( vtmp.
Shape(), viaClearance, &mtvVia );
1027 else if ( lineCollision )
1033 PNS_DBG(
Dbg(), Message, wxString::Format(
"push-or-shove-via st %d", st ) );
1047 LINE cur( aCurrent );
1051 LINE shoved( aCurrent );
1091 LINE head( aCurrent );
1109 PNS_DBG(
Dbg(), AddItem, &aCurrent,
BLUE, 0, wxT(
"rr-current-line" ) );
1110 PNS_DBG(
Dbg(), AddItem, &shoved,
GREEN, 0, wxT(
"rr-shoved-line" ) );
1113 int currentRank = aCurrent.
Rank();
1119 shoved.
SetRank( currentRank );
1131 if( i->ContainsLink( aSeg ) )
1133 PNS_DBG(
Dbg(), Message, wxString::Format(
"Unwind lc %d (depth %d/%d)", i->SegmentCount(), d, (
int)
m_lineStack.size() ) );
1146 if( i->ContainsLink( aSeg ) )
1162 const LINE* l =
static_cast<const LINE*
>( aItem );
1174 PNS_DBG(
Dbg(), AddItem, &aL,
BLUE, 10000, wxT(
"push line stack failed" ) );
1204 if( i->ContainsLink( s ) )
1236 for(
ITEM* link : links )
1241 maxw = std::max( seg->
Width(), maxw );
1245 const ARC* arc =
static_cast<const ARC*
>( link );
1246 maxw = std::max( arc->
Width(), maxw );
1252 if( maxw > 0 && maxw >= v->
Diameter() )
1256 wxString::Format(
"Fixup via: new-w %d via-w %d", maxw, v->
Diameter() ) );
1275 for(
int i = 0; i < 2; i++ )
1312 wxString::Format( wxT(
"current-coll-chk rank %d" ), currentLine.
Rank() ) );
1323 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"nearest %p %s rank %d" ),
1325 nearest->m_item->KindStr(),
1326 nearest->m_item->Rank() ) );
1328 PNS_DBG(
Dbg(), AddShape, nearest->m_item->Shape(),
YELLOW, 10000, wxT(
"nearest" ) );
1338 PNS_DBG(
Dbg(), Message, wxT(
"no-nearest-item ") );
1344 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"iter %d: VF %d" ), aIter, viaFixup?1:0 ) );
1347 ITEM* ni = nearest->m_item;
1350 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"NI: %s (%s)" ),
1353 : wxString( wxT(
"null" ) ) ) );
1361 switch( ni->
Kind() )
1365 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: reverse-collide-via" ), aIter ), 0 );
1383 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: reverse-collide-segment " ),
1405 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: reverse-collide-arc " ), aIter ), 0 );
1427 switch( ni->
Kind() )
1430 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: collide-segment " ), aIter ), 0 );
1443 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: collide-arc " ), aIter ), 0 );
1455 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: collide-via (fixup: %d)" ), aIter, 0 ), 0 );
1467 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: walk-solid " ), aIter ), 0);
1495 PNS_DBG(
Dbg(), Message, wxString::Format(
"ShoveStart [root: %d jts, current: %d jts]",
1515 PNS_DBG(
Dbg(), Message, wxString::Format(
"iter %d: node %p stack %d ",
m_iter,
1524 PNS_DBG(
Dbg(), Message, wxString::Format(
"Fail [time limit expired: %d iter %d iter limit %d",
1558 wxString::Format(
"Shove start, lc = %d", aCurrentHead.
SegmentCount() ) )
1564 LINE head( aCurrentHead );
1574 headSet.
Add( aCurrentHead );
1593 PNS_DBG(
Dbg(), AddItem, &head,
CYAN, 0, wxT(
"head, after shove" ) );
1597 std::unique_ptr< VIA >headVia =
Clone( head.
Via() );
1599 headVia->SetRank( 100000 );
1625 PNS_DBG(
Dbg(), Message, wxString::Format(
"Shove status : %s after %d iterations",
1664 const LINE* headOrig =
static_cast<const LINE*
>( item );
1670 headSet.
Add( *headOrig );
1686 const LINE* headOrig =
static_cast<const LINE*
>( item );
1687 LINE head( *headOrig );
1701 std::unique_ptr< VIA > headVia =
Clone( head.
Via() );
1703 headVia->SetRank( 100000 );
1715 PNS_DBG(
Dbg(), Message, wxString::Format(
"Shove status : %s after %d iterations",
1743 if( item->Net() == handle.
net && item->Layers().Overlaps(handle.
layers) )
1744 return static_cast<VIA*
>( item );
1770 VIA headVia ( *viaToDrag );
1771 headVia.
SetPos( aWhere );
1772 headSet.
Add( &headVia,
false );
1777 if( prevViaHandle.
valid )
1779 aNewVia = prevViaHandle;
1833 if(
SEGMENT* seg = dyn_cast<SEGMENT*>( link ) )
1859 maxWidth = std::max( line.Width(), maxWidth );
1863 area->Inflate( maxWidth );
1913 for(
int pass = 0; pass < n_passes; pass++ )
1921 if( !( line.Marker() &
MK_HEAD ) )
1926 if( optimizer.
Optimize( &line, &optimized, root ) )
1928 PNS_DBG(
Dbg(), AddShape, &line.CLine(),
BLUE, 0, wxT(
"shove-pre-opt" ) );
1931 PNS_DBG(
Dbg(), AddItem, root,
RED, 0, wxT(
"shove-root-opt" ) );
1936 PNS_DBG(
Dbg(), AddShape, &line.CLine(),
GREEN, 0, wxT(
"shove-post-opt" ) );
1984 if ( iter->m_node == aNode )
2023 if ( iter->m_node == aNode )
2025 iter->m_locked =
false;
constexpr EDA_IU_SCALE pcbIUScale
std::optional< BOX2I > OPT_BOX2I
@ ROUNDED_45
H/V/45 with filleted corners.
@ MITERED_45
H/V/45 with mitered corners (default)
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc....
const BOX2I & VisibleViewArea() const
void SetDebugDecorator(DEBUG_DECORATOR *aDecorator)
Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.
ROUTER * Router() const
Return current router settings.
ROUTING_SETTINGS & Settings() const
Return the logger object, allowing to dump geometry to a file.
DEBUG_DECORATOR * Dbg() const
int Width() const override
virtual void SetIteration(int iter)
void Add(const LINE &aLine)
const std::vector< ITEM * > & CItems() const
Base class for PNS router board items.
BOARD_ITEM * Parent() const
virtual const std::string Format() const
virtual NET_HANDLE Net() const
PnsKind Kind() const
Return the type (kind) of the item.
virtual void SetRank(int aRank)
virtual int Layer() const
PnsKind
< Supported item types
const LAYER_RANGE & Layers() const
bool OfKind(int aKindMask) const
bool LayersOverlap(const ITEM *aOther) const
Return true if the set of layers spanned by aOther overlaps our layers.
virtual HOLE * Hole() const
bool Collide(const ITEM *aHead, const NODE *aNode, COLLISION_SEARCH_CONTEXT *aCtx=nullptr) const
Check for a collision (clearance violation) with between us and item aOther.
virtual void Mark(int aMarker) const
virtual bool HasHole() const
virtual int Marker() const
A 2D point on a given set of layers and belonging to a certain net, that links together a number of b...
const std::vector< ITEM * > & LinkList() const
const ITEM_SET & CLinks() const
bool IsStitchingVia() const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
virtual void Unmark(int aMarker=-1) const override
const VECTOR2I & CPoint(int aIdx) const
const SHAPE * Shape() const override
Modifiable accessor to the underlying shape.
void SetShape(const SHAPE_LINE_CHAIN &aLine)
Return the shape of the line.
virtual void Mark(int aMarker) const override
const SHAPE_LINE_CHAIN & CLine() const
void SetRank(int aRank) override
bool HasLockedSegments() const
SHAPE_LINE_CHAIN & Line()
virtual LINE * Clone() const override
Return a deep copy of the item.
bool IsLinkedChecked() const
Assign a shape to the line (a polyline/line chain).
virtual int Marker() const override
void AppendVia(const VIA &aVia)
bool Walkaround(SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN &aPre, SHAPE_LINE_CHAIN &aWalk, SHAPE_LINE_CHAIN &aPost, bool aCw) const
Calculate a line tightly wrapping a convex hull of an obstacle object (aObstacle).
const SEG CSegment(int aIdx) const
Set line width.
int Width() const
Return true if the line is geometrically identical as line aOther.
int Rank() const override
std::vector< LINKED_ITEM * > & Links()
virtual void ClearLinks()
Return the number of segments that were assembled together to form this line.
Keep the router "world" - i.e.
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
void RemoveByMarker(int aMarker)
int GetClearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const
Return the pre-set worst case clearance between any pair of items.
void Replace(ITEM *aOldItem, std::unique_ptr< ITEM > aNewItem)
Replace an item with another one.
OPT_OBSTACLE CheckColliding(const ITEM *aItem, int aKindMask=ITEM::ANY_T)
Check if the item collides with anything else in the world, and if found, returns the obstacle.
const JOINT * FindJoint(const VECTOR2I &aPos, int aLayer, NET_HANDLE aNet) const
Search for a joint at a given position, layer and belonging to given net.
std::optional< OBSTACLE > OPT_OBSTACLE
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
OPT_OBSTACLE NearestObstacle(const LINE *aLine, const COLLISION_SEARCH_OPTIONS &aOpts=COLLISION_SEARCH_OPTIONS())
Follow the line in search of an obstacle that is nearest to the starting to the line's starting point...
void LockJoint(const VECTOR2I &aPos, const ITEM *aItem, bool aLock)
int JointCount() const
Return the number of nodes in the inheritance chain (wrs to the root node).
void ClearRanks(int aMarkerMask=MK_HEAD|MK_VIOLATION)
void Remove(ARC *aArc)
Remove an item from this branch.
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false, bool aFollowLockedSegments=false)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
Perform various optimizations of the lines being routed, attempting to make the lines shorter and les...
void SetRestrictArea(const BOX2I &aArea, bool aStrict=true)
void SetCollisionMask(int aMask)
void SetEffortLevel(int aEffort)
static bool Optimize(LINE *aLine, int aEffortLevel, NODE *aWorld, const VECTOR2I &aV=VECTOR2I(0, 0))
@ LIMIT_CORNER_COUNT
Do not attempt to optimize if the resulting line's corner count is outside the predefined range.
@ SMART_PADS
Reroute pad exits.
@ MERGE_SEGMENTS
Reduce corner cost iteratively.
@ MERGE_OBTUSE
Reduce corner cost by merging obtuse segments.
virtual DEBUG_DECORATOR * GetDebugDecorator()=0
virtual int GetNetCode(NET_HANDLE aNet) const =0
ROUTER_IFACE * GetInterface() const
TIME_LIMIT ShoveTimeLimit() const
PNS_OPTIMIZATION_EFFORT OptimizerEffort() const
Set the optimizer effort. Bigger means cleaner traces, but slower routing.
int ShoveIterationLimit() const
DIRECTION_45::CORNER_MODE GetCornerMode() const
int Width() const override
const SHAPE_LINE_CHAIN Hull(int aClearance, int aWalkaroundThickness, int aLayer=-1) const override
void SetSpringbackDoNotTouchNode(const NODE *aNode)
SHOVE_STATUS shoveIteration(int aIter)
SHOVE_STATUS shoveMainLoop()
std::vector< SHAPE_LINE_CHAIN > HULL_SET
std::pair< LINE, LINE > LINE_PAIR
std::vector< LINE > m_lineStack
LINE * findRootLine(LINE *aLine)
std::vector< SPRINGBACK_TAG > m_nodeStack
SHOVE_STATUS onCollidingArc(LINE &aCurrent, ARC *aObstacleArc)
SHOVE_STATUS ShoveObstacleLine(const LINE &aCurLine, const LINE &aObstacleLine, LINE &aResultLine)
LINE assembleLine(const LINKED_ITEM *aSeg, int *aIndex=nullptr)
std::optional< LINE > OPT_LINE
void SetInitialLine(LINE &aInitial)
bool checkShoveDirection(const LINE &aCurLine, const LINE &aObstacleLine, const LINE &aShovedLine) const
SHOVE_STATUS pushOrShoveVia(VIA *aVia, const VECTOR2I &aForce, int aCurrentRank)
SHOVE_STATUS onCollidingSegment(LINE &aCurrent, SEGMENT *aObstacleSeg)
SHOVE(NODE *aWorld, ROUTER *aRouter)
void DisablePostShoveOptimizations(int aMask)
SHOVE_STATUS ShoveLines(const LINE &aCurrentHead)
bool RewindSpringbackTo(NODE *aNode)
bool pushLineStack(const LINE &aL, bool aKeepCurrentOnTop=false)
OPT_BOX2I totalAffectedArea() const
bool RewindToLastLockedNode()
void replaceLine(LINE &aOld, LINE &aNew, bool aIncludeInChangedArea=true, NODE *aNode=nullptr)
SHOVE_STATUS ShoveDraggingVia(const VIA_HANDLE aOldVia, const VECTOR2I &aWhere, VIA_HANDLE &aNewVia)
void sanityCheck(LINE *aOld, LINE *aNew)
int m_restrictSpringbackTagId
NODE * reduceSpringback(const ITEM_SET &aHeadSet, VIA_HANDLE &aDraggedVia)
void runOptimizer(NODE *aNode)
SHOVE_STATUS shoveLineToHullSet(const LINE &aCurLine, const LINE &aObstacleLine, LINE &aResultLine, const HULL_SET &aHulls)
bool pushSpringback(NODE *aNode, const OPT_BOX2I &aAffectedArea, VIA *aDraggedVia)
SHOVE_STATUS onCollidingLine(LINE &aCurrent, LINE &aObstacle)
void UnlockSpringbackNode(NODE *aNode)
bool AddLockedSpringbackNode(NODE *aNode)
void unwindLineStack(const LINKED_ITEM *aSeg)
SHOVE_STATUS shoveLineFromLoneVia(const LINE &aCurLine, const LINE &aObstacleLine, LINE &aResultLine)
int getClearance(const ITEM *aA, const ITEM *aB) const
SHOVE_STATUS onReverseCollidingVia(LINE &aCurrent, VIA *aObstacleVia)
std::vector< LINE > m_optimizerQueue
SHOVE_STATUS onCollidingSolid(LINE &aCurrent, ITEM *aObstacle, OBSTACLE &aObstacleInfo)
bool fixupViaCollisions(const LINE *aCurrent, OBSTACLE &obs)
void replaceItems(ITEM *aOld, std::unique_ptr< ITEM > aNew)
const NODE * m_springbackDoNotTouchNode
SHOVE_STATUS ShoveMultiLines(const ITEM_SET &aHeadSet)
std::unordered_map< const LINKED_ITEM *, LINE * > m_rootLineHistory
const LINE NewHead() const
std::vector< LINE_PAIR > LINE_PAIR_VEC
SHOVE_STATUS onCollidingVia(ITEM *aCurrent, VIA *aObstacleVia, OBSTACLE &aObstacleInfo)
const std::set< ITEM * > AssembleCluster(ITEM *aStart, int aLayer)
const VECTOR2I & Pos() const
const SHAPE * Shape() const override
Return the geometrical shape of the item.
const VIA_HANDLE MakeHandle() const
void SetDiameter(int aDiameter)
void SetPos(const VECTOR2I &aPos)
const SHAPE_LINE_CHAIN Hull(int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const override
void SetIterationLimit(const int aIterLimit)
void SetSolidsOnly(bool aSolidsOnly)
WALKAROUND_STATUS Route(const LINE &aInitialPath, LINE &aWalkPath, bool aOptimize=true)
void RestrictToSet(bool aEnabled, const std::set< ITEM * > &aSet)
static double DefaultAccuracyForPCB()
A dynamic state checking if a point lies within polygon with a dynamically built outline ( with each ...
void AddPolyline(const SHAPE_LINE_CHAIN &aPolyline)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const SHAPE_LINE_CHAIN Reverse() const
Reverse point order in the line chain.
void Simplify(int aMaxError=0)
Simplify the line chain by removing colinear adjacent segments and duplicate vertices.
int PointCount() const
Return the number of points (vertices) in this line chain.
void Clear()
Remove all points from the line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
const std::string Format(bool aCplusPlus=true) const override
bool IsArcSegment(size_t aSegment) const
long long int Length() const
Return length of the line chain in Euclidean metric.
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
VECTOR2_TRAITS< int32_t >::extended_type extended_type
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Push and Shove diff pair dimensions (gap) settings dialog.
static VIA * findViaByHandle(NODE *aNode, const VIA_HANDLE &handle)
OPT_BOX2I ChangedArea(const ITEM *aItemA, const ITEM *aItemB)
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
#define PNS_DBG(dbg, method,...)
#define PNS_DBGN(dbg, method)
VECTOR2I::extended_type ecoord
std::vector< FAB_LAYER_COLOR > dummy
Hold an object colliding with another object, along with some useful data about the collision.
int m_maxFanoutWidth
worst case (largest) width of the tracks connected to the item
ITEM * m_item
Item found to be colliding with m_head.
constexpr ret_type KiROUND(fp_type v, bool aQuiet=false)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< int32_t > VECTOR2I