KiCad PCB EDA Suite
PNS::DIFF_PAIR Class Reference

DIFF_PAIR. More...

#include <pns_diff_pair.h>

Inheritance diagram for PNS::DIFF_PAIR:
PNS::LINK_HOLDER PNS::ITEM

Classes

struct  COUPLED_SEGMENTS
 

Public Types

typedef std::vector< COUPLED_SEGMENTSCOUPLED_SEGMENTS_VEC
 
typedef std::vector< LINKED_ITEM * > LINKS
 
enum  PnsKind {
  SOLID_T = 1, LINE_T = 2, JOINT_T = 4, SEGMENT_T = 8,
  ARC_T = 16, VIA_T = 32, DIFF_PAIR_T = 64, ANY_T = 0xff
}
 

Public Member Functions

 DIFF_PAIR ()
 
 DIFF_PAIR (int aGap)
 
 DIFF_PAIR (const SHAPE_LINE_CHAIN &aP, const SHAPE_LINE_CHAIN &aN, int aGap=0)
 
 DIFF_PAIR (const LINE &aLineP, const LINE &aLineN, int aGap=0)
 
DIFF_PAIRClone () const override
 Return a deep copy of the item. More...
 
virtual void ClearLinks () override
 Return the number of segments that were assembled together to form this line. More...
 
void SetShape (const SHAPE_LINE_CHAIN &aP, const SHAPE_LINE_CHAIN &aN, bool aSwapLanes=false)
 
void SetShape (const DIFF_PAIR &aPair)
 
void SetNets (int aP, int aN)
 
void SetWidth (int aWidth)
 
int Width () const
 
void SetGap (int aGap)
 
int Gap () const
 
void AppendVias (const VIA &aViaP, const VIA &aViaN)
 
void RemoveVias ()
 
bool EndsWithVias () const
 
void SetViaDiameter (int aDiameter)
 
void SetViaDrill (int aDrill)
 
int NetP () const
 
int NetN () const
 
LINEPLine ()
 
LINENLine ()
 
DP_PRIMITIVE_PAIR EndingPrimitives ()
 
double CoupledLength () const
 
double TotalLength () const
 
double CoupledLengthFactor () const
 
double Skew () const
 
void CoupledSegmentPairs (COUPLED_SEGMENTS_VEC &aPairs) const
 
void Clear ()
 
void Append (const DIFF_PAIR &aOther)
 
bool Empty () const
 
const SHAPE_LINE_CHAINCP () const
 
const SHAPE_LINE_CHAINCN () const
 
bool BuildInitial (const DP_GATEWAY &aEntry, const DP_GATEWAY &aTarget, bool aPrefDiagonal)
 
bool CheckConnectionAngle (const DIFF_PAIR &aOther, int allowedAngles) const
 
int CoupledLength (const SEG &aP, const SEG &aN) const
 
int64_t CoupledLength (const SHAPE_LINE_CHAIN &aP, const SHAPE_LINE_CHAIN &aN) const
 
const RANGED_NUM< int > GapConstraint () const
 
void Link (LINKED_ITEM *aLink)
 Return the list of links from the owning node that constitute this line (or NULL if the line is not linked). More...
 
LINKSLinks ()
 
const LINKSLinks () const
 
bool IsLinked () const
 Check if the segment aLink is a part of the line. More...
 
bool ContainsLink (const LINKED_ITEM *aItem) const
 
LINKED_ITEMGetLink (int aIndex) const
 Erase the linking information. Used to detach the line from the owning node. More...
 
int LinkCount () const
 
void ShowLinks () const
 
virtual const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const
 
virtual const SHAPE_LINE_CHAIN HoleHull (int aClearance, int aWalkaroundThickness, int aLayer) const
 
PnsKind Kind () const
 Return the type (kind) of the item. More...
 
bool OfKind (int aKindMask) const
 Return true if the item's type matches the mask aKindMask. More...
 
std::string KindStr () const
 Returns the kind of the item, as string. More...
 
void SetParent (BOARD_ITEM *aParent)
 
BOARD_ITEMParent () const
 
void SetNet (int aNet)
 
int Net () const
 
const LAYER_RANGELayers () const
 
void SetLayers (const LAYER_RANGE &aLayers)
 
void SetLayer (int aLayer)
 
virtual int Layer () const
 
bool LayersOverlap (const ITEM *aOther) const
 Return true if the set of layers spanned by aOther overlaps our layers. More...
 
NODEOwner () const
 Return the owner of this item, or NULL if there's none. More...
 
void SetOwner (NODE *aOwner)
 Set the node that owns this item. More...
 
bool BelongsTo (NODE *aNode) const
 
bool Collide (const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly=true) const
 Check for a collision (clearance violation) with between us and item aOther. More...
 
virtual const SHAPEShape () const
 Return the geometrical shape of the item. More...
 
virtual const SHAPEHole () const
 
virtual void Mark (int aMarker) const
 
virtual void Unmark (int aMarker=-1) const
 
virtual int Marker () const
 
virtual void SetRank (int aRank)
 
virtual int Rank () const
 
virtual VECTOR2I Anchor (int n) const
 
virtual int AnchorCount () const
 
bool IsLocked () const
 
void SetRoutable (bool aRoutable)
 
bool IsRoutable () const
 

Static Public Member Functions

static bool ClassOf (const ITEM *aItem)
 
static DIFF_PAIRAssembleDp (LINE *aLine)
 

Static Public Attributes

static const int UnusedNet = INT_MAX
 Supported item types. More...
 

Protected Member Functions

void copyLinks (const LINK_HOLDER *aParent)
 < Copy m_links from the line aParent. More...
 

Protected Attributes

LINKS m_links
 
PnsKind m_kind
 
BOARD_ITEMm_parent
 
NODEm_owner
 
LAYER_RANGE m_layers
 
bool m_movable
 
int m_net
 
int m_marker
 
int m_rank
 
bool m_routable
 

Private Member Functions

void updateLine (LINE &aLine, const SHAPE_LINE_CHAIN &aShape, int aNet, const VIA &aVia)
 

Private Attributes

SHAPE_LINE_CHAIN m_n
 
SHAPE_LINE_CHAIN m_p
 
LINE m_line_p
 
LINE m_line_n
 
VIA m_via_p
 
VIA m_via_n
 
bool m_hasVias
 
int m_net_p
 
int m_net_n
 
int m_width
 
int m_gap
 
int m_viaGap
 
int m_maxUncoupledLength
 
int m_chamferLimit
 
RANGED_NUM< int > m_gapConstraint
 

Detailed Description

DIFF_PAIR.

Basic class for a differential pair. Stores two PNS_LINEs (for positive and negative nets, respectively), the gap and coupling constraints.

Definition at line 259 of file pns_diff_pair.h.

