KiCad PCB EDA Suite
pns_dragger.cpp
Go to the documentation of this file.
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2013-2014 CERN
5  * Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #include "pns_arc.h"
23 
24 #include "pns_dragger.h"
25 #include "pns_shove.h"
26 #include "pns_router.h"
27 #include "pns_debug_decorator.h"
28 #include "pns_walkaround.h"
29 
30 namespace PNS {
31 
32 DRAGGER::DRAGGER( ROUTER* aRouter ) :
33  DRAG_ALGO( aRouter )
34 {
35  m_world = NULL;
36  m_lastNode = NULL;
39  m_dragStatus = false;
41  m_freeAngleMode = false;
42 }
43 
44 
46 {
47 }
48 
49 
50 bool DRAGGER::propagateViaForces( NODE* node, std::set<VIA*>& vias )
51 {
52  VIA* via = *vias.begin();
53 
54  VECTOR2I force;
56 
57  bool solidsOnly = false;// ( m_currentMode != RM_Walkaround );
58 
59  if( via->PushoutForce( node, lead, force, solidsOnly, 40 ) )
60  {
61  via->SetPos( via->Pos() + force );
62  return true;
63  }
64 
65  return false;
66 }
67 
68 bool DRAGGER::startDragSegment( const VECTOR2D& aP, SEGMENT* aSeg )
69 {
70  int w2 = aSeg->Width() / 2;
71 
73 
74  if( m_shove )
75  {
76  m_shove->SetInitialLine( m_draggedLine );
77  }
78 
79  auto distA = ( aP - aSeg->Seg().A ).EuclideanNorm();
80  auto distB = ( aP - aSeg->Seg().B ).EuclideanNorm();
81 
82  if( distA <= w2 )
83  {
84  m_mode = DM_CORNER;
85  }
86  else if( distB <= w2 )
87  {
88  //todo (snh) Adjust segment for arcs
90  m_mode = DM_CORNER;
91  }
92  else if ( m_freeAngleMode )
93  {
94  if( distB < distA )
95  {
97  }
98  m_mode = DM_CORNER;
99  }
100  else
101  {
102  m_mode = DM_SEGMENT;
103  }
104 
105  return true;
106 }
107 
108 
109 
110 bool DRAGGER::startDragArc( const VECTOR2D& aP, ARC* aArc )
111 {
113  m_shove->SetInitialLine( m_draggedLine );
114  m_mode = DM_ARC;
115 
116  return true;
117 }
118 
119 
121 {
122  m_initialVia = aVia->MakeHandle();
124 
125  m_mode = DM_VIA;
126 
127  return true;
128 }
129 
131 {
132  ITEM_SET rv;
133 
134  JOINT* jt = aNode->FindJoint( handle.pos, handle.layers.Start(), handle.net );
135 
136  if( !jt )
137  return rv;
138 
139  for( ITEM* item : jt->LinkList() )
140  {
141  if( item->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) )
142  {
143  int segIndex;
144  LINKED_ITEM* seg = ( LINKED_ITEM*) item;
145  LINE l = aNode->AssembleLine( seg, &segIndex );
146 
147  if( segIndex != 0 )
148  l.Reverse();
149 
150  rv.Add( l );
151  }
152  else if( item->OfKind( ITEM::VIA_T ) )
153  {
154  rv.Add( item );
155  }
156  }
157 
158  return rv;
159 }
160 
161 bool DRAGGER::Start( const VECTOR2I& aP, ITEM_SET& aPrimitives )
162 {
163  if( aPrimitives.Empty() )
164  return false;
165 
166  ITEM* startItem = aPrimitives[0];
167 
168  m_lastNode = NULL;
172  m_lastValidPoint = aP;
173 
176 
178  {
179  m_shove = std::make_unique<SHOVE>( m_world, Router() );
180  m_shove->SetLogger( Logger() );
181  m_shove->SetDebugDecorator( Dbg() );
182  }
183 
184  startItem->Unmark( MK_LOCKED );
185 
186  wxLogTrace( "PNS", "StartDragging: item %p [kind %d]", startItem, (int) startItem->Kind() );
187 
188  switch( startItem->Kind() )
189  {
190  case ITEM::SEGMENT_T:
191  return startDragSegment( aP, static_cast<SEGMENT*>( startItem ) );
192 
193  case ITEM::VIA_T:
194  return startDragVia( static_cast<VIA*>( startItem ) );
195 
196  case ITEM::ARC_T:
197  return startDragArc( aP, static_cast<ARC*>( startItem ) );
198 
199  default:
200  return false;
201  }
202 }
203 
204 
205 void DRAGGER::SetMode( int aMode )
206 {
207  m_mode = aMode;
208 }
209 
210 
212 {
213  // fixme: rewrite using shared_ptr...
214  if( m_lastNode )
215  {
216  delete m_lastNode;
217  m_lastNode = nullptr;
218  }
219 
221 
222  switch( m_mode )
223  {
224  case DM_SEGMENT:
225  case DM_CORNER:
226  {
227  //TODO: Make threshhold configurable
228  int thresh = Settings().SmoothDraggedSegments() ? m_draggedLine.Width() / 4 : 0;
229  LINE origLine( m_draggedLine );
230  LINE dragged( m_draggedLine );
231  dragged.SetSnapThreshhold( thresh );
232  dragged.ClearLinks();
233 
234  if( m_mode == DM_SEGMENT )
235  dragged.DragSegment( aP, m_draggedSegmentIndex );
236  else
238 
239  m_lastNode->Remove( origLine );
240  m_lastNode->Add( dragged );
241 
243  m_draggedItems.Add( dragged );
244 
245  break;
246  }
247 
248  case DM_VIA: // fixme...
249  {
251 
252  break;
253  }
254  }
255 
256  if( Settings().CanViolateDRC() )
257  m_dragStatus = true;
258  else
260 
261  return true;
262 }
263 
264 
265 bool DRAGGER::dragViaMarkObstacles( const VIA_HANDLE& aHandle, NODE* aNode, const VECTOR2I& aP )
266 {
268 
269  ITEM_SET fanout = findViaFanoutByHandle( aNode, aHandle );
270 
271  if( fanout.Empty() )
272  {
273  return true;
274  }
275 
276  for( ITEM* item : fanout.Items() )
277  {
278  if( const LINE* l = dyn_cast<const LINE*>( item ) )
279  {
280  LINE origLine( *l );
281  LINE draggedLine( *l );
282 
283  draggedLine.DragCorner( aP, origLine.CLine().Find( aHandle.pos ), m_freeAngleMode );
284  draggedLine.ClearLinks();
285 
286  m_draggedItems.Add( draggedLine );
287 
288  m_lastNode->Remove( origLine );
289  m_lastNode->Add( draggedLine );
290  }
291  else if ( VIA *via = dyn_cast<VIA*>( item ) )
292  {
293  auto nvia = Clone( *via );
294 
295  nvia->SetPos( aP );
296  m_draggedItems.Add( nvia.get() );
297 
298  m_lastNode->Remove( via );
299  m_lastNode->Add( std::move( nvia ) );
300  }
301  }
302 
303  return true;
304 }
305 
306 
307 bool DRAGGER::dragViaWalkaround( const VIA_HANDLE& aHandle, NODE* aNode, const VECTOR2I& aP )
308 {
310 
311  ITEM_SET fanout = findViaFanoutByHandle( aNode, aHandle );
312 
313  if( fanout.Empty() )
314  {
315  return true;
316  }
317 
318  bool viaPropOk = false;
319  VECTOR2I viaTargetPos;
320 
321  for( ITEM* item : fanout.Items() )
322  {
323  if ( VIA *via = dyn_cast<VIA*>( item ) )
324  {
325  auto draggedVia = Clone( *via );
326 
327  draggedVia->SetPos( aP );
328  m_draggedItems.Add( draggedVia.get() );
329 
330  std::set<VIA*> vias;
331 
332  vias.insert( draggedVia.get() );
333 
334  bool ok = propagateViaForces( m_lastNode, vias );
335 
336  if( ok )
337  {
338  viaTargetPos = draggedVia->Pos();
339  viaPropOk = true;
340  m_lastNode->Remove( via );
341  m_lastNode->Add( std::move(draggedVia) );
342  }
343  }
344  }
345 
346  if( !viaPropOk ) // can't force-propagate the via? bummer...
347  return false;
348 
349  for( ITEM* item : fanout.Items() )
350  {
351  if( const LINE* l = dyn_cast<const LINE*>( item ) )
352  {
353  LINE origLine( *l );
354  LINE draggedLine( *l );
355  LINE walkLine( *l );
356 
357  draggedLine.DragCorner( viaTargetPos, origLine.CLine().Find( aHandle.pos ), m_freeAngleMode );
358  draggedLine.ClearLinks();
359 
360  if ( m_world->CheckColliding( &draggedLine ) )
361  {
362  bool ok = tryWalkaround( m_lastNode, draggedLine, walkLine );
363 
364  if( !ok )
365  return false;
366 
367  m_lastNode->Remove( origLine );
368  optimizeAndUpdateDraggedLine( walkLine, origLine, aP );
369  }
370  else
371  {
372  m_draggedItems.Add( draggedLine );
373 
374  m_lastNode->Remove( origLine );
375  m_lastNode->Add( draggedLine );
376  }
377  }
378  }
379 
380  return true;
381 }
382 
383 
384 void DRAGGER::optimizeAndUpdateDraggedLine( LINE& aDragged, const LINE& aOrig, const VECTOR2I& aP )
385 {
386  VECTOR2D lockV;
387  aDragged.ClearLinks();
388  aDragged.Unmark();
389 
390  lockV = aDragged.CLine().NearestPoint( aP );
391 
392  if( Settings().GetOptimizeDraggedTrack() )
393  {
394  OPTIMIZER optimizer( m_lastNode );
395 
397 
398  OPT_BOX2I affectedArea = aDragged.ChangedArea( &aOrig );
399  VECTOR2I anchor( aP );
400 
401  if( aDragged.CLine().Find( aP ) < 0 )
402  {
403  anchor = aDragged.CLine().NearestPoint( aP );
404  }
405 
406  optimizer.SetPreserveVertex( anchor );
407 
408  if( affectedArea )
409  {
410  Dbg()->AddPoint( anchor, 3 );
411  Dbg()->AddBox( *affectedArea, 2 );
412  optimizer.SetRestrictArea( *affectedArea );
413  optimizer.Optimize( &aDragged );
414 
415  OPT_BOX2I optArea = *aDragged.ChangedArea( &aOrig );
416  if( optArea )
417  Dbg()->AddBox( *optArea, 4 );
418  }
419  }
420 
421  m_lastNode->Add( aDragged );
423  m_draggedItems.Add( aDragged );
424 }
425 
426 
427 bool DRAGGER::tryWalkaround( NODE* aNode, LINE& aOrig, LINE& aWalk )
428 {
429  WALKAROUND walkaround( aNode, Router() );
430  bool ok = false;
431  walkaround.SetSolidsOnly( false );
432  walkaround.SetDebugDecorator( Dbg() );
433  walkaround.SetLogger( Logger() );
434  walkaround.SetIterationLimit( Settings().WalkaroundIterationLimit() );
435 
436  aWalk = aOrig;
437 
438  WALKAROUND::RESULT wr = walkaround.Route( aWalk );
439 
440 
442  {
443  aWalk = ( wr.lineCw.CLine().Length() < wr.lineCcw.CLine().Length() ? wr.lineCw :
444  wr.lineCcw );
445  ok = true;
446  }
447  else if( wr.statusCw == WALKAROUND::DONE )
448  {
449  aWalk = wr.lineCw;
450  ok = true;
451  }
452  else if( wr.statusCcw == WALKAROUND::DONE )
453  {
454  aWalk = wr.lineCcw;
455  ok = true;
456  }
457  return ok;
458 }
459 
460 
462 {
463  bool ok = false;
464 // fixme: rewrite using shared_ptr...
465  if( m_lastNode )
466  {
467  delete m_lastNode;
468  m_lastNode = nullptr;
469  }
470 
472 
473  switch( m_mode )
474  {
475  case DM_SEGMENT:
476  case DM_CORNER:
477  {
478  int thresh = Settings().SmoothDraggedSegments() ? m_draggedLine.Width() / 4 : 0;
479  LINE dragged( m_draggedLine );
480  LINE draggedWalk( m_draggedLine );
481  LINE origLine( m_draggedLine );
482 
483  dragged.SetSnapThreshhold( thresh );
484 
485  if( m_mode == DM_SEGMENT )
486  dragged.DragSegment( aP, m_draggedSegmentIndex );
487  else
488  dragged.DragCorner( aP, m_draggedSegmentIndex );
489 
490  if ( m_world->CheckColliding( &dragged ) )
491  {
492  ok = tryWalkaround( m_lastNode, dragged, draggedWalk );
493  }
494  else
495  {
496  draggedWalk = dragged;
497  ok = true;
498  }
499 
500  if( ok )
501  {
502  //Dbg()->AddLine( origLine.CLine(), 4, 100000 );
503  m_lastNode->Remove( origLine );
504  optimizeAndUpdateDraggedLine( draggedWalk, origLine, aP );
505  }
506  break;
507  }
508  case DM_VIA: // fixme...
509  {
511  break;
512  }
513  }
514 
515  m_dragStatus = ok;
516 
517  return true;
518 }
519 
520 bool DRAGGER::dragShove( const VECTOR2I& aP )
521 {
522  bool ok = false;
523 
524  if( m_lastNode )
525  {
526  delete m_lastNode;
527  m_lastNode = NULL;
528  }
529 
530  switch( m_mode )
531  {
532  case DM_SEGMENT:
533  case DM_CORNER:
534  {
535  //TODO: Make threshhold configurable
536  int thresh = Settings().SmoothDraggedSegments() ? m_draggedLine.Width() / 2 : 0;
537  LINE dragged( m_draggedLine );
538  dragged.SetSnapThreshhold( thresh );
539 
540  if( m_mode == DM_SEGMENT )
541  dragged.DragSegment( aP, m_draggedSegmentIndex );
542  else
543  dragged.DragCorner( aP, m_draggedSegmentIndex );
544 
545  SHOVE::SHOVE_STATUS st = m_shove->ShoveLines( dragged );
546 
547  if( st == SHOVE::SH_OK )
548  ok = true;
549  else if( st == SHOVE::SH_HEAD_MODIFIED )
550  {
551  dragged = m_shove->NewHead();
552  ok = true;
553  }
554 
555  m_lastNode = m_shove->CurrentNode()->Branch();
556 
557  if( ok )
558  {
559  VECTOR2D lockV;
560  dragged.ClearLinks();
561  dragged.Unmark();
562 
564  }
565 
566  break;
567  }
568 
569  case DM_VIA:
570  {
571  VIA_HANDLE newVia;
572 
573  SHOVE::SHOVE_STATUS st = m_shove->ShoveDraggingVia( m_draggedVia, aP, newVia );
574 
575  if( st == SHOVE::SH_OK || st == SHOVE::SH_HEAD_MODIFIED )
576  ok = true;
577 
578  m_lastNode = m_shove->CurrentNode()->Branch();
579 
580  if( newVia.valid )
581  m_draggedVia = newVia;
582 
584  break;
585  }
586  }
587 
588  m_dragStatus = ok;
589 
590  return ok;
591 }
592 
593 
595 {
596  NODE* node = CurrentNode();
597 
598  if( node )
599  {
600  // If collisions exist, we can fix in shove/smart mode because all tracks to be committed
601  // will be in valid positions (even if the current routing solution to the mouse cursor is
602  // invalid). In other modes, we can only commit if "Allow DRC violations" is enabled.
603  if( !m_dragStatus )
604  {
606  node = CurrentNode();
607 
608  if( !node )
609  return false;
610  }
611 
612  if( !m_dragStatus && !Settings().CanViolateDRC() )
613  return false;
614 
615  Router()->CommitRouting( node );
616  return true;
617  }
618 
619  return false;
620 }
621 
622 
623 bool DRAGGER::Drag( const VECTOR2I& aP )
624 {
626 
627  bool ret = false;
628 
629  if( m_freeAngleMode )
630  {
631  ret = dragMarkObstacles( aP );
632  }
633  else
634  {
635  switch( m_currentMode )
636  {
637  case RM_MarkObstacles:
638  ret = dragMarkObstacles( aP );
639  break;
640 
641  case RM_Shove:
642  case RM_Smart:
643  ret = dragShove( aP );
644  break;
645 
646  case RM_Walkaround:
647  ret = dragWalkaround( aP );
648  break;
649 
650  default:
651  break;
652  }
653  }
654 
655  if( ret )
656  m_lastValidPoint = aP;
657 
658  return ret;
659 }
660 
661 
663 {
664  return m_lastNode ? m_lastNode : m_world;
665 }
666 
667 
669 {
670  return m_draggedItems;
671 }
672 
673 }
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
Definition: trigo.h:148
int Find(const VECTOR2I &aP) const
Function Find()
const SHAPE_LINE_CHAIN & CLine() const
Definition: pns_line.h:137
Base class for PNS router board items.
Definition: pns_item.h:55
ITEM_SET m_draggedItems
If true, moves the connection lines without maintaining 45 degrees corners.
Definition: pns_dragger.h:145
ROUTER * Router() const
Return current router settings.
Definition: pns_algo_base.h:54
long long int Length() const
Function Length()
bool Drag(const VECTOR2I &aP) override
Function Drag()
virtual void AddPoint(VECTOR2I aP, int aColor, int aSize=100000, const std::string aName="")
virtual void AddBox(BOX2I aB, int aColor, const std::string aName="")
bool tryWalkaround(NODE *aNode, LINE &aOrig, LINE &aWalk)
bool Empty() const
Definition: pns_itemset.h:133
Keep the router "world" - i.e.
Definition: pns_node.h:149
bool propagateViaForces(NODE *node, std::set< VIA * > &vias)
Definition: pns_dragger.cpp:50
OPT_BOX2I ChangedArea(const LINE *aOther) const
Definition: pns_line.cpp:1008
void DragSegment(const VECTOR2I &aP, int aIndex, bool aFreeAngle=false)
Definition: pns_line.cpp:606
const VIA_HANDLE MakeHandle() const
Definition: pns_via.cpp:120
DRAGGER(ROUTER *aRouter)
Definition: pns_dragger.cpp:32
void CommitRouting()
Definition: pns_router.cpp:655
std::unique_ptr< SHOVE > m_shove
Definition: pns_dragger.h:137
DRAG_ALGO.
Definition: pns_drag_algo.h:42
int Width() const override
Definition: pns_segment.h:79
WALKAROUND_STATUS statusCw
ENTRIES & Items()
Definition: pns_itemset.h:138
bool m_dragStatus
Definition: pns_dragger.h:139
void SetRestrictArea(const BOX2I &aArea, bool aStrict=true)
virtual LOGGER * Logger()
bool PushoutForce(NODE *aNode, const VECTOR2I &aDirection, VECTOR2I &aForce, bool aSolidsOnly=true, int aMaxIterations=10)
Definition: pns_via.cpp:32
void optimizeAndUpdateDraggedLine(LINE &aDragged, const LINE &aOrig, const VECTOR2I &aP)
bool startDragSegment(const VECTOR2D &aP, SEGMENT *aSeg)
Definition: pns_dragger.cpp:68
VIA_HANDLE m_draggedVia
Definition: pns_dragger.h:132
virtual bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives) override
Function Start()
LINE m_draggedLine
Definition: pns_dragger.h:136
const ITEM_SET Traces() override
Function Traces()
WALKAROUND_STATUS Route(const LINE &aInitialPath, LINE &aWalkPath, bool aOptimize=true)
NODE * CurrentNode() const override
Function CurrentNode()
bool startDragArc(const VECTOR2D &aP, ARC *aArc)
const SEG & Seg() const
Definition: pns_segment.h:84
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition: pns_line.h:60
virtual void Unmark(int aMarker=-1) const
Definition: pns_item.h:207
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
Definition: pns_node.cpp:124
const VECTOR2I & Pos() const
Definition: pns_via.h:96
bool startDragVia(VIA *aVia)
const VECTOR2I NearestPoint(const VECTOR2I &aP, bool aAllowInternalShapePoints=true) const
Finds a point on the line chain that is closest to point aP.
void Remove(ARC *aArc)
Remove an item from this branch.
Definition: pns_node.cpp:804
int Start() const
Definition: pns_layerset.h:82
ROUTING_SETTINGS & Settings() const
Return the logger object, allowing to dump geometry to a file.
bool dragViaMarkObstacles(const VIA_HANDLE &aHandle, NODE *aNode, const VECTOR2I &aP)
Represents a 2D point on a given set of layers and belonging to a certain net, that links together a ...
Definition: pns_joint.h:42
void Reverse()
Clip the line to the nearest obstacle, traversing from the line's start vertex (0).
Definition: pns_line.cpp:862
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=NULL, bool aStopAtLockedJoints=false)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
Definition: pns_node.cpp:912
#define NULL
int m_draggedSegmentIndex
Definition: pns_dragger.h:138
static bool Optimize(LINE *aLine, int aEffortLevel, NODE *aWorld, const VECTOR2I aV=VECTOR2I(0, 0))
void SetPreserveVertex(const VECTOR2I &aV)
DEBUG_DECORATOR * Dbg() const
Definition: pns_algo_base.h:78
void AddTrailPoint(const VECTOR2I &aP)
bool SmoothDraggedSegments() const
Enable/disable smoothing segments during dragging.
PNS_MODE Mode() const
Set the routing mode.
void SetSolidsOnly(bool aSolidsOnly)
bool dragViaWalkaround(const VIA_HANDLE &aHandle, NODE *aNode, const VECTOR2I &aP)
const LINKED_ITEMS & LinkList() const
Definition: pns_joint.h:195
Reduce corner cost iteratively.
Definition: pns_optimizer.h:99
MOUSE_TRAIL_TRACER m_mouseTrailTracer
Definition: pns_dragger.h:149
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:1027
NODE * m_lastNode
Definition: pns_dragger.h:134
void SetPos(const VECTOR2I &aPos)
Definition: pns_via.h:98
void DragCorner(const VECTOR2I &aP, int aIndex, bool aFreeAngle=false)
Definition: pns_line.cpp:594
bool FixRoute() override
Function FixRoute()
Guess what's better, try to make least mess on the PCB.
const ITEM_SET findViaFanoutByHandle(NODE *aNode, const VIA_HANDLE &handle)
bool dragWalkaround(const VECTOR2I &aP)
Ignore collisions, mark obstacles.
bool dragShove(const VECTOR2I &aP)
PNS_MODE m_currentMode
Definition: pns_dragger.h:140
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
Definition: pns_item.h:257
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:427
WALKAROUND_STATUS statusCcw
LAYER_RANGE layers
Definition: pns_via.h:44
VECTOR2I A
Definition: seg.h:49
VIA_HANDLE m_initialVia
Definition: pns_dragger.h:131
int Width() const
Return true if the line is geometrically identical as line aOther.
Definition: pns_line.h:156
bool dragMarkObstacles(const VECTOR2I &aP)
Only walk around.
OPT< BOX2I > OPT_BOX2I
Definition: box2.h:525
void SetDebugDecorator(DEBUG_DECORATOR *aDecorator)
Assign a debug decorator allowing this algo to draw extra graphics for visual debugging.
Definition: pns_algo_base.h:73
VECTOR2I pos
Definition: pns_via.h:43
PnsKind Kind() const
Return the type (kind) of the item.
Definition: pns_item.h:126
Perform various optimizations of the lines being routed, attempting to make the lines shorter and les...
Definition: pns_optimizer.h:94
bool m_freeAngleMode
Definition: pns_dragger.h:148
void SetEffortLevel(int aEffort)
Push and Shove diff pair dimensions (gap) settings dialog.
VECTOR2D m_lastValidPoint
Contains the list of items that are currently modified by the dragger.
Definition: pns_dragger.h:142
void SetLogger(LOGGER *aLogger)
Definition: pns_algo_base.h:65
void SetMode(int aDragMode) override
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
Definition: pns_node.cpp:615
void SetIterationLimit(const int aIterLimit)
virtual void Unmark(int aMarker=-1) const override
Definition: pns_line.cpp:100
void SetSnapThreshhold(int aThreshhold)
Definition: pns_line.h:221
VECTOR2I B
Definition: seg.h:50