KiCad PCB EDA Suite
PNS::JOINT Class Reference

Class 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...
 

Public Types

typedef ITEM_SET::ENTRIES LINKED_ITEMS
 
enum  PnsKind {
  SOLID_T = 1, LINE_T = 2, JOINT_T = 4, SEGMENT_T = 8,
  VIA_T = 16, DIFF_PAIR_T = 32, 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 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...
 
SEGMENTNextSegment (SEGMENT *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...
 
const std::string KindStr () const
 Function KindStr() More...
 
void SetParent (BOARD_CONNECTED_ITEM *aParent)
 Function SetParent() More...
 
BOARD_CONNECTED_ITEMParent () const
 Function Parent() More...
 
void SetNet (int aNet)
 Function SetNet() More...
 
void SetLayers (const LAYER_RANGE &aLayers)
 Function SetLayers() More...
 
void SetLayer (int aLayer)
 Function SetLayer() More...
 
const LAYER_RANGELayers () const
 Function Layers() More...
 
virtual int Layer () const
 Function Layer() More...
 
bool LayersOverlap (const ITEM *aOther) const
 Function LayersOverlap() More...
 
void SetOwner (NODE *aOwner)
 Functon SetOwner() More...
 
bool BelongsTo (NODE *aNode) const
 Function BelongsTo() More...
 
NODEOwner () const
 Function Owner() More...
 
virtual bool Collide (const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly=true) const
 Function Collide() More...
 
bool Collide (const ITEM *aOther, int aClearance, 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
 

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
 

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

Class 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 44 of file pns_joint.h.

Member Typedef Documentation

Definition at line 47 of file pns_joint.h.

Member Enumeration Documentation

enum PNS::ITEM::PnsKind
inherited

Supported item types

Enumerator
SOLID_T 
LINE_T 
JOINT_T 
SEGMENT_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  VIA_T = 16,
66  DIFF_PAIR_T = 32,
67  ANY_T = 0xff
68  };

Constructor & Destructor Documentation

PNS::JOINT::JOINT ( )
inline

Definition at line 57 of file pns_joint.h.

57  :
58  ITEM( JOINT_T ), m_locked( false ) {}
ITEM(PnsKind aKind)
Definition: pns_item.h:70
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:244
PNS::JOINT::JOINT ( const VECTOR2I aPos,
const LAYER_RANGE aLayers,
int  aNet = -1 
)
inline

Definition at line 60 of file pns_joint.h.

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

60  :
61  ITEM( JOINT_T )
62  {
63  m_tag.pos = aPos;
64  m_tag.net = aNet;
65  m_layers = aLayers;
66  m_locked = false;
67  }
LAYER_RANGE m_layers
Definition: pns_item.h:350
ITEM(PnsKind aKind)
Definition: pns_item.h:70
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:244
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238
PNS::JOINT::JOINT ( const JOINT aB)
inline

Definition at line 69 of file pns_joint.h.

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

69  :
70  ITEM( JOINT_T )
71  {
72  m_layers = aB.m_layers;
73  m_tag.pos = aB.m_tag.pos;
74  m_tag.net = aB.m_tag.net;
75  m_linkedItems = aB.m_linkedItems;
76  m_layers = aB.m_layers;
77  m_locked = aB.m_locked;
78  }
LAYER_RANGE m_layers
Definition: pns_item.h:350
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
ITEM(PnsKind aKind)
Definition: pns_item.h:70
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:244
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238

Member Function Documentation

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

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

Definition at line 326 of file pns_item.h.

Referenced by PNS::DP_PRIMITIVE_PAIR::CursorOrientation(), PNS::DP_PRIMITIVE_PAIR::DP_PRIMITIVE_PAIR(), and PNS::DIFF_PAIR_PLACER::getDanglingAnchor().

327  {
328  return VECTOR2I();
329  }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:580
virtual int PNS::ITEM::AnchorCount ( ) const
inlinevirtualinherited

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

Definition at line 331 of file pns_item.h.

332  {
333  return 0;
334  }
bool PNS::ITEM::BelongsTo ( NODE aNode) const
inlineinherited

Function BelongsTo()

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

Definition at line 249 of file pns_item.h.

References PNS::ITEM::m_owner.

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

250  {
251  return m_owner == aNode;
252  }
NODE * m_owner
Definition: pns_item.h:349
const ITEM_SET& PNS::JOINT::CLinks ( ) const
inline

Definition at line 182 of file pns_joint.h.

References m_linkedItems.

183  {
184  return m_linkedItems;
185  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
ITEM* PNS::JOINT::Clone ( ) const
inlineoverridevirtual

Function Clone()

Returns a deep copy of the item

Implements PNS::ITEM.

Definition at line 80 of file pns_joint.h.

81  {
82  assert( false );
83  return NULL;
84  }
bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aNeedMTV,
VECTOR2I aMTV,
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 44 of file pns_item.cpp.

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::ITEM::Collide(), PNS::OPTIMIZER::CACHE_VISITOR::operator()(), and PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()().

46 {
47  if( collideSimple( aOther, aClearance, aNeedMTV, aMTV, aDifferentNetsOnly ) )
48  return true;
49 
50  // special case for "head" line with a via attached at the end.
51  if( aOther->m_kind == LINE_T )
52  {
53  const LINE* line = static_cast<const LINE*>( aOther );
54 
55  if( line->EndsWithVia() )
56  return collideSimple( &line->Via(), aClearance - line->Width() / 2, aNeedMTV, aMTV, aDifferentNetsOnly );
57  }
58 
59  return false;
60 }
bool collideSimple(const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly) const
Definition: pns_item.cpp:27
bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aDifferentNetsOnly = true 
) const
inlineinherited

Function Collide()

A shortcut for ITEM::Colllide() without MTV stuff.

Definition at line 283 of file pns_item.h.

References PNS::ITEM::Collide(), and dummy().

284  {
285  VECTOR2I dummy;
286 
287  return Collide( aOther, aClearance, false, dummy, aDifferentNetsOnly );
288  }
virtual bool Collide(const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly=true) const
Function Collide()
Definition: pns_item.cpp:44
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
void PNS::JOINT::Dump ( ) const

Definition at line 1056 of file pns_node.cpp.

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().

1057 {
1058  wxLogTrace( "PNS", "joint layers %d-%d, net %d, pos %s, links: %d", m_layers.Start(),
1059  m_layers.End(), m_tag.net, m_tag.pos.Format().c_str(), LinkCount() );
1060 }
LAYER_RANGE m_layers
Definition: pns_item.h:350
int End() const
Definition: pns_layerset.h:88
int LinkCount(int aMask=-1) const
Definition: pns_joint.h:192
int Start() const
Definition: pns_layerset.h:83
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238
const std::string Format() const
Function Format returns the vector formatted as a string.
Definition: vector2d.h:393
virtual const SHAPE_LINE_CHAIN PNS::ITEM::Hull ( int  aClearance = 0,
int  aWalkaroundThickness = 0 
) const
inlinevirtualinherited

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

Definition at line 110 of file pns_item.h.

111  {
112  return SHAPE_LINE_CHAIN();
113  }
Class SHAPE_LINE_CHAIN.
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 88 of file pns_joint.h.

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

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

89  {
90  if( m_linkedItems.Size() != 2 || m_linkedItems.Count( SEGMENT_T ) != 2 )
91  return false;
92 
93  SEGMENT* seg1 = static_cast<SEGMENT*>( m_linkedItems[0] );
94  SEGMENT* seg2 = static_cast<SEGMENT*>( m_linkedItems[1] );
95 
96  // joints between segments of different widths are not considered trivial.
97  return seg1->Width() == seg2->Width();
98  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
Struct SEGMENT is a simple container used when filling areas with segments.
Definition: class_zone.h:57
int Size() const
Definition: pns_itemset.h:162
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
bool PNS::JOINT::IsLocked ( ) const
inline

Definition at line 231 of file pns_joint.h.

References m_locked.

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

232  {
233  return m_locked;
234  }
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:244
bool PNS::JOINT::IsNonFanoutVia ( ) const
inline

Definition at line 100 of file pns_joint.h.

References 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().

101  {
102  int vias = m_linkedItems.Count( VIA_T );
103  int segs = m_linkedItems.Count( SEGMENT_T );
104 
105  return ( m_linkedItems.Size() == 3 && vias == 1 && segs == 2 );
106  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
int Size() const
Definition: pns_itemset.h:162
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
bool PNS::JOINT::IsTraceWidthChange ( ) const
inline

Definition at line 108 of file pns_joint.h.

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

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

109  {
110  if( m_linkedItems.Size() != 2 )
111  return false;
112 
113  if( m_linkedItems.Count( SEGMENT_T ) != 2)
114  return false;
115 
116  SEGMENT* seg1 = static_cast<SEGMENT*>( m_linkedItems[0] );
117  SEGMENT* seg2 = static_cast<SEGMENT*>( m_linkedItems[1] );
118 
119  return seg1->Width() != seg2->Width();
120  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
Struct SEGMENT is a simple container used when filling areas with segments.
Definition: class_zone.h:57
int Size() const
Definition: pns_itemset.h:162
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
const std::string PNS::ITEM::KindStr ( ) const
inherited

Function KindStr()

Returns the kind of the item, as string

Definition at line 63 of file pns_item.cpp.

References 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().

64 {
65  switch( m_kind )
66  {
67  case LINE_T:
68  return "line";
69 
70  case SEGMENT_T:
71  return "segment";
72 
73  case VIA_T:
74  return "via";
75 
76  case JOINT_T:
77  return "joint";
78 
79  case SOLID_T:
80  return "solid";
81 
82  default:
83  return "unknown";
84  }
85 }
PnsKind m_kind
Definition: pns_item.h:346
virtual int PNS::ITEM::Layer ( ) const
inlinevirtualinherited

Function Layer()

Returns the item's layer, for single-layered items only.

Reimplemented in PNS::SEGMENT.

Definition at line 217 of file pns_item.h.

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

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

218  {
219  return Layers().Start();
220  }
const LAYER_RANGE & Layers() const
Function Layers()
Definition: pns_item.h:207
int Start() const
Definition: pns_layerset.h:83
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 228 of file pns_item.h.

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

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

229  {
230  return Layers().Overlaps( aOther->Layers() );
231  }
const LAYER_RANGE & Layers() const
Function Layers()
Definition: pns_item.h:207
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:68
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 123 of file pns_joint.h.

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

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

124  {
125  if( m_linkedItems.Contains( aItem ) )
126  return;
127 
128  m_linkedItems.Add( aItem );
129  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32
bool Contains(ITEM *aItem) const
Definition: pns_itemset.h:190
int PNS::JOINT::LinkCount ( int  aMask = -1) const
inline

Definition at line 192 of file pns_joint.h.

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

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

193  {
194  return m_linkedItems.Count( aMask );
195  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
int Count(int aKindMask=-1) const
Definition: pns_itemset.h:119
const LINKED_ITEMS& PNS::JOINT::LinkList ( ) const
inline
ITEM_SET& PNS::JOINT::Links ( )
inline

Definition at line 187 of file pns_joint.h.

References m_linkedItems.

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

188  {
189  return m_linkedItems;
190  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
void PNS::JOINT::Lock ( bool  aLock = true)
inline

Definition at line 226 of file pns_joint.h.

References m_locked.

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

227  {
228  m_locked = aLock;
229  }
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:244
virtual void PNS::ITEM::Mark ( int  aMarker)
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 301 of file pns_item.h.

References PNS::ITEM::m_marker.

Referenced by PNS::SHOVE::ShoveDraggingVia().

302  {
303  m_marker = aMarker;
304  }
int m_marker
Definition: pns_item.h:354
virtual int PNS::ITEM::Marker ( ) const
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 311 of file pns_item.h.

References PNS::ITEM::m_marker.

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

312  {
313  return m_marker;
314  }
int m_marker
Definition: pns_item.h:354
void PNS::JOINT::Merge ( const JOINT aJoint)
inline

Definition at line 204 of file pns_joint.h.

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().

205  {
206  if( !Overlaps( aJoint ) )
207  return;
208 
209  m_layers.Merge( aJoint.m_layers );
210 
211  if( aJoint.IsLocked() )
212  m_locked = true;
213 
214  for( ITEM* item : aJoint.LinkList() )
215  {
216  m_linkedItems.Add( item );
217  }
218  }
bool Overlaps(const JOINT &rhs) const
Definition: pns_joint.h:220
LAYER_RANGE m_layers
Definition: pns_item.h:350
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
ITEM(PnsKind aKind)
Definition: pns_item.h:70
void Add(const LINE &aLine)
Definition: pns_itemset.cpp:32
bool m_locked
locked (non-movable) flag
Definition: pns_joint.h:244
void Merge(const LAYER_RANGE &aOther)
Definition: pns_layerset.h:93
int PNS::JOINT::Net ( ) const
inline

Definition at line 172 of file pns_joint.h.

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

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

173  {
174  return m_tag.net;
175  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238
SEGMENT* PNS::JOINT::NextSegment ( SEGMENT 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 141 of file pns_joint.h.

References IsLineCorner(), and m_linkedItems.

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

142  {
143  if( !IsLineCorner() )
144  return NULL;
145 
146  return static_cast<SEGMENT*>( m_linkedItems[m_linkedItems[0] == aCurrent ? 1 : 0] );
147  }
bool IsLineCorner() const
Returns true if the joint is a trivial line corner, connecting two segments of the same net...
Definition: pns_joint.h:88
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
Struct SEGMENT is a simple container used when filling areas with segments.
Definition: class_zone.h:57
bool PNS::JOINT::operator== ( const JOINT rhs) const
inline

Definition at line 199 of file pns_joint.h.

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

200  {
201  return m_tag.pos == rhs.m_tag.pos && m_tag.net == rhs.m_tag.net;
202  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238
bool PNS::JOINT::Overlaps ( const JOINT rhs) const
inline

Definition at line 220 of file pns_joint.h.

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

Referenced by Merge().

221  {
222  return m_tag.pos == rhs.m_tag.pos &&
223  m_tag.net == rhs.m_tag.net && m_layers.Overlaps( rhs.m_layers );
224  }
LAYER_RANGE m_layers
Definition: pns_item.h:350
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:68
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238
NODE* PNS::ITEM::Owner ( ) const
inlineinherited

Function Owner()

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

Definition at line 259 of file pns_item.h.

References PNS::ITEM::m_owner.

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

259 { return m_owner; }
NODE * m_owner
Definition: pns_item.h:349
BOARD_CONNECTED_ITEM* PNS::ITEM::Parent ( ) const
inlineinherited

Function Parent()

Returns the corresponding parent object in the host application's model.

Definition at line 157 of file pns_item.h.

References PNS::ITEM::m_parent.

Referenced by PNS_PCBNEW_RULE_RESOLVER::DpNetPair(), PNS_KICAD_IFACE::HideItem(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), ROUTER_TOOL::prepareInteractive(), and PNS_KICAD_IFACE::RemoveItem().

158  {
159  return m_parent;
160  }
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:348
const VECTOR2I& PNS::JOINT::Pos ( ) const
inline

Definition at line 167 of file pns_joint.h.

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

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

168  {
169  return m_tag.pos;
170  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238
virtual int PNS::ITEM::Rank ( ) const
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 321 of file pns_item.h.

References PNS::ITEM::m_rank.

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

322  {
323  return m_rank;
324  }
int m_rank
Definition: pns_item.h:355
void PNS::ITEM::SetLayer ( int  aLayer)
inlineinherited

Function SetLayer()

Sets the layers spanned by the item to a single layer aLayer.

Definition at line 197 of file pns_item.h.

References PNS::ITEM::m_layers.

Referenced by PNS::LINE_PLACER::initPlacement(), PNS::DIFF_PAIR_PLACER::propagateDpHeadForces(), PNS::DIFF_PAIR_PLACER::routeHead(), and PNS::DIFF_PAIR::updateLine().

198  {
199  m_layers = LAYER_RANGE( aLayer, aLayer );
200  }
LAYER_RANGE m_layers
Definition: pns_item.h:350
Class LAYER_RANGE.
Definition: pns_layerset.h:32
void PNS::ITEM::SetLayers ( const LAYER_RANGE aLayers)
inlineinherited

Function SetLayers()

Sets the layers spanned by the item to aLayers.

Definition at line 187 of file pns_item.h.

References PNS::ITEM::m_layers.

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

188  {
189  m_layers = aLayers;
190  }
LAYER_RANGE m_layers
Definition: pns_item.h:350
void PNS::ITEM::SetNet ( int  aNet)
inlineinherited
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 stay unowned.

Definition at line 239 of file pns_item.h.

References PNS::ITEM::m_owner.

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

240  {
241  m_owner = aOwner;
242  }
NODE * m_owner
Definition: pns_item.h:349
void PNS::ITEM::SetParent ( BOARD_CONNECTED_ITEM aParent)
inlineinherited

Function SetParent()

Sets the corresponding parent object in the host application's model.

Definition at line 147 of file pns_item.h.

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

148  {
149  m_parent = aParent;
150  }
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:348
virtual void PNS::ITEM::SetRank ( int  aRank)
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 316 of file pns_item.h.

References PNS::ITEM::m_rank.

317  {
318  m_rank = aRank;
319  }
int m_rank
Definition: pns_item.h:355
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::SEGMENT, and PNS::SOLID.

Definition at line 296 of file pns_item.h.

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

297  {
298  return NULL;
299  }
const HASH_TAG& PNS::JOINT::Tag ( ) const
inline

trivial accessors

Definition at line 162 of file pns_joint.h.

References m_tag.

163  {
164  return m_tag;
165  }
HASH_TAG m_tag
hash tag for unordered_multimap
Definition: pns_joint.h:238
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 133 of file pns_joint.h.

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

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

134  {
135  m_linkedItems.Erase( aItem );
136  return m_linkedItems.Size() == 0;
137  }
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
void Erase(ITEM *aItem)
Definition: pns_itemset.h:196
int Size() const
Definition: pns_itemset.h:162
virtual void PNS::ITEM::Unmark ( int  aMarker = -1)
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 306 of file pns_item.h.

References PNS::ITEM::m_marker.

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

307  {
308  m_marker &= ~aMarker;
309  }
int m_marker
Definition: pns_item.h:354
VIA* PNS::JOINT::Via ( )
inline

Definition at line 149 of file pns_joint.h.

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

150  {
151  for( ITEM* item : m_linkedItems.Items() )
152  {
153  if( item->OfKind( VIA_T ) )
154  return static_cast<VIA*>( item );
155  }
156 
157  return NULL;
158  }
ENTRIES & Items()
Definition: pns_itemset.h:137
ITEM_SET m_linkedItems
list of items linked to this joint
Definition: pns_joint.h:241
ITEM(PnsKind aKind)
Definition: pns_item.h:70

Member Data Documentation

PnsKind PNS::ITEM::m_kind
protectedinherited
ITEM_SET PNS::JOINT::m_linkedItems
private

list of items linked to this joint

Definition at line 241 of file pns_joint.h.

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

bool PNS::JOINT::m_locked
private

locked (non-movable) flag

Definition at line 244 of file pns_joint.h.

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

bool PNS::ITEM::m_movable
protectedinherited
NODE* PNS::ITEM::m_owner
protectedinherited
BOARD_CONNECTED_ITEM* PNS::ITEM::m_parent
protectedinherited

Definition at line 348 of file pns_item.h.

Referenced by PNS::ITEM::ITEM(), PNS::ITEM::Parent(), and PNS::ITEM::SetParent().

HASH_TAG PNS::JOINT::m_tag
private

hash tag for unordered_multimap

Definition at line 238 of file pns_joint.h.

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

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: