KiCad PCB EDA Suite
Loading...
Searching...
No Matches
CN_EDGE Class Reference

CN_EDGE represents a point-to-point connection, whether realized or unrealized (ie: tracks etc. More...

#include <connectivity_algo.h>

Public Member Functions

 CN_EDGE ()
 
 CN_EDGE (const std::shared_ptr< CN_ANCHOR > &aSource, const std::shared_ptr< CN_ANCHOR > &aTarget, unsigned aWeight=0)
 
bool operator< (CN_EDGE aOther) const
 This sort operator provides a sort-by-weight for the ratsnest operation.
 
std::shared_ptr< const CN_ANCHORGetSourceNode () const
 
std::shared_ptr< const CN_ANCHORGetTargetNode () const
 
void SetSourceNode (const std::shared_ptr< const CN_ANCHOR > &aNode)
 
void SetTargetNode (const std::shared_ptr< const CN_ANCHOR > &aNode)
 
void RemoveInvalidRefs ()
 
void SetWeight (unsigned weight)
 
unsigned GetWeight () const
 
void SetVisible (bool aVisible)
 
bool IsVisible () const
 
const VECTOR2I GetSourcePos () const
 
const VECTOR2I GetTargetPos () const
 
unsigned GetLength () const
 

Private Attributes

std::shared_ptr< const CN_ANCHORm_source
 
std::shared_ptr< const CN_ANCHORm_target
 
unsigned m_weight
 
bool m_visible
 

Detailed Description

CN_EDGE represents a point-to-point connection, whether realized or unrealized (ie: tracks etc.

or a ratsnest line).

Definition at line 62 of file connectivity_algo.h.

Constructor & Destructor Documentation

◆ CN_EDGE() [1/2]

CN_EDGE::CN_EDGE ( )
inline

Definition at line 65 of file connectivity_algo.h.

◆ CN_EDGE() [2/2]

CN_EDGE::CN_EDGE ( const std::shared_ptr< CN_ANCHOR > &  aSource,
const std::shared_ptr< CN_ANCHOR > &  aTarget,
unsigned  aWeight = 0 
)
inline

Definition at line 70 of file connectivity_algo.h.

Member Function Documentation

◆ GetLength()

unsigned CN_EDGE::GetLength ( ) const
inline

Definition at line 112 of file connectivity_algo.h.

References m_source, and m_target.

◆ GetSourceNode()

std::shared_ptr< const CN_ANCHOR > CN_EDGE::GetSourceNode ( ) const
inline

◆ GetSourcePos()

const VECTOR2I CN_EDGE::GetSourcePos ( ) const
inline

Definition at line 110 of file connectivity_algo.h.

References m_source.

◆ GetTargetNode()

std::shared_ptr< const CN_ANCHOR > CN_EDGE::GetTargetNode ( ) const
inline

◆ GetTargetPos()

const VECTOR2I CN_EDGE::GetTargetPos ( ) const
inline

Definition at line 111 of file connectivity_algo.h.

References m_target.

◆ GetWeight()

unsigned CN_EDGE::GetWeight ( ) const
inline

Definition at line 105 of file connectivity_algo.h.

References m_weight.

◆ IsVisible()

bool CN_EDGE::IsVisible ( ) const
inline

Definition at line 108 of file connectivity_algo.h.

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
aOtherthe other edge to compare.
Returns
true if our weight is smaller than the other weight.

Definition at line 84 of file connectivity_algo.h.

References m_weight.

◆ RemoveInvalidRefs()

void CN_EDGE::RemoveInvalidRefs ( )
inline

Definition at line 95 of file connectivity_algo.h.

References m_source, and m_target.

◆ SetSourceNode()

void CN_EDGE::SetSourceNode ( const std::shared_ptr< const CN_ANCHOR > &  aNode)
inline

Definition at line 92 of file connectivity_algo.h.

References m_source.

◆ SetTargetNode()

void CN_EDGE::SetTargetNode ( const std::shared_ptr< const CN_ANCHOR > &  aNode)
inline

Definition at line 93 of file connectivity_algo.h.

References m_target.

◆ SetVisible()

void CN_EDGE::SetVisible ( bool  aVisible)
inline

Definition at line 107 of file connectivity_algo.h.

References m_visible.

Referenced by BOARD::UpdateRatsnestExclusions().

◆ SetWeight()

void CN_EDGE::SetWeight ( unsigned  weight)
inline

Definition at line 104 of file connectivity_algo.h.

References m_weight.

Member Data Documentation

◆ m_source

std::shared_ptr<const CN_ANCHOR> CN_EDGE::m_source
private

◆ m_target

std::shared_ptr<const CN_ANCHOR> CN_EDGE::m_target
private

◆ m_visible

bool CN_EDGE::m_visible
private

Definition at line 121 of file connectivity_algo.h.

Referenced by IsVisible(), and SetVisible().

◆ m_weight

unsigned CN_EDGE::m_weight
private

Definition at line 120 of file connectivity_algo.h.

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


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