KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::WALKAROUND Class Reference

#include <pns_walkaround.h>

Inheritance diagram for PNS::WALKAROUND:
PNS::ALGO_BASE

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)
 
ROUTERRouter () const
 Return current router settings.
 
ROUTING_SETTINGSSettings () const
 Return the logger object, allowing to dump geometry to a file.
 
virtual LOGGERLogger ()
 
void SetLogger (LOGGER *aLogger)
 
void SetDebugDecorator (DEBUG_DECORATOR *aDecorator)
 Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.
 
DEBUG_DECORATORDbg () const
 
const BOX2IVisibleViewArea () const
 

Protected Attributes

DEBUG_DECORATORm_debugDecorator
 
ROUTERm_router
 
LOGGERm_logger
 

Private Member Functions

void start (const LINE &aInitialPath)
 
bool singleStep ()
 
NODE::OPT_OBSTACLE nearestObstacle (const LINE &aPath)
 

Private Attributes

NODEm_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< VECTOR2Im_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::CLUSTERm_lastShortestCluster
 
RESULT m_currentResult
 
double m_initialLength
 

Static Private Attributes

static constexpr int MaxWalkPolicies = 3
 

Detailed Description

Definition at line 36 of file pns_walkaround.h.

Member Enumeration Documentation

◆ STATUS

Enumerator
ST_IN_PROGRESS 
ST_ALMOST_DONE 
ST_DONE 
ST_STUCK 
ST_NONE 

Definition at line 60 of file pns_walkaround.h.

◆ WALK_POLICY

Enumerator
WP_CW 
WP_CCW 
WP_SHORTEST 

Definition at line 69 of file pns_walkaround.h.

Constructor & Destructor Documentation

◆ WALKAROUND()

◆ ~WALKAROUND()

PNS::WALKAROUND::~WALKAROUND ( )
inline

Definition at line 58 of file pns_walkaround.h.

Member Function Documentation

◆ Dbg()

DEBUG_DECORATOR * PNS::ALGO_BASE::Dbg ( ) const
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().

◆ Logger()

◆ nearestObstacle()

◆ RestrictToCluster()

void PNS::WALKAROUND::RestrictToCluster ( bool  aEnabled,
const TOPOLOGY::CLUSTER aCluster 
)

◆ Route() [1/2]

◆ Route() [2/2]

STATUS PNS::WALKAROUND::Route ( const LINE aInitialPath,
LINE aWalkPath,
bool  aOptimize = true 
)

◆ Router()

◆ SetAllowedPolicies()

void PNS::WALKAROUND::SetAllowedPolicies ( std::vector< WALK_POLICY aPolicies)

◆ SetDebugDecorator()

void PNS::ALGO_BASE::SetDebugDecorator ( DEBUG_DECORATOR aDecorator)
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().

◆ SetForceWinding()

void PNS::WALKAROUND::SetForceWinding ( bool  aEnabled,
bool  aCw 
)
inline

Definition at line 111 of file pns_walkaround.h.

References m_forceCw, and m_forceWinding.

◆ SetItemMask()

void PNS::WALKAROUND::SetItemMask ( int  aMask)
inline

Definition at line 106 of file pns_walkaround.h.

References m_itemMask.

Referenced by PNS::LINE_PLACER::rhWalkBase().

◆ SetIterationLimit()

void PNS::WALKAROUND::SetIterationLimit ( const int  aIterLimit)
inline

◆ SetLengthLimit()

void PNS::WALKAROUND::SetLengthLimit ( bool  aEnable,
double  aLengthExpansionFactor 
)
inline

◆ SetLogger()

void PNS::ALGO_BASE::SetLogger ( LOGGER aLogger)
inlineinherited

◆ SetPickShortestPath()

void PNS::WALKAROUND::SetPickShortestPath ( bool  aEnabled)
inline

Definition at line 117 of file pns_walkaround.h.

References m_useShortestPath.

◆ SetSolidsOnly()

◆ Settings()

◆ SetWorld()

void PNS::WALKAROUND::SetWorld ( NODE aNode)
inline

Definition at line 88 of file pns_walkaround.h.

References m_world.

◆ singleStep()

◆ start()

void PNS::WALKAROUND::start ( const LINE aInitialPath)
private

◆ VisibleViewArea()

const BOX2I & PNS::ALGO_BASE::VisibleViewArea ( ) const
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().

Member Data Documentation

◆ m_currentCluster

TOPOLOGY::CLUSTER PNS::WALKAROUND::m_currentCluster[MaxWalkPolicies]
private

Definition at line 159 of file pns_walkaround.h.

◆ m_currentObstacle

NODE::OPT_OBSTACLE PNS::WALKAROUND::m_currentObstacle[MaxWalkPolicies]
private

Definition at line 158 of file pns_walkaround.h.

◆ m_currentResult

RESULT PNS::WALKAROUND::m_currentResult
private

Definition at line 161 of file pns_walkaround.h.

Referenced by Route(), singleStep(), and start().

◆ m_cursorPos

VECTOR2I PNS::WALKAROUND::m_cursorPos
private

Definition at line 149 of file pns_walkaround.h.

◆ m_debugDecorator

DEBUG_DECORATOR* PNS::ALGO_BASE::m_debugDecorator
protectedinherited

Definition at line 86 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Dbg(), and PNS::ALGO_BASE::SetDebugDecorator().

◆ m_enabledPolicies

bool PNS::WALKAROUND::m_enabledPolicies[MaxWalkPolicies]
private

Definition at line 157 of file pns_walkaround.h.

Referenced by Route(), SetAllowedPolicies(), and singleStep().

◆ m_forceCw

bool PNS::WALKAROUND::m_forceCw
private

Definition at line 148 of file pns_walkaround.h.

Referenced by SetForceWinding(), and WALKAROUND().

◆ m_forceLongerPath

bool PNS::WALKAROUND::m_forceLongerPath
private

Definition at line 153 of file pns_walkaround.h.

Referenced by WALKAROUND().

◆ m_forceWinding

bool PNS::WALKAROUND::m_forceWinding
private

Definition at line 147 of file pns_walkaround.h.

Referenced by SetForceWinding(), and WALKAROUND().

◆ m_initialLength

double PNS::WALKAROUND::m_initialLength
private

Definition at line 162 of file pns_walkaround.h.

Referenced by Route(), and singleStep().

◆ m_itemMask

int PNS::WALKAROUND::m_itemMask
private

Definition at line 146 of file pns_walkaround.h.

Referenced by nearestObstacle(), Route(), SetItemMask(), SetSolidsOnly(), and WALKAROUND().

◆ m_iteration

int PNS::WALKAROUND::m_iteration
private

Definition at line 144 of file pns_walkaround.h.

Referenced by Route(), start(), and WALKAROUND().

◆ m_iterationLimit

int PNS::WALKAROUND::m_iterationLimit
private

Definition at line 145 of file pns_walkaround.h.

Referenced by Route(), SetIterationLimit(), and WALKAROUND().

◆ m_lastP

VECTOR2I PNS::WALKAROUND::m_lastP
private

Definition at line 150 of file pns_walkaround.h.

◆ m_lastShortestCluster

std::optional<TOPOLOGY::CLUSTER> PNS::WALKAROUND::m_lastShortestCluster
private

Definition at line 160 of file pns_walkaround.h.

Referenced by singleStep().

◆ m_lengthExpansionFactor

double PNS::WALKAROUND::m_lengthExpansionFactor
private

Definition at line 156 of file pns_walkaround.h.

Referenced by Route(), SetLengthLimit(), and WALKAROUND().

◆ m_lengthLimitOn

bool PNS::WALKAROUND::m_lengthLimitOn
private

Definition at line 154 of file pns_walkaround.h.

Referenced by Route(), SetLengthLimit(), and WALKAROUND().

◆ m_logger

LOGGER* PNS::ALGO_BASE::m_logger
protectedinherited

Definition at line 88 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Logger(), and PNS::ALGO_BASE::SetLogger().

◆ m_restrictedSet

std::set<const ITEM*> PNS::WALKAROUND::m_restrictedSet
private

Definition at line 151 of file pns_walkaround.h.

Referenced by nearestObstacle(), and RestrictToCluster().

◆ m_restrictedVertices

std::vector<VECTOR2I> PNS::WALKAROUND::m_restrictedVertices
private

Definition at line 152 of file pns_walkaround.h.

Referenced by RestrictToCluster().

◆ m_router

◆ m_useShortestPath

bool PNS::WALKAROUND::m_useShortestPath
private

Definition at line 155 of file pns_walkaround.h.

Referenced by SetPickShortestPath(), and WALKAROUND().

◆ m_world

NODE* PNS::WALKAROUND::m_world
private

Definition at line 142 of file pns_walkaround.h.

Referenced by nearestObstacle(), Route(), SetWorld(), and singleStep().

◆ MaxWalkPolicies

constexpr int PNS::WALKAROUND::MaxWalkPolicies = 3
staticconstexprprivate

The documentation for this class was generated from the following files: