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,
  ARC_T = 16, VIA_T = 32, DIFF_PAIR_T = 64, 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 aViaType=VIATYPE::THROUGH)
 
 VIA (const VIA &aB)
 
const VECTOR2IPos () const
 
void SetPos (const VECTOR2I &aPos)
 
VIATYPE ViaType () const
 
void SetViaType (VIATYPE 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 m_viaType
 

Detailed Description

Definition at line 48 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 
ARC_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  ARC_T = 16,
66  VIA_T = 32,
67  DIFF_PAIR_T = 64,
68  ANY_T = 0xff
69  };

Constructor & Destructor Documentation

◆ VIA() [1/3]

PNS::VIA::VIA ( )
inline

Definition at line 51 of file pns_via.h.

51  :
52  ITEM( VIA_T )
53  {
54  m_diameter = 2; // Dummy value
55  m_drill = 0;
57  }
ITEM(PnsKind aKind)
Definition: pns_item.h:71
int m_drill
Definition: pns_via.h:173
int m_diameter
Definition: pns_via.h:172
VIATYPE m_viaType
Definition: pns_via.h:176

References m_diameter, m_drill, m_viaType, and 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  aViaType = VIATYPE::THROUGH 
)
inline

Definition at line 59 of file pns_via.h.

61  : ITEM( VIA_T )
62  {
63  SetNet( aNet );
64  SetLayers( aLayers );
65  m_pos = aPos;
66  m_diameter = aDiameter;
67  m_drill = aDrill;
68  m_shape = SHAPE_CIRCLE( aPos, aDiameter / 2 );
69  m_viaType = aViaType;
70 
71  //If we're a through-board via, use all layers regardless of the set passed
72  if( aViaType == VIATYPE::THROUGH )
73  {
74  LAYER_RANGE allLayers( 0, MAX_CU_LAYERS - 1 );
75  SetLayers( allLayers );
76  }
77  }
ITEM(PnsKind aKind)
Definition: pns_item.h:71
int m_drill
Definition: pns_via.h:173
void SetNet(int aNet)
Definition: pns_item.h:148
VECTOR2I m_pos
Definition: pns_via.h:174
int m_diameter
Definition: pns_via.h:172
SHAPE_CIRCLE m_shape
Definition: pns_via.h:175
void SetLayers(const LAYER_RANGE &aLayers)
Definition: pns_item.h:152
VIATYPE m_viaType
Definition: pns_via.h:176
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 THROUGH.

◆ VIA() [3/3]

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

Definition at line 80 of file pns_via.h.

80  :
81  ITEM( aB )
82  {
83  SetNet( aB.Net() );
84  SetLayers( aB.Layers() );
85  m_pos = aB.m_pos;
86  m_diameter = aB.m_diameter;
88  m_marker = aB.m_marker;
89  m_rank = aB.m_rank;
90  m_drill = aB.m_drill;
91  m_viaType = aB.m_viaType;
92  }
int m_rank
Definition: pns_item.h:258
ITEM(PnsKind aKind)
Definition: pns_item.h:71
int m_drill
Definition: pns_via.h:173
int m_marker
Definition: pns_item.h:257
void SetNet(int aNet)
Definition: pns_item.h:148
VECTOR2I m_pos
Definition: pns_via.h:174
int m_diameter
Definition: pns_via.h:172
SHAPE_CIRCLE m_shape
Definition: pns_via.h:175
void SetLayers(const LAYER_RANGE &aLayers)
Definition: pns_item.h:152
VIATYPE m_viaType
Definition: pns_via.h:176

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 157 of file pns_via.h.

158  {
159  return m_pos;
160  }
VECTOR2I m_pos
Definition: pns_via.h:174

References m_pos.

◆ AnchorCount()

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

Reimplemented from PNS::ITEM.

Definition at line 162 of file pns_via.h.

163  {
164  return 1;
165  }

◆ 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 187 of file pns_item.h.

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

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:148
const VECTOR2I & Pos() const
Definition: pns_via.h:100
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:385
OPT< BOX2I > OPT_BOX2I
Definition: box2.h:524

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 94 of file pns_via.h.

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

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:51
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:251
int m_rank
Definition: pns_item.h:258
int m_drill
Definition: pns_via.h:173
int m_marker
Definition: pns_item.h:257
VECTOR2I m_pos
Definition: pns_via.h:174
int m_diameter
Definition: pns_via.h:172
int Net() const
Definition: pns_item.h:149
void SetNet(NETINFO_ITEM *aNetInfo)
Function SetNet Sets a NET_INFO object for the item.
VIATYPE m_viaType
Definition: pns_via.h:176
const LAYER_RANGE & Layers() const
Definition: pns_item.h:151

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 121 of file pns_via.h.

122  {
123  return m_diameter;
124  }
int m_diameter
Definition: pns_via.h:172

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 132 of file pns_via.h.

133  {
134  return m_drill;
135  }
int m_drill
Definition: pns_via.h:173

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:594
VECTOR2I m_pos
Definition: pns_via.h:174
int m_diameter
Definition: pns_via.h:172
const SHAPE_LINE_CHAIN OctagonalHull(const VECTOR2I &aP0, const VECTOR2I &aSize, int aClearance, int aChamfer)
Definition: pns_utils.cpp:35

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 236 of file pns_item.h.

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

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 242 of file pns_item.h.

