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();
158 std::unordered_set<LINE*> alreadyDeleted;
162 auto it2 = alreadyDeleted.find( it.second );
164 if( it2 == alreadyDeleted.end() )
166 alreadyDeleted.insert( it.second );
188 const LINE& aShovedLine )
const
212 int obstacleLineWidth = aObstacleLine.
Width();
216 int holeClearance =
getClearance( viaHole, &aObstacleLine );
218 if( holeClearance +
via.Drill() / 2 > clearance +
via.Diameter() / 2 )
219 clearance = holeClearance +
via.Drill() / 2 -
via.Diameter() / 2;
225 if( ! aObstacleLine.
Walkaround( hull, path_cw,
true ) )
228 if( ! aObstacleLine.
Walkaround( hull, path_ccw,
false ) )
236 if( aObstacleLine.
CPoint( -1 ) != shortest.
CPoint( -1 ) )
261 PNS_DBG(
Dbg(), BeginGroup,
"shove-details", 1 );
263 for( attempt = 0; attempt < 4; attempt++ )
265 bool invertTraversal = ( attempt >= 2 );
266 bool clockwise = attempt % 2;
267 int vFirst = -1, vLast = -1;
269 LINE l( aObstacleLine );
272 for(
int i = 0; i < (int) aHulls.size(); i++ )
274 const SHAPE_LINE_CHAIN& hull = aHulls[invertTraversal ? aHulls.size() - 1 - i : i];
276 PNS_DBG(
Dbg(), AddShape, &hull,
YELLOW, 10000, wxString::Format(
"hull[%d]", i ) );
282 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"Fail-Walk %s %s %d\n" ),
300 for(
int i = 0; i < std::min(
path.PointCount(), obs.
PointCount() ); i++ )
311 for(
int i =
path.PointCount() - 1; i >= 0 && k >= 0; i--, k-- )
320 if( ( vFirst < 0 || vLast < 0 ) && !
path.CompareGeometry( aObstacleLine.
CLine() ) )
322 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail vfirst-last" ),
329 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail vend-start\n" ),
336 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail direction-check" ),
342 if(
path.SelfIntersecting() )
344 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail self-intersect" ),
364 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"attempt %d fail coll-check" ),
391 bool obstacleIsHead =
false;
397 obstacleIsHead =
true;
405 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"shove process-single: voe1 %d voe2 %d" ),
421 int obstacleLineWidth = aObstacleLine.
Width();
422 int clearance =
getClearance( &aCurLine, &aObstacleLine );
426 hulls.reserve( currentLineSegmentCount + 1 );
428 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"shove process-single: cur net %d obs %d cl %d" ),
433 for(
int i = 0; i < currentLineSegmentCount; i++ )
440 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"shove add-extra-clearance %d" ),
447 hulls.push_back( hull );
455 int holeClearance =
getClearance( viaHole, &aObstacleLine );
457 if( holeClearance +
via.Drill() / 2 > viaClearance +
via.Diameter() / 2 )
458 viaClearance = holeClearance +
via.Drill() / 2 -
via.Diameter() / 2;
460 hulls.push_back( aCurLine.
Via().
Hull( viaClearance, obstacleLineWidth ) );
480 LINE shovedLine( obstacleLine );
485 PNS_DBG(
Dbg(), Message,
"try walk (locked segments)");
491 const double extensionWalkThreshold = 1.0;
495 double extensionFactor = 0.0;
498 extensionFactor = shovedLen / obsLen - 1.0;
500 if( extensionFactor > extensionWalkThreshold )
507 PNS_DBG(
Dbg(), AddItem, aObstacleSeg,
BLUE, 0, wxT(
"shove-changed-area" ) );
509 PNS_DBG(
Dbg(), AddItem, &obstacleLine,
GREEN, 10000, wxString::Format(
"obstacle-line [l %d v %d]", obstacleLine.
Layer(), obstacleLine.
EndsWithVia() ) );
510 PNS_DBG(
Dbg(), AddItem, &shovedLine,
BLUE, 10000, wxT(
"shoved-line" ) );
523 int rank = aCurrent.
Rank();
524 shovedLine.
SetRank( rank - 1 );
544 LINE shovedLine( obstacleLine );
545 ARC tmp( *aObstacleArc );
552 const double extensionWalkThreshold = 1.0;
556 double extensionFactor = 0.0;
559 extensionFactor = shovedLen / obsLen - 1.0;
561 if( extensionFactor > extensionWalkThreshold )
567 PNS_DBG(
Dbg(), AddItem, &aCurrent,
RED, 10000, wxT(
"current-line" ) );
568 PNS_DBG(
Dbg(), AddItem, &obstacleLine,
GREEN, 10000, wxT(
"obstacle-line" ) );
569 PNS_DBG(
Dbg(), AddItem, &shovedLine,
BLUE, 10000, wxT(
"shoved-line" ) );
581 int rank = aCurrent.
Rank();
582 shovedLine.
SetRank( rank - 1 );
600 LINE shovedLine( aObstacle );
604 PNS_DBG(
Dbg(), AddItem, &aObstacle,
RED, 100000, wxT(
"obstacle-line" ) );
605 PNS_DBG(
Dbg(), AddItem, &aCurrent,
GREEN, 150000, wxT(
"current-line" ) );
606 PNS_DBG(
Dbg(), AddItem, &shovedLine,
BLUE, 200000, wxT(
"shoved-line" ) );
621 int rank = aObstacle.
Rank();
622 shovedLine.
SetRank( rank - 1 );
641 LINE walkaroundLine( aCurrent );
670 PNS_DBG(
Dbg(), BeginGroup,
"walk-cluster", 1 );
672 for(
ITEM* item : cluster )
673 PNS_DBG(
Dbg(), AddItem, item,
RED, 10000, wxT(
"cl-item" ) );
683 int currentRank = aCurrent.
Rank();
686 bool success =
false;
688 for(
int attempt = 0; attempt < 2; attempt++ )
690 if( attempt == 1 ||
Settings().JumpOverObstacles() )
691 nextRank = currentRank - 1;
693 nextRank = currentRank + 10000;
745 walkaroundLine.
SetRank( nextRank );
747 PNS_DBG(
Dbg(), AddItem, &aCurrent,
RED, 10000, wxT(
"current-line" ) );
748 PNS_DBG(
Dbg(), AddItem, &walkaroundLine,
BLUE, 10000, wxT(
"walk-line" ) );
779 aDraggedVia.
valid =
true;
845 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"via force [%d %d]\n" ), aForce.
x, aForce.
y ) );
848 if ( aForce.
x == 0 && aForce.
y == 0 )
853 PNS_DBG(
Dbg(), Message, wxT(
"weird, can't find the center-of-via joint\n" ) );
871 p0_pushed += aForce.
Resize( 2 );
874 std::unique_ptr<VIA> pushedVia =
Clone( *aVia );
875 pushedVia->SetPos( p0_pushed );
876 pushedVia->Mark( aVia->
Marker() );
888 if( lp.first.HasLockedSegments() )
891 assert( segIndex == 0 || ( segIndex == ( lp.first.SegmentCount() - 1 ) ) );
896 lp.second = lp.first;
897 lp.second.ClearLinks();
898 lp.second.DragCorner( p0_pushed, lp.second.CLine().Find( p0 ) );
899 lp.second.AppendVia( *pushedVia );
900 draggedLines.push_back( lp );
904 pushedVia->SetRank( aCurrentRank - 1 );
905 PNS_DBG(
Dbg(), Message, wxString::Format(
"PushViaRank %d\n", pushedVia->Rank() ) );
924 if( lp.first.Marker() &
MK_HEAD )
936 if( lp.second.SegmentCount() )
939 lp.second.SetRank( aCurrentRank - 1 );
941 PNS_DBG(
Dbg(), Message, wxString::Format(
"PushViaF %p %d\n", &lp.second, lp.second.SegmentCount() ) );
965 assert( aObstacleVia );
971 bool lineCollision =
false;
972 bool viaCollision =
false;
975 PNS_DBG(
Dbg(), BeginGroup,
"push-via-by-line", 1 );
979 VIA vtmp ( *aObstacleVia );
986 LINE* currentLine = (
LINE*) aCurrent;
998 clearance + currentLine->
Width() / 2,
1004 const VIA& currentVia = currentLine->
Via();
1007 viaCollision = currentVia.
Shape()->
Collide( vtmp.
Shape(), viaClearance, &mtvVia );
1019 else if ( lineCollision )
1025 PNS_DBG(
Dbg(), Message, wxString::Format(
"push-or-shove-via st %d", st ) );
1039 LINE cur( aCurrent );
1043 LINE shoved( aCurrent );
1083 LINE head( aCurrent );
1101 PNS_DBG(
Dbg(), AddItem, &aCurrent,
BLUE, 0, wxT(
"rr-current-line" ) );
1102 PNS_DBG(
Dbg(), AddItem, &shoved,
GREEN, 0, wxT(
"rr-shoved-line" ) );
1105 int currentRank = aCurrent.
Rank();
1111 shoved.
SetRank( currentRank );
1123 if( i->ContainsLink( aSeg ) )
1125 PNS_DBG(
Dbg(), Message, wxString::Format(
"Unwind lc %d (depth %d/%d)", i->SegmentCount(), d, (
int)
m_lineStack.size() ) );
1138 if( i->ContainsLink( aSeg ) )
1154 const LINE* l =
static_cast<const LINE*
>( aItem );
1166 PNS_DBG(
Dbg(), AddItem, &aL,
BLUE, 10000, wxT(
"push line stack failed" ) );
1196 if( i->ContainsLink( s ) )
1228 for(
ITEM* link : links )
1233 maxw = std::max( seg->
Width(), maxw );
1237 const ARC* arc =
static_cast<const ARC*
>( link );
1238 maxw = std::max( arc->
Width(), maxw );
1244 if( maxw > 0 && maxw >= v->
Diameter() )
1248 wxString::Format(
"Fixup via: new-w %d via-w %d", maxw, v->
Diameter() ) );
1267 for(
int i = 0; i < 2; i++ )
1304 wxString::Format( wxT(
"current-coll-chk rank %d" ), currentLine.
Rank() ) );
1315 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"nearest %p %s rank %d" ),
1317 nearest->m_item->KindStr(),
1318 nearest->m_item->Rank() ) );
1320 PNS_DBG(
Dbg(), AddShape, nearest->m_item->Shape(),
YELLOW, 10000, wxT(
"nearest" ) );
1330 PNS_DBG(
Dbg(), Message, wxT(
"no-nearest-item ") );
1336 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"iter %d: VF %d" ), aIter, viaFixup?1:0 ) );
1339 ITEM* ni = nearest->m_item;
1342 PNS_DBG(
Dbg(), Message, wxString::Format( wxT(
"NI: %s (%s)" ),
1345 : wxString( wxT(
"null" ) ) ) );
1353 switch( ni->
Kind() )
1357 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: reverse-collide-via" ), aIter ), 0 );
1375 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: reverse-collide-segment " ),
1397 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: reverse-collide-arc " ), aIter ), 0 );
1419 switch( ni->
Kind() )
1422 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: collide-segment " ), aIter ), 0 );
1435 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: collide-arc " ), aIter ), 0 );
1447 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: collide-via (fixup: %d)" ), aIter, 0 ), 0 );
1459 PNS_DBG(
Dbg(), BeginGroup, wxString::Format( wxT(
"iter %d: walk-solid " ), aIter ), 0);
1487 PNS_DBG(
Dbg(), Message, wxString::Format(
"ShoveStart [root: %d jts, current: %d jts]",
1507 PNS_DBG(
Dbg(), Message, wxString::Format(
"iter %d: node %p stack %d ",
m_iter,
1516 PNS_DBG(
Dbg(), Message, wxString::Format(
"Fail [time limit expired: %d iter %d iter limit %d",
1550 wxString::Format(
"Shove start, lc = %d", aCurrentHead.
SegmentCount() ) )
1556 LINE head( aCurrentHead );
1566 headSet.
Add( aCurrentHead );
1585 PNS_DBG(
Dbg(), AddItem, &head,
CYAN, 0, wxT(
"head, after shove" ) );
1589 std::unique_ptr< VIA >headVia =
Clone( head.
Via() );
1591 headVia->SetRank( 100000 );
1617 PNS_DBG(
Dbg(), Message, wxString::Format(
"Shove status : %s after %d iterations",
1656 const LINE* headOrig =
static_cast<const LINE*
>( item );
1662 headSet.
Add( *headOrig );
1678 const LINE* headOrig =
static_cast<const LINE*
>( item );
1679 LINE head( *headOrig );
1693 std::unique_ptr< VIA > headVia =
Clone( head.
Via() );
1695 headVia->SetRank( 100000 );
1707 PNS_DBG(
Dbg(), Message, wxString::Format(
"Shove status : %s after %d iterations",
1735 if( item->Net() == handle.
net && item->Layers().Overlaps(handle.
layers) )
1736 return static_cast<VIA*
>( item );
1762 VIA headVia ( *viaToDrag );
1763 headVia.
SetPos( aWhere );
1764 headSet.
Add( &headVia,
false );
1769 if( prevViaHandle.
valid )
1771 aNewVia = prevViaHandle;
1825 if(
SEGMENT* seg = dyn_cast<SEGMENT*>( link ) )
1851 maxWidth = std::max( line.Width(), maxWidth );
1855 area->Inflate( maxWidth );
1899 for(
int pass = 0; pass < n_passes; pass++ )
1907 if( !( line.Marker() &
MK_HEAD ) )
1912 if( optimizer.
Optimize( &line, &optimized, root ) )
1914 PNS_DBG(
Dbg(), AddShape, &line.CLine(),
BLUE, 0, wxT(
"shove-pre-opt" ) );
1917 PNS_DBG(
Dbg(), AddItem, root,
RED, 0, wxT(
"shove-root-opt" ) );
1922 PNS_DBG(
Dbg(), AddShape, &line.CLine(),
GREEN, 0, wxT(
"shove-post-opt" ) );
1970 if ( iter->m_node == aNode )
2009 if ( iter->m_node == aNode )
2011 iter->m_locked =
false;
constexpr EDA_IU_SCALE pcbIUScale
std::optional< BOX2I > OPT_BOX2I
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) 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.
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 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
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.
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
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).
bool Add(std::unique_ptr< SEGMENT > &&aSegment, bool aAllowRedundant=false)
Add an item to the current node.
void ClearRanks(int aMarkerMask=MK_HEAD|MK_VIOLATION)
void Replace(ITEM *aOldItem, std::unique_ptr< ITEM > &&aNewItem)
Replace an item with another one.
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
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.
SHAPE_LINE_CHAIN & Simplify(bool aRemoveColinear=true)
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< int >::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)
Round a floating point number to an integer using "round halfway cases away from zero".