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

MULTI_DRAGGER. More...

#include <pns_multi_dragger.h>

Inheritance diagram for PNS::MULTI_DRAGGER:
PNS::DRAG_ALGO PNS::ALGO_BASE

Classes

struct  MDRAG_LINE
 

Public Member Functions

 MULTI_DRAGGER (ROUTER *aRouter)
 
 ~MULTI_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 ITEM_SET Traces () override
 Function Traces()
 
void SetMode (PNS::DRAG_MODE aDragMode) override
 
PNS::DRAG_MODE Mode () const override
 
virtual std::vector< PNS::ITEM * > GetLastCommittedLeaderSegments () override
 
virtual bool GetForceMarkObstaclesMode (bool *aDragStatus) const override
 
virtual void SetWorld (NODE *aWorld)
 Function SetWorld()
 
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

bool multidragMarkObstacles (std::vector< MDRAG_LINE > &aCompletedLines)
 
bool multidragShove (std::vector< MDRAG_LINE > &aCompletedLines)
 
bool multidragWalkaround (std::vector< MDRAG_LINE > &aCompletedLines)
 
void restoreLeaderSegments (std::vector< MDRAG_LINE > &aCompletedLines)
 
int findNewLeaderSegment (const MDRAG_LINE &aLine) const
 
bool tryWalkaround (NODE *aNode, LINE &aOrig, LINE &aWalk)
 

Private Attributes

int m_mode
 
bool m_dragStatus
 
PNS_MODE m_currentMode
 
DRAG_MODE m_dragMode
 
std::vector< MDRAG_LINEm_mdragLines
 
std::vector< PNS::ITEM * > m_leaderSegments
 
NODEm_lastNode
 
NODEm_preShoveNode
 
ITEM_SET m_origDraggedItems
 
ITEM_SET m_draggedItems
 
VECTOR2I m_dragStartPoint
 
SEG m_guide
 
std::unique_ptr< SHOVEm_shove
 

Detailed Description

MULTI_DRAGGER.

Dragging algorithm for multiple segments. Very trival version for demonstration purposes.

Definition at line 46 of file pns_multi_dragger.h.

Constructor & Destructor Documentation

◆ MULTI_DRAGGER()

PNS::MULTI_DRAGGER::MULTI_DRAGGER ( ROUTER aRouter)

Definition at line 30 of file pns_multi_dragger.cpp.

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

◆ ~MULTI_DRAGGER()

PNS::MULTI_DRAGGER::~MULTI_DRAGGER ( )

Definition at line 37 of file pns_multi_dragger.cpp.

Member Function Documentation

◆ CurrentLayer()

int PNS::MULTI_DRAGGER::CurrentLayer ( ) const
overridevirtual

Function CurrentLayer()

Returns the layer of currently routed track.

Implements PNS::DRAG_ALGO.

Definition at line 938 of file pns_multi_dragger.cpp.

◆ CurrentNets()

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

Function CurrentNets()

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

Implements PNS::DRAG_ALGO.

Definition at line 329 of file pns_multi_dragger.cpp.

References m_mdragLines.

◆ CurrentNode()

NODE * PNS::MULTI_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 926 of file pns_multi_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(), Drag(), PNS::DRAGGER::dragShove(), PNS::DRAGGER::dragWalkaround(), findNewLeaderSegment(), PNS::SHOVE::fixupViaCollisions(), PNS::LINE_PLACER::handlePullback(), PNS::LINE_PLACER::mergeHead(), PNS::DP_MEANDER_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), multidragShove(), 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(), Start(), PNS::SHOVE::touchRootLine(), PNS::LINE_PLACER::Trace(), PNS::DRAGGER::tryWalkaround(), tryWalkaround(), and PNS::SHOVE::unwindLineStack().

◆ Drag()

◆ findNewLeaderSegment()

◆ FixRoute()

bool PNS::MULTI_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 344 of file pns_multi_dragger.cpp.

References PNS::ROUTER::CommitRouting(), CurrentNode(), m_dragStatus, PNS::ALGO_BASE::Router(), and PNS::ALGO_BASE::Settings().

