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 | 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) |
void | SetLengthLimit (bool aEnable) |
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) |
WALKAROUND_STATUS | singleStep (LINE &aPath, bool aWindingDirection) |
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 |
NODE::OPT_OBSTACLE | m_currentObstacle [2] |
std::set< ITEM * > | m_restrictedSet |
std::vector< VECTOR2I > | m_restrictedVertices |
bool | m_forceLongerPath |
bool | m_lengthLimitOn |
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 57 of file pns_walkaround.h.
Definition at line 40 of file pns_walkaround.h.
References PNS::ITEM::ANY_T, m_forceCw, m_forceLongerPath, m_forceWinding, m_itemMask, m_iteration, and m_lengthLimitOn.
|
inline |
Definition at line 55 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::LINE_PLACER::buildInitialLine(), PNS::LINE_PLACER::clipAndCheckCollisions(), PNS::MEANDER_PLACER::doMove(), PNS::COMPONENT_DRAGGER::Drag(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), PNS::SHOVE::fixupViaCollisions(), PNS::LINE_PLACER::handlePullback(), PNS::LINE_PLACER::mergeHead(), PNS::DP_MEANDER_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), 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::pushLineStack(), PNS::SHOVE::pushOrShoveVia(), PNS::LINE_PLACER::reduceTail(), PNS::LINE_PLACER::removeLoops(), PNS::SHOVE::replaceLine(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::rhWalkOnly(), Route(), PNS::LINE_PLACER::routeStep(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveIteration(), PNS::SHOVE::ShoveLines(), PNS::SHOVE::shoveLineToHullSet(), PNS::SHOVE::shoveMainLoop(), PNS::SHOVE::ShoveMultiLines(), PNS::SHOVE::ShoveObstacleLine(), singleStep(), PNS::LINE_PLACER::splitHeadTail(), PNS::LINE_PLACER::Start(), PNS::DRAGGER::Start(), PNS::LINE_PLACER::Trace(), PNS::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(), and PNS::DRAGGER::tryWalkaround().
|
private |
Definition at line 42 of file pns_walkaround.cpp.
References m_itemMask, PNS::COLLISION_SEARCH_OPTIONS::m_kindMask, PNS::COLLISION_SEARCH_OPTIONS::m_restrictedSet, m_restrictedSet, PNS::COLLISION_SEARCH_OPTIONS::m_useClearanceEpsilon, m_world, and PNS::NODE::NearestObstacle().
Referenced by Route(), and singleStep().
void PNS::WALKAROUND::RestrictToSet | ( | bool | aEnabled, |
const std::set< ITEM * > & | aSet | ||
) |
Definition at line 67 of file pns_walkaround.cpp.
References m_restrictedSet, and m_restrictedVertices.
Referenced by PNS::SHOVE::onCollidingSolid().
const WALKAROUND::RESULT PNS::WALKAROUND::Route | ( | const LINE & | aInitialPath | ) |
Definition at line 148 of file pns_walkaround.cpp.
References ALMOST_DONE, PNS::NODE::CheckColliding(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::LINE::CPoint(), PNS::ALGO_BASE::Dbg(), DONE, PNS::LINE::EndsWithVia(), IN_PROGRESS, SHAPE_LINE_CHAIN::Length(), PNS::LINE::Line(), PNS::WALKAROUND::RESULT::lineCcw, PNS::WALKAROUND::RESULT::lineCw, m_currentObstacle, m_forceCw, m_forceWinding, m_itemMask, m_iteration, m_iterationLimit, m_lengthLimitOn, m_world, nearestObstacle(), PNS_DBG, PNS::LINE::PointCount(), PNS::LINE::SegmentCount(), singleStep(), start(), PNS::WALKAROUND::RESULT::statusCcw, PNS::WALKAROUND::RESULT::statusCw, STUCK, and PNS::LINE::Via().
WALKAROUND::WALKAROUND_STATUS PNS::WALKAROUND::Route | ( | const LINE & | aInitialPath, |
LINE & | aWalkPath, | ||
bool | aOptimize = true |
||
) |
Definition at line 268 of file pns_walkaround.cpp.
References ALMOST_DONE, 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_forceCw, m_forceLongerPath, m_forceWinding, m_itemMask, m_iteration, m_iterationLimit, m_world, PNS::OPTIMIZER::MERGE_OBTUSE, nearestObstacle(), PNS::OPTIMIZER::Optimize(), PNS::LINE::PointCount(), PNS::LINE::SegmentCount(), SHAPE_LINE_CHAIN::Simplify(), singleStep(), start(), STUCK, and PNS::LINE::Via().
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), and PNS::DRAGGER::tryWalkaround().
|
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::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), 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(), and PNS::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(), and PNS::DRAGGER::tryWalkaround().
|
inline |
Definition at line 102 of file pns_walkaround.h.
References m_forceCw, and m_forceWinding.
|
inline |
Definition at line 97 of file pns_walkaround.h.
References m_itemMask.
Referenced by PNS::LINE_PLACER::rhWalkBase().
|
inline |
Definition at line 84 of file pns_walkaround.h.
References m_iterationLimit.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), and PNS::DRAGGER::tryWalkaround().
|
inline |
Definition at line 115 of file pns_walkaround.h.
References m_lengthLimitOn.
|
inlineinherited |
Definition at line 65 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_logger.
Referenced by PNS::LINE_PLACER::rhWalkBase(), and PNS::DRAGGER::tryWalkaround().
|
inline |
Definition at line 89 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(), 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::LINE_PLACER::CommitPlacement(), PNS::DRAGGER::dragMarkObstacles(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), PNS::COMPONENT_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::DRAGGER::tryWalkaround(), and PNS::LINE_PLACER::UnfixRoute().
|
inline |
Definition at line 79 of file pns_walkaround.h.
References m_world.
|
private |
Definition at line 91 of file pns_walkaround.cpp.
References ALMOST_DONE, SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::BBox(), BLUE, SHAPE_LINE_CHAIN::Clear(), PNS::LINE::CLine(), PNS::LINE::CPoint(), PNS::ALGO_BASE::Dbg(), DONE, BOX2< Vec >::GetBottom(), PNS::ROUTING_SETTINGS::GetCornerMode(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), GREEN, IN_PROGRESS, m_currentObstacle, m_iteration, DIRECTION_45::MITERED_90, nearestObstacle(), PNS_DBG, PNS_DBGN, SHAPE_LINE_CHAIN_BASE::PointInside(), SHAPE_LINE_CHAIN_BASE::PointOnEdge(), RED, DIRECTION_45::ROUNDED_90, PNS::LINE::SetShape(), PNS::ALGO_BASE::Settings(), SHAPE_LINE_CHAIN::Simplify(), PNS::LINE::Walkaround(), and PNS::LINE::Width().
Referenced by Route().
|
private |
Definition at line 35 of file pns_walkaround.cpp.
References m_iteration, and m_iterationLimit.
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::DRAGGER::optimizeAndUpdateDraggedLine(), and PNS::SHOVE::runOptimizer().
|
staticprivate |
Definition at line 37 of file pns_walkaround.h.
|
private |
Definition at line 134 of file pns_walkaround.h.
Referenced by Route(), and singleStep().
|
private |
Definition at line 133 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 132 of file pns_walkaround.h.
Referenced by Route(), SetForceWinding(), and WALKAROUND().
|
private |
Definition at line 137 of file pns_walkaround.h.
Referenced by Route(), and WALKAROUND().
|
private |
Definition at line 131 of file pns_walkaround.h.
Referenced by Route(), SetForceWinding(), and WALKAROUND().
|
private |
Definition at line 130 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), SetItemMask(), SetSolidsOnly(), and WALKAROUND().
|
private |
Definition at line 128 of file pns_walkaround.h.
Referenced by Route(), singleStep(), start(), and WALKAROUND().
|
private |
Definition at line 129 of file pns_walkaround.h.
Referenced by Route(), SetIterationLimit(), and start().
|
private |
Definition at line 138 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 135 of file pns_walkaround.h.
Referenced by nearestObstacle(), and RestrictToSet().
|
private |
Definition at line 136 of file pns_walkaround.h.
Referenced by RestrictToSet().
|
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::SHOVE::ShoveObstacleLine(), PNS::DIFF_PAIR_PLACER::updateLeadingRatLine(), PNS::LINE_PLACER::updateLeadingRatLine(), and PNS::ALGO_BASE::VisibleViewArea().
|
private |
Definition at line 126 of file pns_walkaround.h.
Referenced by nearestObstacle(), Route(), and SetWorld().