KiCad PCB EDA Suite
PNS::ITEM Class Referenceabstract

Base class for PNS router board items. More...

#include <pns_item.h>

Inheritance diagram for PNS::ITEM:
PNS::JOINT PNS::LINK_HOLDER PNS::LINKED_ITEM PNS::SOLID PNS::VIA PNS::DIFF_PAIR PNS::LINE PNS::ARC PNS::SEGMENT PNS::VVIA

Public Types

enum  PnsKind {
  SOLID_T = 1, LINE_T = 2, JOINT_T = 4, SEGMENT_T = 8,
  ARC_T = 16, VIA_T = 32, DIFF_PAIR_T = 64, ANY_T = 0xff
}
 

Public Member Functions

 ITEM (PnsKind aKind)
 
 ITEM (const ITEM &aOther)
 
virtual ~ITEM ()
 
virtual ITEMClone () const =0
 Return a deep copy of the item. More...
 
virtual const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const
 
virtual const SHAPE_LINE_CHAIN HoleHull (int aClearance, int aWalkaroundThickness, int aLayer) const
 
PnsKind Kind () const
 Return the type (kind) of the item. More...
 
bool OfKind (int aKindMask) const
 Return true if the item's type matches the mask aKindMask. More...
 
std::string KindStr () const
 Returns the kind of the item, as string. More...
 
void SetParent (BOARD_ITEM *aParent)
 
BOARD_ITEMParent () const
 
void SetNet (int aNet)
 
int Net () const
 
const LAYER_RANGELayers () const
 
void SetLayers (const LAYER_RANGE &aLayers)
 
void SetLayer (int aLayer)
 
virtual int Layer () const
 
bool LayersOverlap (const ITEM *aOther) const
 Return true if the set of layers spanned by aOther overlaps our layers. More...
 
NODEOwner () const
 Return the owner of this item, or NULL if there's none. More...
 
void SetOwner (NODE *aOwner)
 Set the node that owns this item. More...
 
bool BelongsTo (NODE *aNode) const
 
bool Collide (const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly=true) const
 Check for a collision (clearance violation) with between us and item aOther. More...
 
virtual const SHAPEShape () const
 Return the geometrical shape of the item. More...
 
virtual const SHAPEHole () const
 
virtual void Mark (int aMarker) const
 
virtual void Unmark (int aMarker=-1) const
 
virtual int Marker () const
 
virtual void SetRank (int aRank)
 
virtual int Rank () const
 
virtual VECTOR2I Anchor (int n) const
 
virtual int AnchorCount () const
 
bool IsLocked () const
 
void SetRoutable (bool aRoutable)
 
bool IsRoutable () const
 
bool IsVirtual () const
 
void SetIsCompoundShapePrimitive ()
 
bool IsCompoundShapePrimitive () const
 

Static Public Attributes

static const int UnusedNet = INT_MAX
 Supported item types. More...
 

Protected Attributes

PnsKind m_kind
 
BOARD_ITEMm_parent
 
NODEm_owner
 
LAYER_RANGE m_layers
 
bool m_movable
 
int m_net
 
int m_marker
 
int m_rank
 
bool m_routable
 
bool m_isVirtual
 
bool m_isCompoundShapePrimitive
 

Private Member Functions

bool collideSimple (const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly) const
 

Detailed Description

Base class for PNS router board items.

Implements the shared properties of all PCB items net, spanned layers, geometric shape and reference to owning model.

Definition at line 55 of file pns_item.h.

Member Enumeration Documentation

◆ PnsKind

Enumerator
SOLID_T 
LINE_T 
JOINT_T 
SEGMENT_T 
ARC_T 
VIA_T 
DIFF_PAIR_T 
ANY_T 

Definition at line 61 of file pns_item.h.

62  {
63  SOLID_T = 1,
64  LINE_T = 2,
65  JOINT_T = 4,
66  SEGMENT_T = 8,
67  ARC_T = 16,
68  VIA_T = 32,
69  DIFF_PAIR_T = 64,
70  ANY_T = 0xff
71  };

