KiCad PCB EDA Suite
PNS::JOINT Class Reference

JOINT. More...

#include <pns_joint.h>

Inheritance diagram for PNS::JOINT:
PNS::ITEM

Classes

struct  HASH_TAG
 

Joints are hashed by their position, layers and net.

More...
 
struct  JOINT_TAG_HASH
 

Public Types

typedef ITEM_SET::ENTRIES LINKED_ITEMS
 
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
}
 

Supported item types

More...
 

Public Member Functions

 JOINT ()
 
 JOINT (const VECTOR2I &aPos, const LAYER_RANGE &aLayers, int aNet=-1)
 
 JOINT (const JOINT &aB)
 
ITEMClone () const override
 Function Clone() More...
 
bool IsLineCorner () const
 

Returns true if the joint is a trivial line corner, connecting two

segments of the same net, on the same layer. More...

 
bool IsNonFanoutVia () const
 
bool IsStitchingVia () const
 
bool IsTraceWidthChange () const
 
void Link (ITEM *aItem)
 

Links the joint to a given board item (when it's added to the NODE)

More...
 
bool Unlink (ITEM *aItem)
 

Unlinks a given board item from the joint (upon its removal from a NODE) Returns true if the joint became dangling after unlinking.

More...
 
LINKED_ITEMNextSegment (ITEM *aCurrent) const
 

For trivial joints, returns the segment adjacent to (aCurrent).

More...
 
VIAVia ()
 
const HASH_TAGTag () const
 trivial accessors More...
 
const VECTOR2IPos () const
 
int Net () const
 
const LINKED_ITEMSLinkList () const
 
const ITEM_SETCLinks () const
 
ITEM_SETLinks ()
 
int LinkCount (int aMask=-1) const
 
void Dump () const
 
bool operator== (const JOINT &rhs) const
 
void Merge (const JOINT &aJoint)
 
bool Overlaps (const JOINT &rhs) const
 
void Lock (bool aLock=true)
 
bool IsLocked () const
 
virtual const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0) const
 
PnsKind Kind () const
 Function Kind() More...
 
bool OfKind (int aKindMask) const
 Function OfKind() More...
 
std::string KindStr () const
 Function KindStr() More...
 
void SetParent (BOARD_CONNECTED_ITEM *aParent)
 
BOARD_CONNECTED_ITEMParent () const
 
void SetNet (int aNet)
 
const LAYER_RANGELayers () const
 
void SetLayers (const LAYER_RANGE &aLayers)
 
void SetLayer (int aLayer)
 
virtual int Layer () const
 
bool LayersOverlap (const ITEM *aOther) const
 Function LayersOverlap() More...
 
NODEOwner () const
 Function Owner() More...
 
void SetOwner (NODE *aOwner)
 Functon SetOwner() More...
 
bool BelongsTo (NODE *aNode) const
 Function BelongsTo() More...
 
virtual bool Collide (const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I *aMTV, const NODE *aParentNode, bool aDifferentNetsOnly=true) const
 Function Collide() More...
 
virtual const SHAPEShape () const
 Function Shape() More...
 
virtual void Mark (int aMarker)
 
virtual void Unmark (int aMarker=-1)
 
virtual int Marker () const
 
virtual void SetRank (int aRank)
 
virtual int Rank () const
 
virtual VECTOR2I Anchor (int n) const
 
virtual int AnchorCount () const
 
void SetRoutable (bool aRoutable)
 
bool IsRoutable () const
 

Static Public Attributes

static const int UnusedNet = INT_MAX
 

Protected Attributes

PnsKind m_kind
 
BOARD_CONNECTED_ITEMm_parent
 
NODEm_owner
 
LAYER_RANGE m_layers
 
bool m_movable
 
int m_net
 
int m_marker
 
int m_rank
 
bool m_routable
 

Private Attributes

HASH_TAG m_tag
 

hash tag for unordered_multimap

More...
 
ITEM_SET m_linkedItems
 

list of items linked to this joint

More...
 
bool m_locked
 

locked (non-movable) flag

More...
 

Detailed Description

JOINT.

Represents a 2D point on a given set of layers and belonging to a certain net, that links together a number of board items. A hash table of joints is used by the router to follow connectivity between the items.

Definition at line 43 of file pns_joint.h.

Member Typedef Documentation

◆ LINKED_ITEMS

Definition at line 46 of file pns_joint.h.

Member Enumeration Documentation

◆ PnsKind

enum PNS::ITEM::PnsKind
inherited

Supported item types

Enumerator
SOLID_T 
LINE_T 
JOINT_T 
SEGMENT_T 
ARC_T 
VIA_T 
DIFF_PAIR_T 
ANY_T 

Definition at line 59 of file pns_item.h.

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

Constructor & Destructor Documentation

◆ JOINT() [1/3]

PNS::JOINT::JOINT ( )
inline

Definition at line 70 of file pns_joint.h.

70  :
71  ITEM( JOINT_T ), m_locked( false ) {}
ITEM(PnsKind aKind)
Definition: pns_item.h:71
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:263

◆ JOINT() [2/3]

PNS::JOINT::JOINT ( const VECTOR2I aPos,
const LAYER_RANGE aLayers,
int  aNet = -1 
)
inline

Definition at line 73 of file pns_joint.h.

73  :
74  ITEM( JOINT_T )
75  {
76  m_tag.pos = aPos;
77  m_tag.net = aNet;
78  m_layers = aLayers;
79  m_locked = false;
80  }
LAYER_RANGE m_layers
Definition: pns_item.h:253
ITEM(PnsKind aKind)
Definition: pns_item.h:71
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:263
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257

References PNS::ITEM::m_layers, m_locked, m_tag, PNS::JOINT::HASH_TAG::net, and PNS::JOINT::HASH_TAG::pos.

◆ JOINT() [3/3]

PNS::JOINT::JOINT ( const JOINT aB)
inline

Definition at line 82 of file pns_joint.h.

82  :
83  ITEM( JOINT_T )
84  {
85  m_layers = aB.m_layers;
86  m_tag.pos = aB.m_tag.pos;
87  m_tag.net = aB.m_tag.net;
88  m_linkedItems = aB.m_linkedItems;
89  m_layers = aB.m_layers;
90  m_locked = aB.m_locked;
91  }
LAYER_RANGE m_layers
Definition: pns_item.h:253
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
ITEM(PnsKind aKind)
Definition: pns_item.h:71
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:263
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257

References PNS::ITEM::m_layers, m_linkedItems, m_locked, m_tag, PNS::JOINT::HASH_TAG::net, and PNS::JOINT::HASH_TAG::pos.

Member Function Documentation

◆ Anchor()

virtual VECTOR2I PNS::ITEM::Anchor ( int  n) const
inlinevirtualinherited

◆ AnchorCount()

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

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

Definition at line 231 of file pns_item.h.

232  {
233  return 0;
234  }

◆ BelongsTo()

bool PNS::ITEM::BelongsTo ( NODE aNode) const
inlineinherited

Function BelongsTo()

Returns
true if the item is owned by the node aNode.

Definition at line 187 of file pns_item.h.

188  {
189  return m_owner == aNode;
190  }
NODE * m_owner
Definition: pns_item.h:252

References PNS::ITEM::m_owner.

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

◆ CLinks()

const ITEM_SET& PNS::JOINT::CLinks ( ) const
inline

Definition at line 201 of file pns_joint.h.

202  {
203  return m_linkedItems;
204  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260

References m_linkedItems.

◆ Clone()

ITEM* PNS::JOINT::Clone ( ) const
inlineoverridevirtual

Function Clone()

Returns a deep copy of the item

Implements PNS::ITEM.

Definition at line 93 of file pns_joint.h.

94  {
95  assert( false );
96  return NULL;
97  }
#define NULL

References NULL.

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aNeedMTV,
VECTOR2I aMTV,
const NODE aParentNode,
bool  aDifferentNetsOnly = true 
) const
virtualinherited

Function Collide()

Checks for a collision (clearance violation) with between us and item aOther. Collision checking takes all PCB stuff into accound (layers, nets, DRC rules). Optionally returns a minimum translation vector for force propagation algorithm.

Parameters
aOtheritem to check collision against
aClearancedesired clearance
aNeedMTVwhen true, the minimum translation vector is calculated
aMTVthe minimum translation vector
Returns
true, if a collision was found.

Definition at line 48 of file pns_item.cpp.

50 {
51  if( collideSimple( aOther, aClearance, aNeedMTV, aMTV, aParentNode, aDifferentNetsOnly ) )
52  return true;
53 
54  // special case for "head" line with a via attached at the end.
55  if( aOther->m_kind == LINE_T )
56  {
57  const LINE* line = static_cast<const LINE*>( aOther );
58  int clearance = aClearance - line->Width() / 2;
59 
60  if( line->EndsWithVia() )
61  {
62  return collideSimple( &line->Via(), clearance, aNeedMTV, aMTV, aParentNode,
63  aDifferentNetsOnly );
64  }
65  }
66 
67  return false;
68 }
bool collideSimple(const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I *aMTV, const NODE *aParentNode, bool aDifferentNetsOnly) const
Definition: pns_item.cpp:30

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

Referenced by PNS::NODE::CheckColliding(), PNS::OPTIMIZER::CACHE_VISITOR::operator()(), and PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()().

◆ Dump()

void PNS::JOINT::Dump ( ) const

Definition at line 1115 of file pns_node.cpp.

1116 {
1117  wxLogTrace( "PNS", "joint layers %d-%d, net %d, pos %s, links: %d", m_layers.Start(),
1118  m_layers.End(), m_tag.net, m_tag.pos.Format().c_str(), LinkCount() );
1119 }
LAYER_RANGE m_layers
Definition: pns_item.h:253
int Start() const
Definition: pns_layerset.h:83
int End() const
Definition: pns_layerset.h:88
const std::string Format() const
Function Format returns the vector formatted as a string.
Definition: vector2d.h:407
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257
int LinkCount(int aMask=-1) const
Definition: pns_joint.h:211

References LAYER_RANGE::End(), VECTOR2< T >::Format(), LinkCount(), PNS::ITEM::m_layers, m_tag, PNS::JOINT::HASH_TAG::net, PNS::JOINT::HASH_TAG::pos, and LAYER_RANGE::Start().

◆ Hull()

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

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

Definition at line 113 of file pns_item.h.

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

◆ IsLineCorner()

bool PNS::JOINT::IsLineCorner ( ) const
inline

Returns true if the joint is a trivial line corner, connecting two

segments of the same net, on the same layer.

Definition at line 101 of file pns_joint.h.

102  {
103  if( m_linkedItems.Size() != 2 || m_linkedItems.Count( SEGMENT_T | ARC_T ) != 2 )
104  return false;
105 
106  auto seg1 = static_cast<LINKED_ITEM*>( m_linkedItems[0] );
107  auto seg2 = static_cast<LINKED_ITEM*>( m_linkedItems[1] );
108 
109  // joints between segments of different widths are not considered trivial.
110  return seg1->Width() == seg2->Width();
111  }
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
int Size() const
Definition: pns_itemset.h:165

References PNS::ITEM::ARC_T, PNS::ITEM_SET::Count(), m_linkedItems, PNS::ITEM::SEGMENT_T, and PNS::ITEM_SET::Size().

Referenced by PNS::NODE::followLine(), and NextSegment().

◆ IsLocked()

bool PNS::JOINT::IsLocked ( ) const
inline

Definition at line 250 of file pns_joint.h.

251  {
252  return m_locked;
253  }
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:263

References m_locked.

Referenced by PNS::NODE::followLine(), and Merge().

◆ IsNonFanoutVia()

bool PNS::JOINT::IsNonFanoutVia ( ) const
inline

Definition at line 113 of file pns_joint.h.

114  {
115  int vias = m_linkedItems.Count( VIA_T );
116  int segs = m_linkedItems.Count( SEGMENT_T );
117  segs += m_linkedItems.Count( ARC_T );
118 
119  return ( m_linkedItems.Size() == 3 && vias == 1 && segs == 2 );
120  }
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
int Size() const
Definition: pns_itemset.h:165

References PNS::ITEM::ARC_T, PNS::ITEM_SET::Count(), m_linkedItems, PNS::ITEM::SEGMENT_T, PNS::ITEM_SET::Size(), and PNS::ITEM::VIA_T.

Referenced by PNS::TOPOLOGY::AssembleTrivialPath(), and PNS::TOPOLOGY::followTrivialPath().

◆ IsRoutable()

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

Definition at line 242 of file pns_item.h.

242 { return m_routable; }
bool m_routable
Definition: pns_item.h:259

References PNS::ITEM::m_routable.

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

◆ IsStitchingVia()

bool PNS::JOINT::IsStitchingVia ( ) const
inline

Definition at line 122 of file pns_joint.h.

123  {
124  return ( m_linkedItems.Size() == 1 && m_linkedItems.Count( VIA_T ) == 1 );
125  }
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
int Size() const
Definition: pns_itemset.h:165

References PNS::ITEM_SET::Count(), m_linkedItems, PNS::ITEM_SET::Size(), and PNS::ITEM::VIA_T.

◆ IsTraceWidthChange()

bool PNS::JOINT::IsTraceWidthChange ( ) const
inline

Definition at line 127 of file pns_joint.h.

128  {
129  if( m_linkedItems.Size() != 2 )
130  return false;
131 
132  if( m_linkedItems.Count( SEGMENT_T ) != 2)
133  return false;
134 
135  SEGMENT* seg1 = static_cast<SEGMENT*>( m_linkedItems[0] );
136  SEGMENT* seg2 = static_cast<SEGMENT*>( m_linkedItems[1] );
137 
138  return seg1->Width() != seg2->Width();
139  }
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
int Size() const
Definition: pns_itemset.h:165

References PNS::ITEM_SET::Count(), m_linkedItems, PNS::ITEM::SEGMENT_T, PNS::ITEM_SET::Size(), and PNS::SEGMENT::Width().

Referenced by PNS::TOPOLOGY::followTrivialPath().

◆ Kind()

◆ KindStr()

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

Function KindStr()

Returns the kind of the item, as string

Definition at line 71 of file pns_item.cpp.

72 {
73  switch( m_kind )
74  {
75  case ARC_T: return "arc";
76  case LINE_T: return "line";
77  case SEGMENT_T: return "segment";
78  case VIA_T: return "via";
79  case JOINT_T: return "joint";
80  case SOLID_T: return "solid";
81  default: return "unknown";
82  }
83 }
PnsKind m_kind
Definition: pns_item.h:249

References PNS::ITEM::ARC_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()

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

Definition at line 155 of file pns_item.h.

155 { return Layers().Start(); }
int Start() const
Definition: pns_layerset.h:83
const LAYER_RANGE & Layers() const
Definition: pns_item.h:151

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

Referenced by PNS::OPTIMIZER::fanoutCleanup(), and PNS::OPTIMIZER::runSmartPads().

◆ Layers()

◆ LayersOverlap()

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

Function LayersOverlap()

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

Definition at line 163 of file pns_item.h.

164  {
165  return Layers().Overlaps( aOther->Layers() );
166  }
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:68
const LAYER_RANGE & Layers() const
Definition: pns_item.h:151

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

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

◆ Link()

void PNS::JOINT::Link ( ITEM aItem)
inline

Links the joint to a given board item (when it's added to the NODE)

Definition at line 142 of file pns_joint.h.

143  {
144  if( m_linkedItems.Contains( aItem ) )
145  return;
146 
147  m_linkedItems.Add( aItem );
148  }
bool Contains(ITEM *aItem) const
Definition: pns_itemset.h:193
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32

References PNS::ITEM_SET::Add(), PNS::ITEM_SET::Contains(), and m_linkedItems.

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

◆ LinkCount()

int PNS::JOINT::LinkCount ( int  aMask = -1) const
inline

Definition at line 211 of file pns_joint.h.

212  {
213  return m_linkedItems.Count( aMask );
214  }
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260

References PNS::ITEM_SET::Count(), and m_linkedItems.

Referenced by Dump(), PNS::DIFF_PAIR_PLACER::getDanglingAnchor(), PNS::TOPOLOGY::LeadingRatLine(), and PNS::LINE_PLACER::SplitAdjacentSegments().

◆ LinkList()

◆ Links()

ITEM_SET& PNS::JOINT::Links ( )
inline

Definition at line 206 of file pns_joint.h.

207  {
208  return m_linkedItems;
209  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260

References m_linkedItems.

Referenced by PNS::TOPOLOGY::AssembleTrivialPath(), PNS::TOPOLOGY::followTrivialPath(), and PNS::SIZES_SETTINGS::inheritTrackWidth().

◆ Lock()

void PNS::JOINT::Lock ( bool  aLock = true)
inline

Definition at line 245 of file pns_joint.h.

246  {
247  m_locked = aLock;
248  }
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:263

References m_locked.

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

◆ Mark()

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

Reimplemented in PNS::LINE.

Definition at line 219 of file pns_item.h.

219 { m_marker = aMarker; }
int m_marker
Definition: pns_item.h:257

References PNS::ITEM::m_marker.

◆ Marker()

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

Reimplemented in PNS::LINE.

Definition at line 221 of file pns_item.h.

221 { return m_marker; }
int m_marker
Definition: pns_item.h:257

References PNS::ITEM::m_marker.

Referenced by PNS::ARC::ARC(), PNS::ITEM::IsLocked(), PNS::LOGGER::Log(), PNS::SHOVE::pushOrShoveVia(), and ROUTER_PREVIEW_ITEM::Update().

◆ Merge()

void PNS::JOINT::Merge ( const JOINT aJoint)
inline

Definition at line 223 of file pns_joint.h.

224  {
225  if( !Overlaps( aJoint ) )
226  return;
227 
228  m_layers.Merge( aJoint.m_layers );
229 
230  if( aJoint.IsLocked() )
231  m_locked = true;
232 
233  for( ITEM* item : aJoint.LinkList() )
234  {
235  m_linkedItems.Add( item );
236  }
237  }
LAYER_RANGE m_layers
Definition: pns_item.h:253
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
ITEM(PnsKind aKind)
Definition: pns_item.h:71
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:263
void Merge(const LAYER_RANGE &aOther)
Definition: pns_layerset.h:93
bool Overlaps(const JOINT &rhs) const
Definition: pns_joint.h:239

References PNS::ITEM_SET::Add(), IsLocked(), LinkList(), PNS::ITEM::m_layers, m_linkedItems, m_locked, LAYER_RANGE::Merge(), and Overlaps().

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

◆ Net()

int PNS::JOINT::Net ( ) const
inline

Definition at line 191 of file pns_joint.h.

192  {
193  return m_tag.net;
194  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257

References m_tag, and PNS::JOINT::HASH_TAG::net.

Referenced by PNS::TOPOLOGY::NearestUnconnectedItem().

◆ NextSegment()

LINKED_ITEM* PNS::JOINT::NextSegment ( ITEM aCurrent) const
inline

For trivial joints, returns the segment adjacent to (aCurrent).

For non-trival ones, returns NULL, indicating the end of line.

Definition at line 160 of file pns_joint.h.

161  {
162  if( !IsLineCorner() )
163  return NULL;
164 
165  return static_cast<LINKED_ITEM*>( m_linkedItems[m_linkedItems[0] == aCurrent ? 1 : 0] );
166  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
bool IsLineCorner() const
Returns true if the joint is a trivial line corner, connecting two segments of the same net,...
Definition: pns_joint.h:101
#define NULL

References IsLineCorner(), m_linkedItems, and NULL.

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

◆ OfKind()

◆ operator==()

bool PNS::JOINT::operator== ( const JOINT rhs) const
inline

Definition at line 218 of file pns_joint.h.

219  {
220  return m_tag.pos == rhs.m_tag.pos && m_tag.net == rhs.m_tag.net;
221  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257

References m_tag, PNS::JOINT::HASH_TAG::net, and PNS::JOINT::HASH_TAG::pos.

◆ Overlaps()

bool PNS::JOINT::Overlaps ( const JOINT rhs) const
inline

Definition at line 239 of file pns_joint.h.

240  {
241  return m_tag.pos == rhs.m_tag.pos &&
242  m_tag.net == rhs.m_tag.net && m_layers.Overlaps( rhs.m_layers );
243  }
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:68
LAYER_RANGE m_layers
Definition: pns_item.h:253
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257

References PNS::ITEM::m_layers, m_tag, PNS::JOINT::HASH_TAG::net, LAYER_RANGE::Overlaps(), and PNS::JOINT::HASH_TAG::pos.

Referenced by Merge().

◆ Owner()

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

Function Owner()

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

Definition at line 173 of file pns_item.h.

173 { return m_owner; }
NODE * m_owner
Definition: pns_item.h:252

References PNS::ITEM::m_owner.

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

◆ Parent()

◆ Pos()

const VECTOR2I& PNS::JOINT::Pos ( ) const
inline

Definition at line 186 of file pns_joint.h.

187  {
188  return m_tag.pos;
189  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257

References m_tag, and PNS::JOINT::HASH_TAG::pos.

Referenced by PNS::NODE::FindLinesBetweenJoints(), PNS::NODE::followLine(), PNS::TOPOLOGY::LeadingRatLine(), PNS::TOPOLOGY::NearestUnconnectedItem(), and PNS::NODE::rebuildJoint().

◆ Rank()

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

Reimplemented in PNS::LINE.

Definition at line 224 of file pns_item.h.

224 { return m_rank; }
int m_rank
Definition: pns_item.h:258

References PNS::ITEM::m_rank.

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

◆ SetLayer()

◆ SetLayers()

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

Definition at line 152 of file pns_item.h.

152 { m_layers = aLayers; }
LAYER_RANGE m_layers
Definition: pns_item.h:253

References PNS::ITEM::m_layers.

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

◆ SetNet()

◆ SetOwner()

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

Functon SetOwner()

Sets the node that owns this item. An item can belong to a single NODE or be unowned.

Definition at line 180 of file pns_item.h.

180 { m_owner = aOwner; }
NODE * m_owner
Definition: pns_item.h:252

References PNS::ITEM::m_owner.

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

◆ SetParent()

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

Definition at line 145 of file pns_item.h.

145 { m_parent = aParent; }
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:251

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 223 of file pns_item.h.

223 { m_rank = aRank; }
int m_rank
Definition: pns_item.h:258

References PNS::ITEM::m_rank.

◆ SetRoutable()

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

Definition at line 241 of file pns_item.h.

241 { m_routable = aRoutable; }
bool m_routable
Definition: pns_item.h:259

References PNS::ITEM::m_routable.

◆ Shape()

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

Function Shape()

Returns the geometrical shape of the item. Used for collision detection & spatial indexing.

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

Definition at line 214 of file pns_item.h.

215  {
216  return NULL;
217  }
#define NULL

References NULL.

Referenced by PNS::DP_GATEWAYS::BuildFromPrimitivePair(), PNS_PCBNEW_RULE_RESOLVER::CollideHoles(), PNS::ITEM::collideSimple(), PNS::OPTIMIZER::computeBreakouts(), PNS::OPTIMIZER::customBreakouts(), PNS::LOGGER::Log(), PNS::SHOVE::onCollidingVia(), PNS::HIT_VISITOR::operator()(), PNS::INDEX::Query(), and ROUTER_PREVIEW_ITEM::Update().

◆ Tag()

const HASH_TAG& PNS::JOINT::Tag ( ) const
inline

trivial accessors

Definition at line 181 of file pns_joint.h.

182  {
183  return m_tag;
184  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:257

References m_tag.

◆ Unlink()

bool PNS::JOINT::Unlink ( ITEM aItem)
inline

Unlinks a given board item from the joint (upon its removal from a NODE) Returns true if the joint became dangling after unlinking.

Definition at line 152 of file pns_joint.h.

153  {
154  m_linkedItems.Erase( aItem );
155  return m_linkedItems.Size() == 0;
156  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
int Size() const
Definition: pns_itemset.h:165
void Erase(ITEM *aItem)
Definition: pns_itemset.h:199

References PNS::ITEM_SET::Erase(), m_linkedItems, and PNS::ITEM_SET::Size().

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

◆ Unmark()

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

Reimplemented in PNS::LINE.

Definition at line 220 of file pns_item.h.

220 { m_marker &= ~aMarker; }
int m_marker
Definition: pns_item.h:257

References PNS::ITEM::m_marker.

Referenced by PNS::DRAGGER::Start().

◆ Via()

VIA* PNS::JOINT::Via ( )
inline

Definition at line 168 of file pns_joint.h.

169  {
170  for( ITEM* item : m_linkedItems.Items() )
171  {
172  if( item->OfKind( VIA_T ) )
173  return static_cast<VIA*>( item );
174  }
175 
176  return NULL;
177  }
ENTRIES & Items()
Definition: pns_itemset.h:140
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:260
ITEM(PnsKind aKind)
Definition: pns_item.h:71
#define NULL

References PNS::ITEM_SET::Items(), m_linkedItems, NULL, and PNS::ITEM::VIA_T.

Member Data Documentation

◆ m_kind

PnsKind PNS::ITEM::m_kind
protectedinherited

◆ m_layers

◆ m_linkedItems

ITEM_SET PNS::JOINT::m_linkedItems
private

list of items linked to this joint

Definition at line 260 of file pns_joint.h.

Referenced by CLinks(), IsLineCorner(), IsNonFanoutVia(), IsStitchingVia(), IsTraceWidthChange(), JOINT(), Link(), LinkCount(), LinkList(), Links(), Merge(), NextSegment(), Unlink(), and Via().

◆ m_locked

bool PNS::JOINT::m_locked
private

locked (non-movable) flag

Definition at line 263 of file pns_joint.h.

Referenced by IsLocked(), JOINT(), Lock(), and Merge().

◆ m_marker

◆ m_movable

bool PNS::ITEM::m_movable
protectedinherited

◆ m_net

◆ m_owner

NODE* PNS::ITEM::m_owner
protectedinherited

◆ m_parent

BOARD_CONNECTED_ITEM* PNS::ITEM::m_parent
protectedinherited

◆ m_rank

◆ m_routable

bool PNS::ITEM::m_routable
protectedinherited

Definition at line 259 of file pns_item.h.

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

◆ m_tag

HASH_TAG PNS::JOINT::m_tag
private

hash tag for unordered_multimap

Definition at line 257 of file pns_joint.h.

Referenced by Dump(), JOINT(), Net(), operator==(), Overlaps(), Pos(), and Tag().

◆ UnusedNet

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

Definition at line 56 of file pns_item.h.

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


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