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 (int aStartLayer, int aEndLayer)
 Set the layers spanned by the item to aStartLayer and aEndLayer.
 
void SetLayer (int aLayer)
 Set the layers spanned by the item to a single layer aLayer.
 
int StartLayer () const
 Return the contiguous set of layers spanned by the item.
 
int EndLayer () const
 
virtual int Layer () const
 Return the item's layer, for single-layered items only.
 
PCB_LAYER_ID GetBoardLayer () const
 When using CN_ITEM layers to compare against board items, use this function which correctly remaps the B_Cu layer.
 
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
 
int m_start_layer
 start layer of the item N.B. B_Cu is set to INT_MAX
 
int m_end_layer
 end layer of the item N.B. B_Cu is set to INT_MAX
 
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 150 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 156 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 162 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 238 of file connectivity_items.h.

References m_canChangeNet.

Referenced by CN_VISITOR::operator()().

◆ ClearConnections()

void CN_ITEM::ClearConnections ( )
inline

Definition at line 233 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 168 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().

◆ EndLayer()

int CN_ITEM::EndLayer ( ) const
inline

Definition at line 196 of file connectivity_items.h.

References m_end_layer.

Referenced by CN_LIST::FindNearby().

◆ GetAnchor()

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

◆ GetBoardLayer()

PCB_LAYER_ID CN_ITEM::GetBoardLayer ( ) const
inline

When using CN_ITEM layers to compare against board items, use this function which correctly remaps the B_Cu layer.

Definition at line 212 of file connectivity_items.h.

References B_Cu, Layer(), and ToLAYER_ID().

Referenced by RN_NET::OptimizeRNEdges().

◆ Layer()

virtual int CN_ITEM::Layer ( ) const
inlinevirtual

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

N.B. This should only be used inside connectivity as B_Cu is mapped to a large int

Definition at line 203 of file connectivity_items.h.

References StartLayer().

Referenced by GetBoardLayer().

◆ 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 167 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 190 of file connectivity_items.h.

References SetLayers().

Referenced by CN_LIST::Add().

◆ SetLayers()

void CN_ITEM::SetLayers ( int  aStartLayer,
int  aEndLayer 
)
inline

Set the layers spanned by the item to aStartLayer and aEndLayer.

Definition at line 173 of file connectivity_items.h.

References B_Cu, m_end_layer, and m_start_layer.

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

◆ SetValid()

void CN_ITEM::SetValid ( bool  aValid)
inline

Definition at line 164 of file connectivity_items.h.

References m_valid.

◆ SetVisited()

void CN_ITEM::SetVisited ( bool  aVisited)
inline

Definition at line 235 of file connectivity_items.h.

References m_visited.

Referenced by CN_CONNECTIVITY_ALGO::SearchClusters().

◆ StartLayer()

int CN_ITEM::StartLayer ( ) const
inline

Return the contiguous set of layers spanned by the item.

Definition at line 195 of file connectivity_items.h.

References m_start_layer.

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

◆ Valid()

◆ Visited()

bool CN_ITEM::Visited ( ) const
inline

Definition at line 236 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 273 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 267 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 275 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 272 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 263 of file connectivity_items.h.

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

◆ m_end_layer

int CN_ITEM::m_end_layer
protected

end layer of the item N.B. B_Cu is set to INT_MAX

Definition at line 266 of file connectivity_items.h.

Referenced by CN_ITEM(), EndLayer(), and SetLayers().

◆ m_listLock

std::mutex CN_ITEM::m_listLock
private

mutex protecting this item's connected_items set to

Definition at line 280 of file connectivity_items.h.

Referenced by Connect().

◆ m_parent

BOARD_CONNECTED_ITEM* CN_ITEM::m_parent
private

Definition at line 270 of file connectivity_items.h.

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

◆ m_start_layer

int CN_ITEM::m_start_layer
protected

start layer of the item N.B. B_Cu is set to INT_MAX

Definition at line 265 of file connectivity_items.h.

Referenced by CN_ITEM(), SetLayers(), and StartLayer().

◆ m_valid

bool CN_ITEM::m_valid
private

used to identify garbage items (we use lazy removal)

Definition at line 278 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 277 of file connectivity_items.h.

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


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