Constructor & Destructor Documentation

◆ ITEM() [1/2]

PNS::ITEM::ITEM ( PnsKind  aKind)
inline

Definition at line 73 of file pns_item.h.

74  {
75  m_net = UnusedNet;
76  m_movable = true;
77  m_kind = aKind;
78  m_parent = nullptr;
79  m_owner = nullptr;
80  m_marker = 0;
81  m_rank = -1;
82  m_routable = true;
83  m_isVirtual = false;
85  }
NODE * m_owner
Definition: pns_item.h:250
int m_rank
Definition: pns_item.h:256
bool m_movable
Definition: pns_item.h:253
bool m_routable
Definition: pns_item.h:257
static const int UnusedNet
Supported item types.
Definition: pns_item.h:58
bool m_isCompoundShapePrimitive
Definition: pns_item.h:259
int m_marker
Definition: pns_item.h:255
BOARD_ITEM * m_parent
Definition: pns_item.h:249
int m_net
Definition: pns_item.h:254
PnsKind m_kind
Definition: pns_item.h:247
bool m_isVirtual
Definition: pns_item.h:258

References m_isCompoundShapePrimitive, m_isVirtual, m_kind, m_marker, m_movable, m_net, m_owner, m_parent, m_rank, m_routable, and UnusedNet.

◆ ITEM() [2/2]

PNS::ITEM::ITEM ( const ITEM aOther)
inline

Definition at line 87 of file pns_item.h.

88  {
89  m_layers = aOther.m_layers;
90  m_net = aOther.m_net;
91  m_movable = aOther.m_movable;
92  m_kind = aOther.m_kind;
93  m_parent = aOther.m_parent;
94  m_owner = aOther.m_owner; // fixme: wtf this was null?
95  m_marker = aOther.m_marker;
96  m_rank = aOther.m_rank;
97  m_routable = aOther.m_routable;
98  m_isVirtual = aOther.m_isVirtual;
99  m_isCompoundShapePrimitive = aOther.m_isCompoundShapePrimitive;
100  }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:478
NODE * m_owner
Definition: pns_item.h:250
LAYER_RANGE m_layers
Definition: pns_item.h:251
int m_rank
Definition: pns_item.h:256
bool m_movable
Definition: pns_item.h:253
bool m_routable
Definition: pns_item.h:257
bool m_isCompoundShapePrimitive
Definition: pns_item.h:259
int m_marker
Definition: pns_item.h:255
BOARD_ITEM * m_parent
Definition: pns_item.h:249
int m_net
Definition: pns_item.h:254
PnsKind m_kind
Definition: pns_item.h:247
bool m_isVirtual
Definition: pns_item.h:258

References m_isCompoundShapePrimitive, m_isVirtual, m_kind, m_layers, m_marker, m_movable, m_net, m_owner, m_parent, m_rank, and m_routable.

◆ ~ITEM()

PNS::ITEM::~ITEM ( )
virtual

Definition at line 176 of file pns_item.cpp.

177 {
178 }

Member Function Documentation

◆ Anchor()

◆ AnchorCount()

virtual int PNS::ITEM::AnchorCount ( ) const
inlinevirtual

Reimplemented in PNS::VIA, PNS::SEGMENT, PNS::SOLID, and PNS::ARC.

Definition at line 222 of file pns_item.h.

223  {
224  return 0;
225  }

◆ BelongsTo()

bool PNS::ITEM::BelongsTo ( NODE aNode) const
inline
Returns
true if the item is owned by the node aNode.

Definition at line 181 of file pns_item.h.

182  {
183  return m_owner == aNode;
184  }
NODE * m_owner
Definition: pns_item.h:250

References m_owner.

Referenced by PNS::NODE::doRemove().

◆ Clone()

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aOther,
const NODE aNode,
bool  aDifferentNetsOnly = true 
) const

