24#ifndef PCBNEW_ROUTER_PNS_LINK_HOLDER_H_
25#define PCBNEW_ROUTER_PNS_LINK_HOLDER_H_
27#include <core/kicad_algo.h>
29#include "pns_linked_item.h"
36 typedef std::vector<LINKED_ITEM*> LINKS;
44 m_links.push_back( aLink );
49 LINKS& Links() {
return m_links; }
50 const LINKS& Links()
const {
return m_links; }
54 return m_links.size() != 0;
60 return alg::contains( m_links, aItem );
65 return m_links[aIndex];
77 return m_links.size();
85 wxLogTrace( wxT(
"PNS" ), wxT(
"item %p: no links" ),
this );
89 wxLogTrace( wxT(
"PNS" ), wxT(
"item %p: %d links" ),
this, (
int) m_links.size() );
91 for(
int i = 0; i < (int) m_links.size(); i++ )
92 wxLogTrace( wxT(
"PNS" ), wxT(
"item %d: %p\n" ), i, m_links[i] );
100 m_links = aParent->m_links;
Base class for PNS router board items.
Definition pns_item.h:57
Definition pns_linked_item.h:30
Definition pns_link_holder.h:34
void copyLinks(const LINK_HOLDER *aParent)
< Copy m_links from the line aParent.
Definition pns_link_holder.h:98
void Link(LINKED_ITEM *aLink)
Return the list of links from the owning node that constitute this line (or NULL if the line is not l...
Definition pns_link_holder.h:42
bool IsLinked() const
Check if the segment aLink is a part of the line.
Definition pns_link_holder.h:52
LINKED_ITEM * GetLink(int aIndex) const
Erase the linking information. Used to detach the line from the owning node.
Definition pns_link_holder.h:63
LINK_HOLDER(PnsKind aKind)
Add a reference to an item registered in a #NODE that is a part of this line.
Definition pns_link_holder.h:38
virtual void ClearLinks()
Return the number of segments that were assembled together to form this line.
Definition pns_link_holder.h:69
void ShowLinks() const
Definition pns_link_holder.h:80