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

CN_ITEM represents a BOARD_CONNETED_ITEM in the connectivity system (ie: a pad, track/arc/via, or zone). More...

#include <connectivity_items.h>

Inheritance diagram for CN_ITEM:
CN_ZONE_LAYER

Public Member Functions

void Dump ()
 
 CN_ITEM (BOARD_CONNECTED_ITEM *aParent, bool aCanChangeNet, int aAnchorCount=2)
 
virtual ~CN_ITEM ()
 
std::shared_ptr< CN_ANCHORAddAnchor (const VECTOR2I &aPos)
 
std::vector< std::shared_ptr< CN_ANCHOR > > & Anchors ()
 
void SetValid (bool aValid)
 
bool Valid () const
 
void SetDirty (bool aDirty)
 
bool Dirty () const
 
void SetLayers (const LAYER_RANGE &aLayers)
 Set the layers spanned by the item to aLayers.
 
void SetLayer (int aLayer)
 Set the layers spanned by the item to a single layer aLayer.
 
const LAYER_RANGELayers () const
 Return the contiguous set of layers spanned by the item.
 
virtual int Layer () const
 Return the item's layer, for single-layered items only.
 
const BOX2IBBox ()
 
BOARD_CONNECTED_ITEMParent () const
 
const std::vector< CN_ITEM * > & ConnectedItems () const
 
void ClearConnections ()
 
void SetVisited (bool aVisited)
 
bool Visited () const
 
bool CanChangeNet () const
 
void Connect (CN_ITEM *b)
 
void RemoveInvalidRefs ()
 
virtual int AnchorCount () const
 
virtual const VECTOR2I GetAnchor (int n) const
 
int Net () const
 

Protected Attributes

bool m_dirty
 used to identify recently added item not yet scanned into the connectivity search
 
LAYER_RANGE m_layers
 layer range over which the item exists
 
BOX2I m_bbox
 bounding box for the item
 

Private Attributes

BOARD_CONNECTED_ITEMm_parent
 
std::vector< CN_ITEM * > m_connected
 list of physically touching items
 
std::vector< std::shared_ptr< CN_ANCHOR > > m_anchors
 
bool m_canChangeNet
 can the net propagator modify the netcode?
 
bool m_visited
 visited flag for the BFS scan
 
bool m_valid
 used to identify garbage items (we use lazy removal)
 
std::mutex m_listLock
 mutex protecting this item's connected_items set to
 

Detailed Description

CN_ITEM represents a BOARD_CONNETED_ITEM in the connectivity system (ie: a pad, track/arc/via, or zone).

Definition at line 132 of file connectivity_items.h.

Constructor & Destructor Documentation

◆ CN_ITEM()

CN_ITEM::CN_ITEM ( BOARD_CONNECTED_ITEM aParent,
bool  aCanChangeNet,
int  aAnchorCount = 2 
)
inline

◆ ~CN_ITEM()

virtual CN_ITEM::~CN_ITEM ( )
inlinevirtual

Definition at line 149 of file connectivity_items.h.

References anchor, and m_anchors.

Member Function Documentation

◆ AddAnchor()

std::shared_ptr< CN_ANCHOR > CN_ITEM::AddAnchor ( const VECTOR2I aPos)
inline

Definition at line 155 of file connectivity_items.h.

References m_anchors.

Referenced by CN_LIST::Add().

◆ AnchorCount()

int CN_ITEM::AnchorCount ( ) const
virtual

◆ Anchors()

std::vector< std::shared_ptr< CN_ANCHOR > > & CN_ITEM::Anchors ( )
inline

Definition at line 161 of file connectivity_items.h.

References m_anchors.

Referenced by TRACKS_CLEANER::testTrackEndpointIsNode().

◆ BBox()

const BOX2I & CN_ITEM::BBox ( )
inline

◆ CanChangeNet()

bool CN_ITEM::CanChangeNet ( ) const
inline

Definition at line 208 of file connectivity_items.h.

References m_canChangeNet.

Referenced by CN_VISITOR::operator()().

◆ ClearConnections()

void CN_ITEM::ClearConnections ( )
inline

Definition at line 203 of file connectivity_items.h.

References m_connected.

◆ Connect()

void CN_ITEM::Connect ( CN_ITEM b)
inline

◆ ConnectedItems()

◆ Dirty()

bool CN_ITEM::Dirty ( ) const
inline

Definition at line 167 of file connectivity_items.h.

References m_dirty.

Referenced by CN_ANCHOR::Dirty(), and CN_VISITOR::operator()().

◆ Dump()

void CN_ITEM::Dump ( )

Definition at line 85 of file connectivity_items.cpp.

References m_connected, EDA_ITEM::Type(), and Valid().

◆ GetAnchor()

const VECTOR2I CN_ITEM::GetAnchor ( int  n) const
virtual

◆ Layer()

virtual int CN_ITEM::Layer ( ) const
inlinevirtual

Return the item's layer, for single-layered items only.

Definition at line 187 of file connectivity_items.h.

References Layers(), and LAYER_RANGE::Start().

Referenced by RN_NET::OptimizeRNEdges().

◆ Layers()

const LAYER_RANGE & CN_ITEM::Layers ( ) const
inline

Return the contiguous set of layers spanned by the item.

Definition at line 182 of file connectivity_items.h.

References m_layers.

Referenced by CN_LIST::FindNearby(), and Layer().

◆ Net()

◆ Parent()

◆ RemoveInvalidRefs()

void CN_ITEM::RemoveInvalidRefs ( )

Definition at line 136 of file connectivity_items.cpp.

References m_connected.

◆ SetDirty()

void CN_ITEM::SetDirty ( bool  aDirty)
inline

Definition at line 166 of file connectivity_items.h.

References m_dirty.

◆ SetLayer()

void CN_ITEM::SetLayer ( int  aLayer)
inline

Set the layers spanned by the item to a single layer aLayer.

Definition at line 177 of file connectivity_items.h.

References m_layers.

Referenced by CN_LIST::Add().

◆ SetLayers()

void CN_ITEM::SetLayers ( const LAYER_RANGE aLayers)
inline

Set the layers spanned by the item to aLayers.

Definition at line 172 of file connectivity_items.h.

References m_layers.

Referenced by CN_LIST::Add(), and CN_ZONE_LAYER::CN_ZONE_LAYER().

◆ SetValid()

void CN_ITEM::SetValid ( bool  aValid)
inline

Definition at line 163 of file connectivity_items.h.

References m_valid.

◆ SetVisited()

void CN_ITEM::SetVisited ( bool  aVisited)
inline

Definition at line 205 of file connectivity_items.h.

References m_visited.

Referenced by CN_CONNECTIVITY_ALGO::SearchClusters().

◆ Valid()

◆ Visited()

bool CN_ITEM::Visited ( ) const
inline

Definition at line 206 of file connectivity_items.h.

References m_visited.

Member Data Documentation

◆ m_anchors

std::vector<std::shared_ptr<CN_ANCHOR> > CN_ITEM::m_anchors
private

Definition at line 242 of file connectivity_items.h.

Referenced by AddAnchor(), AnchorCount(), Anchors(), CN_ITEM(), GetAnchor(), and ~CN_ITEM().

◆ m_bbox

BOX2I CN_ITEM::m_bbox
protected

bounding box for the item

Definition at line 236 of file connectivity_items.h.

Referenced by BBox().

◆ m_canChangeNet

bool CN_ITEM::m_canChangeNet
private

can the net propagator modify the netcode?

Definition at line 244 of file connectivity_items.h.

Referenced by CanChangeNet(), and CN_ITEM().

◆ m_connected

std::vector<CN_ITEM*> CN_ITEM::m_connected
private

list of physically touching items

Definition at line 241 of file connectivity_items.h.

Referenced by ClearConnections(), CN_ITEM(), Connect(), ConnectedItems(), Dump(), and RemoveInvalidRefs().

◆ m_dirty

bool CN_ITEM::m_dirty
protected

used to identify recently added item not yet scanned into the connectivity search

Definition at line 233 of file connectivity_items.h.

Referenced by BBox(), CN_ITEM(), Dirty(), and SetDirty().

◆ m_layers

LAYER_RANGE CN_ITEM::m_layers
protected

layer range over which the item exists

Definition at line 235 of file connectivity_items.h.

Referenced by CN_ITEM(), Layers(), SetLayer(), and SetLayers().

◆ m_listLock

std::mutex CN_ITEM::m_listLock
private

mutex protecting this item's connected_items set to

Definition at line 249 of file connectivity_items.h.

Referenced by Connect().

◆ m_parent

BOARD_CONNECTED_ITEM* CN_ITEM::m_parent
private

Definition at line 239 of file connectivity_items.h.

Referenced by AnchorCount(), BBox(), CN_ITEM(), GetAnchor(), Net(), and Parent().

◆ m_valid

bool CN_ITEM::m_valid
private

used to identify garbage items (we use lazy removal)

Definition at line 247 of file connectivity_items.h.

Referenced by AnchorCount(), BBox(), CN_ITEM(), GetAnchor(), Net(), SetValid(), and Valid().

◆ m_visited

bool CN_ITEM::m_visited
private

visited flag for the BFS scan

Definition at line 246 of file connectivity_items.h.

Referenced by CN_ITEM(), SetVisited(), and Visited().


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