Check for a collision (clearance violation) with between us and item aOther.

Collision checking takes all PCB stuff into account (layers, nets, DRC rules). Optionally returns a minimum translation vector for force propagation algorithm.

Parameters
aOtheris the item to check collision against.
Returns
true, if a collision was found.

Definition at line 131 of file pns_item.cpp.

132 {
133  if( collideSimple( aOther, aNode, aDifferentNetsOnly ) )
134  return true;
135 
136  // Special cases for "head" lines with vias attached at the end. Note that this does not
137  // support head-line-via to head-line-via collisions, but you can't route two independent
138  // tracks at once so it shouldn't come up.
139 
140  if( m_kind == LINE_T )
141  {
142  const LINE* line = static_cast<const LINE*>( this );
143 
144  if( line->EndsWithVia() && line->Via().collideSimple( aOther, aNode, aDifferentNetsOnly ) )
145  return true;
146  }
147 
148  if( aOther->m_kind == LINE_T )
149  {
150  const LINE* line = static_cast<const LINE*>( aOther );
151 
152  if( line->EndsWithVia() && line->Via().collideSimple( this, aNode, aDifferentNetsOnly ) )
153  return true;
154  }
155 
156  return false;
157 }
PnsKind m_kind
Definition: pns_item.h:247
bool collideSimple(const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly) const
Definition: pns_item.cpp:32

References collideSimple(), PNS::LINE::EndsWithVia(), LINE_T, m_kind, and PNS::LINE::Via().

Referenced by PNS::SHOVE::onCollidingSolid(), PNS::OPTIMIZER::CACHE_VISITOR::operator()(), PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()(), PNS::SHOVE::shoveLineFromLoneVia(), PNS::SHOVE::shoveLineToHullSet(), and PNS::COMPONENT_DRAGGER::Start().

◆ collideSimple()

bool PNS::ITEM::collideSimple ( const ITEM aOther,
const NODE aNode,
bool  aDifferentNetsOnly 
) const
private

Definition at line 32 of file pns_item.cpp.