Member Typedef Documentation

◆ COUPLED_SEGMENTS_VEC

Definition at line 282 of file pns_diff_pair.h.

◆ LINKS

typedef std::vector<LINKED_ITEM*> PNS::LINK_HOLDER::LINKS
inherited

Definition at line 36 of file pns_link_holder.h.

Member Enumeration Documentation

◆ PnsKind

enum PNS::ITEM::PnsKind
inherited
Enumerator
SOLID_T 
LINE_T 
JOINT_T 
SEGMENT_T 
ARC_T 
VIA_T 
DIFF_PAIR_T 
ANY_T 

Definition at line 61 of file pns_item.h.

62  {
63  SOLID_T = 1,
64  LINE_T = 2,
65  JOINT_T = 4,
66  SEGMENT_T = 8,
67  ARC_T = 16,
68  VIA_T = 32,
69  DIFF_PAIR_T = 64,
70  ANY_T = 0xff
71  };

Constructor & Destructor Documentation

◆ DIFF_PAIR() [1/4]

PNS::DIFF_PAIR::DIFF_PAIR ( )
inline

Definition at line 284 of file pns_diff_pair.h.

284  :
286  m_hasVias( false )
287  {
288  // Initialize some members, to avoid uninitialized variables.
289  m_net_p = 0;
290  m_net_n = 0;;
291  m_width = 0;
292  m_gap = 0;
293  m_viaGap = 0;
295  m_chamferLimit = 0;
296  }

References m_chamferLimit, m_gap, m_maxUncoupledLength, m_net_n, m_net_p, m_viaGap, and m_width.

◆ DIFF_PAIR() [2/4]

PNS::DIFF_PAIR::DIFF_PAIR ( int  aGap)
inline

Definition at line 298 of file pns_diff_pair.h.

298  :
300  m_hasVias( false )
301  {
302  m_gapConstraint = aGap;
303 
304  // Initialize other members, to avoid uninitialized variables.
305  m_net_p = 0;
306  m_net_n = 0;;
307  m_width = 0;
308  m_gap = 0;
309  m_viaGap = 0;
311  m_chamferLimit = 0;
312  }
RANGED_NUM< int > m_gapConstraint

References m_chamferLimit, m_gap, m_gapConstraint, m_maxUncoupledLength, m_net_n, m_net_p, m_viaGap, and m_width.

◆ DIFF_PAIR() [3/4]

PNS::DIFF_PAIR::DIFF_PAIR ( const SHAPE_LINE_CHAIN aP,
const SHAPE_LINE_CHAIN aN,
int  aGap = 0 
)
inline

Definition at line 314 of file pns_diff_pair.h.

314  :
316  m_n( aN ),
317  m_p( aP ),
318  m_hasVias( false )
319  {
320  m_gapConstraint = aGap;
321 
322  // Initialize other members, to avoid uninitialized variables.
323  m_net_p = 0;
324  m_net_n = 0;;
325  m_width = 0;
326  m_gap = 0;
327  m_viaGap = 0;
329  m_chamferLimit = 0;
330  }
RANGED_NUM< int > m_gapConstraint
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References m_chamferLimit, m_gap, m_gapConstraint, m_maxUncoupledLength, m_net_n, m_net_p, m_viaGap, and m_width.

◆ DIFF_PAIR() [4/4]

PNS::DIFF_PAIR::DIFF_PAIR ( const LINE aLineP,
const LINE aLineN,
int  aGap = 0 
)
inline

Definition at line 332 of file pns_diff_pair.h.

332  :
334  m_line_p( aLineP ),
335  m_line_n( aLineN ),
336  m_hasVias( false )
337  {
338  m_gapConstraint = aGap;
339  m_net_p = aLineP.Net();
340  m_net_n = aLineN.Net();
341  m_p = aLineP.CLine();
342  m_n = aLineN.CLine();
343 
344  // Do not leave unitialized members, and keep static analyser quiet:
345  m_width = 0;
346  m_gap = 0;
347  m_viaGap = 0;
349  m_chamferLimit = 0;
350  }
RANGED_NUM< int > m_gapConstraint
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References PNS::LINE::CLine(), m_chamferLimit, m_gap, m_gapConstraint, m_maxUncoupledLength, m_n, m_net_n, m_net_p, m_p, m_viaGap, m_width, and PNS::ITEM::Net().

Member Function Documentation

◆ Anchor()

◆ AnchorCount()

virtual int PNS::ITEM::AnchorCount ( ) const
inlinevirtualinherited

Reimplemented in PNS::VIA, PNS::SEGMENT, PNS::SOLID, and PNS::ARC.

Definition at line 218 of file pns_item.h.

219  {
220  return 0;
221  }

◆ Append()

void PNS::DIFF_PAIR::Append ( const DIFF_PAIR aOther)
inline

Definition at line 484 of file pns_diff_pair.h.

485  {
486  m_n.Append( aOther.m_n );
487  m_p.Append( aOther.m_p );
488  }
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References SHAPE_LINE_CHAIN::Append(), m_n, and m_p.

◆ AppendVias()

void PNS::DIFF_PAIR::AppendVias ( const VIA aViaP,
const VIA aViaN 
)
inline

Definition at line 414 of file pns_diff_pair.h.

415  {
416  m_hasVias = true;
417  m_via_p = aViaP;
418  m_via_n = aViaN;
419  }

References m_hasVias, m_via_n, and m_via_p.

Referenced by PNS::DIFF_PAIR_PLACER::routeHead().

◆ AssembleDp()

static DIFF_PAIR* PNS::DIFF_PAIR::AssembleDp ( LINE aLine)
static

◆ BelongsTo()

bool PNS::ITEM::BelongsTo ( NODE aNode) const
inlineinherited
Returns
true if the item is owned by the node aNode.

Definition at line 177 of file pns_item.h.

178  {
179  return m_owner == aNode;
180  }
NODE * m_owner
Definition: pns_item.h:238

References PNS::ITEM::m_owner.

Referenced by PNS::NODE::doRemove().

◆ BuildInitial()

bool PNS::DIFF_PAIR::BuildInitial ( const DP_GATEWAY aEntry,
const DP_GATEWAY aTarget,
bool  aPrefDiagonal 
)

Definition at line 203 of file pns_diff_pair.cpp.

204 {
205  SHAPE_LINE_CHAIN p = DIRECTION_45().BuildInitialTrace ( aEntry.AnchorP(), aTarget.AnchorP(), aPrefDiagonal );
206  SHAPE_LINE_CHAIN n = DIRECTION_45().BuildInitialTrace ( aEntry.AnchorN(), aTarget.AnchorN(), aPrefDiagonal );
207 
208  int mask = aEntry.AllowedAngles() | DIRECTION_45::ANG_STRAIGHT | DIRECTION_45::ANG_OBTUSE;
209 
210  SHAPE_LINE_CHAIN sum_n, sum_p;
211  m_p = p;
212  m_n = n;
213 
214  if( aEntry.HasEntryLines() )
215  {
216  if( !aEntry.Entry().CheckConnectionAngle( *this, mask ) )
217  return false;
218 
219  sum_p = aEntry.Entry().CP();
220  sum_n = aEntry.Entry().CN();
221  sum_p.Append( p );
222  sum_n.Append( n );
223  }
224  else
225  {
226  sum_p = p;
227  sum_n = n;
228  }
229 
230  mask = aTarget.AllowedAngles() | DIRECTION_45::ANG_STRAIGHT | DIRECTION_45::ANG_OBTUSE;
231 
232  m_p = sum_p;
233  m_n = sum_n;
234 
235  if( aTarget.HasEntryLines() )
236  {
237  DP_GATEWAY t(aTarget) ;
238  t.Reverse();
239 
240  if( !CheckConnectionAngle( t.Entry(), mask ) )
241  return false;
242 
243  sum_p.Append( t.Entry().CP() );
244  sum_n.Append( t.Entry().CN() );
245  }
246 
247  m_p = sum_p;
248  m_n = sum_n;
249 
250  if( !checkGap ( p, n, m_gapConstraint ) )
251  return false;
252 
253  if( p.SelfIntersecting() || n.SelfIntersecting() )
254  return false;
255 
256  if( p.Intersects( n ) )
257  return false;
258 
259  return true;
260 }
static bool checkGap(const SHAPE_LINE_CHAIN &p, const SHAPE_LINE_CHAIN &n, int gap)
RANGED_NUM< int > m_gapConstraint
const OPT< INTERSECTION > SelfIntersecting() const
Function SelfIntersecting()
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
SHAPE_LINE_CHAIN m_p
Represent route directions & corner angles in a 45-degree metric.
Definition: direction45.h:36
bool Intersects(const SHAPE_LINE_CHAIN &aChain) const
const SHAPE_LINE_CHAIN BuildInitialTrace(const VECTOR2I &aP0, const VECTOR2I &aP1, bool aStartDiagonal=false, bool aFillet=false) const
Build a 2-segment line chain between points aP0 and aP1 and following 45-degree routing regime.
SHAPE_LINE_CHAIN m_n
bool CheckConnectionAngle(const DIFF_PAIR &aOther, int allowedAngles) const
SHAPE_LINE_CHAIN.

References PNS::DP_GATEWAY::AllowedAngles(), PNS::DP_GATEWAY::AnchorN(), PNS::DP_GATEWAY::AnchorP(), DIRECTION_45::ANG_OBTUSE, DIRECTION_45::ANG_STRAIGHT, SHAPE_LINE_CHAIN::Append(), DIRECTION_45::BuildInitialTrace(), CheckConnectionAngle(), PNS::checkGap(), CN(), CP(), PNS::DP_GATEWAY::Entry(), PNS::DP_GATEWAY::HasEntryLines(), SHAPE_LINE_CHAIN::Intersects(), m_gapConstraint, m_n, m_p, PNS::DP_GATEWAY::Reverse(), and SHAPE_LINE_CHAIN::SelfIntersecting().

Referenced by PNS::DP_GATEWAYS::FitGateways().

◆ CheckConnectionAngle()

bool PNS::DIFF_PAIR::CheckConnectionAngle ( const DIFF_PAIR aOther,
int  allowedAngles 
) const

Definition at line 263 of file pns_diff_pair.cpp.

264 {
265  bool checkP, checkN;
266 
267  if( m_p.SegmentCount() == 0 || aOther.m_p.SegmentCount() == 0 )
268  checkP = true;
269  else
270  {
271  DIRECTION_45 p0( m_p.CSegment( -1 ) );
272  DIRECTION_45 p1( aOther.m_p.CSegment( 0 ) );
273 
274  checkP = ( p0.Angle( p1 ) & aAllowedAngles ) != 0;
275  }
276 
277  if( m_n.SegmentCount() == 0 || aOther.m_n.SegmentCount() == 0 )
278  checkN = true;
279  else
280  {
281  DIRECTION_45 n0( m_n.CSegment( -1 ) );
282  DIRECTION_45 n1( aOther.m_n.CSegment( 0 ) );
283 
284  checkN = ( n0.Angle( n1 ) & aAllowedAngles ) != 0;
285  }
286 
287  return checkP && checkN;
288 }
SHAPE_LINE_CHAIN m_p
Represent route directions & corner angles in a 45-degree metric.
Definition: direction45.h:36
int SegmentCount() const
Function SegmentCount()
SHAPE_LINE_CHAIN m_n
const SEG CSegment(int aIndex) const
Function CSegment()

References SHAPE_LINE_CHAIN::CSegment(), m_n, m_p, and SHAPE_LINE_CHAIN::SegmentCount().

Referenced by BuildInitial().

◆ ClassOf()

static bool PNS::DIFF_PAIR::ClassOf ( const ITEM aItem)
inlinestatic

Definition at line 352 of file pns_diff_pair.h.

353  {
354  return aItem && ITEM::DIFF_PAIR_T == aItem->Kind();
355  }

References PNS::ITEM::DIFF_PAIR_T, and PNS::ITEM::Kind().

◆ Clear()

void PNS::DIFF_PAIR::Clear ( )
inline

Definition at line 478 of file pns_diff_pair.h.

479  {
480  m_n.Clear();
481  m_p.Clear();
482  }
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n
void Clear()
Function Clear() Removes all points from the line chain.

References SHAPE_LINE_CHAIN::Clear(), m_n, and m_p.

◆ ClearLinks()

virtual void PNS::DIFF_PAIR::ClearLinks ( )
inlineoverridevirtual

Return the number of segments that were assembled together to form this line.

Reimplemented from PNS::LINK_HOLDER.

Definition at line 359 of file pns_diff_pair.h.

360  {
361  m_links.clear();
364  }

References PNS::LINK_HOLDER::ClearLinks(), m_line_n, m_line_p, and PNS::LINK_HOLDER::m_links.

◆ Clone()

DIFF_PAIR* PNS::DIFF_PAIR::Clone ( ) const
inlineoverridevirtual

Return a deep copy of the item.

Implements PNS::ITEM.

Definition at line 357 of file pns_diff_pair.h.

357 { assert( false ); return NULL; }
#define NULL

References NULL.

◆ CN()

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aOther,
const NODE aNode,
bool  aDifferentNetsOnly = true 
) const
inherited

Check for a collision (clearance violation) with between us and item aOther.

Collision checking takes all PCB stuff into account (layers, nets, DRC rules). Optionally returns a minimum translation vector for force propagation algorithm.

