KiCad PCB EDA Suite
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 () override
 Function FixRoute() More...
 
NODECurrentNode () const override
 Function CurrentNode() More...
 
const std::vector< int > CurrentNets () 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
 
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
 
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.

32 :
33 DRAG_ALGO( aRouter ),
34 m_initialVia( {} ),
35 m_draggedVia( {} )
36{
37 m_world = nullptr;
38 m_lastNode = nullptr;
41 m_dragStatus = false;
43 m_freeAngleMode = false;
44}
bool m_dragStatus
Definition: pns_dragger.h:150
int m_draggedSegmentIndex
Definition: pns_dragger.h:149
NODE * m_lastNode
Definition: pns_dragger.h:144
VIA_HANDLE m_draggedVia
Definition: pns_dragger.h:142
bool m_freeAngleMode
Definition: pns_dragger.h:159
PNS_MODE m_currentMode
Definition: pns_dragger.h:151
VIA_HANDLE m_initialVia
Definition: pns_dragger.h:141
DRAG_ALGO(ROUTER *aRouter)
Definition: pns_drag_algo.h:46
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ DM_SEGMENT
Definition: pns_router.h:73

◆ ~DRAGGER()

PNS::DRAGGER::~DRAGGER ( )

Definition at line 47 of file pns_dragger.cpp.

48{
49}

Member Function Documentation

◆ checkVirtualVia()

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

Definition at line 71 of file pns_dragger.cpp.

72{
73 int w2 = aSeg->Width() / 2;
74
75 auto distA = ( aP - aSeg->Seg().A ).EuclideanNorm();
76 auto distB = ( aP - aSeg->Seg().B ).EuclideanNorm();
77
78 VECTOR2I psnap;
79
80 if( distA <= w2 )
81 {
82 psnap = aSeg->Seg().A;
83 }
84 else if( distB <= w2 )
85 {
86 psnap = aSeg->Seg().B;
87 }
88 else
89 {
90 return nullptr;
91 }
92
93 JOINT *jt = m_world->FindJoint( psnap, aSeg );
94
95 if ( !jt )
96 {
97 return nullptr;
98 }
99
100 for( auto& lnk : jt->LinkList() )
101 {
102 if( lnk.item->IsVirtual() && lnk.item->OfKind( ITEM::VIA_T ))
103 {
104 return static_cast<VVIA*>( lnk.item );
105 }
106 }
107
108 return nullptr;
109}
JOINT * FindJoint(const VECTOR2I &aPos, int aLayer, int aNet)
Search for a joint at a given position, layer and belonging to given net.
Definition: pns_node.cpp:1197
double EuclideanNorm(const VECTOR2I &vector)
Definition: trigo.h:129

References SEG::A, SEG::B, EuclideanNorm(), PNS::NODE::FindJoint(), PNS::JOINT::LinkList(), PNS::DRAG_ALGO::m_world, PNS::SEGMENT::Seg(), PNS::ITEM::VIA_T, and PNS::SEGMENT::Width().

Referenced by Start().

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

99 {
100 return m_draggedLine.Layer();
101 }
LINE m_draggedLine
Definition: pns_dragger.h:146
virtual int Layer() const
Definition: pns_item.h:160

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

◆ CurrentNets()

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

Function CurrentNets()

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

Implements PNS::DRAG_ALGO.

Definition at line 273 of file pns_dragger.cpp.

274{
275 if( m_mode == PNS::DM_VIA )
276 return std::vector<int>( 1, m_draggedVia.net );
277 else
278 return std::vector<int>( 1, m_draggedLine.Net() );
279}
int Net() const
Definition: pns_item.h:154
@ DM_VIA
Definition: pns_router.h:74

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 758 of file pns_dragger.cpp.

759{
760 return m_lastNode ? m_lastNode : m_world;
761}

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.

79 {
80 return m_debugDecorator;
81 }
DEBUG_DECORATOR * m_debugDecorator
Definition: pns_algo_base.h:86

References PNS::ALGO_BASE::m_debugDecorator.

Referenced by PNS::LINE_PLACER::buildInitialLine(), PNS::LINE_PLACER::clipAndCheckCollisions(), PNS::MEANDER_PLACER::doMove(), PNS::COMPONENT_DRAGGER::Drag(), dragShove(), dragWalkaround(), PNS::SHOVE::fixupViaCollisions(), PNS::LINE_PLACER::handlePullback(), PNS::LINE_PLACER::mergeHead(), PNS::DP_MEANDER_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), 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::pushLineStack(), PNS::SHOVE::pushOrShoveVia(), PNS::LINE_PLACER::reduceTail(), PNS::LINE_PLACER::removeLoops(), PNS::SHOVE::replaceLine(), PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::rhWalkOnly(), PNS::LINE_PLACER::routeStep(), PNS::SHOVE::runOptimizer(), PNS::SHOVE::shoveIteration(), PNS::SHOVE::ShoveLines(), PNS::SHOVE::shoveLineToHullSet(), PNS::SHOVE::shoveMainLoop(), PNS::SHOVE::ShoveMultiLines(), PNS::SHOVE::ShoveObstacleLine(), PNS::WALKAROUND::singleStep(), PNS::LINE_PLACER::splitHeadTail(), PNS::LINE_PLACER::Start(), Start(), PNS::LINE_PLACER::Trace(), tryWalkaround(), and PNS::SHOVE::unwindLineStack().

◆ 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 730 of file pns_dragger.cpp.

731{
733
734 bool ret = false;
735
736 if( m_freeAngleMode )
737 {
738 ret = dragMarkObstacles( aP );
739 }
740 else
741 {
742 switch( m_currentMode )
743 {
744 case RM_MarkObstacles: ret = dragMarkObstacles( aP ); break;
745 case RM_Shove: ret = dragShove( aP ); break;
746 case RM_Walkaround: ret = dragWalkaround( aP ); break;
747 default: break;
748 }
749 }
750
751 if( ret )
752 m_lastValidPoint = aP;
753
754 return ret;
755}
VECTOR2D m_lastValidPoint
Contains the list of items that are currently modified by the dragger.
Definition: pns_dragger.h:153
bool dragShove(const VECTOR2I &aP)
bool dragMarkObstacles(const VECTOR2I &aP)
bool dragWalkaround(const VECTOR2I &aP)
MOUSE_TRAIL_TRACER m_mouseTrailTracer
Definition: pns_dragger.h:160
void AddTrailPoint(const VECTOR2I &aP)
@ RM_Walkaround
Only walk around.
@ RM_Shove
Only shove.

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

Referenced by FixRoute().

◆ dragMarkObstacles()

bool PNS::DRAGGER::dragMarkObstacles ( const VECTOR2I aP)
private

Definition at line 282 of file pns_dragger.cpp.

283{
284 // fixme: rewrite using shared_ptr...
285 if( m_lastNode )
286 {
287 delete m_lastNode;
288 m_lastNode = nullptr;
289 }
290
292
293 switch( m_mode )
294 {
295 case DM_SEGMENT:
296 case DM_CORNER:
297 {
298 //TODO: Make threshold configurable
299 int thresh = Settings().SmoothDraggedSegments() ? m_draggedLine.Width() / 4 : 0;
300 LINE origLine( m_draggedLine );
301 LINE dragged( m_draggedLine );
302 dragged.SetSnapThreshhold( thresh );
303 dragged.ClearLinks();
304
305 if( m_mode == DM_SEGMENT )
306 dragged.DragSegment( aP, m_draggedSegmentIndex );
307 else
308 dragged.DragCorner( aP, m_draggedSegmentIndex, m_freeAngleMode );
309
310 m_lastNode->Remove( origLine );
311 m_lastNode->Add( dragged );
312
314 m_draggedItems.Add( dragged );
315
316 break;
317 }
318
319 case DM_VIA: // fixme...
320 {
322
323 break;
324 }
325 }
326
327 if( Settings().AllowDRCViolations() )
328 m_dragStatus = true;
329 else
331
332 return true;
333}
ROUTING_SETTINGS & Settings() const
Return the logger object, allowing to dump geometry to a file.
ITEM_SET m_draggedItems
If true, moves the connection lines without maintaining 45 degrees corners.
Definition: pns_dragger.h:156
bool dragViaMarkObstacles(const VIA_HANDLE &aHandle, NODE *aNode, const VECTOR2I &aP)
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32
int Width() const
Return true if the line is geometrically identical as line aOther.
Definition: pns_line.h:161
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
Definition: pns_node.cpp:139
OPT_OBSTACLE CheckColliding(const ITEM *aItem, int aKindMask=ITEM::ANY_T)
Check if the item collides with anything else in the world, and if found, returns the obstacle.
Definition: pns_node.cpp:472
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
Definition: pns_node.cpp:664
void Remove(ARC *aArc)
Remove an item from this branch.
Definition: pns_node.cpp:889
bool SmoothDraggedSegments() const
Enable/disable smoothing segments during dragging.
@ DM_CORNER
Definition: pns_router.h:72

References PNS::ITEM_SET::Add(), PNS::NODE::Add(), PNS::NODE::Branch(), PNS::NODE::CheckColliding(), PNS::ITEM_SET::Clear(), PNS::LINK_HOLDER::ClearLinks(), PNS::DM_CORNER, PNS::DM_SEGMENT, PNS::DM_VIA, PNS::LINE::DragCorner(), PNS::LINE::DragSegment(), dragViaMarkObstacles(), m_draggedItems, m_draggedLine, m_draggedSegmentIndex, m_dragStatus, m_freeAngleMode, m_initialVia, m_lastNode, m_mode, PNS::DRAG_ALGO::m_world, PNS::NODE::Remove(), PNS::LINE::SetSnapThreshhold(), PNS::ALGO_BASE::Settings(), PNS::ROUTING_SETTINGS::SmoothDraggedSegments(), and PNS::LINE::Width().

Referenced by Drag().

◆ dragShove()

bool PNS::DRAGGER::dragShove ( const VECTOR2I aP)
private

Definition at line 615 of file pns_dragger.cpp.

