KiCad PCB EDA Suite
|
#include <pns_walkaround.h>
Classes | |
struct | RESULT |
Public Types | |
enum | STATUS { ST_IN_PROGRESS = 0 , ST_ALMOST_DONE , ST_DONE , ST_STUCK , ST_NONE } |
enum | WALK_POLICY { WP_CW = 0 , WP_CCW = 1 , WP_SHORTEST = 2 } |
Public Member Functions | |
WALKAROUND (NODE *aWorld, ROUTER *aRouter) | |
~WALKAROUND () | |
void | SetWorld (NODE *aNode) |
void | SetIterationLimit (const int aIterLimit) |
void | SetSolidsOnly (bool aSolidsOnly) |
void | SetItemMask (int aMask) |
void | SetForceWinding (bool aEnabled, bool aCw) |
void | SetPickShortestPath (bool aEnabled) |
void | RestrictToCluster (bool aEnabled, const TOPOLOGY::CLUSTER &aCluster) |
STATUS | Route (const LINE &aInitialPath, LINE &aWalkPath, bool aOptimize=true) |
const RESULT | Route (const LINE &aInitialPath) |
void | SetLengthLimit (bool aEnable, double aLengthExpansionFactor) |
void | SetAllowedPolicies (std::vector< WALK_POLICY > aPolicies) |
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 Member Functions | |
void | start (const LINE &aInitialPath) |
bool | singleStep () |
NODE::OPT_OBSTACLE | nearestObstacle (const LINE &aPath) |
Private Attributes | |
NODE * | m_world |
int | m_iteration |
int | m_iterationLimit |
int | m_itemMask |
bool | m_forceWinding |
bool | m_forceCw |
VECTOR2I | m_cursorPos |
VECTOR2I | m_lastP |
std::set< const ITEM * > | m_restrictedSet |
std::vector< VECTOR2I > | m_restrictedVertices |
bool | m_forceLongerPath |
bool | m_lengthLimitOn |
bool | m_useShortestPath |
double | m_lengthExpansionFactor |
bool | m_enabledPolicies [MaxWalkPolicies] |
NODE::OPT_OBSTACLE | m_currentObstacle [MaxWalkPolicies] |
TOPOLOGY::CLUSTER | m_currentCluster [MaxWalkPolicies] |
std::optional< TOPOLOGY::CLUSTER > | m_lastShortestCluster |
RESULT | m_currentResult |
double | m_initialLength |
Static Private Attributes | |
static constexpr int | MaxWalkPolicies = 3 |
Definition at line 36 of file pns_walkaround.h.
Enumerator | |
---|---|
ST_IN_PROGRESS | |
ST_ALMOST_DONE | |
ST_DONE | |
ST_STUCK | |
ST_NONE |
Definition at line 60 of file pns_walkaround.h.
Enumerator | |
---|---|
WP_CW | |
WP_CCW | |
WP_SHORTEST |
Definition at line 69 of file pns_walkaround.h.
Definition at line 41 of file pns_walkaround.h.
References PNS::ITEM::ANY_T, m_forceCw, m_forceLongerPath, m_forceWinding, m_itemMask, m_iteration, m_iterationLimit, m_lengthExpansionFactor, m_lengthLimitOn, m_useShortestPath, PNS::ALGO_BASE::Settings(), and PNS::ROUTING_SETTINGS::WalkaroundIterationLimit().
|
inline |
Definition at line 58 of file pns_walkaround.h.
|
inlineinherited |
Definition at line 78 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_debugDecorator.
Referenced by PNS::SHOVE::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(), PNS::SHOVE::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(), PNS::SHOVE::onCollidingArc(), PNS::SHOVE::onCollidingLine(), PNS::SHOVE::onCollidingSegment(), PNS::SHOVE::onCollidingSolid(), PNS::SHOVE::onCollidingVia(), PNS::SHOVE::onReverseCollidingVia(), PNS::DRAGGER::optimizeAndUpdateDraggedLine(), PNS::LINE_PLACER::optimizeTailHeadTransition(), PNS::SHOVE::preShoveCleanup(), PNS::SHOVE::pruneRootLines(), PNS::SHOVE::pushLineStack(), PNS::SHOVE::pushOrShoveVia(), PNS::SHOVE::pushSpringback(), PNS::SHOVE::reconstructHeads(), PNS::SHOVE::reduceSpringback(), PNS::LINE_PLACER::reduceTail(), PNS::SHOVE::removeHeads(), PNS::LINE_PLACER::removeLoops(), PNS::SHOVE::replaceItems(), PNS::SHOVE::replaceLine(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::rhWalkOnly(), Route(), PNS::LINE_PLACER::routeStep(), PNS::SHOVE::Run(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveIteration(), PNS::SHOVE::shoveLineToHullSet(), PNS::SHOVE::shoveMainLoop(), PNS::SHOVE::ShoveObstacleLine(), singleStep(), PNS::LINE_PLACER::splitHeadTail(), PNS::LINE_PLACER::Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::SHOVE::touchRootLine(), PNS::LINE_PLACER::Trace(), PNS::DRAGGER::tryWalkaround(), PNS::MULTI_DRAGGER::tryWalkaround(), and PNS::SHOVE::unwindLineStack().
|
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 47 of file pns_walkaround.cpp.
References PNS::COLLISION_SEARCH_OPTIONS::m_filter, m_itemMask, PNS::COLLISION_SEARCH_OPTIONS::m_kindMask, m_restrictedSet, PNS::COLLISION_SEARCH_OPTIONS::m_useClearanceEpsilon, m_world, and PNS::NODE::NearestObstacle().
Referenced by singleStep().
void PNS::WALKAROUND::RestrictToCluster | ( | bool | aEnabled, |
const TOPOLOGY::CLUSTER & | aCluster | ||
) |
Definition at line 68 of file pns_walkaround.cpp.
References PNS::ITEM::HasHole(), PNS::ITEM::Hole(), PNS::TOPOLOGY::CLUSTER::m_items, m_restrictedSet, and m_restrictedVertices.
Referenced by PNS::SHOVE::onCollidingSolid().
const WALKAROUND::RESULT PNS::WALKAROUND::Route | ( | const LINE & | aInitialPath | ) |
Definition at line 279 of file pns_walkaround.cpp.
References PNS::NODE::CheckColliding(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::LINE::CPoint(), PNS::ALGO_BASE::Dbg(), PNS::LINE::EndsWithVia(), SHAPE_LINE_CHAIN::Length(), PNS::WALKAROUND::RESULT::lines, m_currentResult, m_enabledPolicies, m_initialLength, m_itemMask, m_iteration, m_iterationLimit, m_lengthExpansionFactor, m_lengthLimitOn, m_world, MaxWalkPolicies, PNS_DBG, PNS::LINE::PointCount(), singleStep(), ST_ALMOST_DONE, ST_DONE, ST_IN_PROGRESS, ST_STUCK, start(), PNS::WALKAROUND::RESULT::status, PNS::LINE::Via(), and WHITE.
|
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(), PNS::SHOVE::onCollidingSolid(), PNS::SHOVE::reconstructHeads(), PNS::SHOVE::removeHeads(), PNS::LINE_PLACER::rhWalkBase(), PNS::SHOVE::Run(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::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().
void PNS::WALKAROUND::SetAllowedPolicies | ( | std::vector< WALK_POLICY > | aPolicies | ) |
Definition at line 370 of file pns_walkaround.cpp.
References m_enabledPolicies, and MaxWalkPolicies.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
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 PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), PNS::SHOVE::SHOVE(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
inline |
Definition at line 111 of file pns_walkaround.h.
References m_forceCw, and m_forceWinding.
|
inline |
Definition at line 106 of file pns_walkaround.h.
References m_itemMask.
Referenced by PNS::LINE_PLACER::rhWalkBase().
|
inline |
Definition at line 93 of file pns_walkaround.h.
References m_iterationLimit.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
inline |
Definition at line 129 of file pns_walkaround.h.
References m_lengthExpansionFactor, and m_lengthLimitOn.
Referenced by PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
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().
|
inline |
Definition at line 117 of file pns_walkaround.h.
References m_useShortestPath.
|
inline |
Definition at line 98 of file pns_walkaround.h.
References PNS::ITEM::ANY_T, m_itemMask, and PNS::ITEM::SOLID_T.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
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(), PNS::SHOVE::onCollidingSolid(), PNS::DRAGGER::optimizeAndUpdateDraggedLine(), PNS::DIFF_PAIR_PLACER::propagateDpHeadForces(), PNS::DRAGGER::propagateViaForces(), PNS::SHOVE::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(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveMainLoop(), singleStep(), PNS::LINE_PLACER::Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::tryWalkaround(), PNS::MULTI_DRAGGER::tryWalkaround(), PNS::LINE_PLACER::UnfixRoute(), and WALKAROUND().
|
inline |
Definition at line 88 of file pns_walkaround.h.
References m_world.
|
private |
Definition at line 102 of file pns_walkaround.cpp.
References SHAPE_LINE_CHAIN::Append(), PNS::TOPOLOGY::AssembleCluster(), SHAPE_LINE_CHAIN::BBox(), BLUE, PNS::NODE::CheckColliding(), SHAPE_LINE_CHAIN::Clear(), PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), PNS::NODE::Depth(), BOX2< Vec >::GetBottom(), PNS::NODE::GetClearance(), PNS::ROUTING_SETTINGS::GetCornerMode(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), SHAPE_LINE_CHAIN::Length(), PNS::LINE::Line(), PNS::WALKAROUND::RESULT::lines, m_currentResult, m_enabledPolicies, m_initialLength, PNS::TOPOLOGY::CLUSTER::m_items, m_lastShortestCluster, m_world, MaxWalkPolicies, DIRECTION_45::MITERED_90, nearestObstacle(), PNS_DBG, PNS_DBGN, RED, DIRECTION_45::ROUNDED_90, PNS::ALGO_BASE::Settings(), ST_DONE, ST_IN_PROGRESS, ST_STUCK, PNS::WALKAROUND::RESULT::status, WHITE, WP_CCW, WP_CW, WP_SHORTEST, and YELLOW.
Referenced by Route().
|
private |
Definition at line 35 of file pns_walkaround.cpp.
References PNS::LINK_HOLDER::ClearLinks(), PNS::WALKAROUND::RESULT::lines, m_currentResult, m_iteration, MaxWalkPolicies, ST_IN_PROGRESS, and PNS::WALKAROUND::RESULT::status.
Referenced by Route().
|
inherited |
Definition at line 40 of file pns_algo_base.cpp.
References PNS::ALGO_BASE::m_router, and PNS::ROUTER::VisibleViewArea().
Referenced by PNS::SHOVE::runOptimizer().
|
private |
Definition at line 159 of file pns_walkaround.h.
|
private |
Definition at line 158 of file pns_walkaround.h.
|
private |
Definition at line 161 of file pns_walkaround.h.
Referenced by Route(), singleStep(), and start().
|
private |
Definition at line 149 of file pns_walkaround.h.
|
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 157 of file pns_walkaround.h.
Referenced by Route(), SetAllowedPolicies(), and singleStep().
|
private |
Definition at line 148 of file pns_walkaround.h.
Referenced by SetForceWinding(), and WALKAROUND().
|
private |
Definition at line 153 of file pns_walkaround.h.
Referenced by WALKAROUND().
|
private |
Definition at line 147 of file pns_walkaround.h.
Referenced by SetForceWinding(), and WALKAROUND().
|
private |
Definition at line 162 of file pns_walkaround.h.
Referenced by Route(), and singleStep().
|
private |
Definition at line 146 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), SetItemMask(), SetSolidsOnly(), and WALKAROUND().
|
private |
Definition at line 144 of file pns_walkaround.h.
Referenced by Route(), start(), and WALKAROUND().
|
private |
Definition at line 145 of file pns_walkaround.h.
Referenced by Route(), SetIterationLimit(), and WALKAROUND().
|
private |
Definition at line 150 of file pns_walkaround.h.
|
private |
Definition at line 160 of file pns_walkaround.h.
Referenced by singleStep().
|
private |
Definition at line 156 of file pns_walkaround.h.
Referenced by Route(), SetLengthLimit(), and WALKAROUND().
|
private |
Definition at line 154 of file pns_walkaround.h.
Referenced by Route(), SetLengthLimit(), and WALKAROUND().
|
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 151 of file pns_walkaround.h.
Referenced by nearestObstacle(), and RestrictToCluster().
|
private |
Definition at line 152 of file pns_walkaround.h.
Referenced by RestrictToCluster().
|
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 155 of file pns_walkaround.h.
Referenced by SetPickShortestPath(), and WALKAROUND().
|
private |
Definition at line 142 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), SetWorld(), and singleStep().
|
staticconstexprprivate |
Definition at line 38 of file pns_walkaround.h.
Referenced by PNS::WALKAROUND::RESULT::RESULT(), Route(), SetAllowedPolicies(), singleStep(), and start().