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() More...
 
bool Drag (const VECTOR2I &aP) override
 Function Drag() More...
 
bool FixRoute (bool aForceCommit) override
 Function FixRoute() More...
 
NODECurrentNode () const override
 Function CurrentNode() More...
 
const std::vector< NET_HANDLECurrentNets () const override
 Function CurrentNets() More...
 
int CurrentLayer () const override
 Function CurrentLayer() More...
 
const LINEGetOriginalLine ()
 
const LINEGetLastDragSolution ()
 
const ITEM_SET Traces () override
 Function Traces() More...
 
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() More...
 
ROUTERRouter () const
 Return current router settings. More...
 
ROUTING_SETTINGSSettings () const
 Return the logger object, allowing to dump geometry to a file. More...
 
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. More...
 
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
 
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. More...
 
ITEM_SET m_draggedItems
 If true, moves the connection lines without maintaining 45 degrees corners. More...
 
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 286 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 787 of file pns_dragger.cpp.

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

Referenced by FixRoute().

◆ Dbg()

◆ Drag()

bool PNS::DRAGGER::Drag ( const VECTOR2I aP)
overridevirtual

Function Drag()

Drags the current segment/corner/via to the point aP.

Returns
true, if dragging finished with success.

Implements PNS::DRAG_ALGO.

Definition at line 748 of file pns_dragger.cpp.

References PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PNS::ITEM_SET::Clear(), dragMarkObstacles(), dragShove(), dragWalkaround(), m_currentMode, m_draggedItems, m_forceMarkObstaclesMode, m_freeAngleMode, m_lastNode, m_lastValidPoint, m_mouseTrailTracer, PNS::RM_MarkObstacles, PNS::RM_Shove, and PNS::RM_Walkaround.

Referenced by FixRoute().

◆ 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 707 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.

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

LOGGER * PNS::ALGO_BASE::Logger ( )
virtualinherited

◆ Mode()

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

Implements PNS::DRAG_ALGO.

Definition at line 280 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(), and tryWalkaround().

◆ SetLogger()

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

Definition at line 65 of file pns_algo_base.h.

References PNS::ALGO_BASE::m_logger.

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

◆ SetMode()

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

Reimplemented from PNS::DRAG_ALGO.

Definition at line 274 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 793 of file pns_dragger.cpp.

References m_draggedItems.

◆ tryWalkaround()

◆ VisibleViewArea()

const BOX2I & PNS::ALGO_BASE::VisibleViewArea ( ) const
inherited

Member Data Documentation

◆ m_currentMode

PNS_MODE PNS::DRAGGER::m_currentMode
private

Definition at line 157 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 162 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 153 of file pns_dragger.h.

Referenced by 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 159 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 167 of file pns_dragger.h.

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

◆ m_origViaConnections

ITEM_SET PNS::DRAGGER::m_origViaConnections
private

Definition at line 158 of file pns_dragger.h.

◆ m_router

◆ m_shove

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

Definition at line 154 of file pns_dragger.h.

Referenced by dragShove(), Start(), startDragArc(), and startDragSegment().

◆ m_world


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