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

#include <connectivity_algo.h>

Classes

class  ITEM_MAP_ENTRY
 

Public Types

enum  CLUSTER_SEARCH_MODE { CSM_PROPAGATE , CSM_CONNECTIVITY_CHECK , CSM_RATSNEST }
 
using CLUSTERS = std::vector< std::shared_ptr< CN_CLUSTER > >
 

Public Member Functions

 CN_CONNECTIVITY_ALGO (CONNECTIVITY_DATA *aParentConnectivityData)
 
 ~CN_CONNECTIVITY_ALGO ()
 
bool ItemExists (const BOARD_CONNECTED_ITEM *aItem) const
 
ITEM_MAP_ENTRYItemEntry (const BOARD_CONNECTED_ITEM *aItem)
 
bool IsNetDirty (int aNet) const
 
void ClearDirtyFlags ()
 
void GetDirtyClusters (CLUSTERS &aClusters) const
 
int NetCount () const
 
void Build (BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
 
void LocalBuild (std::shared_ptr< CONNECTIVITY_DATA > aGlobalConnectivity, const std::vector< BOARD_ITEM * > &aLocalItems)
 
void Clear ()
 
bool Remove (BOARD_ITEM *aItem)
 
bool Add (BOARD_ITEM *aItem)
 
const CLUSTERS SearchClusters (CLUSTER_SEARCH_MODE aMode, const std::vector< KICAD_T > &aTypes, int aSingleNet, CN_ITEM *rootItem=nullptr)
 
const CLUSTERS SearchClusters (CLUSTER_SEARCH_MODE aMode)
 
void PropagateNets (BOARD_COMMIT *aCommit=nullptr)
 Propagate nets from pads to other items in clusters.
 
void FillIsolatedIslandsMap (std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > &aMap, bool aConnectivityAlreadyRebuilt)
 Fill in the isolated islands map with copper islands that are not connected to a net.
 
const CLUSTERSGetClusters ()
 
const CN_LISTItemList () const
 
template<typename Func >
void ForEachAnchor (Func &&aFunc) const
 
template<typename Func >
void ForEachItem (Func &&aFunc) const
 
void MarkNetAsDirty (int aNet)
 
void RemoveInvalidRefs ()
 
void SetProgressReporter (PROGRESS_REPORTER *aReporter)
 

Private Member Functions

void searchConnections ()
 
void propagateConnections (BOARD_COMMIT *aCommit=nullptr)
 
template<class Container , class BItem >
void add (Container &c, BItem brditem)
 
void markItemNetAsDirty (const BOARD_ITEM *aItem)
 

Private Attributes

CONNECTIVITY_DATAm_parentConnectivityData
 
CN_LIST m_itemList
 
std::unordered_map< const BOARD_ITEM *, ITEM_MAP_ENTRYm_itemMap
 
std::vector< std::shared_ptr< CN_CLUSTER > > m_connClusters
 
std::vector< std::shared_ptr< CN_CLUSTER > > m_ratsnestClusters
 
std::vector< bool > m_dirtyNets
 
bool m_isLocal
 
std::shared_ptr< CONNECTIVITY_DATAm_globalConnectivityData
 
PROGRESS_REPORTERm_progressReporter = nullptr
 

Detailed Description

Definition at line 125 of file connectivity_algo.h.

Member Typedef Documentation

◆ CLUSTERS

using CN_CONNECTIVITY_ALGO::CLUSTERS = std::vector<std::shared_ptr<CN_CLUSTER> >

Definition at line 135 of file connectivity_algo.h.

Member Enumeration Documentation

◆ CLUSTER_SEARCH_MODE

Enumerator
CSM_PROPAGATE 
CSM_CONNECTIVITY_CHECK 
CSM_RATSNEST 

Definition at line 128 of file connectivity_algo.h.

Constructor & Destructor Documentation

◆ CN_CONNECTIVITY_ALGO()

CN_CONNECTIVITY_ALGO::CN_CONNECTIVITY_ALGO ( CONNECTIVITY_DATA aParentConnectivityData)
inline

Definition at line 170 of file connectivity_algo.h.

◆ ~CN_CONNECTIVITY_ALGO()

CN_CONNECTIVITY_ALGO::~CN_CONNECTIVITY_ALGO ( )
inline

Definition at line 175 of file connectivity_algo.h.

References Clear().

Member Function Documentation

◆ Add()

◆ add()

template<class Container , class BItem >
void CN_CONNECTIVITY_ALGO::add ( Container &  c,
BItem  brditem 
)
inlineprivate

Definition at line 280 of file connectivity_algo.h.

References m_itemMap.

Referenced by Add().

◆ Build()

◆ Clear()

void CN_CONNECTIVITY_ALGO::Clear ( )

◆ ClearDirtyFlags()

void CN_CONNECTIVITY_ALGO::ClearDirtyFlags ( )
inline

Definition at line 198 of file connectivity_algo.h.

References m_dirtyNets.

◆ FillIsolatedIslandsMap()

void CN_CONNECTIVITY_ALGO::FillIsolatedIslandsMap ( std::map< ZONE *, std::map< PCB_LAYER_ID, ISOLATED_ISLANDS > > &  aMap,
bool  aConnectivityAlreadyRebuilt 
)

◆ ForEachAnchor()

template<typename Func >
void CN_CONNECTIVITY_ALGO::ForEachAnchor ( Func &&  aFunc) const
inline

Definition at line 253 of file connectivity_algo.h.

References anchor, and m_itemList.

◆ ForEachItem()

template<typename Func >
void CN_CONNECTIVITY_ALGO::ForEachItem ( Func &&  aFunc) const
inline

Definition at line 263 of file connectivity_algo.h.

References m_itemList.

◆ GetClusters()

const CN_CONNECTIVITY_ALGO::CLUSTERS & CN_CONNECTIVITY_ALGO::GetClusters ( )

Definition at line 722 of file connectivity_algo.cpp.

References CSM_RATSNEST, m_ratsnestClusters, and SearchClusters().

◆ GetDirtyClusters()

void CN_CONNECTIVITY_ALGO::GetDirtyClusters ( CLUSTERS aClusters) const
inline

Definition at line 204 of file connectivity_algo.h.

References m_dirtyNets, and m_ratsnestClusters.

◆ IsNetDirty()

bool CN_CONNECTIVITY_ALGO::IsNetDirty ( int  aNet) const
inline

Definition at line 190 of file connectivity_algo.h.

References m_dirtyNets.

◆ ItemEntry()

ITEM_MAP_ENTRY & CN_CONNECTIVITY_ALGO::ItemEntry ( const BOARD_CONNECTED_ITEM aItem)
inline

Definition at line 185 of file connectivity_algo.h.

References m_itemMap.

◆ ItemExists()

bool CN_CONNECTIVITY_ALGO::ItemExists ( const BOARD_CONNECTED_ITEM aItem) const
inline

Definition at line 180 of file connectivity_algo.h.

References m_itemMap.

◆ ItemList()

const CN_LIST & CN_CONNECTIVITY_ALGO::ItemList ( ) const
inline

Definition at line 247 of file connectivity_algo.h.

References m_itemList.

◆ LocalBuild()

void CN_CONNECTIVITY_ALGO::LocalBuild ( std::shared_ptr< CONNECTIVITY_DATA aGlobalConnectivity,
const std::vector< BOARD_ITEM * > &  aLocalItems 
)

◆ markItemNetAsDirty()

void CN_CONNECTIVITY_ALGO::markItemNetAsDirty ( const BOARD_ITEM aItem)
private

◆ MarkNetAsDirty()

void CN_CONNECTIVITY_ALGO::MarkNetAsDirty ( int  aNet)

Definition at line 729 of file connectivity_algo.cpp.

References m_dirtyNets.

Referenced by Add(), markItemNetAsDirty(), and propagateConnections().

◆ NetCount()

int CN_CONNECTIVITY_ALGO::NetCount ( ) const
inline

Definition at line 215 of file connectivity_algo.h.

References m_dirtyNets.

◆ propagateConnections()

void CN_CONNECTIVITY_ALGO::propagateConnections ( BOARD_COMMIT aCommit = nullptr)
private

Definition at line 603 of file connectivity_algo.cpp.

References m_connClusters, MarkNetAsDirty(), and COMMIT::Modify().

Referenced by PropagateNets().

◆ PropagateNets()

void CN_CONNECTIVITY_ALGO::PropagateNets ( BOARD_COMMIT aCommit = nullptr)

Propagate nets from pads to other items in clusters.

Parameters
aCommitis used to store undo information for items modified by the call.

Definition at line 658 of file connectivity_algo.cpp.

References CSM_PROPAGATE, m_connClusters, propagateConnections(), and SearchClusters().

◆ Remove()

◆ RemoveInvalidRefs()

void CN_CONNECTIVITY_ALGO::RemoveInvalidRefs ( )

Definition at line 222 of file connectivity_algo.cpp.

References m_itemList.

◆ SearchClusters() [1/2]

const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters ( CLUSTER_SEARCH_MODE  aMode)

◆ SearchClusters() [2/2]

◆ searchConnections()

◆ SetProgressReporter()

void CN_CONNECTIVITY_ALGO::SetProgressReporter ( PROGRESS_REPORTER aReporter)

Definition at line 957 of file connectivity_algo.cpp.

References m_progressReporter.

Member Data Documentation

◆ m_connClusters

std::vector<std::shared_ptr<CN_CLUSTER> > CN_CONNECTIVITY_ALGO::m_connClusters
private

◆ m_dirtyNets

std::vector<bool> CN_CONNECTIVITY_ALGO::m_dirtyNets
private

◆ m_globalConnectivityData

std::shared_ptr<CONNECTIVITY_DATA> CN_CONNECTIVITY_ALGO::m_globalConnectivityData
private

Definition at line 299 of file connectivity_algo.h.

Referenced by LocalBuild(), and searchConnections().

◆ m_isLocal

bool CN_CONNECTIVITY_ALGO::m_isLocal
private

Definition at line 298 of file connectivity_algo.h.

Referenced by LocalBuild(), and searchConnections().

◆ m_itemList

CN_LIST CN_CONNECTIVITY_ALGO::m_itemList
private

◆ m_itemMap

std::unordered_map<const BOARD_ITEM*, ITEM_MAP_ENTRY> CN_CONNECTIVITY_ALGO::m_itemMap
private

Definition at line 292 of file connectivity_algo.h.

Referenced by Add(), add(), Build(), Clear(), ItemEntry(), ItemExists(), and Remove().

◆ m_parentConnectivityData

CONNECTIVITY_DATA* CN_CONNECTIVITY_ALGO::m_parentConnectivityData
private

Definition at line 290 of file connectivity_algo.h.

Referenced by searchConnections().

◆ m_progressReporter

PROGRESS_REPORTER* CN_CONNECTIVITY_ALGO::m_progressReporter = nullptr
private

◆ m_ratsnestClusters

std::vector<std::shared_ptr<CN_CLUSTER> > CN_CONNECTIVITY_ALGO::m_ratsnestClusters
private

Definition at line 295 of file connectivity_algo.h.

Referenced by Clear(), GetClusters(), and GetDirtyClusters().


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