◆ GetForceMarkObstaclesMode()

virtual bool PNS::MULTI_DRAGGER::GetForceMarkObstaclesMode ( bool *  aDragStatus) const
inlineoverridevirtual

Implements PNS::DRAG_ALGO.

Definition at line 114 of file pns_multi_dragger.h.

References m_dragStatus.

◆ GetLastCommittedLeaderSegments()

virtual std::vector< PNS::ITEM * > PNS::MULTI_DRAGGER::GetLastCommittedLeaderSegments ( )
inlineoverridevirtual

Reimplemented from PNS::DRAG_ALGO.

Definition at line 112 of file pns_multi_dragger.h.

References m_leaderSegments.

◆ Logger()

◆ Mode()

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

Implements PNS::DRAG_ALGO.

Definition at line 272 of file pns_multi_dragger.cpp.

References PNS::DM_CORNER.

Referenced by Drag(), and Start().

◆ multidragMarkObstacles()

bool PNS::MULTI_DRAGGER::multidragMarkObstacles ( std::vector< MDRAG_LINE > &  aCompletedLines)
private

◆ multidragShove()

◆ multidragWalkaround()

◆ restoreLeaderSegments()

void PNS::MULTI_DRAGGER::restoreLeaderSegments ( std::vector< MDRAG_LINE > &  aCompletedLines)
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(), PNS::DRAGGER::tryWalkaround(), and tryWalkaround().

◆ SetLogger()

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

◆ SetMode()

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

Reimplemented from PNS::DRAG_ALGO.

Definition at line 267 of file pns_multi_dragger.cpp.

◆ 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()

◆ Traces()

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

Function Traces()

Returns the set of dragged items.

Implements PNS::DRAG_ALGO.

Definition at line 932 of file pns_multi_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::MULTI_DRAGGER::m_currentMode
private

Definition at line 166 of file pns_multi_dragger.h.

◆ 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::MULTI_DRAGGER::m_draggedItems
private

Definition at line 173 of file pns_multi_dragger.h.

Referenced by Drag(), and Traces().

◆ m_dragMode

DRAG_MODE PNS::MULTI_DRAGGER::m_dragMode
private

Definition at line 167 of file pns_multi_dragger.h.

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

◆ m_dragStartPoint

VECTOR2I PNS::MULTI_DRAGGER::m_dragStartPoint
private

Definition at line 174 of file pns_multi_dragger.h.

Referenced by Drag(), and Start().

◆ m_dragStatus

bool PNS::MULTI_DRAGGER::m_dragStatus
private

Definition at line 165 of file pns_multi_dragger.h.

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

◆ m_guide

SEG PNS::MULTI_DRAGGER::m_guide
private

Definition at line 175 of file pns_multi_dragger.h.

Referenced by Drag(), and findNewLeaderSegment().

◆ m_lastNode

NODE* PNS::MULTI_DRAGGER::m_lastNode
private

◆ m_leaderSegments

std::vector<PNS::ITEM*> PNS::MULTI_DRAGGER::m_leaderSegments
private

◆ 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_mdragLines

std::vector<MDRAG_LINE> PNS::MULTI_DRAGGER::m_mdragLines
private

Definition at line 168 of file pns_multi_dragger.h.

Referenced by CurrentNets(), Drag(), multidragShove(), and Start().

◆ m_mode

int PNS::MULTI_DRAGGER::m_mode
private

Definition at line 164 of file pns_multi_dragger.h.

◆ m_origDraggedItems

ITEM_SET PNS::MULTI_DRAGGER::m_origDraggedItems
private

Definition at line 172 of file pns_multi_dragger.h.

Referenced by Drag(), and Start().

◆ m_preShoveNode

NODE* PNS::MULTI_DRAGGER::m_preShoveNode
private

Definition at line 171 of file pns_multi_dragger.h.

Referenced by Start().

◆ m_router

◆ m_shove

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

Definition at line 176 of file pns_multi_dragger.h.

Referenced by multidragShove(), and Start().

◆ m_world


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