63 return static_cast<PAD*
>(
m_parent )->GetPosition();
87 wxLogDebug(
" valid: %d, connected: \n", !!
Valid() );
92 wxLogDebug( wxT(
" - %p %d\n" ), t, t->
Type() );
140 if( !(*it)->Valid() )
150 if( !
pad->IsOnCopperLayer() )
155 std::set<VECTOR2I> uniqueAnchors;
156 pad->Padstack().ForEachUniqueLayer(
159 uniqueAnchors.insert(
pad->ShapePos( aLayer ) );
163 item->AddAnchor(
anchor );
167 switch(
pad->GetAttribute() )
169 case PAD_ATTRIB::SMD:
170 case PAD_ATTRIB::NPTH:
171 case PAD_ATTRIB::CONN:
173 LSEQ lmsk =
pad->GetLayerSet().CuStack();
176 item->SetLayer( lmsk.front() );
235 std::vector<CN_ITEM*> rv;
237 for(
int j = 0; j < polys->OutlineCount(); j++ )
246 rv.push_back(
Add( zitem ) );
287 aGarbage.push_back ( item );
294 m_items.resize( lastItem - m_items.begin() );
296 for(
CN_ITEM* item : aGarbage )
297 m_index.Remove( item );
299 m_hasInvalid =
false;
334 size_t minimal_count = 1;
339 return connected_count < 2;
342 return connected_count < minimal_count;
352 if( !shape->IsFilled() )
353 accuracy =
KiROUND( shape->GetWidth() / 2 );
364 ZONE* zone =
static_cast<ZONE*
>( item->Parent() );
369 else if( item->Parent()->HitTest(
Pos(), accuracy ) )
375 return connected_count < minimal_count;
384 int connected_count = 0;
390 ZONE* zone =
static_cast<ZONE*
>( item->Parent() );
395 else if( item->Parent()->HitTest(
Pos() ) )
401 return connected_count;
437 [&aItem](
const CN_ITEM* item )
439 return item->Valid() && item->Parent() == aItem;
448 wxLogTrace( wxT(
"CN" ), wxT(
" - item : %p bitem : %p type : %d inet %s\n" ),
451 item->Parent()->Type(),
452 (
const char*) item->Parent()->GetNetname().c_str() );
453 wxLogTrace( wxT(
"CN" ), wxT(
"- item : %p bitem : %p type : %d inet %s\n" ),
456 item->Parent()->Type(),
457 (
const char*) item->Parent()->GetNetname().c_str() );
467 int netCode = item->
Net();
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
wxString GetNetname() const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
CN_ITEM * m_item
Pad or track/arc/via owning the anchor.
int ConnectedItemsCount() const
std::shared_ptr< CN_CLUSTER > m_cluster
Cluster to which the anchor belongs.
const VECTOR2I & Pos() const
BOARD_CONNECTED_ITEM * Parent() const
bool IsDangling() const
The anchor point is dangling if the parent is a track and this anchor point is not connected to anoth...
std::vector< CN_ITEM * > m_items
bool Contains(const CN_ITEM *aItem)
wxString OriginNetName() const
std::unordered_map< int, int > m_netRanks
CN_ITEM represents a BOARD_CONNETED_ITEM in the connectivity system (ie: a pad, track/arc/via,...
virtual int AnchorCount() const
std::vector< CN_ITEM * > m_connected
list of physically touching items
const std::vector< CN_ITEM * > & ConnectedItems() const
BOARD_CONNECTED_ITEM * m_parent
std::shared_ptr< CN_ANCHOR > AddAnchor(const VECTOR2I &aPos)
void SetLayers(int aStartLayer, int aEndLayer)
Set the layers spanned by the item to aStartLayer and aEndLayer.
virtual const VECTOR2I GetAnchor(int n) const
void SetLayer(int aLayer)
Set the layers spanned by the item to a single layer aLayer.
std::vector< std::shared_ptr< CN_ANCHOR > > m_anchors
bool m_valid
used to identify garbage items (we use lazy removal)
BOARD_CONNECTED_ITEM * Parent() const
void SetDirty(bool aDirty=true)
std::vector< CN_ITEM * > m_items
void addItemtoTree(CN_ITEM *item)
void RemoveInvalidItems(std::vector< CN_ITEM * > &aGarbage)
virtual int AnchorCount() const override
bool HasSingleConnection()
virtual const VECTOR2I GetAnchor(int n) const override
KICAD_T Type() const
Returns the type of object.
virtual wxString GetClass() const =0
Return the class name.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
std::vector< VECTOR2I > GetConnectionPoints() const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
Handle a list of polygons defining a copper zone.
const std::shared_ptr< SHAPE_POLY_SET > & GetFilledPolysList(PCB_LAYER_ID aLayer) const
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const VECTOR2I &aRefPos, int aAccuracy=0) const
Test if the given VECTOR2I is within the bounds of a filled area of this zone.
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I