KiCad PCB EDA Suite
PNS::SEGMENT Class Reference

#include <pns_segment.h>

Inheritance diagram for PNS::SEGMENT:
PNS::LINKED_ITEM PNS::ITEM

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

 SEGMENT ()
 
 SEGMENT (const SEG &aSeg, int aNet)
 
 SEGMENT (const LINE &aParentLine, const SEG &aSeg)
 
SEGMENTClone () const override
 Return a deep copy of the item. More...
 
const SHAPEShape () const override
 Return the geometrical shape of the item. More...
 
void SetWidth (int aWidth) override
 
int Width () const override
 
const SEGSeg () const
 
const SHAPE_LINE_CHAIN CLine () const
 
void SetEnds (const VECTOR2I &a, const VECTOR2I &b)
 
void SwapEnds ()
 
const SHAPE_LINE_CHAIN Hull (int aClearance, int aWalkaroundThickness, int aLayer=-1) const override
 
virtual VECTOR2I Anchor (int n) const override
 
virtual int AnchorCount () const override
 
virtual const SHAPE_LINE_CHAIN HoleHull (int aClearance, int aWalkaroundThickness=0, int aLayer=-1) 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, int aOverrideClearance=-1) const
 Check for a collision (clearance violation) with between us and item aOther. 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
 
bool IsLocked () const
 
void SetRoutable (bool aRoutable)
 
bool IsRoutable () const
 
bool IsVirtual () const
 
void SetIsCompoundShapePrimitive ()
 
bool IsCompoundShapePrimitive () const
 

Static Public Member Functions

static bool ClassOf (const ITEM *aItem)
 

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, int aOverrideClearance) const
 

Private Attributes

SHAPE_SEGMENT m_seg
 

Detailed Description

Definition at line 38 of file pns_segment.h.

Member Enumeration Documentation

◆ PnsKind

enum PNS::ITEM::PnsKind
inherited
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 };
@ SOLID_T
Definition: pns_item.h:63
@ LINE_T
Definition: pns_item.h:64
@ SEGMENT_T
Definition: pns_item.h:66
@ DIFF_PAIR_T
Definition: pns_item.h:69
@ JOINT_T
Definition: pns_item.h:65

Constructor & Destructor Documentation

◆ SEGMENT() [1/3]

PNS::SEGMENT::SEGMENT ( )
inline

Definition at line 41 of file pns_segment.h.

41 :
43 {}
LINKED_ITEM(PnsKind aKind)

Referenced by Clone().

◆ SEGMENT() [2/3]

PNS::SEGMENT::SEGMENT ( const SEG aSeg,
int  aNet 
)
inline

Definition at line 45 of file pns_segment.h.

45 :
47 m_seg( aSeg, 0 )
48 {
49 m_net = aNet;
50 }
int m_net
Definition: pns_item.h:254
SHAPE_SEGMENT m_seg
Definition: pns_segment.h:121

References PNS::ITEM::m_net.

◆ SEGMENT() [3/3]

PNS::SEGMENT::SEGMENT ( const LINE aParentLine,
const SEG aSeg 
)
inline

Definition at line 52 of file pns_segment.h.

52 :
54 m_seg( aSeg, aParentLine.Width() )
55 {
56 m_net = aParentLine.Net();
57 m_layers = aParentLine.Layers();
58 m_marker = aParentLine.Marker();
59 m_rank = aParentLine.Rank();
60 }
LAYER_RANGE m_layers
Definition: pns_item.h:251
int m_marker
Definition: pns_item.h:255
int m_rank
Definition: pns_item.h:256

References PNS::ITEM::Layers(), PNS::ITEM::m_layers, PNS::ITEM::m_marker, PNS::ITEM::m_net, PNS::ITEM::m_rank, PNS::LINE::Marker(), PNS::ITEM::Net(), and PNS::LINE::Rank().

Member Function Documentation

◆ Anchor()

virtual VECTOR2I PNS::SEGMENT::Anchor ( int  n) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 107 of file pns_segment.h.

