KiCad PCB EDA Suite
|
#include <pns_component_dragger.h>
Classes | |
struct | DRAGGED_CONNECTION |
Public Member Functions | |
COMPONENT_DRAGGER (ROUTER *aRouter) | |
~COMPONENT_DRAGGER () | |
bool | Start (const VECTOR2I &aP, ITEM_SET &aPrimitives) override |
Function Start() | |
bool | Drag (const VECTOR2I &aP) override |
Function Drag() | |
bool | FixRoute (bool aForceCommit) override |
Function FixRoute() | |
NODE * | CurrentNode () const override |
Function CurrentNode() | |
const std::vector< NET_HANDLE > | CurrentNets () const override |
Function CurrentNets() | |
virtual int | CurrentLayer () const override |
Function CurrentLayer() | |
const ITEM_SET | Traces () override |
Function Traces() | |
virtual PNS::DRAG_MODE | Mode () const override |
bool | GetForceMarkObstaclesMode (bool *aDragStatus) const override |
virtual void | SetWorld (NODE *aWorld) |
Function SetWorld() | |
virtual void | SetMode (PNS::DRAG_MODE aDragMode) |
virtual std::vector< PNS::ITEM * > | GetLastCommittedLeaderSegments () |
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 | |
NODE * | m_world |
DEBUG_DECORATOR * | m_debugDecorator |
ROUTER * | m_router |
LOGGER * | m_logger |
Private Attributes | |
std::set< SOLID * > | m_solids |
std::set< ITEM * > | m_fixedItems |
std::vector< DRAGGED_CONNECTION > | m_conns |
bool | m_dragStatus |
ITEM_SET | m_draggedItems |
ITEM_SET | m_initialDraggedItems |
NODE * | m_currentNode |
VECTOR2I | m_p0 |
Implements component dragging algorithm.
Definition at line 39 of file pns_component_dragger.h.
PNS::COMPONENT_DRAGGER::COMPONENT_DRAGGER | ( | ROUTER * | aRouter | ) |
Definition at line 35 of file pns_component_dragger.cpp.
References m_currentNode, and m_dragStatus.
PNS::COMPONENT_DRAGGER::~COMPONENT_DRAGGER | ( | ) |
Definition at line 43 of file pns_component_dragger.cpp.
|
inlineoverridevirtual |
Function CurrentLayer()
Returns the layer of currently dragged item(s). Currently unused for component dragging.
Implements PNS::DRAG_ALGO.
Definition at line 96 of file pns_component_dragger.h.
References UNDEFINED_LAYER.
|
inlineoverridevirtual |
Function CurrentNets()
Returns the net(s) of currently dragged item(s). Currently unused for component dragging.
Implements PNS::DRAG_ALGO.
Definition at line 85 of file pns_component_dragger.h.
|
overridevirtual |
Function CurrentNode()
Returns the most recent world state, including all items changed due to dragging operation.
Implements PNS::DRAG_ALGO.
Definition at line 264 of file pns_component_dragger.cpp.
References m_currentNode, and PNS::DRAG_ALGO::m_world.
Referenced by FixRoute().
|
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(), 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(), 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::WALKAROUND::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().
|
overridevirtual |
Function Drag()
Drags the current segment/corner/via to the point aP.
Implements PNS::DRAG_ALGO.
Definition at line 156 of file pns_component_dragger.cpp.
References SEG::A, PNS::ITEM_SET::Add(), PNS::NODE::Add(), PNS::ITEM::ARC_T, SEG::B, BLUE, PNS::NODE::Branch(), PNS::ITEM_SET::Clear(), PNS::LINK_HOLDER::ClearLinks(), PNS::ARC::Clone(), PNS::SEGMENT::Clone(), PNS::ALGO_BASE::Dbg(), PNS::LINE::DragCorner(), PNS::NODE::KillChildren(), m_conns, m_currentNode, m_draggedItems, m_fixedItems, m_initialDraggedItems, m_p0, m_solids, PNS::DRAG_ALGO::m_world, SHAPE_ARC::Move(), PNS_DBG, PNS::NODE::Remove(), PNS::SEGMENT::Seg(), PNS::ITEM::SEGMENT_T, and PNS::LINE::Unmark().
|
overridevirtual |
Function FixRoute()
Checks if the result of current dragging operation is correct and eventually commits it to the world.
Implements PNS::DRAG_ALGO.
Definition at line 247 of file pns_component_dragger.cpp.
References PNS::NODE::CheckColliding(), PNS::ROUTER::CommitRouting(), CurrentNode(), m_draggedItems, PNS::ALGO_BASE::Router(), and PNS::ALGO_BASE::Settings().
|
inlineoverridevirtual |
Implements PNS::DRAG_ALGO.
Definition at line 113 of file pns_component_dragger.h.
References m_dragStatus.
|
inlinevirtualinherited |
Reimplemented in PNS::MULTI_DRAGGER.
Definition at line 125 of file pns_drag_algo.h.
|
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(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
inlineoverridevirtual |
Implements PNS::DRAG_ALGO.
Definition at line 108 of file pns_component_dragger.h.
References PNS::DM_COMPONENT.
|
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(), FixRoute(), PNS::DRAGGER::FixRoute(), PNS::MULTI_DRAGGER::FixRoute(), PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), 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::LINE_PLACER::Start(), PNS::MEANDER_PLACER::Start(), PNS::MEANDER_SKEW_PLACER::Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), 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 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().
|
inlineinherited |
Definition at line 65 of file pns_algo_base.h.
References PNS::ALGO_BASE::m_logger.
Referenced by PNS::LINE_PLACER::rhWalkBase(), PNS::DRAGGER::tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().
|
inlinevirtualinherited |
Reimplemented in PNS::DRAGGER, and PNS::MULTI_DRAGGER.
Definition at line 119 of file pns_drag_algo.h.
|
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::MULTI_DRAGGER::Drag(), PNS::DRAGGER::dragMarkObstacles(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), FixRoute(), PNS::MULTI_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(), PNS::WALKAROUND::singleStep(), PNS::LINE_PLACER::Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::tryWalkaround(), PNS::MULTI_DRAGGER::tryWalkaround(), PNS::LINE_PLACER::UnfixRoute(), and PNS::WALKAROUND::WALKAROUND().
|
inlinevirtualinherited |
Function SetWorld()
Sets the board to work on.
Definition at line 61 of file pns_drag_algo.h.
References PNS::DRAG_ALGO::m_world.
Function Start()
Starts routing a single track at point aP, taking item aStartItem as anchor (unless NULL). Returns true if a dragging operation has started.
Implements PNS::DRAG_ALGO.
Definition at line 48 of file pns_component_dragger.cpp.
References PNS::ITEM::ARC_T, PNS::NODE::AssembleLine(), PNS::COMPONENT_DRAGGER::DRAGGED_CONNECTION::attachedPad, SHAPE_LINE_CHAIN::BBox(), PNS::LINE::CLine(), PNS::ITEM::Collide(), PNS::ITEM_SET::Contains(), SHAPE_LINE_CHAIN::CPoint(), PNS::NODE::FindJoint(), PNS::SOLID::Hull(), PNS::ITEM_SET::Items(), PNS::ITEM::Layer(), PNS::ITEM::Layers(), PNS::JOINT::LinkCount(), PNS::JOINT::LinkList(), PNS::LINK_HOLDER::Links(), m_conns, m_currentNode, m_fixedItems, m_initialDraggedItems, m_p0, m_solids, PNS::DRAG_ALGO::m_world, PNS::JOINT::Net(), PNS::COMPONENT_DRAGGER::DRAGGED_CONNECTION::offset, PNS::COMPONENT_DRAGGER::DRAGGED_CONNECTION::origLine, PNS::SOLID::Pos(), PNS::NODE::QueryJoints(), PNS::ITEM::SEGMENT_T, and PNS::ITEM::SOLID_T.
|
overridevirtual |
Function Traces()
Returns the set of dragged items.
Implements PNS::DRAG_ALGO.
Definition at line 270 of file pns_component_dragger.cpp.
References m_draggedItems.
|
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().
|
private |
Definition at line 130 of file pns_component_dragger.h.
|
private |
Definition at line 135 of file pns_component_dragger.h.
Referenced by COMPONENT_DRAGGER(), CurrentNode(), Drag(), and Start().
|
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 133 of file pns_component_dragger.h.
Referenced by Drag(), FixRoute(), and Traces().
|
private |
Definition at line 132 of file pns_component_dragger.h.
Referenced by COMPONENT_DRAGGER(), and GetForceMarkObstaclesMode().
|
private |
Definition at line 129 of file pns_component_dragger.h.
|
private |
Definition at line 134 of file pns_component_dragger.h.
|
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 136 of file pns_component_dragger.h.
|
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::DIFF_PAIR_PLACER::updateLeadingRatLine(), PNS::LINE_PLACER::updateLeadingRatLine(), and PNS::ALGO_BASE::VisibleViewArea().
|
private |
Definition at line 128 of file pns_component_dragger.h.
|
protectedinherited |
Definition at line 128 of file pns_drag_algo.h.
Referenced by PNS::DRAGGER::checkVirtualVia(), CurrentNode(), PNS::DRAGGER::CurrentNode(), PNS::MULTI_DRAGGER::CurrentNode(), Drag(), PNS::DRAGGER::dragMarkObstacles(), PNS::DRAGGER::dragViaWalkaround(), PNS::DRAGGER::dragWalkaround(), PNS::MULTI_DRAGGER::MULTI_DRAGGER(), PNS::MULTI_DRAGGER::multidragMarkObstacles(), PNS::MULTI_DRAGGER::multidragWalkaround(), PNS::DRAG_ALGO::SetWorld(), Start(), PNS::DRAGGER::Start(), PNS::MULTI_DRAGGER::Start(), PNS::DRAGGER::startDragArc(), PNS::DRAGGER::startDragSegment(), and PNS::DRAGGER::startDragVia().