616{
617 bool ok = false;
618
619 if( m_lastNode )
620 {
621 delete m_lastNode;
622 m_lastNode = nullptr;
623 }
624
625 switch( m_mode )
626 {
627 case DM_SEGMENT:
628 case DM_CORNER:
629 {
630 //TODO: Make threshold configurable
631 int thresh = Settings().SmoothDraggedSegments() ? m_draggedLine.Width() / 2 : 0;
632 LINE dragged( m_draggedLine );
633 dragged.SetSnapThreshhold( thresh );
634
635 if( m_mode == DM_SEGMENT )
636 dragged.DragSegment( aP, m_draggedSegmentIndex );
637 else
638 dragged.DragCorner( aP, m_draggedSegmentIndex );
639
640 PNS_DBG( Dbg(), AddShape, &dragged.CLine(), BLUE, 5000, wxT( "drag-shove-line" ) );
641
642 SHOVE::SHOVE_STATUS st = m_shove->ShoveLines( dragged );
643
644 if( st == SHOVE::SH_OK )
645 {
646 ok = true;
647 }
648 else if( st == SHOVE::SH_HEAD_MODIFIED )
649 {
650 dragged = m_shove->NewHead();
651 ok = true;
652 }
653
654 m_lastNode = m_shove->CurrentNode()->Branch();
655
656 if( ok )
657 {
658 VECTOR2D lockV;
659 dragged.ClearLinks();
660 dragged.Unmark();
662 m_lastDragSolution = dragged;
663 }
664 else
665 {
668 }
669
670 break;
671 }
672
673 case DM_VIA:
674 {
675 VIA_HANDLE newVia;
676
677 // corner count limiter intended to avoid excessive optimization produces mediocre results for via shoving.
678 // this is a hack that disables it, before I figure out a more reliable solution
679 m_shove->DisablePostShoveOptimizations( OPTIMIZER::LIMIT_CORNER_COUNT );
680 SHOVE::SHOVE_STATUS st = m_shove->ShoveDraggingVia( m_draggedVia, aP, newVia );
681
682 if( st == SHOVE::SH_OK || st == SHOVE::SH_HEAD_MODIFIED )
683 ok = true;
684
685 m_lastNode = m_shove->CurrentNode()->Branch();
686
687 if( newVia.valid )
688 m_draggedVia = newVia;
689
691 break;
692 }
693 }
694
695 m_dragStatus = ok;
696
697 return ok;
698}
DEBUG_DECORATOR * Dbg() const
Definition: pns_algo_base.h:78
void optimizeAndUpdateDraggedLine(LINE &aDragged, const LINE &aOrig, const VECTOR2I &aP)
LINE m_lastDragSolution
Definition: pns_dragger.h:147
std::unique_ptr< SHOVE > m_shove
Definition: pns_dragger.h:148
@ LIMIT_CORNER_COUNT
Do not attempt to optimize if the resulting line's corner count is outside the predefined range.
@ SH_HEAD_MODIFIED
Definition: pns_shove.h:54
@ BLUE
Definition: color4d.h:56
#define PNS_DBG(dbg, method,...)

References PNS::NODE::Add(), BLUE, PNS::ITEM_SET::Clear(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), PNS::DM_CORNER, PNS::DM_SEGMENT, PNS::DM_VIA, PNS::LINE::DragCorner(), PNS::LINE::DragSegment(), PNS::OPTIMIZER::LIMIT_CORNER_COUNT, m_draggedItems, m_draggedLine, m_draggedSegmentIndex, m_draggedVia, m_dragStatus, m_lastDragSolution, m_lastNode, m_mode, m_shove, optimizeAndUpdateDraggedLine(), PNS_DBG, PNS::LINE::SetSnapThreshhold(), PNS::ALGO_BASE::Settings(), PNS::SHOVE::SH_HEAD_MODIFIED, PNS::SHOVE::SH_OK, PNS::ROUTING_SETTINGS::SmoothDraggedSegments(), PNS::LINE::Unmark(), PNS::VIA_HANDLE::valid, and PNS::LINE::Width().

Referenced by Drag().

◆ dragViaMarkObstacles()

bool PNS::DRAGGER::dragViaMarkObstacles ( const VIA_HANDLE aHandle,
NODE aNode,
const VECTOR2I aP 
)
private

Definition at line 336 of file pns_dragger.cpp.

337{
339
340 ITEM_SET fanout = findViaFanoutByHandle( aNode, aHandle );
341
342 if( fanout.Empty() )
343 {
344 return true;
345 }
346
347 for( ITEM* item : fanout.Items() )
348 {
349 if( const LINE* l = dyn_cast<const LINE*>( item ) )
350 {
351 LINE origLine( *l );
352 LINE draggedLine( *l );
353
354 draggedLine.DragCorner( aP, origLine.CLine().Find( aHandle.pos ), m_freeAngleMode );
355 draggedLine.ClearLinks();
356
357 m_draggedItems.Add( draggedLine );
358
359 m_lastNode->Remove( origLine );
360 m_lastNode->Add( draggedLine );
361 }
362 else if ( VIA *via = dyn_cast<VIA*>( item ) )
363 {
364 auto nvia = Clone( *via );
365
366 nvia->SetPos( aP );
367 m_draggedItems.Add( nvia.get() );
368
369 m_lastNode->Remove( via );
370 m_lastNode->Add( std::move( nvia ) );
371 }
372 }
373
374 return true;
375}
const ITEM_SET findViaFanoutByHandle(NODE *aNode, const VIA_HANDLE &handle)
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
Definition: pns_item.h:279

