KiCad PCB EDA Suite
PNS::DP_GATEWAY Class Reference

Define a "gateway" for routing a differential pair - e.g. More...

#include <pns_diff_pair.h>

Public Member Functions

 DP_GATEWAY (const VECTOR2I &aAnchorP, const VECTOR2I &aAnchorN, bool aIsDiagonal, int aAllowedEntryAngles=DIRECTION_45::ANG_OBTUSE, int aPriority=0)
 
 ~DP_GATEWAY ()
 
bool IsDiagonal () const
 
const VECTOR2IAnchorP () const
 
const VECTOR2IAnchorN () const
 
int AllowedAngles () const
 
int Priority () const
 
void SetPriority (int aPriority)
 
void SetEntryLines (const SHAPE_LINE_CHAIN &aEntryP, const SHAPE_LINE_CHAIN &aEntryN)
 
const SHAPE_LINE_CHAINEntryP () const
 
const SHAPE_LINE_CHAINEntryN () const
 
const DIFF_PAIR Entry () const
 
void Reverse ()
 
bool HasEntryLines () const
 

Private Attributes

SHAPE_LINE_CHAIN m_entryP
 
SHAPE_LINE_CHAIN m_entryN
 
bool m_hasEntryLines
 
VECTOR2I m_anchorP
 
VECTOR2I m_anchorN
 
bool m_isDiagonal
 
int m_allowedEntryAngles
 
int m_priority
 

Detailed Description

Define a "gateway" for routing a differential pair - e.g.

a pair of points (anchors) with certain orientation, spacing and (optionally) predefined entry paths. The routing algorithm connects such gateways with parallel lines, thus creating a differential pair.

Definition at line 43 of file pns_diff_pair.h.

Constructor & Destructor Documentation

◆ DP_GATEWAY()

PNS::DP_GATEWAY::DP_GATEWAY ( const VECTOR2I aAnchorP,
const VECTOR2I aAnchorN,
bool  aIsDiagonal,
int  aAllowedEntryAngles = DIRECTION_45::ANG_OBTUSE,
int  aPriority = 0 
)
inline

Definition at line 46 of file pns_diff_pair.h.

47  :
48  m_anchorP( aAnchorP ),
49  m_anchorN( aAnchorN ), m_isDiagonal( aIsDiagonal ),
50  m_allowedEntryAngles( aAllowedEntryAngles ), m_priority( aPriority )
51  {
52  m_hasEntryLines = false;
53  }
VECTOR2I m_anchorN
VECTOR2I m_anchorP

References m_hasEntryLines.

◆ ~DP_GATEWAY()

PNS::DP_GATEWAY::~DP_GATEWAY ( )
inline

Definition at line 55 of file pns_diff_pair.h.

56  {
57  }

Member Function Documentation

◆ AllowedAngles()

int PNS::DP_GATEWAY::AllowedAngles ( ) const
inline
Returns
a mask of 45-degree entry directions allowed for the gateway.

Definition at line 74 of file pns_diff_pair.h.

74 { return m_allowedEntryAngles; }

References m_allowedEntryAngles.

Referenced by PNS::DIFF_PAIR::BuildInitial().

◆ AnchorN()

const VECTOR2I& PNS::DP_GATEWAY::AnchorN ( ) const
inline

Definition at line 69 of file pns_diff_pair.h.

69 { return m_anchorN; }
VECTOR2I m_anchorN

References m_anchorN.

Referenced by PNS::DIFF_PAIR::BuildInitial().

◆ AnchorP()

const VECTOR2I& PNS::DP_GATEWAY::AnchorP ( ) const
inline

Definition at line 67 of file pns_diff_pair.h.

67 { return m_anchorP; }
VECTOR2I m_anchorP

References m_anchorP.

Referenced by PNS::DIFF_PAIR::BuildInitial().

◆ Entry()

const DIFF_PAIR PNS::DP_GATEWAY::Entry ( ) const

Definition at line 298 of file pns_diff_pair.cpp.

299 {
300  return DIFF_PAIR( m_entryP, m_entryN, 0 );
301 }
SHAPE_LINE_CHAIN m_entryN
SHAPE_LINE_CHAIN m_entryP

References m_entryN, and m_entryP.

Referenced by PNS::DIFF_PAIR::BuildInitial().

◆ EntryN()

const SHAPE_LINE_CHAIN& PNS::DP_GATEWAY::EntryN ( ) const
inline