242 { return m_routable; }
bool m_routable
Definition: pns_item.h:259

References PNS::ITEM::m_routable.

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

◆ 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 ARC_T: return "arc";
76  case LINE_T: return "line";
77  case SEGMENT_T: return "segment";
78  case VIA_T: return "via";
79  case JOINT_T: return "joint";
80  case SOLID_T: return "solid";
81  default: return "unknown";
82  }
83 }
PnsKind m_kind
Definition: pns_item.h:249

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

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

Definition at line 155 of file pns_item.h.

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

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 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:68
const LAYER_RANGE & Layers() const
Definition: pns_item.h:151

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

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

◆ 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:100
int Net() const
Definition: pns_item.h:149
const LAYER_RANGE & Layers() const
Definition: pns_item.h:151

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 219 of file pns_item.h.

219 { m_marker = aMarker; }
int m_marker
Definition: pns_item.h:257

References PNS::ITEM::m_marker.

◆ Marker()

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

Reimplemented in PNS::LINE.

Definition at line 221 of file pns_item.h.

221 { return m_marker; }
int m_marker
Definition: pns_item.h:257

References PNS::ITEM::m_marker.

Referenced by PNS::ARC::ARC(), 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 173 of file pns_item.h.

173 { return m_owner; }
NODE * m_owner
Definition: pns_item.h:252

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 32 of file pns_via.cpp.

34 {
35  int iter = 0;
36  VIA mv( *this );
37  VECTOR2I force, totalForce;
38 
39  while( iter < aMaxIterations )
40  {
41  NODE::OPT_OBSTACLE obs = aNode->CheckColliding( &mv, aSolidsOnly ? ITEM::SOLID_T
42  : ITEM::ANY_T );
43 
44  if( !obs )
45  break;
46 
47  int clearance = aNode->GetClearance( obs->m_item, &mv );
48 
49  if( iter > aMaxIterations / 2 )
50  {
51  VECTOR2I l = aDirection.Resize( m_diameter / 2 );
52  totalForce += l;
53  mv.SetPos( mv.Pos() + l );
54  }
55 
56  if( obs->m_item->Shape()->Collide( mv.Shape(), clearance, &force ) )
57  {
58  totalForce += force;
59  mv.SetPos( mv.Pos() + force );
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:172
VECTOR2< T > Resize(T aNewLength) const
Function Resize returns a vector of the same direction, but length specified in aNewLength.
Definition: vector2d.h:392
OPT< OBSTACLE > OPT_OBSTACLE
Definition: pns_node.h:148

References PNS::ITEM::ANY_T, PNS::NODE::CheckColliding(), 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 224 of file pns_item.h.

224 { return m_rank; }
int m_rank
Definition: pns_item.h:258

References PNS::ITEM::m_rank.

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

◆ SetDiameter()

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

Definition at line 126 of file pns_via.h.

127  {
128  m_diameter = aDiameter;
130  }
int m_diameter
Definition: pns_via.h:172
SHAPE_CIRCLE m_shape
Definition: pns_via.h:175
void SetRadius(int aRadius)
Definition: shape_circle.h:82

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 137 of file pns_via.h.

138  {
139  m_drill = aDrill;
140  }
int m_drill
Definition: pns_via.h:173

References m_drill.

◆ SetLayer()

◆ SetLayers()

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

Definition at line 152 of file pns_item.h.

152 { m_layers = aLayers; }
LAYER_RANGE m_layers
Definition: pns_item.h:253

References PNS::ITEM::m_layers.

Referenced by PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), Clone(), 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 180 of file pns_item.h.

180 { m_owner = aOwner; }
NODE * m_owner
Definition: pns_item.h:252

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 145 of file pns_item.h.

145 { m_parent = aParent; }
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:251

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ SetPos()

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

Definition at line 105 of file pns_via.h.

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

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 223 of file pns_item.h.

223 { m_rank = aRank; }
int m_rank
Definition: pns_item.h:258

References PNS::ITEM::m_rank.

◆ SetRoutable()

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

Definition at line 241 of file pns_item.h.

241 { m_routable = aRoutable; }
bool m_routable
Definition: pns_item.h:259

References PNS::ITEM::m_routable.

◆ SetViaType()

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

Definition at line 116 of file pns_via.h.

117  {
118  m_viaType = aViaType;
119  }
VIATYPE m_viaType
Definition: pns_via.h:176

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 148 of file pns_via.h.

149  {
150  return &m_shape;
151  }
SHAPE_CIRCLE m_shape
Definition: pns_via.h:175

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 220 of file pns_item.h.

220 { m_marker &= ~aMarker; }
int m_marker
Definition: pns_item.h:257

References PNS::ITEM::m_marker.

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

◆ ViaType()

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

Definition at line 111 of file pns_via.h.

112  {
113  return m_viaType;
114  }
VIATYPE m_viaType
Definition: pns_via.h:176

References m_viaType.

Referenced by PNS_KICAD_IFACE::AddItem().

Member Data Documentation

◆ m_diameter

int PNS::VIA::m_diameter
private

Definition at line 172 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 173 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 251 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 174 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 259 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 175 of file pns_via.h.

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

◆ m_viaType

VIATYPE PNS::VIA::m_viaType
private

Definition at line 176 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: