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

CN_ANCHOR represents a physical location that can be connected: a pad or a track/arc/via endpoint. More...

#include <connectivity_items.h>

Public Member Functions

 CN_ANCHOR (const VECTOR2I &aPos, CN_ITEM *aItem)
 
bool Valid () const
 
bool Dirty () const
 
CN_ITEMItem () const
 
void SetItem (CN_ITEM *aItem)
 
BOARD_CONNECTED_ITEMParent () const
 
const VECTOR2IPos () const
 
void Move (const VECTOR2I &aPos)
 
unsigned int Dist (const CN_ANCHOR &aSecond)
 
int GetTag () const
 
void SetTag (int aTag)
 
const bool & GetNoLine () const
 
void SetNoLine (bool aEnable)
 
const std::shared_ptr< CN_CLUSTER > & GetCluster () const
 
void SetCluster (std::shared_ptr< CN_CLUSTER > &aCluster)
 
bool IsDangling () const
 The anchor point is dangling if the parent is a track and this anchor point is not connected to another item ( track, vias pad or zone) or if the parent is a via and this anchor point is connected to only one track and not to another item.
 
int ConnectedItemsCount () const
 

Static Public Attributes

static const int TAG_UNCONNECTED = -1
 

Private Attributes

VECTOR2I m_pos
 Position of the anchor.
 
CN_ITEMm_item
 Pad or track/arc/via owning the anchor.
 
int m_tag
 Tag for quick connection resolution.
 
bool m_noline
 Whether it the node can be a target for ratsnest lines.
 
std::shared_ptr< CN_CLUSTERm_cluster
 Cluster to which the anchor belongs.
 

Detailed Description

CN_ANCHOR represents a physical location that can be connected: a pad or a track/arc/via endpoint.

Definition at line 58 of file connectivity_items.h.

Constructor & Destructor Documentation

◆ CN_ANCHOR()

CN_ANCHOR::CN_ANCHOR ( const VECTOR2I aPos,
CN_ITEM aItem 
)
inline

Definition at line 61 of file connectivity_items.h.

Member Function Documentation

◆ ConnectedItemsCount()

int CN_ANCHOR::ConnectedItemsCount ( ) const
Returns
the count of tracks and vias connected to this anchor.

Definition at line 374 of file connectivity_items.cpp.

References CN_ITEM::ConnectedItems(), ZONE::HitTestFilledArea(), m_cluster, m_item, PCB_ZONE_T, Pos(), and ToLAYER_ID().

◆ Dirty()

bool CN_ANCHOR::Dirty ( ) const

Definition at line 314 of file connectivity_items.cpp.

References CN_ITEM::Dirty(), m_item, and Valid().

Referenced by PCB_SELECTION_TOOL::grabUnconnected().

◆ Dist()

unsigned int CN_ANCHOR::Dist ( const CN_ANCHOR aSecond)
inline
Returns
tag, a common identifier for connected nodes.

Definition at line 84 of file connectivity_items.h.

References m_pos, and Pos().

◆ GetCluster()

const std::shared_ptr< CN_CLUSTER > & CN_ANCHOR::GetCluster ( ) const
inline

Definition at line 97 of file connectivity_items.h.

References m_cluster.

◆ GetNoLine()

const bool & CN_ANCHOR::GetNoLine ( ) const
inline

Definition at line 94 of file connectivity_items.h.

References m_noline.

◆ GetTag()

int CN_ANCHOR::GetTag ( ) const
inline

Definition at line 90 of file connectivity_items.h.

References m_tag.

◆ IsDangling()

bool CN_ANCHOR::IsDangling ( ) const

The anchor point is dangling if the parent is a track and this anchor point is not connected to another item ( track, vias pad or zone) or if the parent is a via and this anchor point is connected to only one track and not to another item.

Returns
true if this anchor is dangling.

Definition at line 320 of file connectivity_items.cpp.

References CN_ITEM::AnchorCount(), CN_ITEM::ConnectedItems(), ZONE::HitTestFilledArea(), KiROUND(), m_cluster, m_item, Parent(), PCB_ARC_T, PCB_SHAPE_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, Pos(), and ToLAYER_ID().

◆ Item()

CN_ITEM * CN_ANCHOR::Item ( ) const
inline

Definition at line 72 of file connectivity_items.h.

References m_item.

◆ Move()

void CN_ANCHOR::Move ( const VECTOR2I aPos)
inline

Definition at line 79 of file connectivity_items.h.

References m_pos.

◆ Parent()

BOARD_CONNECTED_ITEM * CN_ANCHOR::Parent ( ) const

◆ Pos()

const VECTOR2I & CN_ANCHOR::Pos ( ) const
inline

Definition at line 77 of file connectivity_items.h.

References m_pos.

Referenced by ConnectedItemsCount(), Dist(), and IsDangling().

◆ SetCluster()

void CN_ANCHOR::SetCluster ( std::shared_ptr< CN_CLUSTER > &  aCluster)
inline

Definition at line 98 of file connectivity_items.h.

References m_cluster.

◆ SetItem()

void CN_ANCHOR::SetItem ( CN_ITEM aItem)
inline

Definition at line 73 of file connectivity_items.h.

References m_item.

◆ SetNoLine()

void CN_ANCHOR::SetNoLine ( bool  aEnable)
inline

Definition at line 95 of file connectivity_items.h.

References m_noline.

◆ SetTag()

void CN_ANCHOR::SetTag ( int  aTag)
inline
Returns
true if this node can be a target for ratsnest lines.

Definition at line 91 of file connectivity_items.h.

References m_tag.

◆ Valid()

bool CN_ANCHOR::Valid ( ) const

Definition at line 305 of file connectivity_items.cpp.

References m_item, and CN_ITEM::Valid().

Referenced by Dirty().

Member Data Documentation

◆ m_cluster

std::shared_ptr<CN_CLUSTER> CN_ANCHOR::m_cluster
private

Cluster to which the anchor belongs.

Definition at line 123 of file connectivity_items.h.

Referenced by ConnectedItemsCount(), GetCluster(), IsDangling(), and SetCluster().

◆ m_item

CN_ITEM* CN_ANCHOR::m_item
private

Pad or track/arc/via owning the anchor.

Definition at line 119 of file connectivity_items.h.

Referenced by ConnectedItemsCount(), Dirty(), IsDangling(), Item(), Parent(), SetItem(), and Valid().

◆ m_noline

bool CN_ANCHOR::m_noline
private

Whether it the node can be a target for ratsnest lines.

Definition at line 121 of file connectivity_items.h.

Referenced by GetNoLine(), and SetNoLine().

◆ m_pos

VECTOR2I CN_ANCHOR::m_pos
private

Position of the anchor.

Definition at line 118 of file connectivity_items.h.

Referenced by Dist(), Move(), and Pos().

◆ m_tag

int CN_ANCHOR::m_tag
private

Tag for quick connection resolution.

Definition at line 120 of file connectivity_items.h.

Referenced by GetTag(), and SetTag().

◆ TAG_UNCONNECTED

const int CN_ANCHOR::TAG_UNCONNECTED = -1
static

Definition at line 115 of file connectivity_items.h.


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