References PNS::ITEM_SET::Add(), PNS::NODE::Add(), PNS::ITEM_SET::Clear(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::Clone(), PNS::LINE::DragCorner(), PNS::ITEM_SET::Empty(), SHAPE_LINE_CHAIN::Find(), findViaFanoutByHandle(), PNS::ITEM_SET::Items(), m_draggedItems, m_freeAngleMode, m_lastNode, PNS::VIA_HANDLE::pos, PNS::NODE::Remove(), and via.

Referenced by dragMarkObstacles().

◆ dragViaWalkaround()

bool PNS::DRAGGER::dragViaWalkaround ( const VIA_HANDLE aHandle,
NODE aNode,
const VECTOR2I aP 
)
private

Definition at line 378 of file pns_dragger.cpp.

379{
381
382 ITEM_SET fanout = findViaFanoutByHandle( aNode, aHandle );
383
384 if( fanout.Empty() )
385 {
386 return true;
387 }
388
389 bool viaPropOk = false;
390 VECTOR2I viaTargetPos;
391
392 for( ITEM* item : fanout.Items() )
393 {
394 if ( VIA *via = dyn_cast<VIA*>( item ) )
395 {
396 auto draggedVia = Clone( *via );
397
398 draggedVia->SetPos( aP );
399 m_draggedItems.Add( draggedVia.get() );
400
401 std::set<VIA*> vias;
402
403 vias.insert( draggedVia.get() );
404
405 bool ok = propagateViaForces( m_lastNode, vias );
406
407 if( ok )
408 {
409 viaTargetPos = draggedVia->Pos();
410 viaPropOk = true;
411 m_lastNode->Remove( via );
412 m_lastNode->Add( std::move(draggedVia) );
413 }
414 }
415 }
416
417 if( !viaPropOk ) // can't force-propagate the via? bummer...
418 return false;
419
420 for( ITEM* item : fanout.Items() )
421 {
422 if( const LINE* l = dyn_cast<const LINE*>( item ) )
423 {
424 LINE origLine( *l );
425 LINE draggedLine( *l );
426 LINE walkLine( *l );
427
428 draggedLine.DragCorner( viaTargetPos, origLine.CLine().Find( aHandle.pos ),
430 draggedLine.ClearLinks();
431
432 if ( m_world->CheckColliding( &draggedLine ) )
433 {
434 bool ok = tryWalkaround( m_lastNode, draggedLine, walkLine );
435
436 if( !ok )
437 return false;
438
439 m_lastNode->Remove( origLine );
440 optimizeAndUpdateDraggedLine( walkLine, origLine, aP );
441 }
442 else
443 {
444 m_draggedItems.Add( draggedLine );
445
446 m_lastNode->Remove( origLine );
447 m_lastNode->Add( draggedLine );
448 }
449 }
450 }
451
452 return true;
453}
bool tryWalkaround(NODE *aNode, LINE &aOrig, LINE &aWalk)
bool propagateViaForces(NODE *node, std::set< VIA * > &vias)
Definition: pns_dragger.cpp:52

References PNS::ITEM_SET::Add(), PNS::NODE::Add(), PNS::NODE::CheckColliding(), PNS::ITEM_SET::Clear(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::Clone(), PNS::LINE::DragCorner(), PNS::ITEM_SET::Empty(), SHAPE_LINE_CHAIN::Find(), findViaFanoutByHandle(), PNS::ITEM_SET::Items(), m_draggedItems, m_freeAngleMode, m_lastNode, PNS::DRAG_ALGO::m_world, optimizeAndUpdateDraggedLine(), PNS::VIA_HANDLE::pos, propagateViaForces(), PNS::NODE::Remove(), tryWalkaround(), and via.

Referenced by dragWalkaround().

◆ dragWalkaround()

bool PNS::DRAGGER::dragWalkaround ( const VECTOR2I aP)
private

Definition at line 549 of file pns_dragger.cpp.

550{
551 bool ok = false;
552
553 // fixme: rewrite using shared_ptr...
554 if( m_lastNode )
555 {
556 delete m_lastNode;
557 m_lastNode = nullptr;
558 }
559
561
562 switch( m_mode )
563 {
564 case DM_SEGMENT:
565 case DM_CORNER:
566 {
567 int thresh = Settings().SmoothDraggedSegments() ? m_draggedLine.Width() / 4 : 0;
568 LINE dragged( m_draggedLine );
569 LINE draggedWalk( m_draggedLine );
570 LINE origLine( m_draggedLine );
571
572 dragged.SetSnapThreshhold( thresh );
573
574 if( m_mode == DM_SEGMENT )
575 dragged.DragSegment( aP, m_draggedSegmentIndex );
576 else
577 dragged.DragCorner( aP, m_draggedSegmentIndex );
578
579 if ( m_world->CheckColliding( &dragged ) )
580 {
581 ok = tryWalkaround( m_lastNode, dragged, draggedWalk );
582 }
583 else
584 {
585 draggedWalk = dragged;
586 ok = true;
587 }
588
589 if( draggedWalk.CLine().PointCount() < 2 )
590 ok = false;
591
592 if( ok )
593 {
594 PNS_DBG( Dbg(), AddShape, &origLine.CLine(), BLUE, 50000, wxT( "drag-orig-line" ) );
595 PNS_DBG( Dbg(), AddShape, &draggedWalk.CLine(), CYAN, 75000, wxT( "drag-walk" ) );
596 m_lastNode->Remove( origLine );
597 optimizeAndUpdateDraggedLine( draggedWalk, origLine, aP );
598 }
599
600 break;
601 }
602 case DM_VIA: // fixme...
603 {
605 break;
606 }
607 }
608
609 m_dragStatus = ok;
610
611 return true;
612}
bool dragViaWalkaround(const VIA_HANDLE &aHandle, NODE *aNode, const VECTOR2I &aP)
@ CYAN
Definition: color4d.h:58

References BLUE, PNS::NODE::Branch(), PNS::NODE::CheckColliding(), PNS::LINE::CLine(), CYAN, PNS::ALGO_BASE::Dbg(), PNS::DM_CORNER, PNS::DM_SEGMENT, PNS::DM_VIA, PNS::LINE::DragCorner(), PNS::LINE::DragSegment(), dragViaWalkaround(), m_draggedLine, m_draggedSegmentIndex, m_dragStatus, m_initialVia, m_lastNode, m_mode, PNS::DRAG_ALGO::m_world, optimizeAndUpdateDraggedLine(), PNS_DBG, SHAPE_LINE_CHAIN::PointCount(), PNS::NODE::Remove(), PNS::LINE::SetSnapThreshhold(), PNS::ALGO_BASE::Settings(), PNS::ROUTING_SETTINGS::SmoothDraggedSegments(), tryWalkaround(), and PNS::LINE::Width().

Referenced by Drag().

◆ findViaFanoutByHandle()

const ITEM_SET PNS::DRAGGER::findViaFanoutByHandle ( NODE aNode,
const VIA_HANDLE handle 
)
private

Definition at line 174 of file pns_dragger.cpp.

175{
176 ITEM_SET rv;
177
178 JOINT* jt = aNode->FindJoint( handle.pos, handle.layers.Start(), handle.net );
179
180 if( !jt )
181 return rv;
182
183 for( ITEM* item : jt->LinkList() )
184 {
185 if( item->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) )
186 {
187 int segIndex;
188 LINKED_ITEM* seg = ( LINKED_ITEM*) item;
189 LINE l = aNode->AssembleLine( seg, &segIndex );
190
191 if( segIndex != 0 )
192 l.Reverse();
193
194 rv.Add( l );
195 }
196 else if( item->OfKind( ITEM::VIA_T ) )
197 {
198 rv.Add( item );
199 }
200 }
201
202 return rv;
203}
@ SEGMENT_T
Definition: pns_item.h:66

References PNS::ITEM_SET::Add(), PNS::ITEM::ARC_T, PNS::NODE::AssembleLine(), PNS::NODE::FindJoint(), PNS::VIA_HANDLE::layers, PNS::JOINT::LinkList(), PNS::VIA_HANDLE::net, PNS::VIA_HANDLE::pos, PNS::LINE::Reverse(), PNS::ITEM::SEGMENT_T, LAYER_RANGE::Start(), and PNS::ITEM::VIA_T.

Referenced by dragViaMarkObstacles(), and dragViaWalkaround().

◆ FixRoute()

bool PNS::DRAGGER::FixRoute ( )
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 701 of file pns_dragger.cpp.

702{
703 NODE* node = CurrentNode();
704
705 if( node )
706 {
707 // If collisions exist, we can fix in shove/smart mode because all tracks to be committed
708 // will be in valid positions (even if the current routing solution to the mouse cursor is
709 // invalid). In other modes, we can only commit if "Allow DRC violations" is enabled.
710 if( !m_dragStatus )
711 {
713 node = CurrentNode();
714
715 if( !node )
716 return false;
717 }
718
719 if( !m_dragStatus && !Settings().AllowDRCViolations() )
720 return false;
721
722 Router()->CommitRouting( node );
723 return true;
724 }
725
726 return false;
727}
ROUTER * Router() const
Return current router settings.
Definition: pns_algo_base.h:54
NODE * CurrentNode() const override
Function CurrentNode()
bool Drag(const VECTOR2I &aP) override
Function Drag()
void CommitRouting()
Definition: pns_router.cpp:895

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

◆ GetLastDragSolution()

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

Definition at line 108 of file pns_dragger.h.

109 {
110 return m_lastDragSolution;
111 }

References m_lastDragSolution.

◆ GetOriginalLine()

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

Definition at line 103 of file pns_dragger.h.

104{
105 return m_draggedLine;
106 }

References m_draggedLine.

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

◆ Logger()

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

Reimplemented in PNS::SHOVE.

Definition at line 34 of file pns_algo_base.cpp.

35{
36 return nullptr;
37}

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

◆ Mode()

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

Implements PNS::DRAG_ALGO.

Definition at line 267 of file pns_dragger.cpp.

268{
269 return static_cast<PNS::DRAG_MODE>( m_mode );
270}
DRAG_MODE
Definition: pns_router.h:71

References m_mode.

◆ optimizeAndUpdateDraggedLine()

void PNS::DRAGGER::optimizeAndUpdateDraggedLine ( LINE aDragged,
const LINE aOrig,
const VECTOR2I aP 
)
private

Definition at line 456 of file pns_dragger.cpp.

457{
458 VECTOR2D lockV;
459 aDragged.ClearLinks();
460 aDragged.Unmark();
461
462 lockV = aDragged.CLine().NearestPoint( aP );
463
464 OPTIMIZER optimizer( m_lastNode );
465
467
468 if( Settings().SmoothDraggedSegments() )
470
471 optimizer.SetEffortLevel( effort );
472
473 OPT_BOX2I affectedArea = aDragged.ChangedArea( &aOrig );
474 VECTOR2I anchor( aP );
475
476 if( aDragged.CLine().Find( aP ) < 0 )
477 {
478 anchor = aDragged.CLine().NearestPoint( aP );
479 }
480
481 optimizer.SetPreserveVertex( anchor );
482
483 // People almost never want KiCad to reroute tracks in areas they can't even see, so restrict
484 // the area to what is visible even if we are optimizing the "entire" track.
485 if( Settings().GetOptimizeEntireDraggedTrack() )
486 affectedArea = VisibleViewArea();
487 else if( !affectedArea )
488 affectedArea = BOX2I( aP ); // No valid area yet? set to minimum to disable optimization
489
490 PNS_DBG( Dbg(), AddPoint, anchor, YELLOW, 100000, wxT( "drag-anchor" ) );
491 PNS_DBG( Dbg(), AddShape, *affectedArea, RED, 0, wxT( "drag-affected-area" ) );
492
493 optimizer.SetRestrictArea( *affectedArea );
494 optimizer.Optimize( &aDragged );
495
496 OPT_BOX2I optArea = aDragged.ChangedArea( &aOrig );
497
498 if( optArea )
499 PNS_DBG( Dbg(), AddShape, *optArea, BLUE, 0, wxT( "drag-opt-area" ) );
500
501 m_lastNode->Add( aDragged );
503 m_draggedItems.Add( aDragged );
504}
BOX2< VECTOR2I > BOX2I
Definition: box2.h:847
std::optional< BOX2I > OPT_BOX2I
Definition: box2.h:850
const BOX2I & VisibleViewArea() const
@ MERGE_SEGMENTS
Reduce corner cost iteratively.
Definition: pns_optimizer.h:99
@ MERGE_COLINEAR
Merge co-linear segments.
@ YELLOW
Definition: color4d.h:67
@ RED
Definition: color4d.h:59

References PNS::ITEM_SET::Add(), PNS::NODE::Add(), anchor, BLUE, PNS::LINE::ChangedArea(), PNS::ITEM_SET::Clear(), PNS::LINK_HOLDER::ClearLinks(), PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), SHAPE_LINE_CHAIN::Find(), PNS::OPTIMIZER::KEEP_TOPOLOGY, m_draggedItems, m_lastNode, PNS::OPTIMIZER::MERGE_COLINEAR, PNS::OPTIMIZER::MERGE_SEGMENTS, SHAPE_LINE_CHAIN::NearestPoint(), PNS::OPTIMIZER::Optimize(), PNS_DBG, RED, PNS::OPTIMIZER::RESTRICT_AREA, PNS::OPTIMIZER::SetEffortLevel(), PNS::OPTIMIZER::SetPreserveVertex(), PNS::OPTIMIZER::SetRestrictArea(), PNS::ALGO_BASE::Settings(), PNS::LINE::Unmark(), PNS::ALGO_BASE::VisibleViewArea(), and YELLOW.

Referenced by dragShove(), dragViaWalkaround(), and dragWalkaround().

◆ propagateViaForces()

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

Definition at line 52 of file pns_dragger.cpp.

53{
54 VIA* via = *vias.begin();
55
56 VECTOR2I force;
58
59 const int iterLimit = Settings().ViaForcePropIterationLimit();
60
61 if( via->PushoutForce( node, lead, force, ITEM::ANY_T, iterLimit ) )
62 {
63 via->SetPos( via->Pos() + force );
64 return true;
65 }
66
67 return false;
68}
int ViaForcePropIterationLimit() const
@ VIA
Normal via.
Definition: router_tool.cpp:89

References PNS::ITEM::ANY_T, PNS::MOUSE_TRAIL_TRACER::GetTrailLeadVector(), m_mouseTrailTracer, PNS::ALGO_BASE::Settings(), via, and PNS::ROUTING_SETTINGS::ViaForcePropIterationLimit().

Referenced by dragViaWalkaround().

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

74 {
75 m_debugDecorator = aDecorator;
76 }

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.

66 {
67 m_logger = aLogger;
68 }
LOGGER * m_logger
Definition: pns_algo_base.h:88

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 261 of file pns_dragger.cpp.

262{
263 m_mode = static_cast<int>( aMode );
264}

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.

62 {
63 m_world = aWorld;
64 }

References PNS::DRAG_ALGO::m_world.

◆ Start()

bool PNS::DRAGGER::Start ( const VECTOR2I aP,
ITEM_SET aPrimitives 
)
overridevirtual

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 205 of file pns_dragger.cpp.

206{
207 if( aPrimitives.Empty() )
208 return false;
209
210 ITEM* startItem = aPrimitives[0];
211
212 m_lastNode = nullptr;
216 m_lastValidPoint = aP;
217
220
222 {
223 m_shove = std::make_unique<SHOVE>( m_world, Router() );
224 m_shove->SetLogger( Logger() );
225 m_shove->SetDebugDecorator( Dbg() );
226 }
227
228 startItem->Unmark( MK_LOCKED );
229
230 PNS_DBG( Dbg(), Message, wxString::Format( "StartDragging: item %p [kind %d]",
231 startItem, (int) startItem->Kind() ) );
232
233 switch( startItem->Kind() )
234 {
235 case ITEM::SEGMENT_T:
236 {
237 SEGMENT* seg = static_cast<SEGMENT*>( startItem );
238 VVIA* vvia = checkVirtualVia( aP, seg );
239
240 if( vvia )
241 {
242 return startDragVia( vvia );
243 }
244 else
245 {
246 return startDragSegment( aP, seg );
247 }
248 }
249 case ITEM::VIA_T:
250 return startDragVia( static_cast<VIA*>( startItem ) );
251
252 case ITEM::ARC_T:
253 return startDragArc( aP, static_cast<ARC*>( startItem ) );
254
255 default:
256 return false;
257 }
258}
virtual LOGGER * Logger()
bool startDragSegment(const VECTOR2D &aP, SEGMENT *aSeg)
bool startDragVia(VIA *aVia)
VVIA * checkVirtualVia(const VECTOR2D &aP, SEGMENT *aSeg)
Definition: pns_dragger.cpp:71
bool startDragArc(const VECTOR2D &aP, ARC *aArc)
PNS_MODE Mode() const
Set the routing mode.
@ DM_FREE_ANGLE
Definition: pns_router.h:75
@ MK_LOCKED
Definition: pns_item.h:43
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PNS::ITEM::ARC_T, checkVirtualVia(), PNS::ITEM_SET::Clear(), PNS::MOUSE_TRAIL_TRACER::Clear(), PNS::ALGO_BASE::Dbg(), PNS::DM_FREE_ANGLE, PNS::ITEM_SET::Empty(), Format(), PNS::ITEM::Kind(), PNS::ALGO_BASE::Logger(), m_currentMode, m_draggedItems, m_freeAngleMode, m_lastNode, m_lastValidPoint, m_mode, m_mouseTrailTracer, m_shove, PNS::DRAG_ALGO::m_world, PNS::MK_LOCKED, PNS::ROUTING_SETTINGS::Mode(), PNS_DBG, PNS::RM_Shove, PNS::ALGO_BASE::Router(), PNS::ITEM::SEGMENT_T, PNS::ALGO_BASE::Settings(), startDragArc(), startDragSegment(), startDragVia(), PNS::ITEM::Unmark(), and PNS::ITEM::VIA_T.

◆ startDragArc()

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

Definition at line 154 of file pns_dragger.cpp.

155{
157 m_shove->SetInitialLine( m_draggedLine );
158 m_mode = DM_ARC;
159
160 return true;
161}
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false, bool aFollowLockedSegments=false)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
Definition: pns_node.cpp:999
@ DM_ARC
Definition: pns_router.h:76

References PNS::NODE::AssembleLine(), PNS::DM_ARC, m_draggedLine, m_draggedSegmentIndex, m_mode, m_shove, and PNS::DRAG_ALGO::m_world.

Referenced by Start().

◆ startDragSegment()

bool PNS::DRAGGER::startDragSegment ( const VECTOR2D aP,
SEGMENT aSeg 
)
private

Definition at line 112 of file pns_dragger.cpp.

113{
114 int w2 = aSeg->Width() / 2;
115
118
119 if( m_shove )
120 {
121 m_shove->SetInitialLine( m_draggedLine );
122 }
123
124 auto distA = ( aP - aSeg->Seg().A ).EuclideanNorm();
125 auto distB = ( aP - aSeg->Seg().B ).EuclideanNorm();
126
127 if( distA < w2 || distB < w2 )
128 {
130
131 if( distB <= distA )
133 }
134 else if( m_freeAngleMode )
135 {
136 if( distB < distA &&
138 ( !m_draggedLine.CLine().IsPtOnArc( static_cast<size_t>(m_draggedSegmentIndex) + 1 ) ) )
139 {
141 }
142
144 }
145 else
146 {
148 }
149
150 return true;
151}
const SHAPE_LINE_CHAIN & CLine() const
Definition: pns_line.h:142
int PointCount() const
Definition: pns_line.h:145
bool IsPtOnArc(size_t aPtIndex) const

References SEG::A, PNS::NODE::AssembleLine(), SEG::B, PNS::LINE::CLine(), PNS::DM_CORNER, PNS::DM_SEGMENT, EuclideanNorm(), SHAPE_LINE_CHAIN::IsPtOnArc(), m_draggedLine, m_draggedSegmentIndex, m_freeAngleMode, m_lastDragSolution, m_mode, m_shove, PNS::DRAG_ALGO::m_world, PNS::LINE::PointCount(), PNS::SEGMENT::Seg(), and PNS::SEGMENT::Width().

Referenced by Start().

◆ startDragVia()

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

Definition at line 164 of file pns_dragger.cpp.

165{
166 m_initialVia = aVia->MakeHandle();
168
169 m_mode = DM_VIA;
170
171 return true;
172}

References PNS::DM_VIA, m_draggedVia, m_initialVia, m_mode, and PNS::VIA::MakeHandle().

Referenced by Start().

◆ Traces()

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

Function Traces()

Returns the set of dragged items.

Implements PNS::DRAG_ALGO.

Definition at line 764 of file pns_dragger.cpp.

765{
766 return m_draggedItems;
767}

References m_draggedItems.

◆ tryWalkaround()

bool PNS::DRAGGER::tryWalkaround ( NODE aNode,
LINE aOrig,
LINE aWalk 
)
private

Definition at line 507 of file pns_dragger.cpp.

508{
509 WALKAROUND walkaround( aNode, Router() );
510 bool ok = false;
511 walkaround.SetSolidsOnly( false );
512 walkaround.SetDebugDecorator( Dbg() );
513 walkaround.SetLogger( Logger() );
514 walkaround.SetIterationLimit( Settings().WalkaroundIterationLimit() );
515
516 aWalk = aOrig;
517
518 WALKAROUND::RESULT wr = walkaround.Route( aWalk );
519
520 if( wr.statusCcw == WALKAROUND::DONE && wr.statusCw == WALKAROUND::DONE )
521 {
522 if( wr.lineCw.CLine().PointCount() > 1
523 && wr.lineCw.CLine().Length() < wr.lineCcw.CLine().Length() )
524 {
525 aWalk = wr.lineCw;
526 ok = true;
527 }
528 else if( wr.lineCcw.CLine().PointCount() > 1 )
529 {
530 aWalk = wr.lineCcw;
531 ok = true;
532 }
533 }
534 else if( wr.statusCw == WALKAROUND::DONE && wr.lineCw.CLine().PointCount() > 1 )
535 {
536 aWalk = wr.lineCw;
537 ok = true;
538 }
539 else if( wr.statusCcw == WALKAROUND::DONE && wr.lineCcw.CLine().PointCount() > 1 )
540 {
541 aWalk = wr.lineCcw;
542 ok = true;
543 }
544
545 return ok;
546}

