KiCad PCB EDA Suite
PNS::MEANDER_PLACER Class Reference

Single track length matching/meandering tool. More...

#include <pns_meander_placer.h>

Inheritance diagram for PNS::MEANDER_PLACER:
PNS::MEANDER_PLACER_BASE PNS::PLACEMENT_ALGO PNS::ALGO_BASE PNS::MEANDER_SKEW_PLACER

Public Types

enum  TUNING_STATUS { TOO_SHORT = 0, TOO_LONG, TUNED }
 < Result of the length tuning operation More...
 

Public Member Functions

 MEANDER_PLACER (ROUTER *aRouter)
 
virtual ~MEANDER_PLACER ()
 
virtual bool Start (const VECTOR2I &aP, ITEM *aStartItem) override
 Function Start() More...
 
virtual bool Move (const VECTOR2I &aP, ITEM *aEndItem) override
 Function Move() More...
 
virtual bool FixRoute (const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish=false) override
 Function FixRoute() More...
 
bool CommitPlacement () override
 
bool AbortPlacement () override
 
bool HasPlacedAnything () const override
 
NODECurrentNode (bool aLoopsRemoved=false) const override
 Function CurrentNode() More...
 
const ITEM_SET Traces () override
 Function Traces() More...
 
const VECTOR2ICurrentEnd () const override
 Function CurrentEnd() More...
 
const std::vector< int > CurrentNets () const override
 Function CurrentNets() More...
 
int CurrentLayer () const override
 Function CurrentLayer() More...
 
virtual const wxString TuningInfo (EDA_UNITS aUnits) const override
 Return a string describing the status and length of the tuned traces. More...
 
virtual TUNING_STATUS TuningStatus () const override
 Return the tuning status (too short, too long, etc.) of the trace(s) being tuned. More...
 
bool CheckFit (MEANDER_SHAPE *aShape) override
 Checks if it's OK to place the shape aShape (i.e. More...
 
virtual void AmplitudeStep (int aSign)
 Increase/decreases the current meandering amplitude by one step. More...
 
virtual void SpacingStep (int aSign)
 Increase/decrease the current meandering spacing by one step. More...
 
virtual int Clearance ()
 Return the clearance of the track(s) being length tuned. More...
 
virtual const MEANDER_SETTINGSMeanderSettings () const
 Return the current meandering configuration. More...
 
virtual void UpdateSettings (const MEANDER_SETTINGS &aSettings)
 
int GetTotalPadToDieLength (const LINE &aLine) const
 
virtual bool UnfixRoute ()
 
virtual bool ToggleVia (bool aEnabled)
 Function ToggleVia() More...
 
virtual bool IsPlacingVia () const
 Function IsPlacingVia() More...
 
virtual bool SetLayer (int aLayer)
 Function SetLayer() More...
 
virtual void FlipPosture ()
 Function FlipPosture() More...
 
virtual void UpdateSizes (const SIZES_SETTINGS &aSizes)
 Function UpdateSizes() More...
 
virtual void SetOrthoMode (bool aOrthoMode)
 Function SetOrthoMode() More...
 
virtual void GetModifiedNets (std::vector< int > &aNets) const
 Function GetModifiedNets. 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 Member Functions

bool doMove (const VECTOR2I &aP, ITEM *aEndItem, long long int aTargetLength)
 
void setWorld (NODE *aWorld)
 
virtual long long int origPathLength () const
 current routing start point (end of tail, beginning of head) More...
 
void cutTunedLine (const SHAPE_LINE_CHAIN &aOrigin, const VECTOR2I &aTuneStart, const VECTOR2I &aCursorPos, SHAPE_LINE_CHAIN &aPre, SHAPE_LINE_CHAIN &aTuned, SHAPE_LINE_CHAIN &aPost)
 Extract the part of a track to be meandered, depending on the starting point and the cursor position. More...
 
void tuneLineLength (MEANDERED_LINE &aTuned, long long int aElongation)
 Take a set of meanders in aTuned and tunes their length to extend the original line length by aElongation. More...
 
int compareWithTolerance (long long int aValue, long long int aExpected, long long int aTolerance=0) const
 Compare aValue against aExpected with given tolerance. More...
 
VECTOR2I getSnappedStartPoint (LINKED_ITEM *aStartItem, VECTOR2I aStartPoint)
 
long long int lineLength (const ITEM_SET &aLine) const
 Calculate the total length of the line represented by an item set (tracks and vias) More...
 

Protected Attributes

VECTOR2I m_currentStart
 Current world state. More...
 
NODEm_currentNode
 
LINE m_originLine
 
LINE m_currentTrace
 
ITEM_SET m_tunedPath
 
SHAPE_LINE_CHAIN m_finalShape
 
MEANDERED_LINE m_result
 
LINKED_ITEMm_initialSegment
 
long long int m_lastLength
 
TUNING_STATUS m_lastStatus
 
NODEm_world
 Total length added by pad to die size. More...
 
int m_padToDieLength
 Width of the meandered trace(s). More...
 
int m_currentWidth
 Meander settings. More...
 
MEANDER_SETTINGS m_settings
 The current end point. More...
 
VECTOR2I m_currentEnd
 
DEBUG_DECORATORm_debugDecorator
 
ROUTERm_router
 
LOGGERm_logger
 

Detailed Description

Single track length matching/meandering tool.

Definition at line 45 of file pns_meander_placer.h.

Member Enumeration Documentation

◆ TUNING_STATUS

< Result of the length tuning operation

Enumerator
TOO_SHORT 
TOO_LONG 
TUNED 

Definition at line 49 of file pns_meander_placer_base.h.

Constructor & Destructor Documentation

◆ MEANDER_PLACER()

PNS::MEANDER_PLACER::MEANDER_PLACER ( ROUTER aRouter)

Definition at line 34 of file pns_meander_placer.cpp.

34  :
35  MEANDER_PLACER_BASE( aRouter )
36 {
37  m_currentNode = nullptr;
38 
39  // Init temporary variables (do not leave uninitialized members)
40  m_initialSegment = nullptr;
41  m_lastLength = 0;
43 }
TUNING_STATUS m_lastStatus
long long int m_lastLength
LINKED_ITEM * m_initialSegment

References m_currentNode, m_initialSegment, m_lastLength, m_lastStatus, and PNS::MEANDER_PLACER_BASE::TOO_SHORT.

◆ ~MEANDER_PLACER()

PNS::MEANDER_PLACER::~MEANDER_PLACER ( )
virtual

Definition at line 46 of file pns_meander_placer.cpp.

47 {
48 }

Member Function Documentation

◆ AbortPlacement()

bool PNS::MEANDER_PLACER::AbortPlacement ( )
overridevirtual

Reimplemented from PNS::PLACEMENT_ALGO.

Definition at line 215 of file pns_meander_placer.cpp.

216 {
218  return true;
219 }
void KillChildren()
Definition: pns_node.cpp:1405
NODE * m_world
Total length added by pad to die size.

References PNS::NODE::KillChildren(), and PNS::MEANDER_PLACER_BASE::m_world.

◆ AmplitudeStep()

void PNS::MEANDER_PLACER_BASE::AmplitudeStep ( int  aSign)
virtualinherited

Increase/decreases the current meandering amplitude by one step.

Parameters
aSigndirection (negative = decrease, positive = increase).

Definition at line 44 of file pns_meander_placer_base.cpp.

45 {
46  int a = m_settings.m_maxAmplitude + aSign * m_settings.m_step;
47  a = std::max( a, m_settings.m_minAmplitude );
48 
50 }
int m_minAmplitude
Maximum meandering amplitude.
Definition: pns_meander.h:77
int m_step
Length PadToDie.
Definition: pns_meander.h:86
MEANDER_SETTINGS m_settings
The current end point.
int m_maxAmplitude
Meandering period/spacing (see dialog picture for explanation).
Definition: pns_meander.h:80

References PNS::MEANDER_SETTINGS::m_maxAmplitude, PNS::MEANDER_SETTINGS::m_minAmplitude, PNS::MEANDER_PLACER_BASE::m_settings, and PNS::MEANDER_SETTINGS::m_step.

◆ CheckFit()

bool PNS::MEANDER_PLACER::CheckFit ( MEANDER_SHAPE aShape)
overridevirtual

Checks if it's OK to place the shape aShape (i.e.

if it doesn't cause DRC violations or collide with other meanders).

Parameters
aShapethe shape to check.
Returns
true if the shape fits.

Reimplemented from PNS::MEANDER_PLACER_BASE.

Definition at line 238 of file pns_meander_placer.cpp.

239 {
240  LINE l( m_originLine, aShape->CLine( 0 ) );
241 
242  if( m_currentNode->CheckColliding( &l ) )
243  return false;
244 
245  int w = aShape->Width();
246  int clearance = w + m_settings.m_spacing;
247 
248  return m_result.CheckSelfIntersections( aShape, clearance );
249 }
const SHAPE_LINE_CHAIN & CLine() const
Definition: pns_line.h:137
bool CheckSelfIntersections(MEANDER_SHAPE *aShape, int aClearance)
Check if the given shape is intersecting with any other meander in the current line.
MEANDER_SETTINGS m_settings
The current end point.
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:450
int m_spacing
Amplitude/spacing adjustment step.
Definition: pns_meander.h:83

References PNS::NODE::CheckColliding(), PNS::MEANDERED_LINE::CheckSelfIntersections(), PNS::MEANDER_SHAPE::CLine(), m_currentNode, m_originLine, m_result, PNS::MEANDER_PLACER_BASE::m_settings, PNS::MEANDER_SETTINGS::m_spacing, and PNS::MEANDER_SHAPE::Width().

◆ Clearance()

int PNS::MEANDER_PLACER_BASE::Clearance ( )
virtualinherited

Return the clearance of the track(s) being length tuned.

Returns
clearance value in internal units

Definition at line 62 of file pns_meander_placer_base.cpp.

63 {
64  // Assumption: All tracks are part of the same net class.
65  // It shouldn't matter which track we pick. They should all have the same clearance if
66  // they are part of the same net class. Therefore, pick the first one on the list.
67  ITEM* itemToCheck = Traces().CItems().front().item;
68  PNS::CONSTRAINT constraint;
69 
71  nullptr, CurrentLayer(), &constraint );
72 
73  wxCHECK_MSG( constraint.m_Value.HasMin(), m_currentWidth, "No minimum clearance?" );
74 
75  return constraint.m_Value.Min();
76 }
ROUTER * Router() const
Return current router settings.
Definition: pns_algo_base.h:54
bool HasMin() const
Definition: minoptmax.h:37
virtual const ITEM_SET Traces()=0
Function Traces()
virtual bool QueryConstraint(CONSTRAINT_TYPE aType, const PNS::ITEM *aItemA, const PNS::ITEM *aItemB, int aLayer, PNS::CONSTRAINT *aConstraint)=0
RULE_RESOLVER * GetRuleResolver() const
Definition: pns_router.h:169
virtual int CurrentLayer() const =0
Function CurrentLayer()
T Min() const
Definition: minoptmax.h:33
int m_currentWidth
Meander settings.
const ENTRIES & CItems() const
Definition: pns_itemset.h:136
MINOPTMAX< int > m_Value
Definition: pns_node.h:70

References PNS::ITEM_SET::CItems(), PNS::CT_CLEARANCE, PNS::PLACEMENT_ALGO::CurrentLayer(), PNS::ROUTER::GetRuleResolver(), MINOPTMAX< T >::HasMin(), PNS::MEANDER_PLACER_BASE::m_currentWidth, PNS::CONSTRAINT::m_Value, MINOPTMAX< T >::Min(), PNS::RULE_RESOLVER::QueryConstraint(), PNS::ALGO_BASE::Router(), and PNS::PLACEMENT_ALGO::Traces().

Referenced by PNS::MEANDER_SHAPE::spacing(), and PNS::MEANDER_PLACER_BASE::SpacingStep().

◆ CommitPlacement()

bool PNS::MEANDER_PLACER::CommitPlacement ( )
overridevirtual

Reimplemented from PNS::PLACEMENT_ALGO.

Definition at line 228 of file pns_meander_placer.cpp.

229 {
230  if( m_currentNode )
232 
233  m_currentNode = nullptr;
234  return true;
235 }
ROUTER * Router() const
Return current router settings.
Definition: pns_algo_base.h:54
void CommitRouting()
Definition: pns_router.cpp:707

References PNS::ROUTER::CommitRouting(), m_currentNode, and PNS::ALGO_BASE::Router().

Referenced by FixRoute().

◆ compareWithTolerance()

int PNS::MEANDER_PLACER_BASE::compareWithTolerance ( long long int  aValue,
long long int  aExpected,
long long int  aTolerance = 0 
) const
protectedinherited

Compare aValue against aExpected with given tolerance.

Definition at line 245 of file pns_meander_placer_base.cpp.

247 {
248  if( aValue < aExpected - aTolerance )
249  return -1;
250  else if( aValue > aExpected + aTolerance )
251  return 1;
252  else
253  return 0;
254 }

Referenced by doMove(), and PNS::DP_MEANDER_PLACER::Move().

◆ CurrentEnd()

const VECTOR2I & PNS::MEANDER_PLACER::CurrentEnd ( ) const
overridevirtual

Function CurrentEnd()

Returns the current end of the line(s) being placed/tuned. It may not be equal to the cursor position due to collisions.

Implements PNS::PLACEMENT_ALGO.

Definition at line 259 of file pns_meander_placer.cpp.

260 {
261  return m_currentEnd;
262 }

References PNS::MEANDER_PLACER_BASE::m_currentEnd.

◆ CurrentLayer()

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

Function CurrentLayer()

Returns the layer of currently routed track.

Implements PNS::PLACEMENT_ALGO.

Definition at line 264 of file pns_meander_placer.cpp.

265 {
266  return m_initialSegment->Layers().Start();
267 }
LINKED_ITEM * m_initialSegment
int Start() const
Definition: pns_layerset.h:82
const LAYER_RANGE & Layers() const
Definition: pns_item.h:154

References PNS::ITEM::Layers(), m_initialSegment, and LAYER_RANGE::Start().

◆ CurrentNets()

const std::vector<int> PNS::MEANDER_PLACER::CurrentNets ( ) const
inlineoverridevirtual

Function CurrentNets()

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

Implements PNS::PLACEMENT_ALGO.

Definition at line 80 of file pns_meander_placer.h.

81  {
82  return std::vector<int> (1, m_originLine.Net() );
83  }
int Net() const
Definition: pns_item.h:152

References m_originLine, and PNS::ITEM::Net().

◆ CurrentNode()

NODE * PNS::MEANDER_PLACER::CurrentNode ( bool  aLoopsRemoved = false) const
overridevirtual

Function CurrentNode()

Returns the most recent board state.

Implements PNS::PLACEMENT_ALGO.

Definition at line 51 of file pns_meander_placer.cpp.

52 {
53  if( !m_currentNode )
54  return m_world;
55 
56  return m_currentNode;
57 }
NODE * m_world
Total length added by pad to die size.

References m_currentNode, and PNS::MEANDER_PLACER_BASE::m_world.

◆ cutTunedLine()

void PNS::MEANDER_PLACER_BASE::cutTunedLine ( const SHAPE_LINE_CHAIN aOrigin,
const VECTOR2I aTuneStart,
const VECTOR2I aCursorPos,
SHAPE_LINE_CHAIN aPre,
SHAPE_LINE_CHAIN aTuned,
SHAPE_LINE_CHAIN aPost 
)
protectedinherited

Extract the part of a track to be meandered, depending on the starting point and the cursor position.

Parameters
aOriginthe original line.
aTuneStartpoint where we start meandering (start click coordinates).
aCursorPoscurrent cursor position.
aPrepart before the beginning of meanders.
aTunedpart to be meandered.
aPostpart after the end of meanders.

Definition at line 85 of file pns_meander_placer_base.cpp.

88 {
89  VECTOR2I cp ( aCursorPos );
90 
91  if( cp == aTuneStart ) // we don't like tuning segments with 0 length
92  {
93  int idx = aOrigin.FindSegment( cp );
94 
95  if( idx >= 0 )
96  {
97  const SEG& s = aOrigin.CSegment( idx );
98  cp += ( s.B - s.A ).Resize( 2 );
99  }
100  else
101  {
102  cp += VECTOR2I( 2, 5 ); // some arbitrary value that is not 45 degrees oriented
103  }
104  }
105 
106  VECTOR2I n = aOrigin.NearestPoint( cp, false );
107  VECTOR2I m = aOrigin.NearestPoint( aTuneStart, false );
108 
109  SHAPE_LINE_CHAIN l( aOrigin );
110  l.Split( n );
111  l.Split( m );
112 
113  int i_start = l.Find( m );
114  int i_end = l.Find( n );
115 
116  if( i_start > i_end )
117  {
118  l = l.Reverse();
119  i_start = l.Find( m );
120  i_end = l.Find( n );
121  }
122 
123  aPre = l.Slice( 0, i_start );
124  aPost = l.Slice( i_end, -1 );
125  aTuned = l.Slice( i_start, i_end );
126 
127  aTuned.Simplify();
128 }
SHAPE_LINE_CHAIN & Simplify(bool aRemoveColinear=true)
Simplify the line chain by removing colinear adjacent segments and duplicate vertices.
const SHAPE_LINE_CHAIN Slice(int aStartIndex, int aEndIndex=-1) const
Return a subset of this line chain containing the [start_index, end_index] range of points.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
int FindSegment(const VECTOR2I &aP, int aThreshold=1) const
Search for segment containing point aP.
const VECTOR2I NearestPoint(const VECTOR2I &aP, bool aAllowInternalShapePoints=true) const
Find a point on the line chain that is closest to point aP.
Definition: seg.h:40
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
VECTOR2I A
Definition: seg.h:48
VECTOR2I B
Definition: seg.h:49

References SEG::A, SEG::B, SHAPE_LINE_CHAIN::CSegment(), SHAPE_LINE_CHAIN::Find(), SHAPE_LINE_CHAIN::FindSegment(), SHAPE_LINE_CHAIN::NearestPoint(), SHAPE_LINE_CHAIN::Reverse(), SHAPE_LINE_CHAIN::Simplify(), SHAPE_LINE_CHAIN::Slice(), and SHAPE_LINE_CHAIN::Split().

Referenced by doMove(), and PNS::DP_MEANDER_PLACER::Move().

◆ Dbg()

◆ doMove()

bool PNS::MEANDER_PLACER::doMove ( const VECTOR2I aP,
ITEM aEndItem,
long long int  aTargetLength 
)
protected

Definition at line 110 of file pns_meander_placer.cpp.

111 {
112  SHAPE_LINE_CHAIN pre, tuned, post;
113 
114  if( m_currentNode )
115  delete m_currentNode;
116 
118 
119  cutTunedLine( m_originLine.CLine(), m_currentStart, aP, pre, tuned, post );
120 
121  m_result = MEANDERED_LINE( this, false );
124 
125  for( int i = 0; i < tuned.SegmentCount(); i++ )
126  {
127  if( tuned.IsArcSegment( i ) )
128  {
129  ssize_t arcIndex = tuned.ArcIndex( i );
130  m_result.AddArc( tuned.Arc( arcIndex ) );
131  i = tuned.NextShape( i );
132 
133  // NextShape will return -1 if last shape
134  if( i < 0 )
135  i = tuned.SegmentCount();
136 
137  continue;
138  }
139 
140  const SEG s = tuned.CSegment( i );
141  m_result.AddCorner( s.A );
142  m_result.MeanderSegment( s, s.Side( aP ) < 0 );
143  m_result.AddCorner( s.B );
144  }
145 
146  long long int lineLen = origPathLength();
147 
148  m_lastLength = lineLen;
150 
151  if( compareWithTolerance( lineLen, aTargetLength, m_settings.m_lengthTolerance ) > 0 )
152  {
154  } else {
155  m_lastLength = lineLen - tuned.Length();
156  tuneLineLength( m_result, aTargetLength - lineLen );
157  }
158 
159  for( const ITEM* item : m_tunedPath.CItems() )
160  {
161  if( const LINE* l = dyn_cast<const LINE*>( item ) )
162  {
163  PNS_DBG( Dbg(), AddLine, l->CLine(), BLUE, 30000, "tuned-line" );
164  }
165  }
166 
167  if( m_lastStatus != TOO_LONG )
168  {
169  tuned.Clear();
170 
171  for( MEANDER_SHAPE* m : m_result.Meanders() )
172  {
173  if( m->Type() != MT_EMPTY )
174  {
175  tuned.Append ( m->CLine( 0 ) );
176  }
177  }
178 
179  m_lastLength += tuned.Length();
180 
181  int comp = compareWithTolerance( m_lastLength - aTargetLength, 0,
183 
184  if( comp > 0 )
186  else if( comp < 0 )
188  else
190  }
191 
193  m_finalShape.Append( pre );
194  m_finalShape.Append( tuned );
195  m_finalShape.Append( post );
197 
198  return true;
199 }
const SHAPE_LINE_CHAIN & CLine() const
Definition: pns_line.h:137
SHAPE_LINE_CHAIN & Simplify(bool aRemoveColinear=true)
Simplify the line chain by removing colinear adjacent segments and duplicate vertices.
void AddCorner(const VECTOR2I &aA, const VECTOR2I &aB=VECTOR2I(0, 0))
Create a dummy meander shape representing a line corner.
TUNING_STATUS m_lastStatus
long long int m_lastLength
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
Definition: pns_node.cpp:137
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
void SetWidth(int aWidth)
Set the line width.
Definition: pns_meander.h:466
void AddArc(const SHAPE_ARC &aArc1, const SHAPE_ARC &aArc2=SHAPE_ARC())
Create a dummy meander shape representing an arc corner.
std::vector< MEANDER_SHAPE * > & Meanders()
Definition: pns_meander.h:489
NODE * m_world
Total length added by pad to die size.
#define PNS_DBG(dbg, method,...)
DEBUG_DECORATOR * Dbg() const
Definition: pns_algo_base.h:78
void tuneLineLength(MEANDERED_LINE &aTuned, long long int aElongation)
Take a set of meanders in aTuned and tunes their length to extend the original line length by aElonga...
Definition: seg.h:40
VECTOR2I m_currentStart
Current world state.
Definition: color4d.h:56
void MeanderSegment(const SEG &aSeg, bool aSide, int aBaseIndex=0)
Fit maximum amplitude meanders on a given segment and adds to the current line.
Definition: pns_meander.cpp:45
MEANDER_SETTINGS m_settings
The current end point.
int m_lengthTolerance
Target skew value for diff pair de-skewing.
Definition: pns_meander.h:101
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int compareWithTolerance(long long int aValue, long long int aExpected, long long int aTolerance=0) const
Compare aValue against aExpected with given tolerance.
VECTOR2I A
Definition: seg.h:48
const ENTRIES & CItems() const
Definition: pns_itemset.h:136
int Width() const
Return true if the line is geometrically identical as line aOther.
Definition: pns_line.h:156
void Clear()
Remove all points from the line chain.
SHAPE_LINE_CHAIN m_finalShape
void SetBaselineOffset(int aOffset)
Set the parallel offset between the base segment and the meandered line.
Definition: pns_meander.h:481
virtual long long int origPathLength() const
current routing start point (end of tail, beginning of head)
void cutTunedLine(const SHAPE_LINE_CHAIN &aOrigin, const VECTOR2I &aTuneStart, const VECTOR2I &aCursorPos, SHAPE_LINE_CHAIN &aPre, SHAPE_LINE_CHAIN &aTuned, SHAPE_LINE_CHAIN &aPost)
Extract the part of a track to be meandered, depending on the starting point and the cursor position.
int Side(const VECTOR2I &aP) const
Determine on which side of directed line passing via segment ends point aP lies.
Definition: seg.h:142
VECTOR2I B
Definition: seg.h:49

References SEG::A, PNS::MEANDERED_LINE::AddArc(), PNS::MEANDERED_LINE::AddCorner(), SHAPE_LINE_CHAIN::Append(), SEG::B, BLUE, PNS::NODE::Branch(), PNS::ITEM_SET::CItems(), SHAPE_LINE_CHAIN::Clear(), PNS::LINE::CLine(), PNS::MEANDER_PLACER_BASE::compareWithTolerance(), PNS::MEANDER_PLACER_BASE::cutTunedLine(), PNS::ALGO_BASE::Dbg(), m_currentNode, m_currentStart, m_finalShape, m_lastLength, m_lastStatus, PNS::MEANDER_SETTINGS::m_lengthTolerance, m_originLine, m_result, PNS::MEANDER_PLACER_BASE::m_settings, m_tunedPath, PNS::MEANDER_PLACER_BASE::m_world, PNS::MEANDERED_LINE::Meanders(), PNS::MEANDERED_LINE::MeanderSegment(), PNS::MT_EMPTY, origPathLength(), PNS_DBG, PNS::MEANDERED_LINE::SetBaselineOffset(), PNS::MEANDERED_LINE::SetWidth(), SEG::Side(), SHAPE_LINE_CHAIN::Simplify(), PNS::MEANDER_PLACER_BASE::TOO_LONG, PNS::MEANDER_PLACER_BASE::TOO_SHORT, PNS::MEANDER_PLACER_BASE::TUNED, PNS::MEANDER_PLACER_BASE::tuneLineLength(), and PNS::LINE::Width().

Referenced by PNS::MEANDER_SKEW_PLACER::Move(), and Move().

◆ FixRoute()

bool PNS::MEANDER_PLACER::FixRoute ( const VECTOR2I aP,
ITEM aEndItem,
bool  aForceFinish = false 
)
overridevirtual

Function FixRoute()

Commits the currently routed items to the parent node, taking aP as the final end point and aEndItem as the final anchor (if provided).

Returns
true, if route has been committed. May return false if the routing result is violating design rules - in such case, the track is only committed if Settings.CanViolateDRC() is on.

Implements PNS::PLACEMENT_ALGO.

Definition at line 202 of file pns_meander_placer.cpp.

203 {
204  if( !m_currentNode )
205  return false;
206 
209  CommitPlacement();
210 
211  return true;
212 }
bool CommitPlacement() override
SHAPE_LINE_CHAIN m_finalShape
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
Definition: pns_node.cpp:638

References PNS::NODE::Add(), CommitPlacement(), m_currentNode, m_currentTrace, m_finalShape, and m_originLine.

◆ FlipPosture()

virtual void PNS::PLACEMENT_ALGO::FlipPosture ( )
inlinevirtualinherited

Function FlipPosture()

Toggles the current posture (straight/diagonal) of the trace head.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 160 of file pns_placement_algo.h.

161  {
162  }

◆ GetModifiedNets()

virtual void PNS::PLACEMENT_ALGO::GetModifiedNets ( std::vector< int > &  aNets) const
inlinevirtualinherited

Function GetModifiedNets.

Returns the net codes of all currently routed trace(s)

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 191 of file pns_placement_algo.h.

192  {
193  }

◆ getSnappedStartPoint()

VECTOR2I PNS::MEANDER_PLACER_BASE::getSnappedStartPoint ( LINKED_ITEM aStartItem,
VECTOR2I  aStartPoint 
)
protectedinherited

Definition at line 257 of file pns_meander_placer_base.cpp.

258 {
259  if( aStartItem->Kind() == ITEM::SEGMENT_T )
260  {
261  return static_cast<SEGMENT*>( aStartItem )->Seg().NearestPoint( aStartPoint );
262  }
263  else
264  {
265  wxASSERT( aStartItem->Kind() == ITEM::ARC_T );
266  ARC* arc = static_cast<ARC*>( aStartItem );
267 
268  if( ( VECTOR2I( arc->Anchor( 0 ) - aStartPoint ) ).SquaredEuclideanNorm() <=
269  ( VECTOR2I( arc->Anchor( 1 ) - aStartPoint ) ).SquaredEuclideanNorm() )
270  {
271  return arc->Anchor( 0 );
272  }
273  else
274  {
275  return arc->Anchor( 1 );
276  }
277  }
278 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623

References PNS::ITEM::ARC_T, PNS::ITEM::Kind(), and PNS::ITEM::SEGMENT_T.

Referenced by PNS::MEANDER_SKEW_PLACER::Start(), Start(), and PNS::DP_MEANDER_PLACER::Start().

◆ GetTotalPadToDieLength()

int PNS::MEANDER_PLACER_BASE::GetTotalPadToDieLength ( const LINE aLine) const
inherited

Definition at line 201 of file pns_meander_placer_base.cpp.

202 {
203  int length = 0;
204  JOINT start;
205  JOINT end;
206 
207  m_world->FindLineEnds( aLine, start, end );
208 
209  // Extract the length of the pad to die for start and end pads
210  for( auto& link : start.LinkList() )
211  {
212  if( const SOLID* solid = dynamic_cast<const SOLID*>( link.item ) )
213  {
214  // If there are overlapping pads, choose the first with a non-zero length
215  if( solid->GetPadToDie() > 0 )
216  {
217  length += solid->GetPadToDie();
218  break;
219  }
220  }
221  }
222 
223  for( auto& link : end.LinkList() )
224  {
225  if( const SOLID* solid = dynamic_cast<const SOLID*>( link.item ) )
226  {
227  if( solid->GetPadToDie() > 0 )
228  {
229  length += solid->GetPadToDie();
230  break;
231  }
232  }
233  }
234 
235  return length;
236 }
void FindLineEnds(const LINE &aLine, JOINT &aA, JOINT &aB)
Destroy all child nodes. Applicable only to the root node.
Definition: pns_node.cpp:1028
NODE * m_world
Total length added by pad to die size.

References PNS::NODE::FindLineEnds(), PNS::JOINT::LinkList(), and PNS::MEANDER_PLACER_BASE::m_world.

◆ HasPlacedAnything()

bool PNS::MEANDER_PLACER::HasPlacedAnything ( ) const
overridevirtual

Reimplemented from PNS::PLACEMENT_ALGO.

Definition at line 222 of file pns_meander_placer.cpp.

223 {
224  return m_currentTrace.SegmentCount() > 0;
225 }
int SegmentCount() const
Definition: pns_line.h:139

References m_currentTrace, and PNS::LINE::SegmentCount().

◆ IsPlacingVia()

virtual bool PNS::PLACEMENT_ALGO::IsPlacingVia ( ) const
inlinevirtualinherited

Function IsPlacingVia()

Returns true if the placer is placing a via (or more vias).

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 104 of file pns_placement_algo.h.

105  {
106  return false;
107  }

◆ lineLength()

long long int PNS::MEANDER_PLACER_BASE::lineLength ( const ITEM_SET aLine) const
protectedinherited

Calculate the total length of the line represented by an item set (tracks and vias)

Parameters
aLine@returnPointer to world to search colliding items.

Definition at line 281 of file pns_meander_placer_base.cpp.

282 {
283  long long int total = 0;
284 
285  for( int idx = 0; idx < aLine.Size(); idx++ )
286  {
287  const ITEM* item = aLine[idx];
288 
289  if( const LINE* l = dyn_cast<const LINE*>( item ) )
290  {
291  total += l->CLine().Length();
292  }
293  else if( item->OfKind( ITEM::VIA_T ) && idx > 0 && idx < aLine.Size() - 1 )
294  {
295  int layerPrev = aLine[idx - 1]->Layer();
296  int layerNext = aLine[idx + 1]->Layer();
297 
298  if( layerPrev != layerNext )
299  total += m_router->GetInterface()->StackupHeight( layerPrev, layerNext );
300  }
301  }
302 
303  return total;
304 }
ROUTER * m_router
Definition: pns_algo_base.h:87
virtual int StackupHeight(int aFirstLayer, int aSecondLayer) const =0
ROUTER_IFACE * GetInterface() const
Definition: pns_router.h:207

References PNS::ROUTER::GetInterface(), PNS::ALGO_BASE::m_router, PNS::ITEM::OfKind(), PNS::ITEM_SET::Size(), PNS::ROUTER_IFACE::StackupHeight(), and PNS::ITEM::VIA_T.

Referenced by PNS::MEANDER_SKEW_PLACER::origPathLength(), origPathLength(), PNS::DP_MEANDER_PLACER::origPathLength(), and PNS::MEANDER_SKEW_PLACER::Start().

◆ 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::rhWalkOnly(), PNS::DRAGGER::Start(), and PNS::DRAGGER::tryWalkaround().

◆ MeanderSettings()

const MEANDER_SETTINGS & PNS::MEANDER_PLACER_BASE::MeanderSettings ( ) const
virtualinherited

Return the current meandering configuration.

Returns
the settings

Definition at line 239 of file pns_meander_placer_base.cpp.

240 {
241  return m_settings;
242 }
MEANDER_SETTINGS m_settings
The current end point.

References PNS::MEANDER_PLACER_BASE::m_settings.

Referenced by PNS::MEANDER_SHAPE::makeMiterShape(), LENGTH_TUNER_TOOL::meanderSettingsDialog(), PNS::MEANDER_SHAPE::Settings(), and PNS::MEANDERED_LINE::Settings().

◆ Move()

bool PNS::MEANDER_PLACER::Move ( const VECTOR2I aP,
ITEM aEndItem 
)
overridevirtual

Function Move()

Moves the end of the currently routed primtive(s) to the point aP, taking aEndItem as the anchor (if not NULL). (unless NULL).

Implements PNS::PLACEMENT_ALGO.

Reimplemented in PNS::MEANDER_SKEW_PLACER.

Definition at line 104 of file pns_meander_placer.cpp.

105 {
106  return doMove( aP, aEndItem, m_settings.m_targetLength );
107 }
bool doMove(const VECTOR2I &aP, ITEM *aEndItem, long long int aTargetLength)
MEANDER_SETTINGS m_settings
The current end point.
long long int m_targetLength
Type of corners for the meandered line.
Definition: pns_meander.h:92

References doMove(), PNS::MEANDER_PLACER_BASE::m_settings, and PNS::MEANDER_SETTINGS::m_targetLength.

◆ origPathLength()

long long int PNS::MEANDER_PLACER::origPathLength ( ) const
protectedvirtual

current routing start point (end of tail, beginning of head)

Reimplemented in PNS::MEANDER_SKEW_PLACER.

Definition at line 98 of file pns_meander_placer.cpp.

99 {
101 }
int m_padToDieLength
Width of the meandered trace(s).
long long int lineLength(const ITEM_SET &aLine) const
Calculate the total length of the line represented by an item set (tracks and vias)

References PNS::MEANDER_PLACER_BASE::lineLength(), PNS::MEANDER_PLACER_BASE::m_padToDieLength, and m_tunedPath.

Referenced by doMove().

◆ 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  }
DEBUG_DECORATOR * m_debugDecorator
Definition: pns_algo_base.h:86

References PNS::ALGO_BASE::m_debugDecorator.

Referenced by PNS::LINE_PLACER::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), PNS::SHOVE::SHOVE(), and PNS::DRAGGER::tryWalkaround().

◆ SetLayer()

virtual bool PNS::PLACEMENT_ALGO::SetLayer ( int  aLayer)
inlinevirtualinherited

Function SetLayer()

Sets the current routing layer.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 114 of file pns_placement_algo.h.

115  {
116  return false;
117  }

◆ 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::rhShoveOnly(), PNS::LINE_PLACER::rhWalkOnly(), and PNS::DRAGGER::tryWalkaround().

◆ SetOrthoMode()

virtual void PNS::PLACEMENT_ALGO::SetOrthoMode ( bool  aOrthoMode)
inlinevirtualinherited

Function SetOrthoMode()

Forces the router to place a straight 90/45 degree trace (with the end as near to the cursor as possible) instead of a standard 135 degree two-segment bend.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 182 of file pns_placement_algo.h.

183  {
184  }

◆ Settings()

◆ setWorld()

void PNS::MEANDER_PLACER::setWorld ( NODE aWorld)
protected

◆ SpacingStep()

void PNS::MEANDER_PLACER_BASE::SpacingStep ( int  aSign)
virtualinherited

Increase/decrease the current meandering spacing by one step.

Parameters
aSigndirection (negative = decrease, positive = increase).

Definition at line 53 of file pns_meander_placer_base.cpp.

54 {
55  int s = m_settings.m_spacing + aSign * m_settings.m_step;
56  s = std::max( s, m_currentWidth + Clearance() );
57 
59 }
virtual int Clearance()
Return the clearance of the track(s) being length tuned.
int m_currentWidth
Meander settings.
int m_step
Length PadToDie.
Definition: pns_meander.h:86
MEANDER_SETTINGS m_settings
The current end point.
int m_spacing
Amplitude/spacing adjustment step.
Definition: pns_meander.h:83

References PNS::MEANDER_PLACER_BASE::Clearance(), PNS::MEANDER_PLACER_BASE::m_currentWidth, PNS::MEANDER_PLACER_BASE::m_settings, PNS::MEANDER_SETTINGS::m_spacing, and PNS::MEANDER_SETTINGS::m_step.

◆ Start()

bool PNS::MEANDER_PLACER::Start ( const VECTOR2I aP,
ITEM aStartItem 
)
overridevirtual

Function Start()

Starts placement/drag operation at point aP, taking item aStartItem as anchor (unless NULL).

Implements PNS::PLACEMENT_ALGO.

Reimplemented in PNS::MEANDER_SKEW_PLACER.

Definition at line 60 of file pns_meander_placer.cpp.

61 {
62  if( !aStartItem || !aStartItem->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) )
63  {
64  Router()->SetFailureReason( _( "Please select a track whose length you want to tune." ) );
65  return false;
66  }
67 
68  m_initialSegment = static_cast<LINKED_ITEM*>( aStartItem );
69  m_currentNode = nullptr;
71 
72  m_world = Router()->GetWorld()->Branch();
74 
75  SOLID* padA = nullptr;
76  SOLID* padB = nullptr;
77 
78  TOPOLOGY topo( m_world );
79  m_tunedPath = topo.AssembleTuningPath( m_initialSegment, &padA, &padB );
80 
81  m_padToDieLength = 0;
82 
83  if( padA )
84  m_padToDieLength += padA->GetPadToDie();
85 
86  if( padB )
87  m_padToDieLength += padB->GetPadToDie();
88 
90 
92  m_currentEnd = VECTOR2I( 0, 0 );
93 
94  return true;
95 }
ROUTER * Router() const
Return current router settings.
Definition: pns_algo_base.h:54
LINKED_ITEM * m_initialSegment
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
Definition: pns_node.cpp:137
int m_currentWidth
Meander settings.
void Remove(ARC *aArc)
Remove an item from this branch.
Definition: pns_node.cpp:836
int m_padToDieLength
Width of the meandered trace(s).
NODE * m_world
Total length added by pad to die size.
void SetFailureReason(const wxString &aReason)
Definition: pns_router.h:202
#define _(s)
VECTOR2I getSnappedStartPoint(LINKED_ITEM *aStartItem, VECTOR2I aStartPoint)
VECTOR2I m_currentStart
Current world state.
int Width() const
Return true if the line is geometrically identical as line aOther.
Definition: pns_line.h:156
NODE * GetWorld() const
Definition: pns_router.h:153
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
Definition: pns_node.cpp:946

References _, PNS::ITEM::ARC_T, PNS::NODE::AssembleLine(), PNS::TOPOLOGY::AssembleTuningPath(), PNS::NODE::Branch(), PNS::SOLID::GetPadToDie(), PNS::MEANDER_PLACER_BASE::getSnappedStartPoint(), PNS::ROUTER::GetWorld(), PNS::MEANDER_PLACER_BASE::m_currentEnd, m_currentNode, m_currentStart, PNS::MEANDER_PLACER_BASE::m_currentWidth, m_initialSegment, m_originLine, PNS::MEANDER_PLACER_BASE::m_padToDieLength, m_tunedPath, PNS::MEANDER_PLACER_BASE::m_world, PNS::ITEM::OfKind(), PNS::NODE::Remove(), PNS::ALGO_BASE::Router(), PNS::ITEM::SEGMENT_T, PNS::ROUTER::SetFailureReason(), and PNS::LINE::Width().

◆ ToggleVia()

virtual bool PNS::PLACEMENT_ALGO::ToggleVia ( bool  aEnabled)
inlinevirtualinherited

Function ToggleVia()

Enables/disables a via at the end of currently routed trace.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 94 of file pns_placement_algo.h.

95  {
96  return false;
97  }

◆ Traces()

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

Function Traces()

Returns all routed/tuned traces.

Implements PNS::PLACEMENT_ALGO.

Definition at line 252 of file pns_meander_placer.cpp.

References m_currentTrace, m_finalShape, and m_originLine.

◆ tuneLineLength()

void PNS::MEANDER_PLACER_BASE::tuneLineLength ( MEANDERED_LINE aTuned,
long long int  aElongation 
)
protectedinherited

Take a set of meanders in aTuned and tunes their length to extend the original line length by aElongation.

Definition at line 131 of file pns_meander_placer_base.cpp.

132 {
133  long long int remaining = aElongation;
134  bool finished = false;
135 
136  for( MEANDER_SHAPE* m : aTuned.Meanders() )
137  {
138  if( m->Type() != MT_CORNER && m->Type() != MT_ARC )
139  {
140  if( remaining >= 0 )
141  remaining -= m->MaxTunableLength() - m->BaselineLength();
142 
143  if( remaining < 0 )
144  {
145  if( !finished )
146  {
147  MEANDER_TYPE newType;
148 
149  if( m->Type() == MT_START || m->Type() == MT_SINGLE )
150  newType = MT_SINGLE;
151  else
152  newType = MT_FINISH;
153 
154  m->SetType( newType );
155  m->Recalculate();
156 
157  finished = true;
158  }
159  else
160  {
161  m->MakeEmpty();
162  }
163  }
164  }
165  }
166 
167  remaining = aElongation;
168  int meanderCount = 0;
169 
170  for( MEANDER_SHAPE* m : aTuned.Meanders() )
171  {
172  if( m->Type() != MT_CORNER && m->Type() != MT_ARC && m->Type() != MT_EMPTY )
173  {
174  if(remaining >= 0)
175  {
176  remaining -= m->MaxTunableLength() - m->BaselineLength();
177  meanderCount ++;
178  }
179  }
180  }
181 
182  long long int balance = 0;
183 
184  if( meanderCount )
185  balance = -remaining / meanderCount;
186 
187  if( balance >= 0 )
188  {
189  for( MEANDER_SHAPE* m : aTuned.Meanders() )
190  {
191  if( m->Type() != MT_CORNER && m->Type() != MT_ARC && m->Type() != MT_EMPTY )
192  {
193  m->Resize( std::max( m->Amplitude() - balance / 2,
194  (long long int) m_settings.m_minAmplitude ) );
195  }
196  }
197  }
198 }
int m_minAmplitude
Maximum meandering amplitude.
Definition: pns_meander.h:77
MEANDER_TYPE
Shapes of available meanders.
Definition: pns_meander.h:37
MEANDER_SETTINGS m_settings
The current end point.