Parameters
aOtheris the item to check collision against.
Returns
true, if a collision was found.

Definition at line 97 of file pns_item.cpp.

98 {
99  if( collideSimple( aOther, aNode, aDifferentNetsOnly ) )
100  return true;
101 
102  // Special cases for "head" lines with vias attached at the end. Note that this does not
103  // support head-line-via to head-line-via collisions, but you can't route two independant
104  // tracks at once so it shouldn't come up.
105 
106  if( m_kind == LINE_T )
107  {
108  const LINE* line = static_cast<const LINE*>( this );
109 
110  if( line->EndsWithVia() && line->Via().collideSimple( aOther, aNode, aDifferentNetsOnly ) )
111  return true;
112  }
113 
114  if( aOther->m_kind == LINE_T )
115  {
116  const LINE* line = static_cast<const LINE*>( aOther );
117 
118  if( line->EndsWithVia() && line->Via().collideSimple( this, aNode, aDifferentNetsOnly ) )
119  return true;
120  }
121 
122  return false;
123 }
PnsKind m_kind
Definition: pns_item.h:235
bool collideSimple(const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly) const
Definition: pns_item.cpp:31

References PNS::ITEM::collideSimple(), PNS::LINE::EndsWithVia(), PNS::ITEM::LINE_T, PNS::ITEM::m_kind, and PNS::LINE::Via().

Referenced by PNS::SHOVE::onCollidingSolid(), PNS::OPTIMIZER::CACHE_VISITOR::operator()(), PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()(), PNS::SHOVE::shoveLineFromLoneVia(), PNS::SHOVE::shoveLineToHullSet(), and PNS::COMPONENT_DRAGGER::Start().

◆ ContainsLink()

bool PNS::LINK_HOLDER::ContainsLink ( const LINKED_ITEM aItem) const
inlineinherited

Definition at line 58 of file pns_link_holder.h.

59  {
60  return alg::contains( m_links, aItem );
61  }
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:81

References alg::contains(), and PNS::LINK_HOLDER::m_links.

◆ copyLinks()

void PNS::LINK_HOLDER::copyLinks ( const LINK_HOLDER aParent)
inlineprotectedinherited

< Copy m_links from the line aParent.

List of segments in the owning NODE (ITEM::m_owner) that constitute this line, or NULL if the line is not a part of any node.

Definition at line 98 of file pns_link_holder.h.

References PNS::LINK_HOLDER::m_links.

Referenced by PNS::LINE::LINE(), and PNS::LINE::operator=().

◆ CoupledLength() [1/3]

double PNS::DIFF_PAIR::CoupledLength ( ) const

Definition at line 864 of file pns_diff_pair.cpp.

865 {
866  COUPLED_SEGMENTS_VEC pairs;
867 
868  CoupledSegmentPairs( pairs );
869 
870  double l = 0.0;
871  for( unsigned int i = 0; i < pairs.size(); i++ )
872  l += pairs[i].coupledP.Length();
873 
874  return l;
875 }
void CoupledSegmentPairs(COUPLED_SEGMENTS_VEC &aPairs) const
std::vector< COUPLED_SEGMENTS > COUPLED_SEGMENTS_VEC

References CoupledSegmentPairs().

Referenced by CoupledLengthFactor(), PNS::OPTIMIZER::mergeDpStep(), and PNS::DIFF_PAIR_PLACER::tryWalkDp().

◆ CoupledLength() [2/3]

int PNS::DIFF_PAIR::CoupledLength ( const SEG aP,
const SEG aN 
) const

Definition at line 898 of file pns_diff_pair.cpp.

899 {
900  SEG p_clip, n_clip;
901  int64_t dist = std::abs( aP.Distance( aN ) - m_width );
902 
903  if( aP.ApproxParallel( aN ) && m_gapConstraint.Matches( dist ) &&
904  commonParallelProjection ( aP, aN, p_clip, n_clip ) )
905  return p_clip.Length();
906 
907  return 0;
908 }
int Length() const
Return the length (this).
Definition: seg.h:355
int Distance(const SEG &aSeg) const
Compute minimum Euclidean distance to segment aSeg.
Definition: seg.h:239
RANGED_NUM< int > m_gapConstraint
bool ApproxParallel(const SEG &aSeg) const
Definition: seg.h:295
Definition: seg.h:41
bool commonParallelProjection(SEG p, SEG n, SEG &pClip, SEG &nClip)
bool Matches(const T &aOther) const
Definition: ranged_num.h:43

References SEG::ApproxParallel(), PNS::commonParallelProjection(), SEG::Distance(), SEG::Length(), m_gapConstraint, m_width, and RANGED_NUM< T >::Matches().

◆ CoupledLength() [3/3]

int64_t PNS::DIFF_PAIR::CoupledLength ( const SHAPE_LINE_CHAIN aP,
const SHAPE_LINE_CHAIN aN 
) const

Definition at line 839 of file pns_diff_pair.cpp.

840 {
841  int64_t total = 0;
842 
843  for( int i = 0; i < aP.SegmentCount(); i++ )
844  {
845  for( int j = 0; j < aN.SegmentCount(); j++ )
846  {
847  SEG sp = aP.CSegment( i );
848  SEG sn = aN.CSegment( j );
849 
850  SEG p_clip, n_clip;
851 
852  int64_t dist = std::abs( sp.Distance(sn) - m_width );
853 
854  if( sp.ApproxParallel( sn ) && m_gapConstraint.Matches( dist ) &&
855  commonParallelProjection( sp, sn, p_clip, n_clip ) )
856  total += p_clip.Length();
857  }
858  }
859 
860  return total;
861 }
int Length() const
Return the length (this).
Definition: seg.h:355
int Distance(const SEG &aSeg) const
Compute minimum Euclidean distance to segment aSeg.
Definition: seg.h:239
RANGED_NUM< int > m_gapConstraint
bool ApproxParallel(const SEG &aSeg) const
Definition: seg.h:295
int SegmentCount() const
Function SegmentCount()
Definition: seg.h:41
const SEG CSegment(int aIndex) const
Function CSegment()
bool commonParallelProjection(SEG p, SEG n, SEG &pClip, SEG &nClip)
bool Matches(const T &aOther) const
Definition: ranged_num.h:43

References SEG::ApproxParallel(), PNS::commonParallelProjection(), SHAPE_LINE_CHAIN::CSegment(), SEG::Distance(), SEG::Length(), m_gapConstraint, m_width, RANGED_NUM< T >::Matches(), and SHAPE_LINE_CHAIN::SegmentCount().

◆ CoupledLengthFactor()

double PNS::DIFF_PAIR::CoupledLengthFactor ( ) const

Definition at line 878 of file pns_diff_pair.cpp.

879 {
880  double t = TotalLength();
881 
882  if( t == 0.0 )
883  return 0.0;
884 
885  return CoupledLength() / t;
886 }
double CoupledLength() const
double TotalLength() const

References CoupledLength(), and TotalLength().

◆ CoupledSegmentPairs()

void PNS::DIFF_PAIR::CoupledSegmentPairs ( COUPLED_SEGMENTS_VEC aPairs) const

Definition at line 810 of file pns_diff_pair.cpp.

811 {
812  SHAPE_LINE_CHAIN p( m_p );
813  SHAPE_LINE_CHAIN n( m_n );
814 
815  p.Simplify();
816  n.Simplify();
817 
818  for( int i = 0; i < p.SegmentCount(); i++ )
819  {
820  for( int j = 0; j < n.SegmentCount(); j++ )
821  {
822  SEG sp = p.Segment( i );
823  SEG sn = n.Segment( j );
824 
825  SEG p_clip, n_clip;
826 
827  int64_t dist = std::abs( sp.Distance( sn ) - m_width );
828 
829  if( sp.ApproxParallel( sn ) && m_gapConstraint.Matches( dist ) && commonParallelProjection( sp, sn, p_clip, n_clip ) )
830  {
831  const COUPLED_SEGMENTS spair( p_clip, sp, i, n_clip, sn, j );
832  aPairs.push_back( spair );
833  }
834  }
835  }
836 }
int Distance(const SEG &aSeg) const
Compute minimum Euclidean distance to segment aSeg.
Definition: seg.h:239
RANGED_NUM< int > m_gapConstraint
bool ApproxParallel(const SEG &aSeg) const
Definition: seg.h:295
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n
Definition: seg.h:41
SHAPE_LINE_CHAIN.
bool commonParallelProjection(SEG p, SEG n, SEG &pClip, SEG &nClip)
bool Matches(const T &aOther) const
Definition: ranged_num.h:43

References SEG::ApproxParallel(), PNS::commonParallelProjection(), SEG::Distance(), m_gapConstraint, m_n, m_p, m_width, RANGED_NUM< T >::Matches(), SHAPE_LINE_CHAIN::Segment(), SHAPE_LINE_CHAIN::SegmentCount(), and SHAPE_LINE_CHAIN::Simplify().

Referenced by CoupledLength().

◆ CP()

◆ Empty()

bool PNS::DIFF_PAIR::Empty ( ) const
inline

Definition at line 490 of file pns_diff_pair.h.

491  {
492  return ( m_n.SegmentCount() == 0 ) || ( m_p.SegmentCount() == 0 );
493  }
SHAPE_LINE_CHAIN m_p
int SegmentCount() const
Function SegmentCount()
SHAPE_LINE_CHAIN m_n

References m_n, m_p, and SHAPE_LINE_CHAIN::SegmentCount().

◆ EndingPrimitives()

DP_PRIMITIVE_PAIR PNS::DIFF_PAIR::EndingPrimitives ( )

Definition at line 742 of file pns_diff_pair.cpp.

743 {
744  if( m_hasVias )
745  return DP_PRIMITIVE_PAIR( &m_via_p, &m_via_n );
746  else
747  {
748  const LINE lP( PLine() );
749  const LINE lN( NLine() );
750 
751  SEGMENT sP( lP, lP.CSegment( -1 ) );
752  SEGMENT sN( lN, lN.CSegment( -1 ) );
753 
754  DP_PRIMITIVE_PAIR dpair( &sP, &sN );
755  dpair.SetAnchors( sP.Seg().B, sN.Seg().B );
756 
757  return dpair;
758  }
759 }
usual segment : line with rounded ends

References PNS::LINE::CSegment(), m_hasVias, m_via_n, m_via_p, NLine(), and PLine().

Referenced by PNS::DIFF_PAIR_PLACER::FixRoute().

◆ EndsWithVias()

bool PNS::DIFF_PAIR::EndsWithVias ( ) const
inline

Definition at line 426 of file pns_diff_pair.h.

427  {
428  return m_hasVias;
429  }

References m_hasVias.

Referenced by PNS::DIFF_PAIR_PLACER::FixRoute(), and PNS::DIFF_PAIR_PLACER::UpdateSizes().

◆ Gap()

int PNS::DIFF_PAIR::Gap ( ) const
inline

◆ GapConstraint()

const RANGED_NUM<int> PNS::DIFF_PAIR::GapConstraint ( ) const
inline

Definition at line 504 of file pns_diff_pair.h.

505  {
506  return m_gapConstraint;
507  }
RANGED_NUM< int > m_gapConstraint

References m_gapConstraint.

Referenced by PNS::findCoupledVertices().

◆ GetLink()

LINKED_ITEM* PNS::LINK_HOLDER::GetLink ( int  aIndex) const
inlineinherited

Erase the linking information. Used to detach the line from the owning node.

Definition at line 63 of file pns_link_holder.h.

References PNS::LINK_HOLDER::m_links.

Referenced by PNS::LINE_PLACER::removeLoops(), PNS::TOPOLOGY::SimplifyLine(), PNS::MEANDER_SKEW_PLACER::Start(), and PNS::DP_MEANDER_PLACER::Start().

◆ Hole()

virtual const SHAPE* PNS::ITEM::Hole ( ) const
inlinevirtualinherited

Reimplemented in PNS::VIA, and PNS::SOLID.

Definition at line 201 of file pns_item.h.

202  {
203  return nullptr;
204  }

Referenced by PNS::ITEM::collideSimple().

◆ HoleHull()

virtual const SHAPE_LINE_CHAIN PNS::ITEM::HoleHull ( int  aClearance,
int  aWalkaroundThickness,
int  aLayer 
) const
inlinevirtualinherited

Reimplemented in PNS::SOLID.

Definition at line 117 of file pns_item.h.

119  {
120  return SHAPE_LINE_CHAIN();
121  }
SHAPE_LINE_CHAIN.

◆ Hull()

virtual const SHAPE_LINE_CHAIN PNS::ITEM::Hull ( int  aClearance = 0,
int  aWalkaroundThickness = 0,
int  aLayer = -1 
) const
inlinevirtualinherited

Reimplemented in PNS::VIA, PNS::SEGMENT, PNS::ARC, and PNS::SOLID.

Definition at line 111 of file pns_item.h.

113  {
114  return SHAPE_LINE_CHAIN();
115  }
SHAPE_LINE_CHAIN.

◆ IsLinked()

bool PNS::LINK_HOLDER::IsLinked ( ) const
inlineinherited

◆ IsLocked()

bool PNS::ITEM::IsLocked ( ) const
inlineinherited

Definition at line 223 of file pns_item.h.

224  {
225  return Marker() & MK_LOCKED;
226  }
virtual int Marker() const
Definition: pns_item.h:208

References PNS::ITEM::Marker(), and PNS::MK_LOCKED.

Referenced by ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::performDragging(), and PNS::SHOVE::pushOrShoveVia().

◆ IsRoutable()

bool PNS::ITEM::IsRoutable ( ) const
inlineinherited

Definition at line 229 of file pns_item.h.

229 { return m_routable; }
bool m_routable
Definition: pns_item.h:245

References PNS::ITEM::m_routable.

Referenced by PNS::NODE::addSolid(), and PNS::NODE::removeSolidIndex().

◆ Kind()

◆ KindStr()

std::string PNS::ITEM::KindStr ( ) const
inherited

Returns the kind of the item, as string.

Definition at line 126 of file pns_item.cpp.

127 {
128  switch( m_kind )
129  {
130  case ARC_T: return "arc";
131  case LINE_T: return "line";
132  case SEGMENT_T: return "segment";
133  case VIA_T: return "via";
134  case JOINT_T: return "joint";
135  case SOLID_T: return "solid";
136  case DIFF_PAIR_T: return "diff-pair";
137  default: return "unknown";
138  }
139 }
PnsKind m_kind
Definition: pns_item.h:235

References PNS::ITEM::ARC_T, PNS::ITEM::DIFF_PAIR_T, PNS::ITEM::JOINT_T, PNS::ITEM::LINE_T, PNS::ITEM::m_kind, PNS::ITEM::SEGMENT_T, PNS::ITEM::SOLID_T, and PNS::ITEM::VIA_T.

Referenced by PNS::TOOL_BASE::pickSingleItem(), and PNS::TOOL_BASE::updateEndItem().

◆ Layer()

◆ Layers()

const LAYER_RANGE& PNS::ITEM::Layers ( ) const
inlineinherited

Definition at line 150 of file pns_item.h.

150 { return m_layers; }
LAYER_RANGE m_layers
Definition: pns_item.h:239

References PNS::ITEM::m_layers.

Referenced by PNS::INDEX::Add(), PNS::NODE::Add(), PNS::NODE::addArc(), PNS_KICAD_IFACE::AddItem(), PNS::NODE::addSegment(), PNS::NODE::addSolid(), PNS::NODE::addVia(), PNS::ARC::ARC(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS_PCBNEW_RULE_RESOLVER::Clearance(), PNS::VIA::Clone(), PNS::ITEM::collideSimple(), PNS::MEANDER_PLACER::CurrentLayer(), PNS::DP_MEANDER_PLACER::CurrentLayer(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), PNS::NODE::FindJoint(), PNS::NODE::FindLinesBetweenJoints(), PNS::NODE::findRedundantArc(), PNS::NODE::findRedundantSegment(), ROUTER_TOOL::getStartLayer(), PNS_PCBNEW_RULE_RESOLVER::HoleClearance(), PNS_PCBNEW_RULE_RESOLVER::HoleToHoleClearance(), PNS_KICAD_IFACE::IsFlashedOnLayer(), PNS::ITEM::Layer(), PNS::ITEM::LayersOverlap(), PNS::LINE::LINE(), PNS::NODE::LockJoint(), PNS::VIA::MakeHandle(), PNS::ROUTER::markViolations(), PNS::SHOVE::onCollidingSolid(), LENGTH_TUNER_TOOL::performTuning(), PNS::TOOL_BASE::pickSingleItem(), PNS::INDEX::Query(), PNS::INDEX::Remove(), PNS::NODE::removeArcIndex(), PNS::NODE::removeSegmentIndex(), PNS::NODE::removeSolidIndex(), PNS::NODE::removeViaIndex(), PNS_TEST_ENVIRONMENT::ReplayLog(), PNS::SEGMENT::SEGMENT(), PNS::LINE_PLACER::SetLayer(), ROUTER_PREVIEW_ITEM::Update(), PNS::TOOL_BASE::updateEndItem(), updateLine(), PNS::TOOL_BASE::updateStartItem(), and PNS::VIA::VIA().

◆ LayersOverlap()

bool PNS::ITEM::LayersOverlap ( const ITEM aOther) const
inlineinherited

Return true if the set of layers spanned by aOther overlaps our layers.

Definition at line 159 of file pns_item.h.

160  {
161  return Layers().Overlaps( aOther->Layers() );
162  }
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:67
const LAYER_RANGE & Layers() const
Definition: pns_item.h:150

References PNS::ITEM::Layers(), and LAYER_RANGE::Overlaps().

Referenced by PNS::SHOVE::onCollidingArc(), PNS::SHOVE::onCollidingSegment(), PNS::NODE::rebuildJoint(), and PNS::SHOVE::ShoveObstacleLine().

◆ Link()

void PNS::LINK_HOLDER::Link ( LINKED_ITEM aLink)
inlineinherited

Return the list of links from the owning node that constitute this line (or NULL if the line is not linked).

Definition at line 42 of file pns_link_holder.h.

References PNS::LINK_HOLDER::m_links.

Referenced by PNS::NODE::Add(), and PNS::NODE::AssembleLine().

◆ LinkCount()

int PNS::LINK_HOLDER::LinkCount ( ) const
inlineinherited

Definition at line 75 of file pns_link_holder.h.

76  {
77  return m_links.size();
78  }

References PNS::LINK_HOLDER::m_links.

Referenced by PNS::LINE::IsLinkedChecked(), and PNS::LINE_PLACER::removeLoops().

◆ Links() [1/2]

◆ Links() [2/2]

const LINKS& PNS::LINK_HOLDER::Links ( ) const
inlineinherited

Definition at line 50 of file pns_link_holder.h.

50 { return m_links; }

References PNS::LINK_HOLDER::m_links.

◆ Mark()

virtual void PNS::ITEM::Mark ( int  aMarker) const
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 206 of file pns_item.h.

206 { m_marker = aMarker; }
int m_marker
Definition: pns_item.h:243

References PNS::ITEM::m_marker.

Referenced by PNS::ITEM::collideSimple(), and PNS::SHOVE::ShoveDraggingVia().

◆ Marker()

virtual int PNS::ITEM::Marker ( ) const
inlinevirtualinherited

◆ Net()

◆ NetN()

int PNS::DIFF_PAIR::NetN ( ) const
inline

Definition at line 448 of file pns_diff_pair.h.

449  {
450  return m_net_n;
451  }

References m_net_n.

Referenced by PNS::DP_MEANDER_PLACER::CurrentNets().

◆ NetP()

int PNS::DIFF_PAIR::NetP ( ) const
inline

Definition at line 443 of file pns_diff_pair.h.

444  {
445  return m_net_p;
446  }

References m_net_p.

Referenced by PNS::DP_MEANDER_PLACER::CurrentNets().

◆ NLine()

◆ OfKind()

◆ Owner()

NODE* PNS::ITEM::Owner ( ) const
inlineinherited

Return the owner of this item, or NULL if there's none.

Definition at line 167 of file pns_item.h.

167 { return m_owner; }
NODE * m_owner
Definition: pns_item.h:238

References PNS::ITEM::m_owner.

Referenced by PNS_KICAD_IFACE_BASE::inheritTrackWidth(), and PNS::LINE_PLACER::Move().

◆ Parent()

◆ PLine()

◆ Rank()

virtual int PNS::ITEM::Rank ( ) const
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 211 of file pns_item.h.

211 { return m_rank; }
int m_rank
Definition: pns_item.h:244

References PNS::ITEM::m_rank.

Referenced by PNS::ARC::ARC(), PNS::LINE::LINE(), and PNS::SHOVE::shoveIteration().

◆ RemoveVias()

void PNS::DIFF_PAIR::RemoveVias ( )
inline

Definition at line 421 of file pns_diff_pair.h.

422  {
423  m_hasVias = false;
424  }

References m_hasVias.

◆ SetGap()

void PNS::DIFF_PAIR::SetGap ( int  aGap)
inline

◆ SetLayer()

◆ SetLayers()

void PNS::ITEM::SetLayers ( const LAYER_RANGE aLayers)
inlineinherited

Definition at line 151 of file pns_item.h.

151 { m_layers = aLayers; }
LAYER_RANGE m_layers
Definition: pns_item.h:239

References PNS::ITEM::m_layers.

Referenced by PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::VIA::Clone(), and PNS::VIA::VIA().

◆ SetNet()

◆ SetNets()

void PNS::DIFF_PAIR::SetNets ( int  aP,
int  aN 
)
inline

Definition at line 388 of file pns_diff_pair.h.

389  {
390  m_net_p = aP;
391  m_net_n = aN;
392  }

References m_net_n, and m_net_p.

Referenced by PNS::DIFF_PAIR_PLACER::routeHead().

◆ SetOwner()

void PNS::ITEM::SetOwner ( NODE aOwner)
inlineinherited

Set the node that owns this item.

An item can belong to a single NODE or be unowned.

Definition at line 172 of file pns_item.h.

172 { m_owner = aOwner; }
NODE * m_owner
Definition: pns_item.h:238

References PNS::ITEM::m_owner.

Referenced by PNS::NODE::AssembleLine(), PNS::NODE::doRemove(), and PNS::NODE::Remove().

◆ SetParent()

void PNS::ITEM::SetParent ( BOARD_ITEM aParent)
inlineinherited

Definition at line 144 of file pns_item.h.

144 { m_parent = aParent; }
BOARD_ITEM * m_parent
Definition: pns_item.h:237

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ SetRank()

virtual void PNS::ITEM::SetRank ( int  aRank)
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 210 of file pns_item.h.

210 { m_rank = aRank; }
int m_rank
Definition: pns_item.h:244

References PNS::ITEM::m_rank.

Referenced by PNS::NODE::Commit(), and PNS::SHOVE::ShoveDraggingVia().

◆ SetRoutable()

void PNS::ITEM::SetRoutable ( bool  aRoutable)
inlineinherited

Definition at line 228 of file pns_item.h.

228 { m_routable = aRoutable; }
bool m_routable
Definition: pns_item.h:245

References PNS::ITEM::m_routable.

◆ SetShape() [1/2]

void PNS::DIFF_PAIR::SetShape ( const SHAPE_LINE_CHAIN aP,
const SHAPE_LINE_CHAIN aN,
bool  aSwapLanes = false 
)
inline

Definition at line 368 of file pns_diff_pair.h.

369  {
370  if( aSwapLanes )
371  {
372  m_p = aN;
373  m_n = aP;
374  }
375  else
376  {
377  m_p = aP;
378  m_n = aN;
379  }
380  }
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References m_n, and m_p.

Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), PNS::DP_GATEWAYS::FitGateways(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::OPTIMIZER::mergeDpStep(), and PNS::DIFF_PAIR_PLACER::tryWalkDp().

◆ SetShape() [2/2]

void PNS::DIFF_PAIR::SetShape ( const DIFF_PAIR aPair)
inline

Definition at line 382 of file pns_diff_pair.h.

383  {
384  m_p = aPair.m_p;
385  m_n = aPair.m_n;
386  }
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References m_n, and m_p.

◆ SetViaDiameter()

void PNS::DIFF_PAIR::SetViaDiameter ( int  aDiameter)
inline

Definition at line 431 of file pns_diff_pair.h.

432  {
433  m_via_p.SetDiameter( aDiameter );
434  m_via_n.SetDiameter( aDiameter );
435  }
void SetDiameter(int aDiameter)
Definition: pns_via.h:110

References m_via_n, m_via_p, and PNS::VIA::SetDiameter().

Referenced by PNS::DIFF_PAIR_PLACER::UpdateSizes().

◆ SetViaDrill()

void PNS::DIFF_PAIR::SetViaDrill ( int  aDrill)
inline

Definition at line 437 of file pns_diff_pair.h.

438  {
439  m_via_p.SetDrill( aDrill );
440  m_via_n.SetDrill( aDrill );
441  }
void SetDrill(int aDrill)
Definition: pns_via.h:117

References m_via_n, m_via_p, and PNS::VIA::SetDrill().

Referenced by PNS::DIFF_PAIR_PLACER::UpdateSizes().

◆ SetWidth()

void PNS::DIFF_PAIR::SetWidth ( int  aWidth)
inline

Definition at line 394 of file pns_diff_pair.h.

395  {
396  m_width = aWidth;
397  m_n.SetWidth( aWidth );
398  m_p.SetWidth( aWidth );
399  }
void SetWidth(int aWidth)
Sets the width of all segments in the chain.
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References m_n, m_p, m_width, and SHAPE_LINE_CHAIN::SetWidth().

Referenced by PNS::TOPOLOGY::AssembleDiffPair(), PNS::DIFF_PAIR_PLACER::routeHead(), and PNS::DIFF_PAIR_PLACER::UpdateSizes().

◆ Shape()

virtual const SHAPE* PNS::ITEM::Shape ( ) const
inlinevirtualinherited

Return the geometrical shape of the item.

Used for collision detection and spatial indexing.

Reimplemented in PNS::LINE, PNS::VIA, PNS::SOLID, PNS::ARC, and PNS::SEGMENT.

Definition at line 196 of file pns_item.h.

197  {
198  return nullptr;
199  }

Referenced by PNS::DP_GATEWAYS::BuildFromPrimitivePair(), PNS::ITEM::collideSimple(), PNS::OPTIMIZER::computeBreakouts(), PNS::OPTIMIZER::customBreakouts(), PNS::HIT_VISITOR::operator()(), PNS::INDEX::Query(), and ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM().

◆ ShowLinks()

void PNS::LINK_HOLDER::ShowLinks ( ) const
inlineinherited
Todo:
move outside header.

Definition at line 80 of file pns_link_holder.h.

81  {
82 #if 0
83  if( !IsLinked() )
84  {
85  wxLogTrace( "PNS", "item %p: no links", this );
86  return;
87  }
88 
89  wxLogTrace( "PNS", "item %p: %d links", this, (int) m_links.size() );
90 
91  for( int i = 0; i < (int) m_links.size(); i++ )
92  wxLogTrace( "PNS", "item %d: %p\n", i, m_links[i] );
93 #endif
94  }

References PNS::LINK_HOLDER::m_links.

◆ Skew()

double PNS::DIFF_PAIR::Skew ( ) const

Definition at line 804 of file pns_diff_pair.cpp.

805 {
806  return m_p.Length() - m_n.Length();
807 }
long long int Length() const
Function Length()
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References SHAPE_LINE_CHAIN::Length(), m_n, and m_p.

Referenced by PNS::DIFF_PAIR_PLACER::tryWalkDp().

◆ TotalLength()

double PNS::DIFF_PAIR::TotalLength ( ) const

Definition at line 889 of file pns_diff_pair.cpp.

890 {
891  double lenP = m_p.Length();
892  double lenN = m_n.Length();
893 
894  return (lenN + lenP ) / 2.0;
895 }
long long int Length() const
Function Length()
SHAPE_LINE_CHAIN m_p
SHAPE_LINE_CHAIN m_n

References SHAPE_LINE_CHAIN::Length(), m_n, and m_p.

Referenced by CoupledLengthFactor().

◆ Unmark()

virtual void PNS::ITEM::Unmark ( int  aMarker = -1) const
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 207 of file pns_item.h.

207 { m_marker &= ~aMarker; }
int m_marker
Definition: pns_item.h:243

References PNS::ITEM::m_marker.

Referenced by PNS::NODE::Commit(), and PNS::DRAGGER::Start().

◆ updateLine()

void PNS::DIFF_PAIR::updateLine ( LINE aLine,
const SHAPE_LINE_CHAIN aShape,
int  aNet,
const VIA aVia 
)
inlineprivate

Definition at line 510 of file pns_diff_pair.h.

511  {
512  aLine.SetShape( aShape );
513  aLine.SetWidth( m_width );
514  aLine.SetNet( aNet );
515  aLine.SetLayer( Layers().Start() );
516 
517  if( m_hasVias )
518  aLine.AppendVia( aVia );
519  }
const LAYER_RANGE & Layers() const
Definition: pns_item.h:150

References PNS::LINE::AppendVia(), PNS::ITEM::Layers(), m_hasVias, m_width, PNS::ITEM::SetLayer(), PNS::ITEM::SetNet(), PNS::LINE::SetShape(), and PNS::LINE::SetWidth().

Referenced by NLine(), and PLine().

◆ Width()

int PNS::DIFF_PAIR::Width ( ) const
inline

Definition at line 401 of file pns_diff_pair.h.

401 { return m_width; }

References m_width.

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

Member Data Documentation

◆ m_chamferLimit

int PNS::DIFF_PAIR::m_chamferLimit
private

Definition at line 531 of file pns_diff_pair.h.

Referenced by DIFF_PAIR().

◆ m_gap

int PNS::DIFF_PAIR::m_gap
private

Definition at line 528 of file pns_diff_pair.h.

Referenced by DIFF_PAIR(), Gap(), and SetGap().

◆ m_gapConstraint

RANGED_NUM<int> PNS::DIFF_PAIR::m_gapConstraint
private

◆ m_hasVias

bool PNS::DIFF_PAIR::m_hasVias
private

Definition at line 525 of file pns_diff_pair.h.

Referenced by AppendVias(), EndingPrimitives(), EndsWithVias(), RemoveVias(), and updateLine().

◆ m_kind

PnsKind PNS::ITEM::m_kind
protectedinherited

◆ m_layers

◆ m_line_n

LINE PNS::DIFF_PAIR::m_line_n
private

Definition at line 522 of file pns_diff_pair.h.

Referenced by ClearLinks(), and NLine().

◆ m_line_p

LINE PNS::DIFF_PAIR::m_line_p
private

Definition at line 522 of file pns_diff_pair.h.

Referenced by ClearLinks(), and PLine().

◆ m_links

◆ m_marker

◆ m_maxUncoupledLength

int PNS::DIFF_PAIR::m_maxUncoupledLength
private

Definition at line 530 of file pns_diff_pair.h.

Referenced by DIFF_PAIR().

◆ m_movable

bool PNS::ITEM::m_movable
protectedinherited

◆ m_n

◆ m_net

◆ m_net_n

int PNS::DIFF_PAIR::m_net_n
private

Definition at line 526 of file pns_diff_pair.h.

Referenced by DIFF_PAIR(), NetN(), NLine(), and SetNets().

◆ m_net_p

int PNS::DIFF_PAIR::m_net_p
private

Definition at line 526 of file pns_diff_pair.h.

Referenced by DIFF_PAIR(), NetP(), PLine(), and SetNets().

◆ m_owner

NODE* PNS::ITEM::m_owner
protectedinherited

◆ m_p

◆ m_parent

BOARD_ITEM* PNS::ITEM::m_parent
protectedinherited

◆ m_rank

◆ m_routable

bool PNS::ITEM::m_routable
protectedinherited

Definition at line 245 of file pns_item.h.

Referenced by PNS::ITEM::IsRoutable(), PNS::ITEM::ITEM(), and PNS::ITEM::SetRoutable().

◆ m_via_n

VIA PNS::DIFF_PAIR::m_via_n
private

Definition at line 523 of file pns_diff_pair.h.

Referenced by AppendVias(), EndingPrimitives(), NLine(), SetViaDiameter(), and SetViaDrill().

◆ m_via_p

VIA PNS::DIFF_PAIR::m_via_p
private

Definition at line 523 of file pns_diff_pair.h.

Referenced by AppendVias(), EndingPrimitives(), PLine(), SetViaDiameter(), and SetViaDrill().

◆ m_viaGap

int PNS::DIFF_PAIR::m_viaGap
private

Definition at line 529 of file pns_diff_pair.h.

Referenced by DIFF_PAIR().

◆ m_width

int PNS::DIFF_PAIR::m_width
private

◆ UnusedNet

const int PNS::ITEM::UnusedNet = INT_MAX
staticinherited

Supported item types.

Definition at line 58 of file pns_item.h.

Referenced by PNS::ITEM::ITEM().


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