| 
    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 61 of file pns_walkaround.h.
| Enumerator | |
|---|---|
| WP_CW | |
| WP_CCW | |
| WP_SHORTEST | |
Definition at line 70 of file pns_walkaround.h.
Definition at line 41 of file pns_walkaround.h.
References PNS::ALGO_BASE::ALGO_BASE(), PNS::ITEM::ANY_T, m_forceCw, m_forceLongerPath, m_forceWinding, m_initialLength, m_itemMask, m_iteration, m_iterationLimit, m_lengthExpansionFactor, m_lengthLimitOn, m_useShortestPath, m_world, PNS::ALGO_BASE::Settings(), and PNS::ROUTING_SETTINGS::WalkaroundIterationLimit().
      
  | 
  inline | 
Definition at line 59 of file pns_walkaround.h.
      
  | 
  inlineinherited | 
Definition at line 78 of file pns_algo_base.h.
References 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::pruneLineFromOptimizerQueue(), PNS::SHOVE::pruneRootLines(), PNS::SHOVE::pushLineStack(), PNS::SHOVE::pushOrShoveVia(), PNS::SHOVE::pushSpringback(), PNS::SHOVE::reconstructHeads(), PNS::SHOVE::reduceSpringback(), PNS::LINE_PLACER::reduceTail(), PNS::LINE_PLACER::removeLoops(), PNS::SHOVE::replaceItems(), PNS::SHOVE::replaceLine(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::rhWalkOnly(), PNS::WALKAROUND::Route(), PNS::LINE_PLACER::routeStep(), PNS::SHOVE::Run(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveIteration(), PNS::SHOVE::shoveLineToHullSet(), PNS::SHOVE::shoveMainLoop(), PNS::SHOVE::ShoveObstacleLine(), PNS::LINE_PLACER::simplifyNewLine(), PNS::WALKAROUND::singleStep(), PNS::LINE_PLACER::splitHeadTail(), PNS::DRAGGER::Start(), PNS::LINE_PLACER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::SHOVE::touchRootLine(), PNS::SHOVE::touchRootLine(), PNS::LINE_PLACER::Trace(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
      
  | 
  virtualinherited | 
Definition at line 34 of file pns_algo_base.cpp.
References 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 49 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, and m_world.
Referenced by singleStep().
| void PNS::WALKAROUND::RestrictToCluster | ( | bool | aEnabled, | 
| const TOPOLOGY::CLUSTER & | aCluster ) | 
Definition at line 70 of file pns_walkaround.cpp.
References dyn_cast(), 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 300 of file pns_walkaround.cpp.
References PNS::LINE::CLastPoint(), PNS::LINE::CLine(), PNS::LINE::CPoint(), PNS::ALGO_BASE::Dbg(), PNS::LINE::EndsWithVia(), SHAPE_LINE_CHAIN::Length(), m_currentResult, m_enabledPolicies, m_initialLength, m_itemMask, m_iteration, m_iterationLimit, m_lengthExpansionFactor, m_lengthLimitOn, m_world, MaxWalkPolicies, PNS_DBG, PNS::LINE::PointCount(), result, singleStep(), ST_ALMOST_DONE, ST_DONE, ST_IN_PROGRESS, ST_STUCK, start(), PNS::LINE::Via(), and WHITE.
      
  | 
  inlineinherited | 
Return current router settings.
Definition at line 54 of file pns_algo_base.h.
References 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::DIFF_PAIR_PLACER::FixRoute(), PNS::DRAGGER::FixRoute(), PNS::MULTI_DRAGGER::FixRoute(), PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), PNS::MEANDER_PLACER_BASE::lineDelay(), PNS::MEANDER_PLACER_BASE::lineLength(), 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::DRAGGER::Start(), PNS::LINE_PLACER::Start(), PNS::MEANDER_PLACER::Start(), PNS::MEANDER_SKEW_PLACER::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 391 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 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 112 of file pns_walkaround.h.
References m_forceCw, and m_forceWinding.
      
  | 
  inline | 
Definition at line 107 of file pns_walkaround.h.
References m_itemMask.
Referenced by PNS::LINE_PLACER::rhWalkBase().
      
  | 
  inline | 
Definition at line 94 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 130 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 m_logger.
Referenced by PNS::LINE_PLACER::rhWalkBase(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
      
  | 
  inline | 
Definition at line 118 of file pns_walkaround.h.
References m_useShortestPath.
      
  | 
  inline | 
Definition at line 99 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 m_router.
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::DIFF_PAIR_PLACER::FixRoute(), PNS::LINE_PLACER::FixRoute(), PNS::MULTI_DRAGGER::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(), PNS::WALKAROUND::singleStep(), PNS::DRAGGER::Start(), PNS::LINE_PLACER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::tryWalkaround(), PNS::MULTI_DRAGGER::tryWalkaround(), PNS::LINE_PLACER::UnfixRoute(), and PNS::WALKAROUND::WALKAROUND().
      
  | 
  inline | 
Definition at line 89 of file pns_walkaround.h.
References m_world.
      
  | 
  private | 
Definition at line 104 of file pns_walkaround.cpp.
References SHAPE_LINE_CHAIN::Append(), PNS::TOPOLOGY::AssembleCluster(), SHAPE_LINE_CHAIN::BBox(), BLUE, SHAPE_LINE_CHAIN::Clear(), clearance, PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), PNS::NODE::Depth(), BOX2< Vec >::GetBottom(), ADVANCED_CFG::GetCfg(), PNS::ROUTING_SETTINGS::GetCornerMode(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), SHAPE_LINE_CHAIN::Length(), PNS::LINE::Line(), m_currentResult, m_enabledPolicies, m_initialLength, PNS::TOPOLOGY::CLUSTER::m_items, m_lastShortestCluster, ADVANCED_CFG::m_PNSProcessClusterTimeout, 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, WHITE, WP_CCW, WP_CW, WP_SHORTEST, and YELLOW.
Referenced by Route().
      
  | 
  private | 
Definition at line 37 of file pns_walkaround.cpp.
References m_currentResult, m_iteration, MaxWalkPolicies, and ST_IN_PROGRESS.
Referenced by Route().
      
  | 
  inherited | 
Definition at line 40 of file pns_algo_base.cpp.
References m_router.
Referenced by PNS::SHOVE::runOptimizer().
      
  | 
  private | 
Definition at line 160 of file pns_walkaround.h.
      
  | 
  private | 
Definition at line 159 of file pns_walkaround.h.
      
  | 
  private | 
Definition at line 162 of file pns_walkaround.h.
Referenced by Route(), singleStep(), and start().
      
  | 
  private | 
Definition at line 150 of file pns_walkaround.h.
      
  | 
  protectedinherited | 
Definition at line 86 of file pns_algo_base.h.
Referenced by ALGO_BASE(), Dbg(), and SetDebugDecorator().
      
  | 
  private | 
Definition at line 158 of file pns_walkaround.h.
Referenced by Route(), SetAllowedPolicies(), and singleStep().
      
  | 
  private | 
Definition at line 149 of file pns_walkaround.h.
Referenced by SetForceWinding(), and WALKAROUND().
      
  | 
  private | 
Definition at line 154 of file pns_walkaround.h.
Referenced by WALKAROUND().
      
  | 
  private | 
Definition at line 148 of file pns_walkaround.h.
Referenced by SetForceWinding(), and WALKAROUND().
      
  | 
  private | 
Definition at line 163 of file pns_walkaround.h.
Referenced by Route(), singleStep(), and WALKAROUND().
      
  | 
  private | 
Definition at line 147 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), SetItemMask(), SetSolidsOnly(), and WALKAROUND().
      
  | 
  private | 
Definition at line 145 of file pns_walkaround.h.
Referenced by Route(), start(), and WALKAROUND().
      
  | 
  private | 
Definition at line 146 of file pns_walkaround.h.
Referenced by Route(), SetIterationLimit(), and WALKAROUND().
      
  | 
  private | 
Definition at line 151 of file pns_walkaround.h.
      
  | 
  private | 
Definition at line 161 of file pns_walkaround.h.
Referenced by singleStep().
      
  | 
  private | 
Definition at line 157 of file pns_walkaround.h.
Referenced by Route(), SetLengthLimit(), and WALKAROUND().
      
  | 
  private | 
Definition at line 155 of file pns_walkaround.h.
Referenced by Route(), SetLengthLimit(), and WALKAROUND().
      
  | 
  protectedinherited | 
Definition at line 88 of file pns_algo_base.h.
Referenced by ALGO_BASE(), Logger(), and SetLogger().
      
  | 
  private | 
Definition at line 152 of file pns_walkaround.h.
Referenced by nearestObstacle(), and RestrictToCluster().
      
  | 
  private | 
Definition at line 153 of file pns_walkaround.h.
Referenced by RestrictToCluster().
      
  | 
  protectedinherited | 
Definition at line 87 of file pns_algo_base.h.
Referenced by ALGO_BASE(), PNS::DP_MEANDER_PLACER::calculateTimeDomainTargets(), PNS::MEANDER_PLACER::calculateTimeDomainTargets(), PNS::MEANDER_SKEW_PLACER::calculateTimeDomainTargets(), PNS::MEANDER_PLACER::doMove(), PNS::LINE_PLACER::FixRoute(), PNS::DP_MEANDER_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), Router(), Settings(), PNS::DIFF_PAIR_PLACER::updateLeadingRatLine(), PNS::LINE_PLACER::updateLeadingRatLine(), and VisibleViewArea().
      
  | 
  private | 
Definition at line 156 of file pns_walkaround.h.
Referenced by SetPickShortestPath(), and WALKAROUND().
      
  | 
  private | 
Definition at line 143 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), SetWorld(), singleStep(), and WALKAROUND().
      
  | 
  staticconstexprprivate | 
Definition at line 38 of file pns_walkaround.h.
Referenced by PNS::WALKAROUND::RESULT::RESULT(), Route(), SetAllowedPolicies(), singleStep(), and start().