![]() |
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() More... | |
bool | Drag (const VECTOR2I &aP) override |
Function Drag() More... | |
bool | FixRoute () override |
Function FixRoute() More... | |
NODE * | CurrentNode () const override |
Function CurrentNode() More... | |
const std::vector< int > | CurrentNets () const override |
Function CurrentNets() More... | |
virtual int | CurrentLayer () const override |
Function CurrentLayer() More... | |
const ITEM_SET | Traces () override |
Function Traces() More... | |
virtual void | SetWorld (NODE *aWorld) |
Function SetWorld() More... | |
virtual void | SetMode (int aDragMode) |
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 | |
NODE * | m_world |
DEBUG_DECORATOR * | m_debugDecorator |
ROUTER * | m_router |
LOGGER * | m_logger |
Private Attributes | |
std::set< SOLID * > | m_solids |
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 42 of file pns_component_dragger.h.
PNS::COMPONENT_DRAGGER::COMPONENT_DRAGGER | ( | ROUTER * | aRouter | ) |
Definition at line 34 of file pns_component_dragger.cpp.
References m_currentNode, and m_dragStatus.
PNS::COMPONENT_DRAGGER::~COMPONENT_DRAGGER | ( | ) |
Definition at line 42 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 99 of file pns_component_dragger.h.
References UNDEFINED_LAYER.
|
inlineoverridevirtual |
Function CurrentNets()
Returns the net code(s) of currently dragged item(s). Currently unused for component dragging.
Implements PNS::DRAG_ALGO.
Definition at line 88 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 182 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::MEANDER_PLACER::doMove(), 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(), PNS::WALKAROUND::singleStep(), PNS::DRAGGER::Start(), and PNS::DRAGGER::tryWalkaround().
|
overridevirtual |
Function Drag()
Drags the current segment/corner/via to the point aP.
Implements PNS::DRAG_ALGO.
Definition at line 112 of file pns_component_dragger.cpp.
References PNS::ITEM_SET::Add(), PNS::NODE::Add(), PNS::DEBUG_DECORATOR::AddLine(), PNS::NODE::Branch(), PNS::ITEM_SET::Clear(), PNS::SOLID::Clone(), PNS::ALGO_BASE::Dbg(), PNS::ITEM_SET::Items(), PNS::NODE::KillChildren(), m_conns, m_currentNode, m_draggedItems, m_initialDraggedItems, m_p0, m_solids, PNS::DRAG_ALGO::m_world, PNS::SOLID::Pos(), and PNS::NODE::Remove().
|
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 160 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().
|
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().
|
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(), 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().
|
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().
|
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().
|
inlinevirtualinherited |
|
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(), 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().
|
inlinevirtualinherited |
Function SetWorld()
Sets the board to work on.
Definition at line 60 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 47 of file pns_component_dragger.cpp.
References PNS::ITEM::ARC_T, PNS::NODE::AssembleLine(), PNS::COMPONENT_DRAGGER::DRAGGED_CONNECTION::attachedPad, PNS::ITEM::Collide(), PNS::NODE::FindJoint(), PNS::ITEM_SET::Items(), m_conns, m_currentNode, m_initialDraggedItems, m_p0, m_solids, PNS::DRAG_ALGO::m_world, PNS::COMPONENT_DRAGGER::DRAGGED_CONNECTION::offset, PNS::COMPONENT_DRAGGER::DRAGGED_CONNECTION::origLine, 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 187 of file pns_component_dragger.cpp.
References m_draggedItems.
|
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().
|
private |
Definition at line 121 of file pns_component_dragger.h.
|
private |
Definition at line 126 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 124 of file pns_component_dragger.h.
Referenced by Drag(), FixRoute(), and Traces().
|
private |
Definition at line 123 of file pns_component_dragger.h.
Referenced by COMPONENT_DRAGGER().
|
private |
Definition at line 125 of file pns_component_dragger.h.
|
protectedinherited |
Definition at line 88 of file pns_algo_base.h.
Referenced by PNS::ALGO_BASE::SetLogger(), and PNS::WALKAROUND::singleStep().
|
private |
Definition at line 127 of file pns_component_dragger.h.
|
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 120 of file pns_component_dragger.h.
|
protectedinherited |
Definition at line 118 of file pns_drag_algo.h.
Referenced by CurrentNode(), PNS::DRAGGER::CurrentNode(), Drag(), PNS::DRAGGER::DRAGGER(), PNS::DRAGGER::dragMarkObstacles(), PNS::DRAGGER::dragViaWalkaround(), PNS::DRAGGER::dragWalkaround(), PNS::DRAG_ALGO::SetWorld(), Start(), PNS::DRAGGER::Start(), PNS::DRAGGER::startDragArc(), and PNS::DRAGGER::startDragSegment().