KiCad PCB EDA Suite
|
#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_ENTRY & | ItemEntry (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 CLUSTERS & | GetClusters () |
const CN_LIST & | ItemList () 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_DATA * | m_parentConnectivityData |
CN_LIST | m_itemList |
std::unordered_map< const BOARD_ITEM *, ITEM_MAP_ENTRY > | m_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_DATA > | m_globalConnectivityData |
PROGRESS_REPORTER * | m_progressReporter = nullptr |
Definition at line 125 of file connectivity_algo.h.
using CN_CONNECTIVITY_ALGO::CLUSTERS = std::vector<std::shared_ptr<CN_CLUSTER> > |
Definition at line 135 of file connectivity_algo.h.
Enumerator | |
---|---|
CSM_PROPAGATE | |
CSM_CONNECTIVITY_CHECK | |
CSM_RATSNEST |
Definition at line 128 of file connectivity_algo.h.
|
inline |
Definition at line 170 of file connectivity_algo.h.
|
inline |
Definition at line 175 of file connectivity_algo.h.
References Clear().
bool CN_CONNECTIVITY_ALGO::Add | ( | BOARD_ITEM * | aItem | ) |
Definition at line 104 of file connectivity_algo.cpp.
References add(), CN_LIST::Add(), FP_JUST_ADDED, BOARD_ITEM::GetBoard(), BOARD::GetEnabledLayers(), BOARD_ITEM::GetLayer(), ZONE::GetLayerSet(), BOARD_ITEM::GetParentFootprint(), IsCopperLayer(), BOARD_ITEM::IsOnCopperLayer(), m_itemList, m_itemMap, markItemNetAsDirty(), MarkNetAsDirty(), pad, PCB_ARC_T, PCB_FOOTPRINT_T, PCB_NETINFO_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, LSET::RunOnLayers(), and EDA_ITEM::Type().
Referenced by Build(), FillIsolatedIslandsMap(), and LocalBuild().
|
inlineprivate |
void CN_CONNECTIVITY_ALGO::Build | ( | BOARD * | aBoard, |
PROGRESS_REPORTER * | aReporter = nullptr |
||
) |
Definition at line 442 of file connectivity_algo.cpp.
References Add(), CN_LIST::Add(), PROGRESS_REPORTER::AdvanceProgress(), LSET::AllCuMask(), BOARD::Drawings(), BOARD::Footprints(), BOARD_ITEM::GetBoard(), BOARD::GetEnabledLayers(), GetKiCadThreadPool(), PROGRESS_REPORTER::IsCancelled(), PROGRESS_REPORTER::KeepRefreshing(), m_itemList, m_itemMap, markItemNetAsDirty(), pad, LSET::RunOnLayers(), PROGRESS_REPORTER::SetCurrentProgress(), tp, BOARD::Tracks(), and BOARD::Zones().
void CN_CONNECTIVITY_ALGO::Clear | ( | ) |
Definition at line 948 of file connectivity_algo.cpp.
References CN_LIST::Clear(), m_connClusters, m_itemList, m_itemMap, and m_ratsnestClusters.
Referenced by ~CN_CONNECTIVITY_ALGO().
|
inline |
Definition at line 198 of file connectivity_algo.h.
References m_dirtyNets.
void CN_CONNECTIVITY_ALGO::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.
Definition at line 665 of file connectivity_algo.cpp.
References Add(), CSM_CONNECTIVITY_CHECK, CN_ZONE_LAYER::HasSingleConnection(), PROGRESS_REPORTER::IsCancelled(), PROGRESS_REPORTER::KeepRefreshing(), m_connClusters, m_progressReporter, Remove(), SearchClusters(), PROGRESS_REPORTER::SetCurrentProgress(), and CN_ZONE_LAYER::SubpolyIndex().
|
inline |
Definition at line 253 of file connectivity_algo.h.
References anchor, and m_itemList.
|
inline |
Definition at line 263 of file connectivity_algo.h.
References m_itemList.
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().
|
inline |
Definition at line 204 of file connectivity_algo.h.
References m_dirtyNets, and m_ratsnestClusters.
|
inline |
Definition at line 190 of file connectivity_algo.h.
References m_dirtyNets.
|
inline |
Definition at line 185 of file connectivity_algo.h.
References m_itemMap.
|
inline |
Definition at line 180 of file connectivity_algo.h.
References m_itemMap.
|
inline |
Definition at line 247 of file connectivity_algo.h.
References m_itemList.
void CN_CONNECTIVITY_ALGO::LocalBuild | ( | std::shared_ptr< CONNECTIVITY_DATA > | aGlobalConnectivity, |
const std::vector< BOARD_ITEM * > & | aLocalItems | ||
) |
Definition at line 577 of file connectivity_algo.cpp.
References Add(), m_globalConnectivityData, m_isLocal, PCB_ARC_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TRACE_T, and PCB_VIA_T.
|
private |
Definition at line 84 of file connectivity_algo.cpp.
References BOARD_CONNECTED_ITEM::GetNetCode(), BOARD_ITEM::IsConnected(), MarkNetAsDirty(), pad, FOOTPRINT::Pads(), PCB_FOOTPRINT_T, and EDA_ITEM::Type().
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().
|
inline |
Definition at line 215 of file connectivity_algo.h.
References m_dirtyNets.
|
private |
Definition at line 603 of file connectivity_algo.cpp.
References m_connClusters, MarkNetAsDirty(), and COMMIT::Modify().
Referenced by PropagateNets().
void CN_CONNECTIVITY_ALGO::PropagateNets | ( | BOARD_COMMIT * | aCommit = nullptr | ) |
Propagate nets from pads to other items in clusters.
aCommit | is 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().
bool CN_CONNECTIVITY_ALGO::Remove | ( | BOARD_ITEM * | aItem | ) |
Definition at line 46 of file connectivity_algo.cpp.
References m_itemList, m_itemMap, markItemNetAsDirty(), pad, PCB_ARC_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, CN_LIST::SetDirty(), CN_LIST::SetHasInvalid(), and EDA_ITEM::Type().
Referenced by FillIsolatedIslandsMap().
void CN_CONNECTIVITY_ALGO::RemoveInvalidRefs | ( | ) |
Definition at line 222 of file connectivity_algo.cpp.
References m_itemList.
const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters | ( | CLUSTER_SEARCH_MODE | aMode | ) |
Definition at line 318 of file connectivity_algo.cpp.
References CSM_PROPAGATE, PCB_ARC_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, and SearchClusters().
const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters | ( | CLUSTER_SEARCH_MODE | aMode, |
const std::vector< KICAD_T > & | aTypes, | ||
int | aSingleNet, | ||
CN_ITEM * | rootItem = nullptr |
||
) |
Definition at line 339 of file connectivity_algo.cpp.
References CN_LIST::begin(), CN_ITEM::ConnectedItems(), CSM_PROPAGATE, CN_LIST::end(), PROGRESS_REPORTER::IsCancelled(), CN_LIST::IsDirty(), m_itemList, m_progressReporter, CN_ITEM::Net(), searchConnections(), and CN_ITEM::SetVisited().
Referenced by FillIsolatedIslandsMap(), GetClusters(), PropagateNets(), and SearchClusters().
|
private |
Definition at line 229 of file connectivity_algo.cpp.
References CN_LIST::begin(), CN_LIST::ClearDirtyFlags(), CN_LIST::end(), GetKiCadThreadPool(), CN_LIST::IsDirty(), PROGRESS_REPORTER::KeepRefreshing(), m_globalConnectivityData, m_isLocal, m_itemList, m_parentConnectivityData, m_progressReporter, CN_LIST::RemoveInvalidItems(), CONNECTIVITY_DATA::RemoveInvalidRefs(), PROGRESS_REPORTER::SetMaxProgress(), PROF_TIMER::Show(), and tp.
Referenced by SearchClusters().
void CN_CONNECTIVITY_ALGO::SetProgressReporter | ( | PROGRESS_REPORTER * | aReporter | ) |
Definition at line 957 of file connectivity_algo.cpp.
References m_progressReporter.
|
private |
Definition at line 294 of file connectivity_algo.h.
Referenced by Clear(), FillIsolatedIslandsMap(), propagateConnections(), and PropagateNets().
|
private |
Definition at line 296 of file connectivity_algo.h.
Referenced by ClearDirtyFlags(), GetDirtyClusters(), IsNetDirty(), MarkNetAsDirty(), and NetCount().
|
private |
Definition at line 299 of file connectivity_algo.h.
Referenced by LocalBuild(), and searchConnections().
|
private |
Definition at line 298 of file connectivity_algo.h.
Referenced by LocalBuild(), and searchConnections().
|
private |
Definition at line 291 of file connectivity_algo.h.
Referenced by Add(), Build(), Clear(), ForEachAnchor(), ForEachItem(), ItemList(), Remove(), RemoveInvalidRefs(), SearchClusters(), and searchConnections().
|
private |
Definition at line 292 of file connectivity_algo.h.
Referenced by Add(), add(), Build(), Clear(), ItemEntry(), ItemExists(), and Remove().
|
private |
Definition at line 290 of file connectivity_algo.h.
Referenced by searchConnections().
|
private |
Definition at line 301 of file connectivity_algo.h.
Referenced by FillIsolatedIslandsMap(), SearchClusters(), searchConnections(), and SetProgressReporter().
|
private |
Definition at line 295 of file connectivity_algo.h.
Referenced by Clear(), GetClusters(), and GetDirtyClusters().