33 {
34  const ROUTER_IFACE* iface = ROUTER::GetInstance()->GetInterface();
35  const SHAPE* shapeA = Shape();
36  const SHAPE* holeA = Hole();
37  int lineWidthA = 0;
38  const SHAPE* shapeB = aOther->Shape();
39  const SHAPE* holeB = aOther->Hole();
40  int lineWidthB = 0;
41 
42  // Sadly collision routines ignore SHAPE_POLY_LINE widths so we have to pass them in as part
43  // of the clearance value.
44  if( m_kind == LINE_T )
45  lineWidthA = static_cast<const LINE*>( this )->Width() / 2;
46 
47  if( aOther->m_kind == LINE_T )
48  lineWidthB = static_cast<const LINE*>( aOther )->Width() / 2;
49 
50  // same nets? no collision!
51  if( aDifferentNetsOnly && m_net == aOther->m_net && m_net >= 0 && aOther->m_net >= 0 )
52  return false;
53 
54  // check if we are not on completely different layers first
55  if( !m_layers.Overlaps( aOther->m_layers ) )
56  return false;
57 
58  auto checkKeepout =
59  []( const ZONE* aKeepout, const BOARD_ITEM* aOther )
60  {
61  constexpr KICAD_T TRACK_TYPES[] = { PCB_ARC_T, PCB_TRACE_T, EOT };
62 
63  if( aKeepout->GetDoNotAllowTracks() && aOther->IsType( TRACK_TYPES ) )
64  return true;
65 
66  if( aKeepout->GetDoNotAllowVias() && aOther->Type() == PCB_VIA_T )
67  return true;
68 
69  if( aKeepout->GetDoNotAllowPads() && aOther->Type() == PCB_PAD_T )
70  return true;
71 
72  // Incomplete test, but better than nothing:
73  if( aKeepout->GetDoNotAllowFootprints() && aOther->Type() == PCB_PAD_T )
74  {
75  return !aKeepout->GetParentFootprint()
76  || aKeepout->GetParentFootprint() != aOther->GetParentFootprint();
77  }
78 
79  return false;
80  };
81 
82  const ZONE* zoneA = dynamic_cast<ZONE*>( Parent() );
83  const ZONE* zoneB = dynamic_cast<ZONE*>( aOther->Parent() );
84 
85  if( zoneA && aOther->Parent() && !checkKeepout( zoneA, aOther->Parent() ) )
86  return false;
87 
88  if( zoneB && Parent() && !checkKeepout( zoneB, Parent() ) )
89  return false;
90 
91  if( holeA || holeB )
92  {
93  int holeClearance = aNode->GetHoleClearance( this, aOther );
94 
95  if( holeA && holeA->Collide( shapeB, holeClearance + lineWidthB ) )
96  {
97  Mark( Marker() | MK_HOLE );
98  return true;
99  }
100 
101  if( holeB && holeB->Collide( shapeA, holeClearance + lineWidthA ) )
102  {
103  aOther->Mark( aOther->Marker() | MK_HOLE );
104  return true;
105  }
106 
107  if( holeA && holeB )
108  {
109  int holeToHoleClearance = aNode->GetHoleToHoleClearance( this, aOther );
110 
111  if( holeA->Collide( holeB, holeToHoleClearance ) )
112  {
113  Mark( Marker() | MK_HOLE );
114  aOther->Mark( aOther->Marker() | MK_HOLE );
115  return true;
116  }
117  }
118  }
119 
120  if( !aOther->Layers().IsMultilayer() && !iface->IsFlashedOnLayer( this, aOther->Layer()) )
121  return false;
122 
123  if( !Layers().IsMultilayer() && !iface->IsFlashedOnLayer( aOther, Layer()) )
124  return false;
125 
126  int clearance = aNode->GetClearance( this, aOther );
127  return shapeA->Collide( shapeB, clearance + lineWidthA + lineWidthB );
128 }
virtual const SHAPE * Hole() const
Definition: pns_item.h:205
virtual int Layer() const
Definition: pns_item.h:158
bool GetDoNotAllowFootprints() const
Definition: zone.h:740
virtual void Mark(int aMarker) const
Definition: pns_item.h:210
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
bool IsMultilayer() const
Definition: pns_layerset.h:77
bool GetDoNotAllowVias() const
Definition: zone.h:737
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:67
LAYER_RANGE m_layers
Definition: pns_item.h:251
BOARD_ITEM * Parent() const
Definition: pns_item.h:149
class PAD, a pad in a footprint
Definition: typeinfo.h:89
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
Definition: shape.h:165
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
bool GetDoNotAllowPads() const
Definition: zone.h:739
virtual const SHAPE * Shape() const
Return the geometrical shape of the item.
Definition: pns_item.h:200
bool GetDoNotAllowTracks() const
Definition: zone.h:738
Handle a list of polygons defining a copper zone.
Definition: zone.h:56
An abstract shape on 2D plane.
Definition: shape.h:116
int m_net
Definition: pns_item.h:254
PnsKind m_kind
Definition: pns_item.h:247
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
ROUTER_IFACE * GetInterface() const
Definition: pns_router.h:208
static ROUTER * GetInstance()
Definition: pns_router.cpp:78
const LAYER_RANGE & Layers() const
Definition: pns_item.h:154
virtual int Marker() const
Definition: pns_item.h:212
BOARD_ITEM_CONTAINER * GetParentFootprint() const
Definition: board_item.cpp:191

