KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::DRAGGER Class Reference

DRAGGER. More...

#include <pns_dragger.h>

Inheritance diagram for PNS::DRAGGER:
PNS::DRAG_ALGO PNS::ALGO_BASE

Public Member Functions

 DRAGGER (ROUTER *aRouter)
 
 ~DRAGGER ()
 
virtual 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()
 
NODECurrentNode () const override
 Function CurrentNode()
 
const std::vector< NET_HANDLECurrentNets () const override
 Function CurrentNets()
 
int CurrentLayer () const override
 Function CurrentLayer()
 
const LINEGetOriginalLine ()
 
const LINEGetLastDragSolution ()
 
const ITEM_SET Traces () override
 Function Traces()
 
void SetMode (PNS::DRAG_MODE aDragMode) override
 
PNS::DRAG_MODE Mode () const override
 
bool GetForceMarkObstaclesMode (bool *aDragStatus) const override
 
virtual void SetWorld (NODE *aWorld)
 Function SetWorld()
 
virtual std::vector< PNS::ITEM * > GetLastCommittedLeaderSegments ()
 
ROUTERRouter () const
 Return current router settings.
 
ROUTING_SETTINGSSettings () const
 Return the logger object, allowing to dump geometry to a file.
 
virtual LOGGERLogger ()
 
void SetLogger (LOGGER *aLogger)
 
void SetDebugDecorator (DEBUG_DECORATOR *aDecorator)
 Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.
 
DEBUG_DECORATORDbg () const
 
const BOX2IVisibleViewArea () const
 

Protected Attributes

NODEm_world
 
DEBUG_DECORATORm_debugDecorator
 
ROUTERm_router
 
LOGGERm_logger
 

Private Member Functions

const ITEM_SET findViaFanoutByHandle (NODE *aNode, const VIA_HANDLE &handle)
 
bool dragMarkObstacles (const VECTOR2I &aP)
 
bool dragShove (const VECTOR2I &aP)
 
bool dragWalkaround (const VECTOR2I &aP)
 
bool startDragSegment (const VECTOR2D &aP, SEGMENT *aSeg)
 
bool startDragArc (const VECTOR2D &aP, ARC *aArc)
 
bool startDragVia (VIA *aVia)
 
bool dragViaMarkObstacles (const VIA_HANDLE &aHandle, NODE *aNode, const VECTOR2I &aP)
 
bool dragViaWalkaround (const VIA_HANDLE &aHandle, NODE *aNode, const VECTOR2I &aP)
 
void optimizeAndUpdateDraggedLine (LINE &aDragged, const LINE &aOrig, const VECTOR2I &aP)
 
bool propagateViaForces (NODE *node, std::set< VIA * > &vias)
 
bool tryWalkaround (NODE *aNode, LINE &aOrig, LINE &aWalk)
 
VVIAcheckVirtualVia (const VECTOR2D &aP, SEGMENT *aSeg)
 

Private Attributes

VIA_HANDLE m_initialVia
 
VIA_HANDLE m_draggedVia
 
NODEm_lastNode
 
NODEm_preDragNode
 
int m_mode
 
LINE m_draggedLine
 
LINE m_lastDragSolution
 
std::unique_ptr< SHOVEm_shove
 
int m_draggedSegmentIndex
 
bool m_dragStatus
 
PNS_MODE m_currentMode
 
ITEM_SET m_origViaConnections
 
VECTOR2D m_lastValidPoint
 Contains the list of items that are currently modified by the dragger.
 
ITEM_SET m_draggedItems
 If true, moves the connection lines without maintaining 45 degrees corners.
 
bool m_freeAngleMode
 
bool m_forceMarkObstaclesMode
 
MOUSE_TRAIL_TRACER m_mouseTrailTracer
 

Detailed Description

DRAGGER.

Via, segment and corner dragging algorithm.

Definition at line 47 of file pns_dragger.h.

Constructor & Destructor Documentation

◆ DRAGGER()

PNS::DRAGGER::DRAGGER ( ROUTER aRouter)

Definition at line 32 of file pns_dragger.cpp.

◆ ~DRAGGER()

PNS::DRAGGER::~DRAGGER ( )

Definition at line 48 of file pns_dragger.cpp.

Member Function Documentation

◆ checkVirtualVia()

VVIA * PNS::DRAGGER::checkVirtualVia ( const VECTOR2D aP,
SEGMENT aSeg 
)
private

◆ CurrentLayer()

int PNS::DRAGGER::CurrentLayer ( ) const
inlineoverridevirtual

Function CurrentLayer()

Returns the layer of currently routed track.

Implements PNS::DRAG_ALGO.

Definition at line 98 of file pns_dragger.h.

References PNS::ITEM::Layer(), and m_draggedLine.

◆ CurrentNets()

const std::vector< NET_HANDLE > PNS::DRAGGER::CurrentNets ( ) const
overridevirtual

Function CurrentNets()

Returns the net(s) of currently routed track(s).

Implements PNS::DRAG_ALGO.

Definition at line 292 of file pns_dragger.cpp.

References PNS::DM_VIA, m_draggedLine, m_draggedVia, m_mode, PNS::ITEM::Net(), and PNS::VIA_HANDLE::net.

◆ CurrentNode()

NODE * PNS::DRAGGER::CurrentNode ( ) const
overridevirtual

Function CurrentNode()

Returns the most recent world state, including all items changed due to dragging operation.

Implements PNS::DRAG_ALGO.

Definition at line 804 of file pns_dragger.cpp.

References m_lastNode, and PNS::DRAG_ALGO::m_world.

Referenced by FixRoute().

◆ Dbg()

DEBUG_DECORATOR * PNS::ALGO_BASE::Dbg ( ) const
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(), PNS::COMPONENT_DRAGGER::Drag(), PNS::MULTI_DRAGGER::Drag(), dragShove(), 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(), 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(), Start(), PNS::MULTI_DRAGGER::Start(), PNS::SHOVE::touchRootLine(), PNS::LINE_PLACER::Trace(), tryWalkaround(), PNS::MULTI_DRAGGER::tryWalkaround(), and PNS::SHOVE::unwindLineStack().

◆ Drag()

◆ dragMarkObstacles()

◆ dragShove()

◆ dragViaMarkObstacles()

◆ dragViaWalkaround()

◆ dragWalkaround()

◆ findViaFanoutByHandle()

◆ FixRoute()

bool PNS::DRAGGER::FixRoute ( bool  aForceCommit)
overridevirtual

Function FixRoute()

Checks if the result of current dragging operation is correct and eventually commits it to the world.

Returns
true, if dragging finished with success.

Implements PNS::DRAG_ALGO.

Definition at line 721 of file pns_dragger.cpp.

References PNS::ROUTER::CommitRouting(), CurrentNode(), Drag(), m_dragStatus, m_forceMarkObstaclesMode, m_lastValidPoint, and PNS::ALGO_BASE::Router().

◆ GetForceMarkObstaclesMode()

bool PNS::DRAGGER::GetForceMarkObstaclesMode ( bool *  aDragStatus) const
inlineoverridevirtual

Implements PNS::DRAG_ALGO.

Definition at line 124 of file pns_dragger.h.

References m_dragStatus, and m_forceMarkObstaclesMode.

◆ GetLastCommittedLeaderSegments()

virtual std::vector< PNS::ITEM * > PNS::DRAG_ALGO::GetLastCommittedLeaderSegments ( )
inlinevirtualinherited

Reimplemented in PNS::MULTI_DRAGGER.

Definition at line 125 of file pns_drag_algo.h.

◆ GetLastDragSolution()

const LINE & PNS::DRAGGER::GetLastDragSolution ( )
inline

Definition at line 108 of file pns_dragger.h.

References m_lastDragSolution.

◆ GetOriginalLine()

const LINE & PNS::DRAGGER::GetOriginalLine ( )
inline

Definition at line 103 of file pns_dragger.h.

References m_draggedLine.

Referenced by PNS::TOOL_BASE::checkSnap().

◆ Logger()

◆ Mode()

PNS::DRAG_MODE PNS::DRAGGER::Mode ( ) const
overridevirtual

Implements PNS::DRAG_ALGO.

Definition at line 286 of file pns_dragger.cpp.

References m_mode.

◆ optimizeAndUpdateDraggedLine()

◆ propagateViaForces()

bool PNS::DRAGGER::propagateViaForces ( NODE node,
std::set< VIA * > &  vias 
)
private

◆ Router()

◆ 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 PNS::ALGO_BASE::m_debugDecorator.

Referenced by PNS::SHOVE::onCollidingSolid(), PNS::LINE_PLACER::rhWalkBase(), PNS::SHOVE::SHOVE(), tryWalkaround(), and PNS::MULTI_DRAGGER::tryWalkaround().

◆ SetLogger()

void PNS::ALGO_BASE::SetLogger ( LOGGER aLogger)
inlineinherited

◆ SetMode()

void PNS::DRAGGER::SetMode ( PNS::DRAG_MODE  aDragMode)
overridevirtual

Reimplemented from PNS::DRAG_ALGO.

Definition at line 280 of file pns_dragger.cpp.

References m_mode.

◆ Settings()

◆ SetWorld()

virtual void PNS::DRAG_ALGO::SetWorld ( NODE aWorld)
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.

◆ Start()

◆ startDragArc()

bool PNS::DRAGGER::startDragArc ( const VECTOR2D aP,
ARC aArc 
)
private

◆ startDragSegment()

◆ startDragVia()

bool PNS::DRAGGER::startDragVia ( VIA aVia)
private

◆ Traces()

const ITEM_SET PNS::DRAGGER::Traces ( )
overridevirtual

Function Traces()

Returns the set of dragged items.

Implements PNS::DRAG_ALGO.

Definition at line 810 of file pns_dragger.cpp.

References m_draggedItems.

◆ tryWalkaround()

◆ VisibleViewArea()

const BOX2I & PNS::ALGO_BASE::VisibleViewArea ( ) const
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().

Member Data Documentation

◆ m_currentMode

PNS_MODE PNS::DRAGGER::m_currentMode
private

Definition at line 158 of file pns_dragger.h.

Referenced by Drag(), and Start().

◆ m_debugDecorator

DEBUG_DECORATOR* PNS::ALGO_BASE::m_debugDecorator
protectedinherited

Definition at line 86 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Dbg(), and PNS::ALGO_BASE::SetDebugDecorator().

◆ m_draggedItems

ITEM_SET PNS::DRAGGER::m_draggedItems
private

If true, moves the connection lines without maintaining 45 degrees corners.

Definition at line 163 of file pns_dragger.h.

Referenced by Drag(), dragMarkObstacles(), dragShove(), dragViaMarkObstacles(), dragViaWalkaround(), optimizeAndUpdateDraggedLine(), Start(), and Traces().

◆ m_draggedLine

LINE PNS::DRAGGER::m_draggedLine
private

◆ m_draggedSegmentIndex

int PNS::DRAGGER::m_draggedSegmentIndex
private

◆ m_draggedVia

VIA_HANDLE PNS::DRAGGER::m_draggedVia
private

Definition at line 148 of file pns_dragger.h.

Referenced by CurrentNets(), dragShove(), and startDragVia().

◆ m_dragStatus

bool PNS::DRAGGER::m_dragStatus
private

◆ m_forceMarkObstaclesMode

bool PNS::DRAGGER::m_forceMarkObstaclesMode
private

◆ m_freeAngleMode

bool PNS::DRAGGER::m_freeAngleMode
private

◆ m_initialVia

VIA_HANDLE PNS::DRAGGER::m_initialVia
private

Definition at line 147 of file pns_dragger.h.

Referenced by dragMarkObstacles(), dragWalkaround(), and startDragVia().

◆ m_lastDragSolution

LINE PNS::DRAGGER::m_lastDragSolution
private

Definition at line 154 of file pns_dragger.h.

Referenced by Drag(), dragShove(), GetLastDragSolution(), and startDragSegment().

◆ m_lastNode

◆ m_lastValidPoint

VECTOR2D PNS::DRAGGER::m_lastValidPoint
private

Contains the list of items that are currently modified by the dragger.

Definition at line 160 of file pns_dragger.h.

Referenced by Drag(), FixRoute(), and Start().

◆ m_logger

LOGGER* PNS::ALGO_BASE::m_logger
protectedinherited

Definition at line 88 of file pns_algo_base.h.

Referenced by PNS::ALGO_BASE::Logger(), and PNS::ALGO_BASE::SetLogger().

◆ m_mode

int PNS::DRAGGER::m_mode
private

◆ m_mouseTrailTracer

MOUSE_TRAIL_TRACER PNS::DRAGGER::m_mouseTrailTracer
private

Definition at line 168 of file pns_dragger.h.

Referenced by Drag(), propagateViaForces(), and Start().

◆ m_origViaConnections

ITEM_SET PNS::DRAGGER::m_origViaConnections
private

Definition at line 159 of file pns_dragger.h.

◆ m_preDragNode

NODE* PNS::DRAGGER::m_preDragNode
private

Definition at line 151 of file pns_dragger.h.

Referenced by Start().

◆ m_router

◆ m_shove

std::unique_ptr<SHOVE> PNS::DRAGGER::m_shove
private

Definition at line 155 of file pns_dragger.h.

Referenced by dragShove(), and Start().

◆ m_world


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