Definition at line 97 of file pns_diff_pair.h.

97 { return m_entryN; }
SHAPE_LINE_CHAIN m_entryN

References m_entryN.

◆ EntryP()

const SHAPE_LINE_CHAIN& PNS::DP_GATEWAY::EntryP ( ) const
inline

Definition at line 96 of file pns_diff_pair.h.

96 { return m_entryP; }
SHAPE_LINE_CHAIN m_entryP

References m_entryP.

◆ HasEntryLines()

bool PNS::DP_GATEWAY::HasEntryLines ( ) const
inline

Definition at line 102 of file pns_diff_pair.h.

103  {
104  return m_hasEntryLines;
105  }

References m_hasEntryLines.

Referenced by PNS::DIFF_PAIR::BuildInitial().

◆ IsDiagonal()

bool PNS::DP_GATEWAY::IsDiagonal ( ) const
inline
Returns
true if the gateway anchors lie on a diagonal line.

Definition at line 62 of file pns_diff_pair.h.

63  {
64  return m_isDiagonal;
65  }

References m_isDiagonal.

◆ Priority()

int PNS::DP_GATEWAY::Priority ( ) const
inline
Returns
priority/score value for gateway matching.

Definition at line 79 of file pns_diff_pair.h.

80  {
81  return m_priority;
82  }

References m_priority.

◆ Reverse()

void PNS::DP_GATEWAY::Reverse ( )

Definition at line 198 of file pns_diff_pair.cpp.

199 {
202 }
SHAPE_LINE_CHAIN m_entryN
const SHAPE_LINE_CHAIN Reverse() const
Reverse point order in the line chain.
SHAPE_LINE_CHAIN m_entryP

References m_entryN, m_entryP, and SHAPE_LINE_CHAIN::Reverse().

Referenced by PNS::DIFF_PAIR::BuildInitial().

◆ SetEntryLines()

void PNS::DP_GATEWAY::SetEntryLines ( const SHAPE_LINE_CHAIN aEntryP,
const SHAPE_LINE_CHAIN aEntryN 
)
inline

Definition at line 89 of file pns_diff_pair.h.

90  {
91  m_entryP = aEntryP;
92  m_entryN = aEntryN;
93  m_hasEntryLines = true;
94  }
SHAPE_LINE_CHAIN m_entryN
SHAPE_LINE_CHAIN m_entryP

References m_entryN, m_entryP, and m_hasEntryLines.

◆ SetPriority()

void PNS::DP_GATEWAY::SetPriority ( int  aPriority)
inline

Definition at line 84 of file pns_diff_pair.h.

85  {
86  m_priority = aPriority;
87  }

References m_priority.

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

Member Data Documentation

◆ m_allowedEntryAngles

int PNS::DP_GATEWAY::m_allowedEntryAngles
private

Definition at line 112 of file pns_diff_pair.h.

Referenced by AllowedAngles().

◆ m_anchorN

VECTOR2I PNS::DP_GATEWAY::m_anchorN
private

Definition at line 110 of file pns_diff_pair.h.

Referenced by AnchorN().

◆ m_anchorP

VECTOR2I PNS::DP_GATEWAY::m_anchorP
private

Definition at line 110 of file pns_diff_pair.h.

Referenced by AnchorP().

◆ m_entryN

SHAPE_LINE_CHAIN PNS::DP_GATEWAY::m_entryN
private

Definition at line 108 of file pns_diff_pair.h.

Referenced by Entry(), EntryN(), Reverse(), and SetEntryLines().

◆ m_entryP

SHAPE_LINE_CHAIN PNS::DP_GATEWAY::m_entryP
private

Definition at line 108 of file pns_diff_pair.h.

Referenced by Entry(), EntryP(), Reverse(), and SetEntryLines().

◆ m_hasEntryLines

bool PNS::DP_GATEWAY::m_hasEntryLines
private

Definition at line 109 of file pns_diff_pair.h.

Referenced by DP_GATEWAY(), HasEntryLines(), and SetEntryLines().

◆ m_isDiagonal

bool PNS::DP_GATEWAY::m_isDiagonal
private

Definition at line 111 of file pns_diff_pair.h.

Referenced by IsDiagonal().

◆ m_priority

int PNS::DP_GATEWAY::m_priority
private

Definition at line 113 of file pns_diff_pair.h.

Referenced by Priority(), and SetPriority().


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