![]() |
KiCad PCB EDA Suite
|
#include <pns_walkaround.h>
Classes | |
struct | RESULT |
Public Types | |
enum | WALKAROUND_STATUS { IN_PROGRESS = 0, ALMOST_DONE, DONE, STUCK } |
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 | SetSingleDirection (bool aForceSingleDirection) |
void | SetSingleDirection2 (bool aForceSingleDirection) |
void | SetApproachCursor (bool aEnabled, const VECTOR2I &aPos) |
void | SetForceWinding (bool aEnabled, bool aCw) |
void | RestrictToSet (bool aEnabled, const std::set< ITEM * > &aSet) |
WALKAROUND_STATUS | Route (const LINE &aInitialPath, LINE &aWalkPath, bool aOptimize=true) |
const RESULT | Route (const LINE &aInitialPath) |
ROUTER * | Router () const |
Return current router settings. More... | |
ROUTING_SETTINGS & | Settings () const |
Return the logger object, allowing to dump geometry to a file. More... | |
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. More... | |
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) |
WALKAROUND_STATUS | singleStep (LINE &aPath, bool aWindingDirection) |
NODE::OPT_OBSTACLE | nearestObstacle (const LINE &aPath) |
Private Attributes | |
NODE * | m_world |
int | m_recursiveBlockageCount |
int | m_iteration |
int | m_iterationLimit |
int | m_itemMask |
bool | m_forceSingleDirection |
bool | m_forceLongerPath |
bool | m_cursorApproachMode |
bool | m_forceWinding |
bool | m_forceCw |
bool | m_forceUniqueWindingDirection |
VECTOR2I | m_cursorPos |
NODE::OPT_OBSTACLE | m_currentObstacle [2] |
bool | m_recursiveCollision [2] |
std::set< ITEM * > | m_restrictedSet |
Static Private Attributes | |
static const int | DefaultIterationLimit = 50 |
Definition at line 35 of file pns_walkaround.h.
Enumerator | |
---|---|
IN_PROGRESS | |
ALMOST_DONE | |
DONE | |
STUCK |
Definition at line 61 of file pns_walkaround.h.
Definition at line 40 of file pns_walkaround.h.
References PNS::ITEM::ANY_T, m_cursorApproachMode, m_forceCw, m_forceLongerPath, m_forceSingleDirection, m_forceUniqueWindingDirection, m_forceWinding, m_itemMask, m_iteration, m_recursiveBlockageCount, and m_recursiveCollision.
|
inline |
Definition at line 59 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::MEANDER_PLACER::doMove(), PNS::COMPONENT_DRAGGER::Drag(), PNS::MEANDER_SKEW_PLACER::Move(), PNS::DP_MEANDER_PLACER::Move(), PNS::SHOVE::onCollidingArc(), PNS::SHOVE::onCollidingLine(), PNS::SHOVE::onCollidingSegment(), PNS::SHOVE::onCollidingSolid(), PNS::DRAGGER::optimizeAndUpdateDraggedLine(), PNS::SHOVE::replaceLine(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveIteration(), PNS::SHOVE::ShoveLines(), PNS::SHOVE::shoveLineToHullSet(), PNS::SHOVE::ShoveObstacleLine(), singleStep(), PNS::DRAGGER::Start(), and PNS::DRAGGER::tryWalkaround().
|
virtualinherited |
Reimplemented in PNS::SHOVE.
Definition at line 34 of file pns_algo_base.cpp.
References NULL.
Referenced by PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), PNS::DRAGGER::Start(), and PNS::DRAGGER::tryWalkaround().
|
private |
Definition at line 41 of file pns_walkaround.cpp.
References m_itemMask, m_restrictedSet, m_world, PNS::NODE::NearestObstacle(), and NULL.
Referenced by Route(), and singleStep().
|
inline |
Definition at line 129 of file pns_walkaround.h.
References m_restrictedSet.
Referenced by PNS::SHOVE::onCollidingSolid().
WALKAROUND::WALKAROUND_STATUS PNS::WALKAROUND::Route | ( | const LINE & | aInitialPath, |
LINE & | aWalkPath, | ||
bool | aOptimize = true |
||
) |
Definition at line 286 of file pns_walkaround.cpp.
References SEG::A, ALMOST_DONE, SHAPE_LINE_CHAIN::Append(), SEG::B, PNS::NODE::CheckColliding(), PNS::LINE::CLine(), PNS::LINE::CPoint(), DONE, PNS::LINE::EndsWithVia(), IN_PROGRESS, SHAPE_LINE_CHAIN::Length(), PNS::LINE::Line(), m_currentObstacle, m_cursorApproachMode, m_cursorPos, m_forceCw, m_forceLongerPath, m_forceSingleDirection, m_forceWinding, m_itemMask, m_iteration, m_iterationLimit, m_recursiveBlockageCount, m_world, PNS::OPTIMIZER::MERGE_OBTUSE, nearestObstacle(), SEG::NearestPoint(), PNS::OPTIMIZER::Optimize(), PNS::LINE::PointCount(), SHAPE_LINE_CHAIN::Remove(), SHAPE_LINE_CHAIN::Segment(), PNS::LINE::SegmentCount(), SHAPE_LINE_CHAIN::SegmentCount(), PNS::LINE::SetShape(), SHAPE_LINE_CHAIN::Simplify(), singleStep(), start(), STUCK, and PNS::LINE::Via().
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::DRAGGER::tryWalkaround().
const WALKAROUND::RESULT PNS::WALKAROUND::Route | ( | const LINE & | aInitialPath | ) |
Definition at line 178 of file pns_walkaround.cpp.
References ALMOST_DONE, PNS::NODE::CheckColliding(), PNS::clipToLoopStart(), PNS::LINE::CPoint(), DONE, PNS::LINE::EndsWithVia(), IN_PROGRESS, PNS::LINE::Line(), PNS::WALKAROUND::RESULT::lineCcw, PNS::WALKAROUND::RESULT::lineCw, m_currentObstacle, m_forceCw, m_forceSingleDirection, m_forceWinding, m_itemMask, m_iteration, m_iterationLimit, m_recursiveBlockageCount, m_world, nearestObstacle(), PNS::LINE::PointCount(), PNS::LINE::SegmentCount(), SHAPE_LINE_CHAIN::Simplify(), singleStep(), start(), PNS::WALKAROUND::RESULT::statusCcw, PNS::WALKAROUND::RESULT::statusCw, STUCK, and PNS::LINE::Via().
|
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::CommitPlacement(), PNS::DP_MEANDER_PLACER::CommitPlacement(), PNS::DIFF_PAIR_PLACER::CommitPlacement(), PNS::LINE_PLACER::CommitPlacement(), PNS::COMPONENT_DRAGGER::FixRoute(), PNS::DRAGGER::FixRoute(), PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), PNS::MEANDER_SKEW_PLACER::Start(), PNS::MEANDER_PLACER::Start(), PNS::DP_MEANDER_PLACER::Start(), PNS::DRAGGER::Start(), PNS::DIFF_PAIR_PLACER::Start(), and PNS::DRAGGER::tryWalkaround().
|
inline |
Definition at line 117 of file pns_walkaround.h.
References m_cursorApproachMode, and m_cursorPos.
Referenced by PNS::LINE_PLACER::rhShoveOnly().
|
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::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), PNS::SHOVE::SHOVE(), and PNS::DRAGGER::tryWalkaround().
|
inline |
|
inline |
|
inline |
Definition at line 88 of file pns_walkaround.h.
References m_iterationLimit.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::DRAGGER::tryWalkaround().
|
inlineinherited |
Definition at line 65 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_logger.
Referenced by PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::DRAGGER::tryWalkaround().
|
inline |
Definition at line 106 of file pns_walkaround.h.
References m_forceLongerPath, and m_forceSingleDirection.
Referenced by PNS::SHOVE::onCollidingSolid().
|
inline |
|
inline |
Definition at line 93 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::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::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::DRAGGER::dragMarkObstacles(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), PNS::COMPONENT_DRAGGER::FixRoute(), PNS::DRAGGER::FixRoute(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::LINE_PLACER::FixRoute(), PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), PNS::LINE_PLACER::Move(), PNS::SHOVE::onCollidingSolid(), PNS::DRAGGER::optimizeAndUpdateDraggedLine(), PNS::LINE_PLACER::rhMarkObstacles(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), PNS::LINE_PLACER::routeStep(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveMainLoop(), PNS::DRAGGER::Start(), PNS::LINE_PLACER::Start(), and PNS::DRAGGER::tryWalkaround().
|
inline |
Definition at line 83 of file pns_walkaround.h.
References m_world.
Referenced by PNS::LINE_PLACER::rhShoveOnly().
|
private |
Definition at line 55 of file pns_walkaround.cpp.
References PNS::DEBUG_DECORATOR::AddLine(), SHAPE_LINE_CHAIN::Append(), PNS::DEBUG_DECORATOR::BeginGroup(), PNS::NODE::CheckColliding(), PNS::LINE::CLine(), PNS::LINE::ClipToNearestObstacle(), PNS::LINE::CPoint(), PNS::ALGO_BASE::Dbg(), DONE, PNS::DEBUG_DECORATOR::EndGroup(), IN_PROGRESS, SHAPE_LINE_CHAIN::Length(), PNS::LINE::Line(), PNS::LOGGER::Log(), m_currentObstacle, m_itemMask, m_iteration, PNS::ALGO_BASE::m_logger, m_recursiveBlockageCount, m_world, name, nearestObstacle(), PNS::LINE::PointCount(), PNS::LINE::SetShape(), STUCK, and PNS::LINE::Walkaround().
Referenced by Route().
|
private |
Definition at line 34 of file pns_walkaround.cpp.
References m_iteration, and m_iterationLimit.
Referenced by Route().
|
inherited |
Definition at line 39 of file pns_algo_base.cpp.
References PNS::ALGO_BASE::m_router, and PNS::ROUTER::VisibleViewArea().
Referenced by PNS::SHOVE::runOptimizer().
|
staticprivate |
Definition at line 37 of file pns_walkaround.h.
|
private |
Definition at line 160 of file pns_walkaround.h.
Referenced by Route(), and singleStep().
|
private |
Definition at line 155 of file pns_walkaround.h.
Referenced by Route(), SetApproachCursor(), and WALKAROUND().
|
private |
Definition at line 159 of file pns_walkaround.h.
Referenced by Route(), and SetApproachCursor().
|
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(), SetForceWinding(), and WALKAROUND().
|
private |
Definition at line 154 of file pns_walkaround.h.
Referenced by Route(), SetSingleDirection(), and WALKAROUND().
|
private |
Definition at line 154 of file pns_walkaround.h.
Referenced by Route(), SetSingleDirection(), SetSingleDirection2(), and WALKAROUND().
|
private |
Definition at line 158 of file pns_walkaround.h.
Referenced by WALKAROUND().
|
private |
Definition at line 156 of file pns_walkaround.h.
Referenced by Route(), SetForceWinding(), and WALKAROUND().
|
private |
Definition at line 153 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), SetItemMask(), SetSolidsOnly(), singleStep(), and WALKAROUND().
|
private |
Definition at line 151 of file pns_walkaround.h.
Referenced by Route(), singleStep(), start(), and WALKAROUND().
|
private |
Definition at line 152 of file pns_walkaround.h.
Referenced by Route(), SetIterationLimit(), and start().
|
protectedinherited |
Definition at line 88 of file pns_algo_base.h.
Referenced by PNS::ALGO_BASE::SetLogger(), and singleStep().
|
private |
Definition at line 150 of file pns_walkaround.h.
Referenced by Route(), singleStep(), and WALKAROUND().
|
private |
Definition at line 161 of file pns_walkaround.h.
Referenced by WALKAROUND().
|
private |
Definition at line 162 of file pns_walkaround.h.
Referenced by nearestObstacle(), and RestrictToSet().
|
protectedinherited |
Definition at line 87 of file pns_algo_base.h.
Referenced by 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 148 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), SetWorld(), and singleStep().