KiCad PCB EDA Suite
PNS::VIA Class Reference

#include <pns_via.h>

Inheritance diagram for PNS::VIA:
PNS::ITEM

Public Types

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

Supported item types

More...
 

Public Member Functions

 VIA ()
 
 VIA (const VECTOR2I &aPos, const LAYER_RANGE &aLayers, int aDiameter, int aDrill, int aNet=-1, VIATYPE_T aViaType=VIA_THROUGH)
 
 VIA (const VIA &aB)
 
const VECTOR2IPos () const
 
void SetPos (const VECTOR2I &aPos)
 
VIATYPE_T ViaType () const
 
void SetViaType (VIATYPE_T aViaType)
 
int Diameter () const
 
void SetDiameter (int aDiameter)
 
int Drill () const
 
void SetDrill (int aDrill)
 
bool PushoutForce (NODE *aNode, const VECTOR2I &aDirection, VECTOR2I &aForce, bool aSolidsOnly=true, int aMaxIterations=10)
 
const SHAPEShape () const override
 Function Shape() More...
 
VIAClone () const override
 Function Clone() More...
 
const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0) const override
 
virtual VECTOR2I Anchor (int n) const override
 
virtual int AnchorCount () const override
 
OPT_BOX2I ChangedArea (const VIA *aOther) const
 
const VIA_HANDLE MakeHandle () const
 
PnsKind Kind () const
 Function Kind() More...
 
bool OfKind (int aKindMask) const
 Function OfKind() More...
 
std::string KindStr () const
 Function KindStr() More...
 
void SetParent (BOARD_CONNECTED_ITEM *aParent)
 
BOARD_CONNECTED_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
 Function LayersOverlap() More...
 
NODEOwner () const
 Function Owner() More...
 
void SetOwner (NODE *aOwner)
 Functon SetOwner() More...
 
bool BelongsTo (NODE *aNode) const
 Function BelongsTo() More...
 
virtual bool Collide (const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I *aMTV, const NODE *aParentNode, bool aDifferentNetsOnly=true) const
 Function Collide() More...
 
virtual void Mark (int aMarker)
 
virtual void Unmark (int aMarker=-1)
 
virtual int Marker () const
 
virtual void SetRank (int aRank)
 
virtual int Rank () const
 
bool IsLocked () const
 
void SetRoutable (bool aRoutable)
 
bool IsRoutable () const
 

Static Public Member Functions

static bool ClassOf (const ITEM *aItem)
 

Static Public Attributes

static const int UnusedNet = INT_MAX
 

Protected Attributes

PnsKind m_kind
 
BOARD_CONNECTED_ITEMm_parent
 
NODEm_owner
 
LAYER_RANGE m_layers
 
bool m_movable
 
int m_net
 
int m_marker
 
int m_rank
 
bool m_routable
 

Private Attributes

int m_diameter
 
int m_drill
 
VECTOR2I m_pos
 
SHAPE_CIRCLE m_shape
 
VIATYPE_T m_viaType
 

Detailed Description

Definition at line 47 of file pns_via.h.

Member Enumeration Documentation

◆ PnsKind

enum PNS::ITEM::PnsKind
inherited

Supported item types

Enumerator
SOLID_T 
LINE_T 
JOINT_T 
SEGMENT_T 
VIA_T 
DIFF_PAIR_T 
ANY_T 

Definition at line 59 of file pns_item.h.

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

Constructor & Destructor Documentation

◆ VIA() [1/3]

PNS::VIA::VIA ( )
inline

Definition at line 50 of file pns_via.h.

50  :
51  ITEM( VIA_T )
52  {
53  m_diameter = 2; // Dummy value
54  m_drill = 0;
56  }
VIATYPE_T m_viaType
Definition: pns_via.h:175
ITEM(PnsKind aKind)
Definition: pns_item.h:70
int m_drill
Definition: pns_via.h:172
int m_diameter
Definition: pns_via.h:171

References m_diameter, m_drill, m_viaType, and VIA_THROUGH.

Referenced by Clone().

◆ VIA() [2/3]

PNS::VIA::VIA ( const VECTOR2I aPos,
const LAYER_RANGE aLayers,
int  aDiameter,
int  aDrill,
int  aNet = -1,
VIATYPE_T  aViaType = VIA_THROUGH 
)
inline