108 {
109 if( n == 0 )
110 return m_seg.GetSeg().A;
111 else
112 return m_seg.GetSeg().B;
113 }
VECTOR2I A
Definition: seg.h:49
VECTOR2I B
Definition: seg.h:50
const SEG & GetSeg() const

References SEG::A, SEG::B, SHAPE_SEGMENT::GetSeg(), and m_seg.

Referenced by PNS::TOPOLOGY::AssembleDiffPair().

◆ AnchorCount()

virtual int PNS::SEGMENT::AnchorCount ( ) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 115 of file pns_segment.h.

116 {
117 return 2;
118 }

◆ BelongsTo()

bool PNS::ITEM::BelongsTo ( NODE aNode) const
inlineinherited
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 PNS::ITEM::m_owner.

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

◆ ClassOf()

static bool PNS::SEGMENT::ClassOf ( const ITEM aItem)
inlinestatic

Definition at line 62 of file pns_segment.h.

63 {
64 return aItem && SEGMENT_T == aItem->Kind();
65 }

References PNS::ITEM::Kind(), and PNS::ITEM::SEGMENT_T.

◆ CLine()

const SHAPE_LINE_CHAIN PNS::SEGMENT::CLine ( ) const
inline

Definition at line 89 of file pns_segment.h.

90 {
91 return SHAPE_LINE_CHAIN( { m_seg.GetSeg().A, m_seg.GetSeg().B } );
92 }
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...

References SEG::B, SHAPE_SEGMENT::GetSeg(), and m_seg.

◆ Clone()

SEGMENT * PNS::SEGMENT::Clone ( ) const
overridevirtual

Return a deep copy of the item.

Implements PNS::ITEM.

Definition at line 121 of file pns_line.cpp.

122{
123 SEGMENT* s = new SEGMENT;
124
125 s->m_seg = m_seg;
126 s->m_net = m_net;
127 s->m_layers = m_layers;
128 s->m_marker = m_marker;
129 s->m_rank = m_rank;
130
131 return s;
132}

References PNS::ITEM::m_layers, PNS::ITEM::m_marker, PNS::ITEM::m_net, PNS::ITEM::m_rank, m_seg, and SEGMENT().

Referenced by PNS::COMPONENT_DRAGGER::Drag().

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aOther,
const NODE aNode,
bool  aDifferentNetsOnly = true,
int  aOverrideClearance = -1 
) const
inherited

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 157 of file pns_item.cpp.

158{
159 if( collideSimple( aOther, aNode, aDifferentNetsOnly, aOverrideClearance ) )
160 return true;
161
162 // Special cases for "head" lines with vias attached at the end. Note that this does not
163 // support head-line-via to head-line-via collisions, but you can't route two independent
164 // tracks at once so it shouldn't come up.
165
166 if( m_kind == LINE_T )
167 {
168 const LINE* line = static_cast<const LINE*>( this );
169
170 if( line->EndsWithVia() && line->Via().collideSimple( aOther, aNode, aDifferentNetsOnly, aOverrideClearance ) )
171 return true;
172 }
173
174 if( aOther->m_kind == LINE_T )
175 {
176 const LINE* line = static_cast<const LINE*>( aOther );
177
178 if( line->EndsWithVia() && line->Via().collideSimple( this, aNode, aDifferentNetsOnly, aOverrideClearance ) )
179 return true;
180 }
181
182 return false;
183}
PnsKind m_kind
Definition: pns_item.h:247
bool collideSimple(const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly, int aOverrideClearance) const
Definition: pns_item.cpp:32

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

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

◆ collideSimple()

bool PNS::ITEM::collideSimple ( const ITEM aOther,
const NODE aNode,
bool  aDifferentNetsOnly,
int  aOverrideClearance 
) const
privateinherited

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 bool thisNotFlashed = !iface->IsFlashedOnLayer( this, aOther->Layer() );
92 bool otherNotFlashed = !iface->IsFlashedOnLayer( aOther, Layer() );
93
94 if( ( aNode->GetCollisionQueryScope() == NODE::CQS_ALL_RULES
95 || ( thisNotFlashed || otherNotFlashed ) )
96 && ( holeA || holeB ) )
97 {
98 int holeClearance = aNode->GetHoleClearance( this, aOther );
99
100 if( holeClearance >= 0 && holeA && holeA->Collide( shapeB, holeClearance + lineWidthB ) )
101 {
102 Mark( Marker() | MK_HOLE );
103 return true;
104 }
105
106 if( holeB && holeClearance >= 0 && holeB->Collide( shapeA, holeClearance + lineWidthA ) )
107 {
108 aOther->Mark( aOther->Marker() | MK_HOLE );
109 return true;
110 }
111
112 if( holeA && holeB )
113 {
114 int holeToHoleClearance = aNode->GetHoleToHoleClearance( this, aOther );
115
116 if( holeToHoleClearance >= 0 && holeA->Collide( holeB, holeToHoleClearance ) )
117 {
118 Mark( Marker() | MK_HOLE );
119 aOther->Mark( aOther->Marker() | MK_HOLE );
120 return true;
121 }
122 }
123 }
124
125 if( !aOther->Layers().IsMultilayer() && thisNotFlashed )
126 return false;
127
128 if( !Layers().IsMultilayer() && otherNotFlashed )
129 return false;
130
131 int clearance = aOverrideClearance >= 0 ? aOverrideClearance : aNode->GetClearance( this, aOther );
132
133 if( clearance >= 0 )
134 {
135 if( m_parent && m_parent->GetLayer() == Edge_Cuts )
136 {
137 int actual;
138 VECTOR2I pos;
139
140 if( shapeA->Collide( shapeB, clearance + lineWidthA, &actual, &pos )
141 && !aNode->QueryEdgeExclusions( pos ) )
142 {
143 return true;
144 }
145 }
146 else
147 {
148 if( shapeA->Collide( shapeB, clearance + lineWidthA + lineWidthB ) )
149 return true;
150 }
151 }
152
153 return false;
154}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:53
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:170
BOARD_ITEM_CONTAINER * GetParentFootprint() const
Definition: board_item.cpp:217
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:67
BOARD_ITEM * Parent() const
Definition: pns_item.h:149
virtual const SHAPE * Hole() const
Definition: pns_item.h:205
virtual int Layer() const
Definition: pns_item.h:158
virtual const SHAPE * Shape() const
Return the geometrical shape of the item.
Definition: pns_item.h:200
const LAYER_RANGE & Layers() const
Definition: pns_item.h:154
virtual void Mark(int aMarker) const
Definition: pns_item.h:210
virtual int Marker() const
Definition: pns_item.h:212
BOARD_ITEM * m_parent
Definition: pns_item.h:249
@ CQS_ALL_RULES
check all rules
Definition: pns_node.h:156
ROUTER_IFACE * GetInterface() const
Definition: pns_router.h:208
static ROUTER * GetInstance()
Definition: pns_router.cpp:78
An abstract shape on 2D plane.
Definition: shape.h:123
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:178
Handle a list of polygons defining a copper zone.
Definition: zone.h:58
bool GetDoNotAllowVias() const
Definition: zone.h:716
bool GetDoNotAllowPads() const
Definition: zone.h:718
bool GetDoNotAllowTracks() const
Definition: zone.h:717
bool GetDoNotAllowFootprints() const
Definition: zone.h:719
@ Edge_Cuts
Definition: layer_ids.h:113
@ MK_HOLE
Definition: pns_item.h:45
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ EOT
search types array terminator (End Of Types)
Definition: typeinfo.h:81
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:104
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:89
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:105
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:103

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

Referenced by PNS::ITEM::Collide().

◆ Hole()

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

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

Definition at line 205 of file pns_item.h.

206 {
207 return nullptr;
208 }

Referenced by PNS::ITEM::collideSimple(), PNS::VIA::PushoutForce(), ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM(), and ROUTER_PREVIEW_ITEM::Update().

◆ HoleHull()

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

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

Definition at line 121 of file pns_item.h.

123 {
124 return SHAPE_LINE_CHAIN();
125 }

◆ Hull()

const SHAPE_LINE_CHAIN PNS::SEGMENT::Hull ( int  aClearance,
int  aWalkaroundThickness,
int  aLayer = -1 
) const
overridevirtual

Reimplemented from PNS::ITEM.

Definition at line 531 of file pns_line.cpp.

532{
533 return SegmentHull( m_seg, aClearance, aWalkaroundThickness );
534}
const SHAPE_LINE_CHAIN SegmentHull(const SHAPE_SEGMENT &aSeg, int aClearance, int aWalkaroundThickness)
Definition: pns_utils.cpp:169

References m_seg, and PNS::SegmentHull().

Referenced by PNS::SHOVE::ShoveObstacleLine().

◆ IsCompoundShapePrimitive()

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

Definition at line 241 of file pns_item.h.

bool m_isCompoundShapePrimitive
Definition: pns_item.h:259

References PNS::ITEM::m_isCompoundShapePrimitive.

◆ IsLocked()

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

Definition at line 227 of file pns_item.h.

228 {
229 return Marker() & MK_LOCKED;
230 }
@ MK_LOCKED
Definition: pns_item.h:43

References PNS::ITEM::Marker(), and PNS::MK_LOCKED.

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

◆ IsRoutable()

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

Definition at line 233 of file pns_item.h.

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

References PNS::ITEM::m_routable.

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

◆ IsVirtual()

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

◆ Kind()

◆ KindStr()

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

Returns the kind of the item, as string.

Definition at line 186 of file pns_item.cpp.

187{
188 switch( m_kind )
189 {
190 case ARC_T: return "arc";
191 case LINE_T: return "line";
192 case SEGMENT_T: return "segment";
193 case VIA_T: return "via";
194 case JOINT_T: return "joint";
195 case SOLID_T: return "solid";
196 case DIFF_PAIR_T: return "diff-pair";
197 default: return "unknown";
198 }
199}

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

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

◆ Layer()

◆ Layers()

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

Definition at line 154 of file pns_item.h.

154{ return m_layers; }

References PNS::ITEM::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(), PNS::ITEM::collideSimple(), PNS::DP_MEANDER_PLACER::CurrentLayer(), PNS::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_BASE::IsFlashedOnLayer(), PNS::ITEM::Layer(), PNS::ITEM::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_LOG_PLAYER::ReplayLog(), 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
inlineinherited

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 }

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

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

◆ Mark()

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

Reimplemented in PNS::LINE.

Definition at line 210 of file pns_item.h.

210{ m_marker = aMarker; }

References PNS::ITEM::m_marker.

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

◆ Marker()

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

◆ Net()

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

Definition at line 152 of file pns_item.h.

152{ return m_net; }

References PNS::ITEM::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::AssembleCluster(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::LINE_PLACER::buildInitialLine(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS::VIA::Clone(), PNS::DRAGGER::CurrentNets(), PNS::MEANDER_PLACER::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(), PNS::MEANDER_SKEW_PLACER::origPathLength(), 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(), SEGMENT(), PNS::SHOVE::ShoveObstacleLine(), PNS::DIFF_PAIR_PLACER::Start(), PNS::LINE_PLACER::Start(), PNS::MEANDER_SKEW_PLACER::Start(), ROUTER_TOOL::UpdateMessagePanel(), and PNS::VIA::VIA().

◆ OfKind()

◆ Owner()

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

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; }

References PNS::ITEM::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
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 215 of file pns_item.h.

215{ return m_rank; }

References PNS::ITEM::m_rank.

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

◆ Seg()

◆ SetEnds()

void PNS::SEGMENT::SetEnds ( const VECTOR2I a,
const VECTOR2I b 
)
inline

Definition at line 94 of file pns_segment.h.

95 {
96 m_seg.SetSeg( SEG ( a, b ) );
97 }
Definition: seg.h:42
void SetSeg(const SEG &aSeg)

References m_seg, and SHAPE_SEGMENT::SetSeg().

◆ SetIsCompoundShapePrimitive()

void PNS::ITEM::SetIsCompoundShapePrimitive ( )
inlineinherited

Definition at line 240 of file pns_item.h.

References PNS::ITEM::m_isCompoundShapePrimitive.

◆ SetLayer()

◆ SetLayers()

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

Definition at line 155 of file pns_item.h.

155{ m_layers = aLayers; }

References PNS::ITEM::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)
inlineinherited

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; }

References PNS::ITEM::m_owner.

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

◆ SetParent()

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

Definition at line 148 of file pns_item.h.

148{ m_parent = aParent; }

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ SetRank()

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

Reimplemented in PNS::LINE.

Definition at line 214 of file pns_item.h.

214{ m_rank = aRank; }

References PNS::ITEM::m_rank.

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

◆ SetRoutable()

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

Definition at line 232 of file pns_item.h.

232{ m_routable = aRoutable; }

References PNS::ITEM::m_routable.

◆ SetWidth()

void PNS::SEGMENT::SetWidth ( int  aWidth)
inlineoverridevirtual

Reimplemented from PNS::LINKED_ITEM.

Definition at line 74 of file pns_segment.h.

75 {
76 m_seg.SetWidth(aWidth);
77 }
void SetWidth(int aWidth)

References m_seg, and SHAPE_SEGMENT::SetWidth().

Referenced by PNS::LINE_PLACER::FixRoute().

◆ Shape()

const SHAPE * PNS::SEGMENT::Shape ( ) const
inlineoverridevirtual

Return the geometrical shape of the item.

Used for collision detection and spatial indexing.

Reimplemented from PNS::ITEM.

Definition at line 69 of file pns_segment.h.

70 {
71 return static_cast<const SHAPE*>( &m_seg );
72 }

References m_seg.

◆ SwapEnds()

void PNS::SEGMENT::SwapEnds ( )
inline

Definition at line 99 of file pns_segment.h.

100 {
101 SEG tmp = m_seg.GetSeg();
102 m_seg.SetSeg( SEG (tmp.B , tmp.A ) );
103 }

References SEG::A, SEG::B, SHAPE_SEGMENT::GetSeg(), m_seg, and SHAPE_SEGMENT::SetSeg().

◆ Unmark()

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

Reimplemented in PNS::LINE.

Definition at line 211 of file pns_item.h.

211{ m_marker &= ~aMarker; }

References PNS::ITEM::m_marker.

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

◆ Width()

int PNS::SEGMENT::Width ( ) const
inlineoverridevirtual

Member Data Documentation

◆ m_isCompoundShapePrimitive

bool PNS::ITEM::m_isCompoundShapePrimitive
protectedinherited

◆ m_isVirtual

bool PNS::ITEM::m_isVirtual
protectedinherited

◆ m_kind

PnsKind PNS::ITEM::m_kind
protectedinherited

◆ m_layers

◆ m_marker

◆ m_movable

bool PNS::ITEM::m_movable
protectedinherited

◆ m_net

◆ m_owner

NODE* PNS::ITEM::m_owner
protectedinherited

◆ m_parent

BOARD_ITEM* PNS::ITEM::m_parent
protectedinherited

◆ m_rank

◆ m_routable

bool PNS::ITEM::m_routable
protectedinherited

Definition at line 257 of file pns_item.h.

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

◆ m_seg

SHAPE_SEGMENT PNS::SEGMENT::m_seg
private

Definition at line 121 of file pns_segment.h.

Referenced by Anchor(), CLine(), Clone(), Hull(), Seg(), SetEnds(), SetWidth(), Shape(), SwapEnds(), and Width().

◆ UnusedNet

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

Supported item types.

Definition at line 58 of file pns_item.h.

Referenced by PNS::ITEM::ITEM().


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