References PNS::MEANDER_SETTINGS::m_minAmplitude, PNS::MEANDER_PLACER_BASE::m_settings, PNS::MEANDERED_LINE::Meanders(), PNS::MT_ARC, PNS::MT_CORNER, PNS::MT_EMPTY, PNS::MT_FINISH, PNS::MT_SINGLE, and PNS::MT_START.

Referenced by doMove(), and PNS::DP_MEANDER_PLACER::Move().

◆ TuningInfo()

const wxString PNS::MEANDER_PLACER::TuningInfo ( EDA_UNITS  aUnits) const
overridevirtual

Return a string describing the status and length of the tuned traces.

Implements PNS::MEANDER_PLACER_BASE.

Reimplemented in PNS::MEANDER_SKEW_PLACER.

Definition at line 270 of file pns_meander_placer.cpp.

271 {
272  wxString status;
273 
274  switch ( m_lastStatus )
275  {
276  case TOO_LONG:
277  status = _( "Too long: " );
278  break;
279  case TOO_SHORT:
280  status = _( "Too short: " );
281  break;
282  case TUNED:
283  status = _( "Tuned: " );
284  break;
285  default:
286  return _( "?" );
287  }
288 
289  status += ::MessageTextFromValue( aUnits, m_lastLength );
290  status += "/";
291  status += ::MessageTextFromValue( aUnits, m_settings.m_targetLength );
292 
293  return status;
294 }
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:104
TUNING_STATUS m_lastStatus
long long int m_lastLength
#define _(s)
MEANDER_SETTINGS m_settings
The current end point.
long long int m_targetLength
Type of corners for the meandered line.
Definition: pns_meander.h:92

References _, m_lastLength, m_lastStatus, PNS::MEANDER_PLACER_BASE::m_settings, PNS::MEANDER_SETTINGS::m_targetLength, MessageTextFromValue(), PNS::MEANDER_PLACER_BASE::TOO_LONG, PNS::MEANDER_PLACER_BASE::TOO_SHORT, and PNS::MEANDER_PLACER_BASE::TUNED.

◆ TuningStatus()

MEANDER_PLACER::TUNING_STATUS PNS::MEANDER_PLACER::TuningStatus ( ) const
overridevirtual

Return the tuning status (too short, too long, etc.) of the trace(s) being tuned.

Implements PNS::MEANDER_PLACER_BASE.

Definition at line 297 of file pns_meander_placer.cpp.

298 {
299  return m_lastStatus;
300 }
TUNING_STATUS m_lastStatus

References m_lastStatus.

◆ UnfixRoute()

virtual bool PNS::PLACEMENT_ALGO::UnfixRoute ( )
inlinevirtualinherited

Reimplemented in PNS::LINE_PLACER.

Definition at line 81 of file pns_placement_algo.h.

81 { return false; };

◆ UpdateSettings()

void PNS::MEANDER_PLACER_BASE::UpdateSettings ( const MEANDER_SETTINGS aSettings)
virtualinherited

Definition at line 79 of file pns_meander_placer_base.cpp.

80 {
81  m_settings = aSettings;
82 }
MEANDER_SETTINGS m_settings
The current end point.

References PNS::MEANDER_PLACER_BASE::m_settings.

Referenced by LENGTH_TUNER_TOOL::meanderSettingsDialog().

◆ UpdateSizes()

virtual void PNS::PLACEMENT_ALGO::UpdateSizes ( const SIZES_SETTINGS aSizes)
inlinevirtualinherited

Function UpdateSizes()

Performs on-the-fly update of the width, via diameter & drill size from a settings class. Used to dynamically change these parameters as the track is routed.

Reimplemented in PNS::LINE_PLACER, and PNS::DIFF_PAIR_PLACER.

Definition at line 171 of file pns_placement_algo.h.

172  {
173  }

◆ 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 }
ROUTER * m_router
Definition: pns_algo_base.h:87
const BOX2I & VisibleViewArea() const
Definition: pns_router.h:210

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

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

Member Data Documentation

◆ m_currentEnd

VECTOR2I PNS::MEANDER_PLACER_BASE::m_currentEnd
protectedinherited

◆ m_currentNode

NODE* PNS::MEANDER_PLACER::m_currentNode
protected

◆ m_currentStart

VECTOR2I PNS::MEANDER_PLACER::m_currentStart
protected

Current world state.

Definition at line 105 of file pns_meander_placer.h.

Referenced by doMove(), PNS::MEANDER_SKEW_PLACER::Start(), and Start().

◆ m_currentTrace

LINE PNS::MEANDER_PLACER::m_currentTrace
protected

Definition at line 111 of file pns_meander_placer.h.

Referenced by FixRoute(), HasPlacedAnything(), and Traces().

◆ m_currentWidth

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

SHAPE_LINE_CHAIN PNS::MEANDER_PLACER::m_finalShape
protected

Definition at line 114 of file pns_meander_placer.h.

Referenced by doMove(), FixRoute(), and Traces().

◆ m_initialSegment

LINKED_ITEM* PNS::MEANDER_PLACER::m_initialSegment
protected

◆ m_lastLength

long long int PNS::MEANDER_PLACER::m_lastLength
protected

◆ m_lastStatus

TUNING_STATUS PNS::MEANDER_PLACER::m_lastStatus
protected

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

LINE PNS::MEANDER_PLACER::m_originLine
protected

◆ m_padToDieLength

◆ m_result

MEANDERED_LINE PNS::MEANDER_PLACER::m_result
protected

Definition at line 115 of file pns_meander_placer.h.

Referenced by CheckFit(), and doMove().

◆ m_router

◆ m_settings

◆ m_tunedPath

ITEM_SET PNS::MEANDER_PLACER::m_tunedPath
protected

Definition at line 112 of file pns_meander_placer.h.

Referenced by doMove(), origPathLength(), and Start().

◆ m_world


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