References PNS::LINE::CLine(), PNS::ALGO_BASE::Dbg(), PNS::WALKAROUND::DONE, SHAPE_LINE_CHAIN::Length(), PNS::WALKAROUND::RESULT::lineCcw, PNS::WALKAROUND::RESULT::lineCw, PNS::ALGO_BASE::Logger(), SHAPE_LINE_CHAIN::PointCount(), PNS::WALKAROUND::Route(), PNS::ALGO_BASE::Router(), PNS::ALGO_BASE::SetDebugDecorator(), PNS::WALKAROUND::SetIterationLimit(), PNS::ALGO_BASE::SetLogger(), PNS::WALKAROUND::SetSolidsOnly(), PNS::ALGO_BASE::Settings(), PNS::WALKAROUND::RESULT::statusCcw, and PNS::WALKAROUND::RESULT::statusCw.

Referenced by dragViaWalkaround(), and dragWalkaround().

◆ VisibleViewArea()

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

Definition at line 40 of file pns_algo_base.cpp.

41{
42 return m_router->VisibleViewArea();
43}
const BOX2I & VisibleViewArea() const
Definition: pns_router.h:217

References PNS::ALGO_BASE::m_router, and PNS::ROUTER::VisibleViewArea().

Referenced by optimizeAndUpdateDraggedLine(), and PNS::SHOVE::runOptimizer().

Member Data Documentation

◆ m_currentMode

PNS_MODE PNS::DRAGGER::m_currentMode
private

Definition at line 151 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 156 of file pns_dragger.h.

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

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

◆ m_dragStatus

bool PNS::DRAGGER::m_dragStatus
private

Definition at line 150 of file pns_dragger.h.

Referenced by dragMarkObstacles(), dragShove(), dragWalkaround(), and FixRoute().

◆ m_freeAngleMode

bool PNS::DRAGGER::m_freeAngleMode
private

◆ m_initialVia

VIA_HANDLE PNS::DRAGGER::m_initialVia
private

Definition at line 141 of file pns_dragger.h.

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

◆ m_lastDragSolution

LINE PNS::DRAGGER::m_lastDragSolution
private

Definition at line 147 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 153 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::SetLogger().

◆ m_mode

int PNS::DRAGGER::m_mode
private

◆ m_mouseTrailTracer

MOUSE_TRAIL_TRACER PNS::DRAGGER::m_mouseTrailTracer
private

Definition at line 160 of file pns_dragger.h.

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

◆ m_origViaConnections

ITEM_SET PNS::DRAGGER::m_origViaConnections
private

Definition at line 152 of file pns_dragger.h.

◆ m_router

◆ m_shove

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

Definition at line 148 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: