KiCad PCB EDA Suite
CN_EDGE Class Reference

#include <connectivity_algo.h>

Public Member Functions

 CN_EDGE ()
 
 CN_EDGE (CN_ANCHOR_PTR aSource, CN_ANCHOR_PTR aTarget, unsigned aWeight=0)
 
bool operator< (CN_EDGE aOther) const
 This sort operator provides a sort-by-weight for the ratsnest operation. More...
 
CN_ANCHOR_PTR GetSourceNode () const
 
CN_ANCHOR_PTR GetTargetNode () const
 
unsigned GetWeight () const
 
void SetSourceNode (const CN_ANCHOR_PTR &aNode)
 
void SetTargetNode (const CN_ANCHOR_PTR &aNode)
 
void SetWeight (unsigned weight)
 
void SetVisible (bool aVisible)
 
bool IsVisible () const
 
const VECTOR2I GetSourcePos () const
 
const VECTOR2I GetTargetPos () const
 

Private Attributes

CN_ANCHOR_PTR m_source
 
CN_ANCHOR_PTR m_target
 
unsigned m_weight
 
bool m_visible
 

Detailed Description

Definition at line 59 of file connectivity_algo.h.

Constructor & Destructor Documentation

◆ CN_EDGE() [1/2]

CN_EDGE::CN_EDGE ( )
inline

Definition at line 62 of file connectivity_algo.h.

63  : m_weight( 0 ), m_visible( true )
64  {}
unsigned m_weight

◆ CN_EDGE() [2/2]

CN_EDGE::CN_EDGE ( CN_ANCHOR_PTR  aSource,
CN_ANCHOR_PTR  aTarget,
unsigned  aWeight = 0 
)
inline

Definition at line 66 of file connectivity_algo.h.

67  : m_source( aSource ), m_target( aTarget ), m_weight( aWeight ), m_visible( true )
68  {}
CN_ANCHOR_PTR m_target
unsigned m_weight
CN_ANCHOR_PTR m_source

Member Function Documentation

◆ GetSourceNode()

CN_ANCHOR_PTR CN_EDGE::GetSourceNode ( ) const
inline

Definition at line 80 of file connectivity_algo.h.

80 { return m_source; }
CN_ANCHOR_PTR m_source

References m_source.

Referenced by RN_NET::compute().

◆ GetSourcePos()

const VECTOR2I CN_EDGE::GetSourcePos ( ) const
inline

Definition at line 98 of file connectivity_algo.h.

99  {
100  return m_source->Pos();
101  }
CN_ANCHOR_PTR m_source

References m_source.

◆ GetTargetNode()

CN_ANCHOR_PTR CN_EDGE::GetTargetNode ( ) const
inline

Definition at line 81 of file connectivity_algo.h.

81 { return m_target; }
CN_ANCHOR_PTR m_target

References m_target.

◆ GetTargetPos()

const VECTOR2I CN_EDGE::GetTargetPos ( ) const
inline

Definition at line 103 of file connectivity_algo.h.

104  {
105  return m_target->Pos();
106  }
CN_ANCHOR_PTR m_target

References m_target.

◆ GetWeight()

unsigned CN_EDGE::GetWeight ( ) const
inline

Definition at line 82 of file connectivity_algo.h.

82 { return m_weight; }
unsigned m_weight

References m_weight.

◆ IsVisible()

bool CN_EDGE::IsVisible ( ) const
inline

Definition at line 93 of file connectivity_algo.h.

94  {
95  return m_visible;
96  }

References m_visible.

◆ operator<()

bool CN_EDGE::operator< ( CN_EDGE  aOther) const
inline

This sort operator provides a sort-by-weight for the ratsnest operation.

Parameters
aOtherOther edge to compare
Returns
true if our weight is smaller than the other weight

Definition at line 75 of file connectivity_algo.h.

76  {
77  return m_weight < aOther.m_weight;
78  }
unsigned m_weight

References m_weight.

◆ SetSourceNode()

void CN_EDGE::SetSourceNode ( const CN_ANCHOR_PTR aNode)
inline

Definition at line 84 of file connectivity_algo.h.

84 { m_source = aNode; }
CN_ANCHOR_PTR m_source

References m_source.

◆ SetTargetNode()

void CN_EDGE::SetTargetNode ( const CN_ANCHOR_PTR aNode)
inline

Definition at line 85 of file connectivity_algo.h.

85 { m_target = aNode; }
CN_ANCHOR_PTR m_target

References m_target.

◆ SetVisible()

void CN_EDGE::SetVisible ( bool  aVisible)
inline

Definition at line 88 of file connectivity_algo.h.

89  {
90  m_visible = aVisible;
91  }

References m_visible.

◆ SetWeight()

void CN_EDGE::SetWeight ( unsigned  weight)
inline

Definition at line 86 of file connectivity_algo.h.

86 { m_weight = weight; }
unsigned m_weight

References m_weight.

Member Data Documentation

◆ m_source

CN_ANCHOR_PTR CN_EDGE::m_source
private

Definition at line 109 of file connectivity_algo.h.

Referenced by GetSourceNode(), GetSourcePos(), and SetSourceNode().

◆ m_target

CN_ANCHOR_PTR CN_EDGE::m_target
private

Definition at line 110 of file connectivity_algo.h.

Referenced by GetTargetNode(), GetTargetPos(), and SetTargetNode().

◆ m_visible

bool CN_EDGE::m_visible
private

Definition at line 112 of file connectivity_algo.h.

Referenced by IsVisible(), and SetVisible().

◆ m_weight

unsigned CN_EDGE::m_weight
private

Definition at line 111 of file connectivity_algo.h.

Referenced by GetWeight(), operator<(), and SetWeight().


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