Definition at line 58 of file pns_via.h.

59  :
60  ITEM( VIA_T )
61  {
62  SetNet( aNet );
63  SetLayers( aLayers );
64  m_pos = aPos;
65  m_diameter = aDiameter;
66  m_drill = aDrill;
67  m_shape = SHAPE_CIRCLE( aPos, aDiameter / 2 );
68  m_viaType = aViaType;
69 
70  //If we're a through-board via, use all layers regardless of the set passed
71  if( aViaType == VIA_THROUGH )
72  {
73  LAYER_RANGE allLayers( 0, MAX_CU_LAYERS - 1 );
74  SetLayers( allLayers );
75  }
76  }
VIATYPE_T m_viaType
Definition: pns_via.h:175
ITEM(PnsKind aKind)
Definition: pns_item.h:70
int m_drill
Definition: pns_via.h:172
void SetNet(int aNet)
Definition: pns_item.h:147
VECTOR2I m_pos
Definition: pns_via.h:173
int m_diameter
Definition: pns_via.h:171
SHAPE_CIRCLE m_shape
Definition: pns_via.h:174
void SetLayers(const LAYER_RANGE &aLayers)
Definition: pns_item.h:151
Class LAYER_RANGE.
Definition: pns_layerset.h:32

References m_diameter, m_drill, m_pos, m_shape, m_viaType, MAX_CU_LAYERS, PNS::ITEM::SetLayers(), PNS::ITEM::SetNet(), and VIA_THROUGH.

◆ VIA() [3/3]

PNS::VIA::VIA ( const VIA aB)
inline

Definition at line 79 of file pns_via.h.

79  :
80  ITEM( aB )
81  {
82  SetNet( aB.Net() );
83  SetLayers( aB.Layers() );
84  m_pos = aB.m_pos;
85  m_diameter = aB.m_diameter;
87  m_marker = aB.m_marker;
88  m_rank = aB.m_rank;
89  m_drill = aB.m_drill;
90  m_viaType = aB.m_viaType;
91  }
VIATYPE_T m_viaType
Definition: pns_via.h:175
int m_rank
Definition: pns_item.h:257
ITEM(PnsKind aKind)
Definition: pns_item.h:70
int m_drill
Definition: pns_via.h:172
int m_marker
Definition: pns_item.h:256
void SetNet(int aNet)
Definition: pns_item.h:147
VECTOR2I m_pos
Definition: pns_via.h:173
int m_diameter
Definition: pns_via.h:171
SHAPE_CIRCLE m_shape
Definition: pns_via.h:174
void SetLayers(const LAYER_RANGE &aLayers)
Definition: pns_item.h:151

References PNS::ITEM::Layers(), m_diameter, m_drill, PNS::ITEM::m_marker, m_pos, PNS::ITEM::m_rank, m_shape, m_viaType, PNS::ITEM::Net(), PNS::ITEM::SetLayers(), and PNS::ITEM::SetNet().

Member Function Documentation

◆ Anchor()

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

Reimplemented from PNS::ITEM.

Definition at line 156 of file pns_via.h.

157  {
158  return m_pos;
159  }
VECTOR2I m_pos
Definition: pns_via.h:173

References m_pos.

◆ AnchorCount()

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

Reimplemented from PNS::ITEM.

Definition at line 161 of file pns_via.h.

162  {
163  return 1;
164  }

◆ BelongsTo()

bool PNS::ITEM::BelongsTo ( NODE aNode) const
inlineinherited

Function BelongsTo()

Returns
true if the item is owned by the node aNode.

Definition at line 186 of file pns_item.h.

187  {
188  return m_owner == aNode;
189  }
NODE * m_owner
Definition: pns_item.h:251

References PNS::ITEM::m_owner.

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

◆ ChangedArea()

OPT_BOX2I VIA::ChangedArea ( const VIA aOther) const

Definition at line 103 of file pns_via.cpp.

104 {
105  if ( aOther->Pos() != Pos() )
106  {
107  BOX2I tmp = Shape()->BBox();
108  tmp.Merge( aOther->Shape()->BBox() );
109  return tmp;
110  }
111 
112  return OPT_BOX2I();
113 }
const SHAPE * Shape() const override
Function Shape()
Definition: pns_via.h:147
const VECTOR2I & Pos() const
Definition: pns_via.h:99
virtual const BOX2I BBox(int aClearance=0) const =0
Function BBox()
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
Definition: box2.h:384
OPT< BOX2I > OPT_BOX2I
Definition: box2.h:523

References SHAPE::BBox(), BOX2< Vec >::Merge(), Pos(), and Shape().

Referenced by PNS::ChangedArea().

◆ ClassOf()

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

Definition at line 93 of file pns_via.h.

94  {
95  return aItem && VIA_T == aItem->Kind();
96  }

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

◆ Clone()

VIA * VIA::Clone ( ) const
overridevirtual

Function Clone()

Returns a deep copy of the item

Implements PNS::ITEM.

Definition at line 84 of file pns_via.cpp.

85 {
86  VIA* v = new VIA();
87 
88  v->SetNet( Net() );
89  v->SetLayers( Layers() );
90  v->m_pos = m_pos;
91  v->m_diameter = m_diameter;
92  v->m_drill = m_drill;
93  v->m_shape = SHAPE_CIRCLE( m_pos, m_diameter / 2 );
94  v->m_rank = m_rank;
95  v->m_marker = m_marker;
96  v->m_viaType = m_viaType;
97  v->m_parent = m_parent;
98 
99  return v;
100 }
VIA()
Definition: pns_via.h:50
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:250
VIATYPE_T m_viaType
Definition: pns_via.h:175
int m_rank
Definition: pns_item.h:257
int m_drill
Definition: pns_via.h:172
int m_marker
Definition: pns_item.h:256
VECTOR2I m_pos
Definition: pns_via.h:173
int m_diameter
Definition: pns_via.h:171
int Net() const
Definition: pns_item.h:148
void SetNet(NETINFO_ITEM *aNetInfo)
Function SetNet Sets a NET_INFO object for the item.
const LAYER_RANGE & Layers() const
Definition: pns_item.h:150

References PNS::ITEM::Layers(), m_diameter, m_drill, PNS::ITEM::m_marker, PNS::ITEM::m_parent, m_pos, PNS::ITEM::m_rank, m_shape, m_viaType, PNS::ITEM::Net(), PNS::ITEM::SetLayers(), PNS::ITEM::SetNet(), and VIA().

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aNeedMTV,
VECTOR2I aMTV,
const NODE aParentNode,
bool  aDifferentNetsOnly = true 
) const
virtualinherited

Function Collide()

Checks for a collision (clearance violation) with between us and item aOther. Collision checking takes all PCB stuff into accound (layers, nets, DRC rules). Optionally returns a minimum translation vector for force propagation algorithm.

Parameters
aOtheritem to check collision against
aClearancedesired clearance
aNeedMTVwhen true, the minimum translation vector is calculated
aMTVthe minimum translation vector
Returns
true, if a collision was found.

Definition at line 48 of file pns_item.cpp.

50 {
51  if( collideSimple( aOther, aClearance, aNeedMTV, aMTV, aParentNode, aDifferentNetsOnly ) )
52  return true;
53 
54  // special case for "head" line with a via attached at the end.
55  if( aOther->m_kind == LINE_T )
56  {
57  const LINE* line = static_cast<const LINE*>( aOther );
58  int clearance = aClearance - line->Width() / 2;
59 
60  if( line->EndsWithVia() )
61  {
62  return collideSimple( &line->Via(), clearance, aNeedMTV, aMTV, aParentNode,
63  aDifferentNetsOnly );
64  }
65  }
66 
67  return false;
68 }
bool collideSimple(const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I *aMTV, const NODE *aParentNode, bool aDifferentNetsOnly) const
Definition: pns_item.cpp:30

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

Referenced by PNS::NODE::CheckColliding(), PNS::OPTIMIZER::CACHE_VISITOR::operator()(), and PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()().

◆ Diameter()

int PNS::VIA::Diameter ( ) const
inline

Definition at line 120 of file pns_via.h.

121  {
122  return m_diameter;
123  }
int m_diameter
Definition: pns_via.h:171

References m_diameter.

Referenced by PNS_KICAD_IFACE::AddItem(), PNS::LINE::LINE(), and PNS::DIFF_PAIR_PLACER::propagateDpHeadForces().

◆ Drill()

int PNS::VIA::Drill ( ) const
inline

Definition at line 131 of file pns_via.h.

132  {
133  return m_drill;
134  }
int m_drill
Definition: pns_via.h:172

References m_drill.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ Hull()

const SHAPE_LINE_CHAIN VIA::Hull ( int  aClearance = 0,
int  aWalkaroundThickness = 0 
) const
overridevirtual

Reimplemented from PNS::ITEM.

Definition at line 74 of file pns_via.cpp.

75 {
76  int cl = ( aClearance + aWalkaroundThickness / 2 );
77 
78  return OctagonalHull( m_pos -
80  cl + 1, ( 2 * cl + m_diameter ) * 0.26 );
81 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
VECTOR2I m_pos
Definition: pns_via.h:173
int m_diameter
Definition: pns_via.h:171
const SHAPE_LINE_CHAIN OctagonalHull(const VECTOR2I &aP0, const VECTOR2I &aSize, int aClearance, int aChamfer)
Various utility functions.
Definition: pns_utils.cpp:33

References m_diameter, m_pos, and PNS::OctagonalHull().

Referenced by PNS::NODE::NearestObstacle(), PNS::SHOVE::ProcessSingleLine(), and PNS::SHOVE::walkaroundLoneVia().

◆ IsLocked()

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

Definition at line 235 of file pns_item.h.

236  {
237  return Marker() & MK_LOCKED;
238  }
virtual int Marker() const
Definition: pns_item.h:220

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

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

◆ IsRoutable()

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

Definition at line 241 of file pns_item.h.

241 { return m_routable; }
bool m_routable
Definition: pns_item.h:258

References PNS::ITEM::m_routable.

◆ Kind()

◆ KindStr()

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

Function KindStr()

Returns the kind of the item, as string

Definition at line 71 of file pns_item.cpp.

72 {
73  switch( m_kind )
74  {
75  case LINE_T: return "line";
76  case SEGMENT_T: return "segment";
77  case VIA_T: return "via";
78  case JOINT_T: return "joint";
79  case SOLID_T: return "solid";
80  default: return "unknown";
81  }
82 }
PnsKind m_kind
Definition: pns_item.h:248

References 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()

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

Reimplemented in PNS::SEGMENT.

Definition at line 154 of file pns_item.h.

154 { return Layers().Start(); }
int Start() const
Definition: pns_layerset.h:83
const LAYER_RANGE & Layers() const
Definition: pns_item.h:150

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

Referenced by PNS::OPTIMIZER::fanoutCleanup(), and PNS::OPTIMIZER::runSmartPads().

◆ Layers()

◆ LayersOverlap()

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

Function LayersOverlap()

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

Definition at line 162 of file pns_item.h.

163  {
164  return Layers().Overlaps( aOther->Layers() );
165  }
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:68
const LAYER_RANGE & Layers() const
Definition: pns_item.h:150

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

Referenced by PNS::SHOVE::onCollidingSegment(), PNS::SHOVE::ProcessSingleLine(), and PNS::NODE::removeViaIndex().

◆ MakeHandle()

const VIA_HANDLE VIA::MakeHandle ( ) const

Definition at line 115 of file pns_via.cpp.

116 {
117  VIA_HANDLE h;
118  h.pos = Pos();
119  h.layers = Layers();
120  h.net = Net();
121  h.valid = true;
122  return h;
123 }
const VECTOR2I & Pos() const
Definition: pns_via.h:99
int Net() const
Definition: pns_item.h:148
const LAYER_RANGE & Layers() const
Definition: pns_item.h:150

References PNS::VIA_HANDLE::layers, PNS::ITEM::Layers(), PNS::VIA_HANDLE::net, PNS::ITEM::Net(), PNS::VIA_HANDLE::pos, Pos(), and PNS::VIA_HANDLE::valid.

Referenced by PNS::SHOVE::pushSpringback(), PNS::SHOVE::ShoveDraggingVia(), and PNS::DRAGGER::startDragVia().

◆ Mark()

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

Reimplemented in PNS::LINE.

Definition at line 218 of file pns_item.h.

218 { m_marker = aMarker; }
int m_marker
Definition: pns_item.h:256

References PNS::ITEM::m_marker.

◆ Marker()

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

Reimplemented in PNS::LINE.

Definition at line 220 of file pns_item.h.

220 { return m_marker; }
int m_marker
Definition: pns_item.h:256

References PNS::ITEM::m_marker.

Referenced by PNS::ITEM::IsLocked(), PNS::LOGGER::Log(), PNS::SHOVE::pushOrShoveVia(), and ROUTER_PREVIEW_ITEM::Update().

◆ Net()

◆ OfKind()

◆ Owner()

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

Function Owner()

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

Definition at line 172 of file pns_item.h.

172 { return m_owner; }
NODE * m_owner
Definition: pns_item.h:251

References PNS::ITEM::m_owner.

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

◆ Parent()

◆ Pos()

◆ PushoutForce()

bool VIA::PushoutForce ( NODE aNode,
const VECTOR2I aDirection,
VECTOR2I aForce,
bool  aSolidsOnly = true,
int  aMaxIterations = 10 
)

Definition at line 31 of file pns_via.cpp.

33 {
34  int iter = 0;
35  VIA mv( *this );
36  VECTOR2I force, totalForce, force2;
37 
38  while( iter < aMaxIterations )
39  {
40  NODE::OPT_OBSTACLE obs = aNode->CheckColliding( &mv,
41  aSolidsOnly ? ITEM::SOLID_T : ITEM::ANY_T );
42 
43  if( !obs )
44  break;
45 
46  int clearance = aNode->GetClearance( obs->m_item, &mv );
47 
48  if( iter > aMaxIterations / 2 )
49  {
50  VECTOR2I l = aDirection.Resize( m_diameter / 2 );
51  totalForce += l;
52  mv.SetPos( mv.Pos() + l );
53  }
54 
55  bool col = CollideShapes( obs->m_item->Shape(), mv.Shape(), clearance, true, force2 );
56 
57  if( col ) {
58  totalForce += force2;
59  mv.SetPos( mv.Pos() + force2 );
60  }
61 
62  iter++;
63  }
64 
65  if( iter == aMaxIterations )
66  return false;
67 
68  aForce = totalForce;
69 
70  return true;
71 }
int m_diameter
Definition: pns_via.h:171
VECTOR2< T > Resize(T aNewLength) const
Function Resize returns a vector of the same direction, but length specified in aNewLength.
Definition: vector2d.h:385
OPT< OBSTACLE > OPT_OBSTACLE
Definition: pns_node.h:143
bool CollideShapes(const SHAPE *aA, const SHAPE *aB, int aClearance, bool aNeedMTV, VECTOR2I &aMTV)

References PNS::ITEM::ANY_T, PNS::NODE::CheckColliding(), CollideShapes(), PNS::NODE::GetClearance(), m_diameter, Pos(), VECTOR2< T >::Resize(), SetPos(), Shape(), and PNS::ITEM::SOLID_T.

Referenced by PNS::LINE_PLACER::buildInitialLine(), and PNS::DIFF_PAIR_PLACER::propagateDpHeadForces().

◆ Rank()

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

Reimplemented in PNS::LINE.

Definition at line 223 of file pns_item.h.

223 { return m_rank; }
int m_rank
Definition: pns_item.h:257

References PNS::ITEM::m_rank.

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

◆ SetDiameter()

void PNS::VIA::SetDiameter ( int  aDiameter)
inline

Definition at line 125 of file pns_via.h.

126  {
127  m_diameter = aDiameter;
129  }
int m_diameter
Definition: pns_via.h:171
SHAPE_CIRCLE m_shape
Definition: pns_via.h:174
void SetRadius(int aRadius)
Definition: shape_circle.h:69

References m_diameter, m_shape, and SHAPE_CIRCLE::SetRadius().

Referenced by PNS::DIFF_PAIR_PLACER::propagateDpHeadForces().

◆ SetDrill()

void PNS::VIA::SetDrill ( int  aDrill)
inline

Definition at line 136 of file pns_via.h.

137  {
138  m_drill = aDrill;
139  }
int m_drill
Definition: pns_via.h:172

References m_drill.

◆ SetLayer()

void PNS::ITEM::SetLayer ( int  aLayer)
inlineinherited

◆ SetLayers()

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

Definition at line 151 of file pns_item.h.

151 { m_layers = aLayers; }
LAYER_RANGE m_layers
Definition: pns_item.h:252

References PNS::ITEM::m_layers.

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

◆ SetNet()

◆ SetOwner()

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

Functon SetOwner()

Sets the node that owns this item. An item can belong to a single NODE or be unowned.

Definition at line 179 of file pns_item.h.

179 { m_owner = aOwner; }
NODE * m_owner
Definition: pns_item.h:251

References PNS::ITEM::m_owner.

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

◆ SetParent()

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

Definition at line 144 of file pns_item.h.

144 { m_parent = aParent; }
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:250

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ SetPos()

void PNS::VIA::SetPos ( const VECTOR2I aPos)
inline

Definition at line 104 of file pns_via.h.

105  {
106  m_pos = aPos;
107  m_shape.SetCenter( aPos );
108  }
void SetCenter(const VECTOR2I &aCenter)
Definition: shape_circle.h:74
VECTOR2I m_pos
Definition: pns_via.h:173
SHAPE_CIRCLE m_shape
Definition: pns_via.h:174

References m_pos, m_shape, and SHAPE_CIRCLE::SetCenter().

Referenced by PNS::LINE_PLACER::buildInitialLine(), PushoutForce(), PNS::SHOVE::ShoveDraggingVia(), and PNS::SHOVE::ShoveLines().

◆ SetRank()

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

Reimplemented in PNS::LINE.

Definition at line 222 of file pns_item.h.

222 { m_rank = aRank; }
int m_rank
Definition: pns_item.h:257

References PNS::ITEM::m_rank.

◆ SetRoutable()

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

Definition at line 240 of file pns_item.h.

240 { m_routable = aRoutable; }
bool m_routable
Definition: pns_item.h:258

References PNS::ITEM::m_routable.

◆ SetViaType()

void PNS::VIA::SetViaType ( VIATYPE_T  aViaType)
inline

Definition at line 115 of file pns_via.h.

116  {
117  m_viaType = aViaType;
118  }
VIATYPE_T m_viaType
Definition: pns_via.h:175

References m_viaType.

◆ Shape()

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

Function Shape()

Returns the geometrical shape of the item. Used for collision detection & spatial indexing.

Reimplemented from PNS::ITEM.

Definition at line 147 of file pns_via.h.

148  {
149  return &m_shape;
150  }
SHAPE_CIRCLE m_shape
Definition: pns_via.h:174

References m_shape.

Referenced by ChangedArea(), PNS::OPTIMIZER::computeBreakouts(), PNS::SHOVE::onCollidingVia(), and PushoutForce().

◆ Unmark()

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

Reimplemented in PNS::LINE.

Definition at line 219 of file pns_item.h.

219 { m_marker &= ~aMarker; }
int m_marker
Definition: pns_item.h:256

References PNS::ITEM::m_marker.

Referenced by PNS::DRAGGER::Start().

◆ ViaType()

VIATYPE_T PNS::VIA::ViaType ( ) const
inline

Definition at line 110 of file pns_via.h.

111  {
112  return m_viaType;
113  }
VIATYPE_T m_viaType
Definition: pns_via.h:175

References m_viaType.

Referenced by PNS_KICAD_IFACE::AddItem().

Member Data Documentation

◆ m_diameter

int PNS::VIA::m_diameter
private

Definition at line 171 of file pns_via.h.

Referenced by Clone(), Diameter(), Hull(), PushoutForce(), SetDiameter(), and VIA().

◆ m_drill

int PNS::VIA::m_drill
private

Definition at line 172 of file pns_via.h.

Referenced by Clone(), Drill(), SetDrill(), and VIA().

◆ 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_CONNECTED_ITEM* PNS::ITEM::m_parent
protectedinherited

Definition at line 250 of file pns_item.h.

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

◆ m_pos

VECTOR2I PNS::VIA::m_pos
private

Definition at line 173 of file pns_via.h.

Referenced by Anchor(), Clone(), Hull(), Pos(), SetPos(), and VIA().

◆ m_rank

◆ m_routable

bool PNS::ITEM::m_routable
protectedinherited

Definition at line 258 of file pns_item.h.

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

◆ m_shape

SHAPE_CIRCLE PNS::VIA::m_shape
private

Definition at line 174 of file pns_via.h.

Referenced by Clone(), SetDiameter(), SetPos(), Shape(), and VIA().

◆ m_viaType

VIATYPE_T PNS::VIA::m_viaType
private

Definition at line 175 of file pns_via.h.

Referenced by Clone(), SetViaType(), VIA(), and ViaType().

◆ UnusedNet

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

Definition at line 56 of file pns_item.h.

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


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