KiCad PCB EDA Suite
|
The actual Push and Shove algorithm. More...
#include <pns_shove.h>
Classes | |
struct | HEAD_LINE_ENTRY |
struct | ROOT_LINE_ENTRY |
struct | SPRINGBACK_TAG |
Public Types | |
enum | SHOVE_STATUS { SH_OK = 0 , SH_NULL , SH_INCOMPLETE , SH_HEAD_MODIFIED , SH_TRY_WALK } |
enum | SHOVE_POLICY { SHP_DEFAULT = 0 , SHP_SHOVE = 0x1 , SHP_WALK_FORWARD = 0x2 , SHP_WALK_BACK = 0x4 , SHP_IGNORE = 0x8 , SHP_DONT_OPTIMIZE = 0x10 } |
Public Member Functions | |
void | SetDefaultShovePolicy (int aPolicy) |
void | SetShovePolicy (const LINKED_ITEM *aItem, int aPolicy) |
void | SetShovePolicy (const LINE &aLine, int aPolicy) |
SHOVE (NODE *aWorld, ROUTER *aRouter) | |
~SHOVE () | |
void | ClearHeads () |
void | AddHeads (const LINE &aHead, int aPolicy=SHP_DEFAULT) |
void | AddHeads (VIA_HANDLE aHead, VECTOR2I aNewPos, int aPolicy=SHP_DEFAULT) |
SHOVE_STATUS | Run () |
SHOVE_STATUS | ShoveDraggingVia (const VIA_HANDLE aOldVia, const VECTOR2I &aWhere, VIA_HANDLE &aNewVia) |
bool | ShoveObstacleLine (const LINE &aCurLine, const LINE &aObstacleLine, LINE &aResultLine) |
void | ForceClearance (bool aEnabled, int aClearance) |
NODE * | CurrentNode () |
bool | HeadsModified (int aIndex=-1) const |
const PNS::LINE | GetModifiedHead (int aIndex) const |
const VIA_HANDLE | GetModifiedHeadVia (int aIndex) const |
bool | AddLockedSpringbackNode (NODE *aNode) |
void | UnlockSpringbackNode (NODE *aNode) |
bool | RewindSpringbackTo (NODE *aNode) |
bool | RewindToLastLockedNode () |
void | DisablePostShoveOptimizations (int aMask) |
void | SetSpringbackDoNotTouchNode (const NODE *aNode) |
ROUTER * | Router () const |
Return current router settings. | |
ROUTING_SETTINGS & | Settings () const |
Return the logger object, allowing to dump geometry to a file. | |
virtual LOGGER * | Logger () |
void | SetLogger (LOGGER *aLogger) |
void | SetDebugDecorator (DEBUG_DECORATOR *aDecorator) |
Assign a debug decorator allowing this algo to draw extra graphics for visual debugging. | |
DEBUG_DECORATOR * | Dbg () const |
const BOX2I & | VisibleViewArea () const |
Protected Attributes | |
DEBUG_DECORATOR * | m_debugDecorator |
ROUTER * | m_router |
LOGGER * | m_logger |
Private Types | |
typedef std::vector< SHAPE_LINE_CHAIN > | HULL_SET |
typedef std::optional< LINE > | OPT_LINE |
typedef std::pair< LINE, LINE > | LINE_PAIR |
typedef std::vector< LINE_PAIR > | LINE_PAIR_VEC |
Private Member Functions | |
bool | shoveLineToHullSet (const LINE &aCurLine, const LINE &aObstacleLine, LINE &aResultLine, const HULL_SET &aHulls) |
NODE * | reduceSpringback (const ITEM_SET &aHeadSet) |
bool | pushSpringback (NODE *aNode, const OPT_BOX2I &aAffectedArea) |
bool | shoveLineFromLoneVia (const LINE &aCurLine, const LINE &aObstacleLine, LINE &aResultLine) |
bool | checkShoveDirection (const LINE &aCurLine, const LINE &aObstacleLine, const LINE &aShovedLine) const |
SHOVE_STATUS | onCollidingArc (LINE &aCurrent, ARC *aObstacleArc) |
SHOVE_STATUS | onCollidingLine (LINE &aCurrent, LINE &aObstacle, int aNextRank) |
SHOVE_STATUS | onCollidingSegment (LINE &aCurrent, SEGMENT *aObstacleSeg) |
SHOVE_STATUS | onCollidingSolid (LINE &aCurrent, ITEM *aObstacle, OBSTACLE &aObstacleInfo) |
SHOVE_STATUS | onCollidingVia (ITEM *aCurrent, VIA *aObstacleVia, OBSTACLE &aObstacleInfo, int aNextRank) |
SHOVE_STATUS | onReverseCollidingVia (LINE &aCurrent, VIA *aObstacleVia, OBSTACLE &aObstacleInfo) |
SHOVE_STATUS | pushOrShoveVia (VIA *aVia, const VECTOR2I &aForce, int aNextRank) |
OPT_BOX2I | totalAffectedArea () const |
void | unwindLineStack (const LINKED_ITEM *aSeg) |
void | unwindLineStack (const ITEM *aItem) |
void | runOptimizer (NODE *aNode) |
bool | pushLineStack (const LINE &aL, bool aKeepCurrentOnTop=false) |
void | popLineStack () |
LINE | assembleLine (const LINKED_ITEM *aSeg, int *aIndex=nullptr, bool aPreCleanup=false) |
void | replaceItems (ITEM *aOld, std::unique_ptr< ITEM > aNew) |
ROOT_LINE_ENTRY * | replaceLine (LINE &aOld, LINE &aNew, bool aIncludeInChangedArea=true, NODE *aNode=nullptr) |
ROOT_LINE_ENTRY * | findRootLine (const LINE &aLine) |
ROOT_LINE_ENTRY * | findRootLine (const LINKED_ITEM *aItem) |
ROOT_LINE_ENTRY * | touchRootLine (const LINE &aLine) |
ROOT_LINE_ENTRY * | touchRootLine (const LINKED_ITEM *aItem) |
void | pruneRootLines (NODE *aRemovedNode) |
SHOVE_STATUS | shoveIteration (int aIter) |
SHOVE_STATUS | shoveMainLoop () |
int | getClearance (const ITEM *aA, const ITEM *aB) const |
bool | fixupViaCollisions (const LINE *aCurrent, OBSTACLE &obs) |
void | sanityCheck (LINE *aOld, LINE *aNew) |
void | reconstructHeads (bool aShoveFailed) |
void | removeHeads () |
bool | preShoveCleanup (LINE *aOld, LINE *aNew) |
const wxString | formatPolicy (int aPolicy) |
Private Attributes | |
std::vector< SPRINGBACK_TAG > | m_nodeStack |
std::vector< LINE > | m_lineStack |
std::vector< LINE > | m_optimizerQueue |
std::deque< HEAD_LINE_ENTRY > | m_headLines |
std::unordered_map< LINKED_ITEM::UNIQ_ID, ROOT_LINE_ENTRY * > | m_rootLineHistory |
NODE * | m_root |
NODE * | m_currentNode |
const NODE * | m_springbackDoNotTouchNode |
int | m_restrictSpringbackTagId |
VIA * | m_draggedVia |
int | m_iter |
bool | m_headsModified |
int | m_forceClearance |
bool | m_multiLineMode |
int | m_optFlagDisableMask |
int | m_defaultPolicy |
OPT_BOX2I | m_affectedArea |
The actual Push and Shove algorithm.
Definition at line 45 of file pns_shove.h.
|
private |
Definition at line 110 of file pns_shove.h.
|
private |
Definition at line 112 of file pns_shove.h.
|
private |
Definition at line 113 of file pns_shove.h.
|
private |
Definition at line 111 of file pns_shove.h.
Enumerator | |
---|---|
SHP_DEFAULT | |
SHP_SHOVE | |
SHP_WALK_FORWARD | |
SHP_WALK_BACK | |
SHP_IGNORE | |
SHP_DONT_OPTIMIZE |
Definition at line 58 of file pns_shove.h.
Enumerator | |
---|---|
SH_OK | |
SH_NULL | |
SH_INCOMPLETE | |
SH_HEAD_MODIFIED | |
SH_TRY_WALK |
Definition at line 49 of file pns_shove.h.
Definition at line 185 of file pns_shove.cpp.
References PNS::ROUTER_IFACE::GetDebugDecorator(), PNS::ROUTER::GetInterface(), m_currentNode, m_defaultPolicy, m_draggedVia, m_forceClearance, m_iter, m_multiLineMode, m_optFlagDisableMask, m_restrictSpringbackTagId, m_root, m_springbackDoNotTouchNode, PNS::ALGO_BASE::SetDebugDecorator(), and SHP_SHOVE.
PNS::SHOVE::~SHOVE | ( | ) |
Definition at line 204 of file pns_shove.cpp.
void PNS::SHOVE::AddHeads | ( | const LINE & | aHead, |
int | aPolicy = SHP_DEFAULT |
||
) |
Definition at line 2088 of file pns_shove.cpp.
References m_headLines.
void PNS::SHOVE::AddHeads | ( | VIA_HANDLE | aHead, |
VECTOR2I | aNewPos, | ||
int | aPolicy = SHP_DEFAULT |
||
) |
Definition at line 2094 of file pns_shove.cpp.
References m_headLines, PNS::SHOVE::HEAD_LINE_ENTRY::prevVia, PNS::SHOVE::HEAD_LINE_ENTRY::theVia, and PNS::SHOVE::HEAD_LINE_ENTRY::viaNewPos.
bool PNS::SHOVE::AddLockedSpringbackNode | ( | NODE * | aNode | ) |
Definition at line 1972 of file pns_shove.cpp.
References PNS::ALGO_BASE::Dbg(), PNS::SHOVE::SPRINGBACK_TAG::m_locked, PNS::SHOVE::SPRINGBACK_TAG::m_node, m_nodeStack, and PNS_DBG.
|
private |
Definition at line 209 of file pns_shove.cpp.
References PNS::NODE::AssembleLine(), m_currentNode, and preShoveCleanup().
Referenced by onCollidingArc(), onCollidingSegment(), onReverseCollidingVia(), pushOrShoveVia(), and shoveIteration().
|
private |
Definition at line 232 of file pns_shove.cpp.
References SHAPE_LINE_CHAIN::POINT_INSIDE_TRACKER::AddPolyline(), PNS::LINE::CLine(), PNS::LINE::CPoint(), SHAPE_LINE_CHAIN::POINT_INSIDE_TRACKER::IsInside(), and SHAPE_LINE_CHAIN::Reverse().
Referenced by shoveLineToHullSet().
void PNS::SHOVE::ClearHeads | ( | ) |
Definition at line 2082 of file pns_shove.cpp.
References m_headLines.
NODE * PNS::SHOVE::CurrentNode | ( | ) |
Definition at line 1966 of file pns_shove.cpp.
References m_currentNode, and m_root.
|
inlineinherited |
Definition at line 78 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_debugDecorator.
Referenced by AddLockedSpringbackNode(), PNS::LINE_PLACER::buildInitialLine(), PNS::LINE_PLACER::clipAndCheckCollisions(), PNS::MEANDER_PLACER::doMove(), PNS::COMPONENT_DRAGGER::Drag(), PNS::MULTI_DRAGGER::Drag(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), PNS::MULTI_DRAGGER::findNewLeaderSegment(), fixupViaCollisions(), PNS::LINE_PLACER::handlePullback(), PNS::LINE_PLACER::mergeHead(), PNS::DP_MEANDER_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), PNS::MULTI_DRAGGER::multidragShove(), PNS::MULTI_DRAGGER::multidragWalkaround(), onCollidingArc(), onCollidingLine(), onCollidingSegment(), onCollidingSolid(), onCollidingVia(), onReverseCollidingVia(), PNS::DRAGGER::optimizeAndUpdateDraggedLine(), PNS::LINE_PLACER::optimizeTailHeadTransition(), preShoveCleanup(), pruneRootLines(), pushLineStack(), pushOrShoveVia(), pushSpringback(), reconstructHeads(), reduceSpringback(), PNS::LINE_PLACER::reduceTail(), removeHeads(), PNS::LINE_PLACER::removeLoops(), replaceItems(), replaceLine(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::rhWalkOnly(), PNS::WALKAROUND::Route(), PNS::LINE_PLACER::routeStep(), Run(), runOptimizer(), shoveIteration(), shoveLineToHullSet(), shoveMainLoop(), ShoveObstacleLine(), PNS::WALKAROUND::singleStep(), PNS::LINE_PLACER::splitHeadTail(), PNS::LINE_PLACER::Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), touchRootLine(), PNS::LINE_PLACER::Trace(), PNS::DRAGGER::tryWalkaround(), PNS::MULTI_DRAGGER::tryWalkaround(), and unwindLineStack().
void PNS::SHOVE::DisablePostShoveOptimizations | ( | int | aMask | ) |
Definition at line 2051 of file pns_shove.cpp.
References m_optFlagDisableMask.
|
private |
Definition at line 1772 of file pns_shove.cpp.
References PNS::LINK_HOLDER::Links(), and m_rootLineHistory.
Referenced by reconstructHeads(), Run(), runOptimizer(), and shoveIteration().
|
private |
Definition at line 1785 of file pns_shove.cpp.
References m_rootLineHistory, and PNS::LINKED_ITEM::Uid().
Definition at line 1381 of file pns_shove.cpp.
References SEG::A, PNS::ITEM::ARC_T, SEG::B, PNS::JOINT::CLinks(), PNS::ITEM::Collide(), PNS::ALGO_BASE::Dbg(), PNS::VIA::Diameter(), PNS::NODE::FindJoint(), PNS::ITEM::Layer(), m_currentNode, PNS::OBSTACLE::m_item, PNS::OBSTACLE::m_maxFanoutWidth, PNS::ITEM::OfKind(), PNS_DBG, PNS::VIA::Pos(), PNS::SEGMENT::Seg(), PNS::ITEM::SEGMENT_T, PNS::VIA::SetDiameter(), PNS::JOINT::Via(), PNS::ITEM::VIA_T, PNS::ARC::Width(), and PNS::SEGMENT::Width().
Referenced by shoveIteration().
|
inline |
Definition at line 88 of file pns_shove.h.
References m_forceClearance.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk().
|
private |
Definition at line 2474 of file pns_shove.cpp.
References m_defaultPolicy, SHP_DEFAULT, SHP_IGNORE, SHP_SHOVE, and SHP_WALK_FORWARD.
Referenced by Run().
Definition at line 161 of file pns_shove.cpp.
References PNS::NODE::GetClearance(), PNS::ITEM::HasHole(), PNS::ITEM::Hole(), m_currentNode, and m_forceClearance.
Referenced by onCollidingVia(), onReverseCollidingVia(), shoveLineFromLoneVia(), and ShoveObstacleLine().
const PNS::LINE PNS::SHOVE::GetModifiedHead | ( | int | aIndex | ) | const |
Definition at line 2503 of file pns_shove.cpp.
References m_headLines.
const VIA_HANDLE PNS::SHOVE::GetModifiedHeadVia | ( | int | aIndex | ) | const |
Definition at line 2508 of file pns_shove.cpp.
References m_headLines.
bool PNS::SHOVE::HeadsModified | ( | int | aIndex = -1 | ) | const |
Definition at line 2495 of file pns_shove.cpp.
References m_headLines, and m_headsModified.
|
virtualinherited |
Definition at line 34 of file pns_algo_base.cpp.
References PNS::ALGO_BASE::m_logger.
Referenced by PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
private |
Definition at line 588 of file pns_shove.cpp.
References assembleLine(), BLUE, PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), GREEN, PNS::LINE::HasLockedSegments(), PNS::ITEM::LayersOverlap(), SHAPE_LINE_CHAIN::Length(), PNS_DBG, pushLineStack(), PNS::LINE::Rank(), RED, replaceLine(), sanityCheck(), PNS::LINE::SetRank(), SH_INCOMPLETE, SH_OK, SH_TRY_WALK, ShoveObstacleLine(), and WHITE.
Referenced by shoveIteration().
|
private |
Definition at line 638 of file pns_shove.cpp.
References BLUE, PNS::ALGO_BASE::Dbg(), GREEN, m_multiLineMode, PNS::LINE::Marker(), PNS::MK_HEAD, PNS_DBG, pushLineStack(), RED, replaceLine(), sanityCheck(), PNS::LINE::SetRank(), SH_INCOMPLETE, SH_OK, and ShoveObstacleLine().
Referenced by shoveIteration().
|
private |
Definition at line 529 of file pns_shove.cpp.
References assembleLine(), BLUE, PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), PNS::LINE::EndsWithVia(), GREEN, PNS::LINE::HasLockedSegments(), PNS::ITEM::Layer(), PNS::ITEM::LayersOverlap(), SHAPE_LINE_CHAIN::Length(), PNS::LINE::Line(), PNS_DBG, pushLineStack(), PNS::LINE::Rank(), RED, replaceLine(), sanityCheck(), PNS::LINE::SetRank(), SH_INCOMPLETE, SH_OK, SH_TRY_WALK, ShoveObstacleLine(), and SHAPE_LINE_CHAIN::Simplify2().
Referenced by shoveIteration().
|
private |
Definition at line 675 of file pns_shove.cpp.
References PNS::TOPOLOGY::AssembleCluster(), BLUE, PNS::LINK_HOLDER::ClearLinks(), PNS::ITEM::Collide(), PNS::ALGO_BASE::Dbg(), dummy, PNS::LINE::EndsWithVia(), PNS::NODE::FindJoint(), PNS::LINE::HasLoops(), PNS::ITEM::Layer(), PNS::ITEM::Layers(), PNS::LINE::Line(), PNS::WALKAROUND::RESULT::lines, PNS::JOINT::LinkList(), m_currentNode, PNS::TOPOLOGY::CLUSTER::m_items, m_lineStack, m_multiLineMode, PNS::LINE::Mark(), PNS::LINE::Marker(), PNS::MK_HEAD, onCollidingVia(), PNS_DBG, PNS_DBGN, popLineStack(), PNS::VIA::Pos(), pushLineStack(), PNS::ITEM::Rank(), PNS::LINE::Rank(), RED, replaceLine(), PNS::WALKAROUND::RestrictToCluster(), PNS::WALKAROUND::Route(), PNS::ALGO_BASE::Router(), sanityCheck(), PNS::WALKAROUND::SetAllowedPolicies(), PNS::ALGO_BASE::SetDebugDecorator(), PNS::WALKAROUND::SetIterationLimit(), PNS::LINE::SetRank(), PNS::WALKAROUND::SetSolidsOnly(), PNS::ALGO_BASE::Settings(), SH_INCOMPLETE, SH_OK, ShoveObstacleLine(), SHAPE_LINE_CHAIN::Simplify2(), PNS::WALKAROUND::ST_DONE, PNS_LAYER_RANGE::Start(), PNS::WALKAROUND::RESULT::status, PNS::LINE::Unmark(), via, PNS::LINE::Via(), PNS::ITEM::VIA_T, and PNS::WALKAROUND::WP_SHORTEST.
Referenced by shoveIteration().
|
private |
Definition at line 1072 of file pns_shove.cpp.
References PNS::VIA::Clone(), SHAPE::Collide(), PNS::ALGO_BASE::Dbg(), PNS::VIA::Diameter(), PNS::LINE::EndsWithVia(), getClearance(), PNS::ITEM::Layer(), LIGHTRED, PNS::ITEM::LINE_T, PNS::OBSTACLE::m_maxFanoutWidth, PNS::ITEM::OfKind(), PNS_DBG, PNS_DBGN, pushOrShoveVia(), PNS::ITEM::RelevantShapeLayers(), PNS::VIA::SetDiameter(), PNS::ITEM::Shape(), PNS::LINE::Shape(), PNS::VIA::Shape(), PNS::ITEM::SOLID_T, VECTOR2< T >::SquaredEuclideanNorm(), PNS::LINE::Via(), and PNS::LINE::Width().
Referenced by onCollidingSolid(), onReverseCollidingVia(), and shoveIteration().
|
private |
Definition at line 1165 of file pns_shove.cpp.
References PNS::LINE::AppendVia(), PNS::ITEM::ARC_T, assembleLine(), BLUE, SHAPE_LINE_CHAIN::Clear(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), SHAPE::Collide(), PNS::ALGO_BASE::Dbg(), PNS::VIA::Diameter(), PNS::LINE::EndsWithVia(), PNS::NODE::FindJoint(), getClearance(), GREEN, PNS::VIA::Hull(), PNS::ITEM::Layer(), LIGHTGREEN, LIGHTRED, LIGHTYELLOW, PNS::LINE::Line(), PNS::JOINT::LinkList(), m_currentNode, m_iter, onCollidingVia(), PNS_DBG, PNS_DBGN, SHAPE_LINE_CHAIN_BASE::PointInside(), PNS::VIA::Pos(), pushLineStack(), PNS::LINE::Rank(), PNS::ITEM::RelevantShapeLayers(), PNS::LINE::RemoveVia(), replaceLine(), PNS::ITEM::SEGMENT_T, PNS::LINE::SetRank(), PNS::LINE::SetShape(), SH_INCOMPLETE, SH_OK, PNS::VIA::Shape(), ShoveObstacleLine(), unwindLineStack(), PNS::LINE::Via(), PNS::LINE::Width(), and YELLOW.
Referenced by shoveIteration().
|
private |
Definition at line 1355 of file pns_shove.cpp.
References PNS::LINK_HOLDER::Links(), m_lineStack, and m_optimizerQueue.
Referenced by onCollidingSolid(), and shoveIteration().
Definition at line 2222 of file pns_shove.cpp.
References PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), PNS_DBG, SHAPE_LINE_CHAIN::PointCount(), replaceLine(), PNS::LINE::SetShape(), and SHAPE_LINE_CHAIN::Simplify2().
Referenced by assembleLine().
|
private |
Definition at line 801 of file pns_shove.cpp.
References PNS::ALGO_BASE::Dbg(), PNS::NODE::GetUpdatedItems(), PNS::ITEM::LINKED_ITEM_MASK_T, m_rootLineHistory, and PNS_DBG.
Referenced by reduceSpringback(), and Run().
|
private |
Definition at line 1331 of file pns_shove.cpp.
References BLUE, PNS::ALGO_BASE::Dbg(), PNS::LINK_HOLDER::IsLinked(), m_lineStack, m_optimizerQueue, PNS_DBG, and PNS::LINE::SegmentCount().
Referenced by onCollidingArc(), onCollidingLine(), onCollidingSegment(), onCollidingSolid(), onReverseCollidingVia(), pushOrShoveVia(), Run(), shoveIteration(), and shoveMainLoop().
|
private |
Definition at line 943 of file pns_shove.cpp.
References PNS::ITEM::ARC_T, assembleLine(), PNS::Clone(), PNS::ALGO_BASE::Dbg(), PNS::NODE::FindJoint(), PNS::ITEM::IsLocked(), PNS::JOINT::IsLocked(), LIGHTGREEN, LIGHTRED, PNS::JOINT::LinkList(), PNS::LINE::LinkVia(), m_currentNode, PNS::ITEM::Marker(), PNS::SHOVE::ROOT_LINE_ENTRY::newLine, PNS_DBG, PNS::VIA::Pos(), pushLineStack(), PNS::NODE::Remove(), replaceItems(), replaceLine(), VECTOR2< T >::Resize(), PNS::ITEM::SEGMENT_T, PNS::ALGO_BASE::Settings(), SH_INCOMPLETE, SH_OK, SH_TRY_WALK, unwindLineStack(), v2, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by onCollidingVia(), and Run().
Definition at line 885 of file pns_shove.cpp.
References PNS::ALGO_BASE::Dbg(), PNS::NODE::Depth(), PNS_LAYER_RANGE::End(), PNS::VIA_HANDLE::layers, PNS::SHOVE::SPRINGBACK_TAG::m_affectedArea, PNS::SHOVE::SPRINGBACK_TAG::m_draggedVias, m_headLines, PNS::SHOVE::SPRINGBACK_TAG::m_locked, PNS::SHOVE::SPRINGBACK_TAG::m_node, m_nodeStack, PNS::SHOVE::SPRINGBACK_TAG::m_seq, PNS_DBG, PNS::VIA_HANDLE::pos, PNS_LAYER_RANGE::Start(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Run().
|
private |
Definition at line 2150 of file pns_shove.cpp.
References CYAN, PNS::ALGO_BASE::Dbg(), findRootLine(), PNS::NODE::FindViaByHandle(), PNS::ROUTER::GetInterface(), m_currentNode, m_headLines, m_headsModified, PNS_DBG, and PNS::ALGO_BASE::Router().
Referenced by Run().
Definition at line 824 of file pns_shove.cpp.
References PNS::NODE::CheckColliding(), PNS::ALGO_BASE::Dbg(), PNS::NODE::Depth(), PNS::SHOVE::SPRINGBACK_TAG::m_draggedVias, m_headLines, PNS::SHOVE::SPRINGBACK_TAG::m_locked, PNS::SHOVE::SPRINGBACK_TAG::m_node, m_nodeStack, m_root, m_springbackDoNotTouchNode, PNS_DBG, and pruneRootLines().
Referenced by Run().
|
private |
Definition at line 2114 of file pns_shove.cpp.
References PNS::ALGO_BASE::Dbg(), PNS::NODE::Depth(), PNS::ROUTER::GetInterface(), m_currentNode, m_headLines, PNS_DBG, PNS::NODE::Remove(), and PNS::ALGO_BASE::Router().
Referenced by Run().
Definition at line 49 of file pns_shove.cpp.
References PNS::ChangedArea(), PNS::ALGO_BASE::Dbg(), m_affectedArea, m_currentNode, m_rootLineHistory, PNS::SHOVE::ROOT_LINE_ENTRY::newVia, PNS::ITEM::OfKind(), PNS_DBG, PNS::NODE::Replace(), touchRootLine(), and PNS::ITEM::VIA_T.
Referenced by pushOrShoveVia().
|
private |
Definition at line 80 of file pns_shove.cpp.
References BLUE, PNS::ChangedArea(), PNS::LINE::Clone(), PNS::ALGO_BASE::Dbg(), PNS::LINE::EndsWithVia(), PNS::LINK_HOLDER::LinkCount(), PNS::LINK_HOLDER::Links(), m_affectedArea, m_currentNode, m_rootLineHistory, PNS::SHOVE::ROOT_LINE_ENTRY::newLine, PNS_DBG, PNS::NODE::Replace(), PNS::LINE::SegmentCount(), PNS::LINK_HOLDER::Unlink(), and PNS::ITEM::VIA_T.
Referenced by onCollidingArc(), onCollidingLine(), onCollidingSegment(), onCollidingSolid(), onReverseCollidingVia(), preShoveCleanup(), pushOrShoveVia(), and runOptimizer().
bool PNS::SHOVE::RewindSpringbackTo | ( | NODE * | aNode | ) |
Definition at line 1986 of file pns_shove.cpp.
References PNS::NODE::KillChildren(), m_currentNode, m_nodeStack, and m_root.
bool PNS::SHOVE::RewindToLastLockedNode | ( | ) |
Definition at line 2020 of file pns_shove.cpp.
References m_currentNode, and m_nodeStack.
|
inlineinherited |
Return current router settings.
Definition at line 54 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_router.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::MEANDER_PLACER_BASE::Clearance(), PNS::DIFF_PAIR_PLACER::CommitPlacement(), PNS::DP_MEANDER_PLACER::CommitPlacement(), PNS::LINE_PLACER::CommitPlacement(), PNS::MEANDER_PLACER::CommitPlacement(), PNS::COMPONENT_DRAGGER::FixRoute(), PNS::DRAGGER::FixRoute(), PNS::MULTI_DRAGGER::FixRoute(), PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), PNS::LINE_PLACER::makeVia(), PNS::MULTI_DRAGGER::multidragShove(), onCollidingSolid(), reconstructHeads(), removeHeads(), PNS::LINE_PLACER::rhWalkBase(), Run(), runOptimizer(), shoveIteration(), PNS::DIFF_PAIR_PLACER::Start(), PNS::DP_MEANDER_PLACER::Start(), PNS::LINE_PLACER::Start(), PNS::MEANDER_PLACER::Start(), PNS::MEANDER_SKEW_PLACER::Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
SHOVE::SHOVE_STATUS PNS::SHOVE::Run | ( | ) |
Definition at line 2251 of file pns_shove.cpp.
References PNS::ITEM_SET::Add(), PNS::NODE::Add(), PNS::NODE::Branch(), PNS::NODE::ClearRanks(), PNS::Clone(), PNS::LINE::CPoint(), PNS::ALGO_BASE::Dbg(), PNS::NODE::Depth(), PNS::LINE::EndsWithVia(), findRootLine(), PNS::NODE::FindViaByHandle(), formatPolicy(), PNS::ROUTER::GetInterface(), PNS::LINK_HOLDER::LinkCount(), PNS::LINE::LinkVia(), PNS::NODE::LockJoint(), m_affectedArea, m_currentNode, m_headLines, m_headsModified, m_iter, m_lineStack, m_multiLineMode, m_optimizerQueue, m_rootLineHistory, PNS::ITEM::Net(), PNS_DBG, PNS::VIA::Pos(), pruneRootLines(), pushLineStack(), pushOrShoveVia(), pushSpringback(), reconstructHeads(), reduceSpringback(), removeHeads(), PNS::ALGO_BASE::Router(), runOptimizer(), PNS::LINE::SegmentCount(), PNS::LINE::SetRank(), SetShovePolicy(), SH_HEAD_MODIFIED, SH_INCOMPLETE, SH_OK, shoveMainLoop(), touchRootLine(), and PNS::LINE::Via().
|
private |
Definition at line 1843 of file pns_shove.cpp.
References PNS::ITEM::ANY_T, BLUE, PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), findRootLine(), PNS::ROUTING_SETTINGS::GetCornerMode(), PNS::ROUTER::GetInterface(), GREEN, PNS::OPTIMIZER::LIMIT_CORNER_COUNT, PNS::LINK_HOLDER::LinkCount(), m_optFlagDisableMask, m_optimizerQueue, PNS::OPTIMIZER::MERGE_OBTUSE, PNS::OPTIMIZER::MERGE_SEGMENTS, DIRECTION_45::MITERED_45, PNS::OE_FULL, PNS::OE_LOW, PNS::OE_MEDIUM, PNS::OPTIMIZER::Optimize(), PNS::ROUTING_SETTINGS::OptimizerEffort(), PNS_DBG, RED, replaceLine(), PNS::OPTIMIZER::RESTRICT_AREA, DIRECTION_45::ROUNDED_45, PNS::ALGO_BASE::Router(), PNS::OPTIMIZER::SetCollisionMask(), PNS::OPTIMIZER::SetEffortLevel(), PNS::OPTIMIZER::SetRestrictArea(), PNS::ALGO_BASE::Settings(), SHP_DONT_OPTIMIZE, PNS::OPTIMIZER::SMART_PADS, totalAffectedArea(), and PNS::ALGO_BASE::VisibleViewArea().
Referenced by Run().
Definition at line 178 of file pns_shove.cpp.
References PNS::LINE::CPoint().
Referenced by onCollidingArc(), onCollidingLine(), onCollidingSegment(), and onCollidingSolid().
|
inlineinherited |
Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.
Definition at line 73 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_debugDecorator.
Referenced by onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), SHOVE(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
void PNS::SHOVE::SetDefaultShovePolicy | ( | int | aPolicy | ) |
Definition at line 2063 of file pns_shove.cpp.
References m_defaultPolicy.
|
inlineinherited |
Definition at line 65 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_logger.
Referenced by PNS::LINE_PLACER::rhWalkBase(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
void PNS::SHOVE::SetShovePolicy | ( | const LINE & | aLine, |
int | aPolicy | ||
) |
Definition at line 2075 of file pns_shove.cpp.
References touchRootLine().
void PNS::SHOVE::SetShovePolicy | ( | const LINKED_ITEM * | aItem, |
int | aPolicy | ||
) |
void PNS::SHOVE::SetSpringbackDoNotTouchNode | ( | const NODE * | aNode | ) |
Definition at line 2057 of file pns_shove.cpp.
References m_springbackDoNotTouchNode.
|
inherited |
Return the logger object, allowing to dump geometry to a file.
Definition at line 28 of file pns_algo_base.cpp.
References PNS::ALGO_BASE::m_router, and PNS::ROUTER::Settings().
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::LINE_PLACER::buildInitialLine(), PNS::LINE_PLACER::CommitPlacement(), PNS::MULTI_DRAGGER::Drag(), PNS::DRAGGER::dragMarkObstacles(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), PNS::COMPONENT_DRAGGER::FixRoute(), PNS::MULTI_DRAGGER::FixRoute(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::LINE_PLACER::FixRoute(), PNS::LINE_PLACER::Move(), onCollidingSolid(), PNS::DRAGGER::optimizeAndUpdateDraggedLine(), PNS::DIFF_PAIR_PLACER::propagateDpHeadForces(), PNS::DRAGGER::propagateViaForces(), pushOrShoveVia(), PNS::LINE_PLACER::rhMarkObstacles(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::rhWalkOnly(), PNS::DIFF_PAIR_PLACER::route(), PNS::LINE_PLACER::routeHead(), PNS::LINE_PLACER::routeStep(), runOptimizer(), shoveMainLoop(), PNS::WALKAROUND::singleStep(), PNS::LINE_PLACER::Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::tryWalkaround(), PNS::MULTI_DRAGGER::tryWalkaround(), PNS::LINE_PLACER::UnfixRoute(), and PNS::WALKAROUND::WALKAROUND().
SHOVE_STATUS PNS::SHOVE::ShoveDraggingVia | ( | const VIA_HANDLE | aOldVia, |
const VECTOR2I & | aWhere, | ||
VIA_HANDLE & | aNewVia | ||
) |
|
private |
Definition at line 1466 of file pns_shove.cpp.
References PNS::ITEM::ARC_T, assembleLine(), PNS::ITEM::Collide(), PNS::ALGO_BASE::Dbg(), PNS::NODE::Depth(), PNS::LINE::EndsWithVia(), findRootLine(), PNS::NODE::FindViaByHandle(), fixupViaCollisions(), PNS::ITEM::Format(), PNS::ROUTER::GetInterface(), EDA_ITEM::GetItemDescription(), PNS::ITEM::HOLE_T, PNS::ITEM::Kind(), PNS::ITEM::Layer(), PNS::ITEM::Layers(), PNS::VIA_HANDLE::layers, m_currentNode, m_defaultPolicy, PNS::COLLISION_SEARCH_OPTIONS::m_filter, PNS::COLLISION_SEARCH_OPTIONS::m_kindMask, m_lineStack, PNS::NODE::NearestObstacle(), PNS::ITEM::Net(), PNS::VIA_HANDLE::net, PNS::ITEM::OfKind(), onCollidingArc(), onCollidingLine(), onCollidingSegment(), onCollidingSolid(), onCollidingVia(), onReverseCollidingVia(), PNS::ITEM::OwningNode(), PNS::ITEM::Parent(), pcbIUScale, PNS_DBG, PNS_DBGN, popLineStack(), PNS::VIA_HANDLE::pos, PNS::VIA::Pos(), pushLineStack(), PNS::ITEM::Rank(), PNS::LINE::Rank(), RED, PNS::ALGO_BASE::Router(), PNS::ITEM::SEGMENT_T, PNS::LINE::SegmentCount(), PNS::DEBUG_DECORATOR::SetIteration(), SH_INCOMPLETE, SH_NULL, SH_OK, SH_TRY_WALK, SHP_IGNORE, PNS::ITEM::SOLID_T, unwindLineStack(), up, PNS::VIA_HANDLE::valid, PNS::LINE::Via(), PNS::ITEM::VIA_T, PNS::LINE::Width(), and YELLOW.
Referenced by shoveMainLoop().
|
private |
Definition at line 252 of file pns_shove.cpp.
References PNS::ITEM::Collide(), PNS::LINE::CPoint(), SHAPE_LINE_CHAIN::CPoint(), getClearance(), PNS::VIA::Hull(), PNS::ITEM::Layer(), SHAPE_LINE_CHAIN::Length(), m_currentNode, SHAPE_LINE_CHAIN::PointCount(), PNS::LINE::SetShape(), via, PNS::LINE::Via(), PNS::LINE::Walkaround(), and PNS::LINE::Width().
Referenced by ShoveObstacleLine().
|
private |
Definition at line 299 of file pns_shove.cpp.
References checkShoveDirection(), PNS::LINE::CLine(), PNS::ITEM::Collide(), PNS::LINE::CPoint(), SHAPE_LINE_CHAIN::CPoint(), PNS::ALGO_BASE::Dbg(), PNS::NODE::FindJoint(), SHAPE_LINE_CHAIN::Format(), PNS::ITEM::Layer(), LIGHTGRAY, PNS::JOINT::LinkList(), m_currentNode, PNS::LINE::Marker(), PNS::MK_HEAD, path, PNS_DBG, PNS_DBGN, SHAPE_LINE_CHAIN::PointCount(), PNS::LINE::SetShape(), PNS::LINE::Walkaround(), WHITE, PNS::LINE::Width(), and YELLOW.
Referenced by ShoveObstacleLine().
|
private |
Definition at line 1710 of file pns_shove.cpp.
References PNS::ALGO_BASE::Dbg(), PNS::TIME_LIMIT::Expired(), PNS::NODE::JointCount(), m_affectedArea, m_currentNode, m_draggedVia, m_iter, m_lineStack, m_root, PNS_DBG, pushLineStack(), PNS::TIME_LIMIT::Restart(), PNS::ALGO_BASE::Settings(), SH_INCOMPLETE, SH_OK, shoveIteration(), PNS::ROUTING_SETTINGS::ShoveIterationLimit(), and PNS::ROUTING_SETTINGS::ShoveTimeLimit().
Referenced by Run().
bool PNS::SHOVE::ShoveObstacleLine | ( | const LINE & | aCurLine, |
const LINE & | aObstacleLine, | ||
LINE & | aResultLine | ||
) |
Definition at line 428 of file pns_shove.cpp.
References PNS::LINE::AppendVia(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::LINE::CSegment(), PNS::ALGO_BASE::Dbg(), SHAPE_ARC::DefaultAccuracyForPCB(), PNS::LINE::EndsWithVia(), getClearance(), PNS::SEGMENT::Hull(), PNS::VIA::Hull(), SHAPE_LINE_CHAIN::IsArcSegment(), KiROUND(), PNS::ITEM::Layer(), PNS::ITEM::LayersOverlap(), PNS_DBG, PNS::LINE::RemoveVia(), PNS::LINE::SegmentCount(), shoveLineFromLoneVia(), shoveLineToHullSet(), via, PNS::LINE::Via(), and PNS::LINE::Width().
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), onCollidingArc(), onCollidingLine(), onCollidingSegment(), onCollidingSolid(), and onReverseCollidingVia().
|
private |
Definition at line 1756 of file pns_shove.cpp.
References m_affectedArea, and m_nodeStack.
Referenced by runOptimizer().
|
private |
Definition at line 1796 of file pns_shove.cpp.
References PNS::LINE::Clone(), PNS::ALGO_BASE::Dbg(), PNS::LINK_HOLDER::Links(), m_rootLineHistory, and PNS_DBG.
Referenced by replaceItems(), Run(), and SetShovePolicy().
|
private |
Definition at line 1824 of file pns_shove.cpp.
References PNS::ALGO_BASE::Dbg(), m_rootLineHistory, PNS_DBG, and PNS::LINKED_ITEM::Uid().
void PNS::SHOVE::UnlockSpringbackNode | ( | NODE * | aNode | ) |
Definition at line 2034 of file pns_shove.cpp.
References m_nodeStack.
|
private |
Definition at line 1315 of file pns_shove.cpp.
References PNS::ITEM::ARC_T, PNS::ITEM::LINE_T, PNS::LINK_HOLDER::Links(), PNS::ITEM::OfKind(), PNS::ITEM::SEGMENT_T, and unwindLineStack().
|
private |
Definition at line 1286 of file pns_shove.cpp.
References PNS::ALGO_BASE::Dbg(), m_lineStack, m_optimizerQueue, and PNS_DBG.
Referenced by onReverseCollidingVia(), pushOrShoveVia(), shoveIteration(), and unwindLineStack().
|
inherited |
Definition at line 40 of file pns_algo_base.cpp.
References PNS::ALGO_BASE::m_router, and PNS::ROUTER::VisibleViewArea().
Referenced by runOptimizer().
|
private |
Definition at line 246 of file pns_shove.h.
Referenced by replaceItems(), replaceLine(), Run(), shoveMainLoop(), and totalAffectedArea().
|
private |
Definition at line 234 of file pns_shove.h.
Referenced by assembleLine(), CurrentNode(), fixupViaCollisions(), getClearance(), onCollidingSolid(), onReverseCollidingVia(), pushOrShoveVia(), reconstructHeads(), removeHeads(), replaceItems(), replaceLine(), RewindSpringbackTo(), RewindToLastLockedNode(), Run(), SHOVE(), shoveIteration(), shoveLineFromLoneVia(), shoveLineToHullSet(), and shoveMainLoop().
|
protectedinherited |
Definition at line 86 of file pns_algo_base.h.
Referenced by PNS::ALGO_BASE::Dbg(), and PNS::ALGO_BASE::SetDebugDecorator().
|
private |
Definition at line 245 of file pns_shove.h.
Referenced by formatPolicy(), SetDefaultShovePolicy(), SHOVE(), and shoveIteration().
|
private |
Definition at line 237 of file pns_shove.h.
Referenced by SHOVE(), and shoveMainLoop().
|
private |
Definition at line 240 of file pns_shove.h.
Referenced by ForceClearance(), getClearance(), and SHOVE().
|
private |
Definition at line 229 of file pns_shove.h.
Referenced by AddHeads(), ClearHeads(), GetModifiedHead(), GetModifiedHeadVia(), HeadsModified(), pushSpringback(), reconstructHeads(), reduceSpringback(), removeHeads(), and Run().
|
private |
Definition at line 239 of file pns_shove.h.
Referenced by HeadsModified(), reconstructHeads(), and Run().
|
private |
Definition at line 238 of file pns_shove.h.
Referenced by onReverseCollidingVia(), Run(), SHOVE(), and shoveMainLoop().
|
private |
Definition at line 227 of file pns_shove.h.
Referenced by onCollidingSolid(), popLineStack(), pushLineStack(), Run(), shoveIteration(), shoveMainLoop(), and unwindLineStack().
|
protectedinherited |
Definition at line 88 of file pns_algo_base.h.
Referenced by PNS::ALGO_BASE::Logger(), and PNS::ALGO_BASE::SetLogger().
|
private |
Definition at line 241 of file pns_shove.h.
Referenced by onCollidingLine(), onCollidingSolid(), Run(), and SHOVE().
|
private |
Definition at line 226 of file pns_shove.h.
Referenced by AddLockedSpringbackNode(), pushSpringback(), reduceSpringback(), RewindSpringbackTo(), RewindToLastLockedNode(), totalAffectedArea(), and UnlockSpringbackNode().
|
private |
Definition at line 243 of file pns_shove.h.
Referenced by DisablePostShoveOptimizations(), runOptimizer(), and SHOVE().
|
private |
Definition at line 228 of file pns_shove.h.
Referenced by popLineStack(), pushLineStack(), Run(), runOptimizer(), and unwindLineStack().
|
private |
Definition at line 236 of file pns_shove.h.
Referenced by SHOVE().
|
private |
Definition at line 233 of file pns_shove.h.
Referenced by CurrentNode(), reduceSpringback(), RewindSpringbackTo(), SHOVE(), and shoveMainLoop().
|
private |
Definition at line 231 of file pns_shove.h.
Referenced by findRootLine(), pruneRootLines(), replaceItems(), replaceLine(), Run(), and touchRootLine().
|
protectedinherited |
Definition at line 87 of file pns_algo_base.h.
Referenced by PNS::MEANDER_PLACER::doMove(), PNS::LINE_PLACER::FixRoute(), PNS::MEANDER_PLACER_BASE::lineLength(), PNS::DP_MEANDER_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), PNS::ALGO_BASE::Router(), PNS::ALGO_BASE::Settings(), PNS::DIFF_PAIR_PLACER::updateLeadingRatLine(), PNS::LINE_PLACER::updateLeadingRatLine(), and PNS::ALGO_BASE::VisibleViewArea().
|
private |
Definition at line 235 of file pns_shove.h.
Referenced by reduceSpringback(), SetSpringbackDoNotTouchNode(), and SHOVE().