References SHAPE::Collide(), EOT, PNS::NODE::GetClearance(), ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), PNS::NODE::GetHoleClearance(), PNS::NODE::GetHoleToHoleClearance(), PNS::ROUTER::GetInstance(), PNS::ROUTER::GetInterface(), BOARD_ITEM::GetParentFootprint(), Hole(), PNS::ROUTER_IFACE::IsFlashedOnLayer(), LAYER_RANGE::IsMultilayer(), Layer(), Layers(), LINE_T, m_kind, m_layers, m_net, Mark(), Marker(), PNS::MK_HOLE, LAYER_RANGE::Overlaps(), Parent(), PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, and Shape().

Referenced by Collide().

◆ Hole()

virtual const SHAPE* PNS::ITEM::Hole ( ) const
inlinevirtual

Reimplemented in PNS::VIA, and PNS::SOLID.

Definition at line 205 of file pns_item.h.

206  {
207  return nullptr;
208  }

Referenced by collideSimple(), ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM(), and ROUTER_PREVIEW_ITEM::Update().

◆ HoleHull()

virtual const SHAPE_LINE_CHAIN PNS::ITEM::HoleHull ( int  aClearance,
int  aWalkaroundThickness,
int  aLayer 
) const
inlinevirtual

Reimplemented in PNS::SOLID.

Definition at line 121 of file pns_item.h.

123  {
124  return SHAPE_LINE_CHAIN();
125  }
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...

◆ Hull()

virtual const SHAPE_LINE_CHAIN PNS::ITEM::Hull ( int  aClearance = 0,
int  aWalkaroundThickness = 0,
int  aLayer = -1 
) const
inlinevirtual

Reimplemented in PNS::VIA, PNS::SEGMENT, PNS::ARC, and PNS::SOLID.

Definition at line 115 of file pns_item.h.

117  {
118  return SHAPE_LINE_CHAIN();
119  }
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...

◆ IsCompoundShapePrimitive()

bool PNS::ITEM::IsCompoundShapePrimitive ( ) const
inline

Definition at line 241 of file pns_item.h.

241 { return m_isCompoundShapePrimitive; }
bool m_isCompoundShapePrimitive
Definition: pns_item.h:259

References m_isCompoundShapePrimitive.

◆ IsLocked()

bool PNS::ITEM::IsLocked ( ) const
inline

Definition at line 227 of file pns_item.h.

228  {
229  return Marker() & MK_LOCKED;
230  }
virtual int Marker() const
Definition: pns_item.h:212

References Marker(), and PNS::MK_LOCKED.

Referenced by ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::performDragging(), and PNS::SHOVE::pushOrShoveVia().

◆ IsRoutable()

bool PNS::ITEM::IsRoutable ( ) const
inline

Definition at line 233 of file pns_item.h.

233 { return m_routable; }
bool m_routable
Definition: pns_item.h:257

References m_routable.

Referenced by PNS::NODE::addSolid(), and PNS::NODE::removeSolidIndex().

◆ IsVirtual()

bool PNS::ITEM::IsVirtual ( ) const
inline

◆ Kind()

◆ KindStr()

std::string PNS::ITEM::KindStr ( ) const

Returns the kind of the item, as string.

Definition at line 160 of file pns_item.cpp.

161 {
162  switch( m_kind )
163  {
164  case ARC_T: return "arc";
165  case LINE_T: return "line";
166  case SEGMENT_T: return "segment";
167  case VIA_T: return "via";
168  case JOINT_T: return "joint";
169  case SOLID_T: return "solid";
170  case DIFF_PAIR_T: return "diff-pair";
171  default: return "unknown";
172  }
173 }
PnsKind m_kind
Definition: pns_item.h:247

References ARC_T, DIFF_PAIR_T, JOINT_T, LINE_T, m_kind, SEGMENT_T, SOLID_T, and VIA_T.

Referenced by PNS::TOOL_BASE::pickSingleItem(), and PNS::TOOL_BASE::updateEndItem().

◆ Layer()

◆ Layers()

const LAYER_RANGE& PNS::ITEM::Layers ( ) const
inline

Definition at line 154 of file pns_item.h.

154 { return m_layers; }
LAYER_RANGE m_layers
Definition: pns_item.h:251

References m_layers.

Referenced by PNS::INDEX::Add(), PNS::NODE::Add(), PNS::NODE::addArc(), PNS_KICAD_IFACE::AddItem(), PNS::NODE::addSegment(), PNS::NODE::addSolid(), PNS::NODE::addVia(), PNS::ARC::ARC(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS_PCBNEW_RULE_RESOLVER::Clearance(), PNS::VIA::Clone(), collideSimple(), PNS::MEANDER_PLACER::CurrentLayer(), PNS::DP_MEANDER_PLACER::CurrentLayer(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), PNS::NODE::FindJoint(), PNS::NODE::FindLinesBetweenJoints(), PNS::NODE::findRedundantArc(), PNS::NODE::findRedundantSegment(), PNS::NODE::FixupVirtualVias(), ROUTER_TOOL::getStartLayer(), PNS_PCBNEW_RULE_RESOLVER::HoleClearance(), PNS_PCBNEW_RULE_RESOLVER::HoleToHoleClearance(), PNS_KICAD_IFACE::IsFlashedOnLayer(), Layer(), LayersOverlap(), PNS::LINE::LINE(), PNS::NODE::LockJoint(), PNS::VIA::MakeHandle(), PNS::ROUTER::markViolations(), PNS::SHOVE::onCollidingSolid(), LENGTH_TUNER_TOOL::performTuning(), PNS::TOOL_BASE::pickSingleItem(), PNS::INDEX::Query(), PNS::INDEX::Remove(), PNS::NODE::removeArcIndex(), PNS::NODE::removeSegmentIndex(), PNS::NODE::removeSolidIndex(), PNS::NODE::removeViaIndex(), PNS_TEST_ENVIRONMENT::ReplayLog(), PNS::SEGMENT::SEGMENT(), PNS::LINE_PLACER::SetLayer(), PNS::COMPONENT_DRAGGER::Start(), ROUTER_PREVIEW_ITEM::Update(), PNS::TOOL_BASE::updateEndItem(), PNS::DIFF_PAIR::updateLine(), PNS::TOOL_BASE::updateStartItem(), and PNS::VIA::VIA().

◆ LayersOverlap()

bool PNS::ITEM::LayersOverlap ( const ITEM aOther) const
inline

Return true if the set of layers spanned by aOther overlaps our layers.

Definition at line 163 of file pns_item.h.

164  {
165  return Layers().Overlaps( aOther->Layers() );
166  }
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:67
const LAYER_RANGE & Layers() const
Definition: pns_item.h:154

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

Referenced by PNS::SHOVE::onCollidingArc(), PNS::SHOVE::onCollidingSegment(), PNS::NODE::rebuildJoint(), and PNS::SHOVE::ShoveObstacleLine().

◆ Mark()

virtual void PNS::ITEM::Mark ( int  aMarker) const
inlinevirtual

Reimplemented in PNS::LINE.

Definition at line 210 of file pns_item.h.

210 { m_marker = aMarker; }
int m_marker
Definition: pns_item.h:255

References m_marker.

Referenced by collideSimple(), and PNS::SHOVE::ShoveDraggingVia().

◆ Marker()

virtual int PNS::ITEM::Marker ( ) const
inlinevirtual

Reimplemented in PNS::LINE.

Definition at line 212 of file pns_item.h.

212 { return m_marker; }
int m_marker
Definition: pns_item.h:255

References m_marker.

Referenced by PNS::ARC::ARC(), collideSimple(), IsLocked(), PNS::SHOVE::pushOrShoveVia(), and ROUTER_PREVIEW_ITEM::Update().

◆ Net()

int PNS::ITEM::Net ( ) const
inline

Definition at line 152 of file pns_item.h.

152 { return m_net; }
int m_net
Definition: pns_item.h:254

References m_net.

Referenced by PNS::INDEX::Add(), PNS::NODE::Add(), PNS::NODE::addArc(), PNS_KICAD_IFACE::AddItem(), PNS::NODE::addSegment(), PNS::NODE::addSolid(), PNS::NODE::addVia(), PNS::ARC::ARC(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::LINE_PLACER::buildInitialLine(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS::VIA::Clone(), PNS::MEANDER_PLACER::CurrentNets(), PNS::DRAGGER::CurrentNets(), PNS::DIFF_PAIR::DIFF_PAIR(), PNS::OPTIMIZER::fanoutCleanup(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), PNS::NODE::FindJoint(), PNS::NODE::findRedundantArc(), PNS::NODE::findRedundantSegment(), PNS::LINE_PLACER::FixRoute(), ROUTER_TOOL::InlineDrag(), PNS_PCBNEW_RULE_RESOLVER::IsDiffPair(), PNS::ROUTER::isStartingPointRoutable(), PNS::LINE::LINE(), PNS::NODE::LockJoint(), PNS::VIA::MakeHandle(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), ROUTER_TOOL::prepareInteractive(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), PNS::NODE::rebuildJoint(), PNS::INDEX::Remove(), PNS::NODE::removeArcIndex(), PNS::NODE::removeSegmentIndex(), PNS::NODE::removeSolidIndex(), PNS::NODE::removeViaIndex(), PNS::OPTIMIZER::runSmartPads(), PNS::SEGMENT::SEGMENT(), PNS::SHOVE::ShoveObstacleLine(), PNS::MEANDER_SKEW_PLACER::Start(), PNS::DIFF_PAIR_PLACER::Start(), PNS::LINE_PLACER::Start(), ROUTER_TOOL::UpdateMessagePanel(), and PNS::VIA::VIA().

◆ OfKind()

◆ Owner()

NODE* PNS::ITEM::Owner ( ) const
inline

Return the owner of this item, or NULL if there's none.

Definition at line 171 of file pns_item.h.

171 { return m_owner; }
NODE * m_owner
Definition: pns_item.h:250

References m_owner.

Referenced by PNS_KICAD_IFACE_BASE::inheritTrackWidth(), PNS::LINE_PLACER::Move(), and PNS::LINE_PLACER::rhShoveOnly().

◆ Parent()

◆ Rank()

virtual int PNS::ITEM::Rank ( ) const
inlinevirtual

Reimplemented in PNS::LINE.

Definition at line 215 of file pns_item.h.

215 { return m_rank; }
int m_rank
Definition: pns_item.h:256

References m_rank.

Referenced by PNS::ARC::ARC(), PNS::LINE::LINE(), and PNS::SHOVE::shoveIteration().

◆ SetIsCompoundShapePrimitive()

void PNS::ITEM::SetIsCompoundShapePrimitive ( )
inline

Definition at line 240 of file pns_item.h.

240 { m_isCompoundShapePrimitive = true; }
bool m_isCompoundShapePrimitive
Definition: pns_item.h:259

References m_isCompoundShapePrimitive.

◆ SetLayer()

◆ SetLayers()

void PNS::ITEM::SetLayers ( const LAYER_RANGE aLayers)
inline

Definition at line 155 of file pns_item.h.

155 { m_layers = aLayers; }
LAYER_RANGE m_layers
Definition: pns_item.h:251

References m_layers.

Referenced by PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::VIA::Clone(), and PNS::VIA::VIA().

◆ SetNet()

◆ SetOwner()

void PNS::ITEM::SetOwner ( NODE aOwner)
inline

Set the node that owns this item.

An item can belong to a single NODE or be unowned.

Definition at line 176 of file pns_item.h.

176 { m_owner = aOwner; }
NODE * m_owner
Definition: pns_item.h:250

References m_owner.

Referenced by PNS::NODE::AssembleLine(), PNS::NODE::doRemove(), and PNS::NODE::Remove().

◆ SetParent()

void PNS::ITEM::SetParent ( BOARD_ITEM aParent)
inline

Definition at line 148 of file pns_item.h.

148 { m_parent = aParent; }
BOARD_ITEM * m_parent
Definition: pns_item.h:249

References m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ SetRank()

virtual void PNS::ITEM::SetRank ( int  aRank)
inlinevirtual

Reimplemented in PNS::LINE.

Definition at line 214 of file pns_item.h.

214 { m_rank = aRank; }
int m_rank
Definition: pns_item.h:256

References m_rank.

Referenced by PNS::NODE::Commit(), and PNS::SHOVE::ShoveDraggingVia().

◆ SetRoutable()

void PNS::ITEM::SetRoutable ( bool  aRoutable)
inline

Definition at line 232 of file pns_item.h.

232 { m_routable = aRoutable; }
bool m_routable
Definition: pns_item.h:257

References m_routable.

◆ Shape()

virtual const SHAPE* PNS::ITEM::Shape ( ) const
inlinevirtual

Return the geometrical shape of the item.

Used for collision detection and spatial indexing.

Reimplemented in PNS::LINE, PNS::VIA, PNS::SOLID, PNS::ARC, and PNS::SEGMENT.

Definition at line 200 of file pns_item.h.

201  {
202  return nullptr;
203  }

Referenced by PNS::DP_GATEWAYS::BuildFromPrimitivePair(), collideSimple(), PNS::OPTIMIZER::computeBreakouts(), PNS::OPTIMIZER::customBreakouts(), PNS::HIT_VISITOR::operator()(), PNS::INDEX::Query(), ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM(), and ROUTER_PREVIEW_ITEM::Update().

◆ Unmark()

virtual void PNS::ITEM::Unmark ( int  aMarker = -1) const
inlinevirtual

Reimplemented in PNS::LINE.

Definition at line 211 of file pns_item.h.

211 { m_marker &= ~aMarker; }
int m_marker
Definition: pns_item.h:255

References m_marker.

Referenced by PNS::NODE::Commit(), and PNS::DRAGGER::Start().

Member Data Documentation

◆ m_isCompoundShapePrimitive

bool PNS::ITEM::m_isCompoundShapePrimitive
protected

Definition at line 259 of file pns_item.h.

Referenced by IsCompoundShapePrimitive(), ITEM(), and SetIsCompoundShapePrimitive().

◆ m_isVirtual

bool PNS::ITEM::m_isVirtual
protected

Definition at line 258 of file pns_item.h.

Referenced by PNS::VIA::Clone(), IsVirtual(), ITEM(), PNS::VIA::VIA(), and PNS::VVIA::VVIA().

◆ m_kind

PnsKind PNS::ITEM::m_kind
protected

Definition at line 247 of file pns_item.h.

Referenced by Collide(), collideSimple(), ITEM(), Kind(), KindStr(), and OfKind().

◆ m_layers

◆ m_marker

◆ m_movable

bool PNS::ITEM::m_movable
protected

Definition at line 253 of file pns_item.h.

Referenced by ITEM(), PNS::LINE::LINE(), PNS::LINE::operator=(), and PNS::SOLID::SOLID().

◆ m_net

◆ m_owner

NODE* PNS::ITEM::m_owner
protected

Definition at line 250 of file pns_item.h.

Referenced by BelongsTo(), ITEM(), PNS::LINE::operator=(), Owner(), and SetOwner().

◆ m_parent

BOARD_ITEM* PNS::ITEM::m_parent
protected

Definition at line 249 of file pns_item.h.

Referenced by PNS::VIA::Clone(), ITEM(), Parent(), and SetParent().

◆ m_rank

◆ m_routable

bool PNS::ITEM::m_routable
protected

Definition at line 257 of file pns_item.h.

Referenced by IsRoutable(), ITEM(), and SetRoutable().

◆ UnusedNet

const int PNS::ITEM::UnusedNet = INT_MAX
static

Supported item types.

Definition at line 58 of file pns_item.h.

Referenced by ITEM().


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