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 SetUseClustering (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, bool aAnyCompletePolicyIsSuccess=false)
 
void SetCollisionFilter (COLLISION_FILTER_FUNC aFilter)
 
void SetClearanceOverride (CLEARANCE_OVERRIDE_FUNC aFunc)
 
ROUTER * Router () const
 Return the instance of our router.
 
ROUTING_SETTINGS & Settings () const
 Return current router settings.
 
virtual LOGGER * Logger ()
 Return the logger object, allowing to dump geometry to a file.
 
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::set< ITEM * > m_processedItems
 
COLLISION_FILTER_FUNC m_collisionFilter
 
CLEARANCE_OVERRIDE_FUNC m_overrideClearance
 
RESULT m_currentResult
 
double m_initialLength
 
bool m_useClustering
 
bool m_anyCompletePolicyIsSuccess
 

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 64 of file pns_walkaround.h.

◆ WALK_POLICY

Enumerator
WP_CW 
WP_CCW 
WP_SHORTEST 

Definition at line 73 of file pns_walkaround.h.

Constructor & Destructor Documentation

◆ WALKAROUND()

◆ ~WALKAROUND()

PNS::WALKAROUND::~WALKAROUND ( )
inline

Definition at line 62 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 m_debugDecorator.

Referenced by PNS::SHOVE::AddLockedSpringbackNode(), PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::DRAGGER::bestAnchorForPoint(), PNS::LINE_PLACER::buildInitialLine(), PNS::SHOVE::checkShoveDirection(), PNS::LINE_PLACER::clipAndCheckCollisions(), PNS::MEANDER_PLACER::doMove(), PNS::BLOCK_DRAGGER::Drag(), PNS::COMPONENT_DRAGGER::Drag(), PNS::MULTI_DRAGGER::Drag(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), PNS::MULTI_DRAGGER::findNewLeaderSegment(), PNS::TRACKS_SPREADER::findNoOptSegments(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::SHOVE::fixupViaCollisions(), PNS::LINE_PLACER::handlePullback(), PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::mergeHead(), PNS::DIFF_PAIR_PLACER::Move(), PNS::DP_MEANDER_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), PNS::TRACKS_SPREADER::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::TRACKS_SPREADER::prepareSpreadableLines(), PNS::SHOVE::preShoveCleanup(), PNS::SHOVE::pruneLineFromOptimizerQueue(), PNS::SHOVE::pruneRootLines(), PNS::SHOVE::pushLineStack(), PNS::SHOVE::pushOrShoveVia(), PNS::SHOVE::pushSpringback(), PNS::SHOVE::reconstructHeads(), PNS::MULTI_DRAGGER::reconstructOriginalDpCoupling(), PNS::SHOVE::reduceSpringback(), PNS::LINE_PLACER::reduceTail(), PNS::PLACEMENT_ALGO::removeLoops(), PNS::SHOVE::replaceItems(), PNS::SHOVE::replaceLine(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::rhWalkOnly(), PNS::WALKAROUND::Route(), PNS::DIFF_PAIR_PLACER::routeHead(), PNS::LINE_PLACER::routeStep(), PNS::SHOVE::Run(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveIteration(), PNS::SHOVE::shoveLineToHullSet(), PNS::SHOVE::shoveMainLoop(), PNS::SHOVE::ShoveObstacleLine(), PNS::PLACEMENT_ALGO::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::MULTI_DRAGGER::tryAssembleDiffPair(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().

◆ Logger()

LOGGER * PNS::ALGO_BASE::Logger ( )
virtualinherited

Return the logger object, allowing to dump geometry to a file.

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().

◆ nearestObstacle()

◆ RestrictToCluster()

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

◆ Route() [1/2]

◆ Route() [2/2]

◆ Router()

ROUTER * PNS::ALGO_BASE::Router ( ) const
inlineinherited

Return the instance of our router.

Definition at line 54 of file pns_algo_base.h.

References m_router.

Referenced by PNS::TRACKS_SPREADER::AbortPlacement(), PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::MEANDER_PLACER_BASE::chainNarrowingOffset(), PNS::MEANDER_PLACER_BASE::Clearance(), PNS::DIFF_PAIR_PLACER::CommitPlacement(), PNS::DP_MEANDER_PLACER::CommitPlacement(), PNS::LINE_PLACER::CommitPlacement(), PNS::MEANDER_PLACER::CommitPlacement(), PNS::TRACKS_SPREADER::CommitPlacement(), PNS::TRACKS_SPREADER::CurrentNode(), PNS::BLOCK_DRAGGER::FixRoute(), PNS::COMPONENT_DRAGGER::FixRoute(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::DRAGGER::FixRoute(), PNS::MULTI_DRAGGER::FixRoute(), PNS::MEANDER_PLACER_BASE::initChainExtras(), PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), PNS::MEANDER_PLACER_BASE::lineDelay(), PNS::MEANDER_PLACER_BASE::lineLength(), PNS::DIFF_PAIR_PLACER::makeVia(), PNS::LINE_PLACER::makeVia(), PNS::TRACKS_SPREADER::Move(), PNS::MULTI_DRAGGER::multidragShove(), PNS::SHOVE::onCollidingSolid(), PNS::TRACKS_SPREADER::prepareSpreadableLines(), PNS::SHOVE::reconstructHeads(), PNS::MULTI_DRAGGER::reconstructOriginalDpCoupling(), PNS::LINE_PLACER::removeAntennas(), PNS::LINE_PLACER::rhWalkBase(), PNS::DIFF_PAIR_PLACER::routeHead(), PNS::SHOVE::Run(), 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::startDragArc(), PNS::MULTI_DRAGGER::tryAssembleDiffPair(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().

◆ SetAllowedPolicies()

void PNS::WALKAROUND::SetAllowedPolicies ( std::vector< WALK_POLICY > aPolicies,
bool aAnyCompletePolicyIsSuccess = false )

◆ SetClearanceOverride()

void PNS::WALKAROUND::SetClearanceOverride ( CLEARANCE_OVERRIDE_FUNC aFunc)

Definition at line 455 of file pns_walkaround.cpp.

References m_overrideClearance.

Referenced by PNS::TRACKS_SPREADER::Move().

◆ SetCollisionFilter()

void PNS::WALKAROUND::SetCollisionFilter ( COLLISION_FILTER_FUNC aFilter)

Definition at line 38 of file pns_walkaround.cpp.

References m_collisionFilter.

Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk().

◆ 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 m_debugDecorator.

Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::TRACKS_SPREADER::Move(), 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 115 of file pns_walkaround.h.

References m_forceCw, and m_forceWinding.

◆ SetItemMask()

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

Definition at line 110 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 121 of file pns_walkaround.h.

References m_useShortestPath.

◆ SetSolidsOnly()

◆ Settings()

◆ SetUseClustering()

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

Definition at line 126 of file pns_walkaround.h.

References m_useClustering.

Referenced by PNS::TRACKS_SPREADER::Move().

◆ SetWorld()

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

Definition at line 92 of file pns_walkaround.h.

References m_world.

◆ singleStep()

◆ start()

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

Definition at line 43 of file pns_walkaround.cpp.

References m_currentResult, m_iteration, MaxWalkPolicies, and ST_IN_PROGRESS.

Referenced by Route().

◆ VisibleViewArea()

const BOX2I & PNS::ALGO_BASE::VisibleViewArea ( ) const
inherited

Definition at line 40 of file pns_algo_base.cpp.

References m_router.

Referenced by PNS::SHOVE::runOptimizer().

Member Data Documentation

◆ m_anyCompletePolicyIsSuccess

bool PNS::WALKAROUND::m_anyCompletePolicyIsSuccess
private

Definition at line 177 of file pns_walkaround.h.

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

◆ m_collisionFilter

COLLISION_FILTER_FUNC PNS::WALKAROUND::m_collisionFilter
private

Definition at line 172 of file pns_walkaround.h.

Referenced by nearestObstacle(), SetCollisionFilter(), and singleStep().

◆ m_currentCluster

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

Definition at line 170 of file pns_walkaround.h.

◆ m_currentObstacle

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

Definition at line 169 of file pns_walkaround.h.

◆ m_currentResult

RESULT PNS::WALKAROUND::m_currentResult
private

Definition at line 174 of file pns_walkaround.h.

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

◆ m_cursorPos

VECTOR2I PNS::WALKAROUND::m_cursorPos
private

Definition at line 160 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 ALGO_BASE(), Dbg(), and SetDebugDecorator().

◆ m_enabledPolicies

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

Definition at line 168 of file pns_walkaround.h.

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

◆ m_forceCw

bool PNS::WALKAROUND::m_forceCw
private

Definition at line 159 of file pns_walkaround.h.

Referenced by SetForceWinding(), and WALKAROUND().

◆ m_forceLongerPath

bool PNS::WALKAROUND::m_forceLongerPath
private

Definition at line 164 of file pns_walkaround.h.

Referenced by WALKAROUND().

◆ m_forceWinding

bool PNS::WALKAROUND::m_forceWinding
private

Definition at line 158 of file pns_walkaround.h.

Referenced by SetForceWinding(), and WALKAROUND().

◆ m_initialLength

double PNS::WALKAROUND::m_initialLength
private

Definition at line 175 of file pns_walkaround.h.

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

◆ m_itemMask

int PNS::WALKAROUND::m_itemMask
private

Definition at line 157 of file pns_walkaround.h.

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

◆ m_iteration

int PNS::WALKAROUND::m_iteration
private

Definition at line 155 of file pns_walkaround.h.

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

◆ m_iterationLimit

int PNS::WALKAROUND::m_iterationLimit
private

Definition at line 156 of file pns_walkaround.h.

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

◆ m_lastP

VECTOR2I PNS::WALKAROUND::m_lastP
private

Definition at line 161 of file pns_walkaround.h.

◆ m_lengthExpansionFactor

double PNS::WALKAROUND::m_lengthExpansionFactor
private

Definition at line 167 of file pns_walkaround.h.

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

◆ m_lengthLimitOn

bool PNS::WALKAROUND::m_lengthLimitOn
private

Definition at line 165 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 ALGO_BASE(), Logger(), and SetLogger().

◆ m_overrideClearance

CLEARANCE_OVERRIDE_FUNC PNS::WALKAROUND::m_overrideClearance
private

Definition at line 173 of file pns_walkaround.h.

Referenced by nearestObstacle(), SetClearanceOverride(), singleStep(), and WALKAROUND().

◆ m_processedItems

std::set<ITEM*> PNS::WALKAROUND::m_processedItems
private

Definition at line 171 of file pns_walkaround.h.

Referenced by Route(), and singleStep().

◆ m_restrictedSet

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

Definition at line 162 of file pns_walkaround.h.

Referenced by nearestObstacle(), and RestrictToCluster().

◆ m_restrictedVertices

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

Definition at line 163 of file pns_walkaround.h.

Referenced by RestrictToCluster().

◆ m_router

◆ m_useClustering

bool PNS::WALKAROUND::m_useClustering
private

Definition at line 176 of file pns_walkaround.h.

Referenced by SetUseClustering(), singleStep(), and WALKAROUND().

◆ m_useShortestPath

bool PNS::WALKAROUND::m_useShortestPath
private

Definition at line 166 of file pns_walkaround.h.

Referenced by SetPickShortestPath(), and WALKAROUND().

◆ m_world

NODE* PNS::WALKAROUND::m_world
private

Definition at line 153 of file pns_walkaround.h.

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

◆ MaxWalkPolicies

int PNS::WALKAROUND::MaxWalkPolicies = 3
staticconstexprprivate

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