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

Build a topological view of a single named net chain's routed copper. More...

#include <drc_chain_topology.h>

Classes

struct  STUB
 

Public Types

enum class  STATUS {
  OK , NO_ITEMS , NO_TERMINAL_PADS , DISCONNECTED ,
  CYCLE_DETECTED
}
 

Public Member Functions

 CHAIN_TOPOLOGY (BOARD *aBoard, const wxString &aChainName, const std::set< BOARD_CONNECTED_ITEM * > &aChainItems)
 
STATUS GetStatus () const
 
bool IsValid () const
 
double TrunkLength () const
 
double TrunkDelay () const
 
const std::vector< STUB > & Stubs () const
 
const wxString & GetChainName () const
 

Private Attributes

wxString m_chainName
 
STATUS m_status = STATUS::NO_ITEMS
 
double m_trunkLength = 0.0
 
double m_trunkDelay = 0.0
 
std::vector< STUBm_stubs
 

Detailed Description

Build a topological view of a single named net chain's routed copper.

The chain is modeled as a graph with (x, y, layer) nodes. Tracks and arcs contribute one edge each between their endpoints; vias contribute one edge per adjacent copper layer pair within their layer span; series passives (enumerated via EnumerateChainBridges) contribute one edge between their cross-net pads on the footprint placement layer. Mid-segment T-junctions are detected via shape collision and the trunk track is split at the contact point so the stub branches off the actual junction.

When both terminal pads (NETINFO_ITEM::GetTerminalPad(0/1)) are present and connected by a unique simple path, GetStatus() returns OK and:

  • TrunkLength() / TrunkDelay() give the terminal-to-terminal sum,
  • Stubs() gives the off-trunk branches with their branch points, contributing items, lengths, and delays.

When the topology cannot be reduced to a tree with both terminals reachable, callers fall back to legacy aggregate / proxy semantics.

Definition at line 56 of file drc_chain_topology.h.

Member Enumeration Documentation

◆ STATUS

enum class CHAIN_TOPOLOGY::STATUS
strong
Enumerator
OK 
NO_ITEMS 
NO_TERMINAL_PADS 
DISCONNECTED 
CYCLE_DETECTED 

Definition at line 68 of file drc_chain_topology.h.

Constructor & Destructor Documentation

◆ CHAIN_TOPOLOGY()

Member Function Documentation

◆ GetChainName()

const wxString & CHAIN_TOPOLOGY::GetChainName ( ) const
inline

Definition at line 88 of file drc_chain_topology.h.

References m_chainName.

◆ GetStatus()

STATUS CHAIN_TOPOLOGY::GetStatus ( ) const
inline

Definition at line 80 of file drc_chain_topology.h.

References m_status.

Referenced by BOOST_AUTO_TEST_CASE().

◆ IsValid()

bool CHAIN_TOPOLOGY::IsValid ( ) const
inline

Definition at line 81 of file drc_chain_topology.h.

References m_status, and OK.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ Stubs()

const std::vector< STUB > & CHAIN_TOPOLOGY::Stubs ( ) const
inline

Definition at line 86 of file drc_chain_topology.h.

References m_stubs.

Referenced by BOOST_AUTO_TEST_CASE().

◆ TrunkDelay()

double CHAIN_TOPOLOGY::TrunkDelay ( ) const
inline

Definition at line 84 of file drc_chain_topology.h.

References m_trunkDelay.

◆ TrunkLength()

double CHAIN_TOPOLOGY::TrunkLength ( ) const
inline

Definition at line 83 of file drc_chain_topology.h.

References m_trunkLength.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

Member Data Documentation

◆ m_chainName

wxString CHAIN_TOPOLOGY::m_chainName
private

Definition at line 91 of file drc_chain_topology.h.

Referenced by CHAIN_TOPOLOGY(), and GetChainName().

◆ m_status

STATUS CHAIN_TOPOLOGY::m_status = STATUS::NO_ITEMS
private

Definition at line 92 of file drc_chain_topology.h.

Referenced by CHAIN_TOPOLOGY(), GetStatus(), and IsValid().

◆ m_stubs

std::vector<STUB> CHAIN_TOPOLOGY::m_stubs
private

Definition at line 95 of file drc_chain_topology.h.

Referenced by CHAIN_TOPOLOGY(), and Stubs().

◆ m_trunkDelay

double CHAIN_TOPOLOGY::m_trunkDelay = 0.0
private

Definition at line 94 of file drc_chain_topology.h.

Referenced by CHAIN_TOPOLOGY(), and TrunkDelay().

◆ m_trunkLength

double CHAIN_TOPOLOGY::m_trunkLength = 0.0
private

Definition at line 93 of file drc_chain_topology.h.

Referenced by CHAIN_TOPOLOGY(), and TrunkLength().


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