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
 
PnsKind Kind () const
 Function Kind() More...
 
bool OfKind (int aKindMask) const
 Function OfKind() More...
 
const std::string KindStr () const
 Function KindStr() More...
 
void SetParent (BOARD_CONNECTED_ITEM *aParent)
 Function SetParent() More...
 
BOARD_CONNECTED_ITEMParent () const
 Function Parent() More...
 
void SetNet (int aNet)
 Function SetNet() More...
 
int Net () const
 Function Net() More...
 
void SetLayers (const LAYER_RANGE &aLayers)
 Function SetLayers() More...
 
void SetLayer (int aLayer)
 Function SetLayer() More...
 
const LAYER_RANGELayers () const
 Function Layers() More...
 
virtual int Layer () const
 Function Layer() More...
 
bool LayersOverlap (const ITEM *aOther) const
 Function LayersOverlap() More...
 
void SetOwner (NODE *aOwner)
 Functon SetOwner() More...
 
bool BelongsTo (NODE *aNode) const
 Function BelongsTo() More...
 
NODEOwner () const
 Function Owner() More...
 
virtual bool Collide (const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly=true) const
 Function Collide() More...
 
bool Collide (const ITEM *aOther, int aClearance, 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 36 of file pns_via.h.

Member Enumeration Documentation

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

PNS::VIA::VIA ( )
inline

Definition at line 39 of file pns_via.h.

References m_diameter, m_drill, m_viaType, and VIA_THROUGH.

Referenced by Clone().

39  :
40  ITEM( VIA_T )
41  {
42  m_diameter = 2; // Dummy value
43  m_drill = 0;
45  }
VIATYPE_T m_viaType
Definition: pns_via.h:162
ITEM(PnsKind aKind)
Definition: pns_item.h:70
int m_drill
Definition: pns_via.h:159
int m_diameter
Definition: pns_via.h:158
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 47 of file pns_via.h.

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

48  :
49  ITEM( VIA_T )
50  {
51  SetNet( aNet );
52  SetLayers( aLayers );
53  m_pos = aPos;
54  m_diameter = aDiameter;
55  m_drill = aDrill;
56  m_shape = SHAPE_CIRCLE( aPos, aDiameter / 2 );
57  m_viaType = aViaType;
58 
59  //If we're a through-board via, use all layers regardless of the set passed
60  if( aViaType == VIA_THROUGH )
61  {
62  LAYER_RANGE allLayers( 0, MAX_CU_LAYERS - 1 );
63  SetLayers( allLayers );
64  }
65  }
VIATYPE_T m_viaType
Definition: pns_via.h:162
ITEM(PnsKind aKind)
Definition: pns_item.h:70
int m_drill
Definition: pns_via.h:159
void SetNet(int aNet)
Function SetNet()
Definition: pns_item.h:169
VECTOR2I m_pos
Definition: pns_via.h:160
int m_diameter
Definition: pns_via.h:158
SHAPE_CIRCLE m_shape
Definition: pns_via.h:161
void SetLayers(const LAYER_RANGE &aLayers)
Function SetLayers()
Definition: pns_item.h:189
Class LAYER_RANGE.
Definition: pns_layerset.h:32
PNS::VIA::VIA ( const VIA aB)
inline

Definition at line 68 of file pns_via.h.

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

68  :
69  ITEM( VIA_T )
70  {
71  SetNet( aB.Net() );
72  SetLayers( aB.Layers() );
73  m_pos = aB.m_pos;
74  m_diameter = aB.m_diameter;
75  m_shape = SHAPE_CIRCLE( m_pos, m_diameter / 2 );
76  m_marker = aB.m_marker;
77  m_rank = aB.m_rank;
78  m_drill = aB.m_drill;
79  m_viaType = aB.m_viaType;
80  }
VIATYPE_T m_viaType
Definition: pns_via.h:162
int m_rank
Definition: pns_item.h:367
ITEM(PnsKind aKind)
Definition: pns_item.h:70
int m_drill
Definition: pns_via.h:159
int m_marker
Definition: pns_item.h:366
void SetNet(int aNet)
Function SetNet()
Definition: pns_item.h:169
VECTOR2I m_pos
Definition: pns_via.h:160
int m_diameter
Definition: pns_via.h:158
SHAPE_CIRCLE m_shape
Definition: pns_via.h:161
void SetLayers(const LAYER_RANGE &aLayers)
Function SetLayers()
Definition: pns_item.h:189

Member Function Documentation

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

Reimplemented from PNS::ITEM.

Definition at line 145 of file pns_via.h.

References m_pos.

146  {
147  return m_pos;
148  }
VECTOR2I m_pos
Definition: pns_via.h:160
virtual int PNS::VIA::AnchorCount ( ) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 150 of file pns_via.h.

References ChangedArea().

151  {
152  return 1;
153  }
bool PNS::ITEM::BelongsTo ( NODE aNode) const
inlineinherited

Function BelongsTo()

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

Definition at line 251 of file pns_item.h.

References PNS::ITEM::m_owner.

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

252  {
253  return m_owner == aNode;
254  }
NODE * m_owner
Definition: pns_item.h:361
OPT_BOX2I VIA::ChangedArea ( const VIA aOther) const

Definition at line 102 of file pns_via.cpp.

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

Referenced by AnchorCount(), and PNS::ChangedArea().

103 {
104  if ( aOther->Pos() != Pos() )
105  {
106  BOX2I tmp = Shape()->BBox();
107  tmp.Merge( aOther->Shape()->BBox() );
108  return tmp;
109  }
110 
111  return OPT_BOX2I();
112 }
const VECTOR2I & Pos() const
Definition: pns_via.h:88
const SHAPE * Shape() const override
Function Shape()
Definition: pns_via.h:136
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
static bool PNS::VIA::ClassOf ( const ITEM aItem)
inlinestatic

Definition at line 82 of file pns_via.h.

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

83  {
84  return aItem && VIA_T == aItem->Kind();
85  }
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.

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(), PNS::ITEM::SetNet(), and VIA().

Referenced by Shape().

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 
98  return v;
99 }
VIA()
Definition: pns_via.h:39
const LAYER_RANGE & Layers() const
Function Layers()
Definition: pns_item.h:209
VIATYPE_T m_viaType
Definition: pns_via.h:162
int m_rank
Definition: pns_item.h:367
int m_drill
Definition: pns_via.h:159
int m_marker
Definition: pns_item.h:366
VECTOR2I m_pos
Definition: pns_via.h:160
int m_diameter
Definition: pns_via.h:158
void SetNet(NETINFO_ITEM *aNetInfo)
Function SetNet Sets a NET_INFO object for the item.
int Net() const
Function Net()
Definition: pns_item.h:179
bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aNeedMTV,
VECTOR2I aMTV,
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 44 of file pns_item.cpp.

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::ITEM::Collide(), PNS::OPTIMIZER::CACHE_VISITOR::operator()(), PNS::NODE::DEFAULT_OBSTACLE_VISITOR::operator()(), and PNS::ITEM::Owner().

46 {
47  if( collideSimple( aOther, aClearance, aNeedMTV, aMTV, aDifferentNetsOnly ) )
48  return true;
49 
50  // special case for "head" line with a via attached at the end.
51  if( aOther->m_kind == LINE_T )
52  {
53  const LINE* line = static_cast<const LINE*>( aOther );
54 
55  if( line->EndsWithVia() )
56  return collideSimple( &line->Via(), aClearance - line->Width() / 2, aNeedMTV, aMTV, aDifferentNetsOnly );
57  }
58 
59  return false;
60 }
bool collideSimple(const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly) const
Definition: pns_item.cpp:27
bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aDifferentNetsOnly = true 
) const
inlineinherited

Function Collide()

A shortcut for ITEM::Colllide() without MTV stuff.

Definition at line 285 of file pns_item.h.

References PNS::ITEM::Collide(), and dummy().

286  {
287  VECTOR2I dummy;
288 
289  return Collide( aOther, aClearance, false, dummy, aDifferentNetsOnly );
290  }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
virtual bool Collide(const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly=true) const
Function Collide()
Definition: pns_item.cpp:44
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
int PNS::VIA::Diameter ( ) const
inline

Definition at line 109 of file pns_via.h.

References m_diameter.

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

110  {
111  return m_diameter;
112  }
int m_diameter
Definition: pns_via.h:158
int PNS::VIA::Drill ( ) const
inline

Definition at line 120 of file pns_via.h.

References m_drill.

Referenced by PNS_KICAD_IFACE::AddItem().

121  {
122  return m_drill;
123  }
int m_drill
Definition: pns_via.h:159
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.

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

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

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:160
int m_diameter
Definition: pns_via.h:158
const SHAPE_LINE_CHAIN OctagonalHull(const VECTOR2I &aP0, const VECTOR2I &aSize, int aClearance, int aChamfer)
Various utility functions.
Definition: pns_utils.cpp:33
bool PNS::ITEM::IsLocked ( ) const
inlineinherited

Definition at line 338 of file pns_item.h.

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

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

339  {
340  return Marker() & MK_LOCKED;
341  }
virtual int Marker() const
Definition: pns_item.h:313
bool PNS::ITEM::IsRoutable ( ) const
inlineinherited

Definition at line 348 of file pns_item.h.

References PNS::ITEM::collideSimple(), and PNS::ITEM::m_routable.

349  {
350  return m_routable;
351  }
bool m_routable
Definition: pns_item.h:368
const std::string PNS::ITEM::KindStr ( ) const
inherited

Function KindStr()

Returns the kind of the item, as string

Definition at line 63 of file pns_item.cpp.

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::ITEM::OfKind(), PNS::TOOL_BASE::pickSingleItem(), and PNS::TOOL_BASE::updateEndItem().

64 {
65  switch( m_kind )
66  {
67  case LINE_T:
68  return "line";
69 
70  case SEGMENT_T:
71  return "segment";
72 
73  case VIA_T:
74  return "via";
75 
76  case JOINT_T:
77  return "joint";
78 
79  case SOLID_T:
80  return "solid";
81 
82  default:
83  return "unknown";
84  }
85 }
PnsKind m_kind
Definition: pns_item.h:358
virtual int PNS::ITEM::Layer ( ) const
inlinevirtualinherited

Function Layer()

Returns the item's layer, for single-layered items only.

Reimplemented in PNS::SEGMENT.

Definition at line 219 of file pns_item.h.

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

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

220  {
221  return Layers().Start();
222  }
const LAYER_RANGE & Layers() const
Function Layers()
Definition: pns_item.h:209
int Start() const
Definition: pns_layerset.h:83
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 230 of file pns_item.h.

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

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

231  {
232  return Layers().Overlaps( aOther->Layers() );
233  }
const LAYER_RANGE & Layers() const
Function Layers()
Definition: pns_item.h:209
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:68
virtual void PNS::ITEM::Mark ( int  aMarker)
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 303 of file pns_item.h.

References PNS::ITEM::m_marker.

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

304  {
305  m_marker = aMarker;
306  }
int m_marker
Definition: pns_item.h:366
virtual int PNS::ITEM::Marker ( ) const
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 313 of file pns_item.h.

References PNS::ITEM::m_marker.

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

314  {
315  return m_marker;
316  }
int m_marker
Definition: pns_item.h:366
NODE* PNS::ITEM::Owner ( ) const
inlineinherited

Function Owner()

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

Definition at line 261 of file pns_item.h.

References PNS::ITEM::Collide(), and PNS::ITEM::m_owner.

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

261 { return m_owner; }
NODE * m_owner
Definition: pns_item.h:361
BOARD_CONNECTED_ITEM* PNS::ITEM::Parent ( ) const
inlineinherited

Function Parent()

Returns the corresponding parent object in the host application's model.

Definition at line 159 of file pns_item.h.

References PNS::ITEM::m_parent.

Referenced by PNS_PCBNEW_RULE_RESOLVER::DpNetPair(), PNS_KICAD_IFACE::HideItem(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), ROUTER_TOOL::prepareInteractive(), and PNS_KICAD_IFACE::RemoveItem().

160  {
161  return m_parent;
162  }
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:360
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.

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(), PNS::DIFF_PAIR_PLACER::propagateDpHeadForces(), and SetDrill().

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 }
VECTOR2< T > Resize(T aNewLength) const
Function Resize returns a vector of the same direction, but length specified in aNewLength.
Definition: vector2d.h:385
int m_diameter
Definition: pns_via.h:158
OPT< OBSTACLE > OPT_OBSTACLE
Definition: pns_node.h:139
bool CollideShapes(const SHAPE *aA, const SHAPE *aB, int aClearance, bool aNeedMTV, VECTOR2I &aMTV)
virtual int PNS::ITEM::Rank ( ) const
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 323 of file pns_item.h.

References PNS::ITEM::m_rank.

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

324  {
325  return m_rank;
326  }
int m_rank
Definition: pns_item.h:367
void PNS::VIA::SetDiameter ( int  aDiameter)
inline

Definition at line 114 of file pns_via.h.

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

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

115  {
116  m_diameter = aDiameter;
118  }
int m_diameter
Definition: pns_via.h:158
SHAPE_CIRCLE m_shape
Definition: pns_via.h:161
void SetRadius(int aRadius)
Definition: shape_circle.h:69
void PNS::VIA::SetDrill ( int  aDrill)
inline

Definition at line 125 of file pns_via.h.

References m_drill, and PushoutForce().

126  {
127  m_drill = aDrill;
128  }
int m_drill
Definition: pns_via.h:159
void PNS::ITEM::SetLayer ( int  aLayer)
inlineinherited

Function SetLayer()

Sets the layers spanned by the item to a single layer aLayer.

Definition at line 199 of file pns_item.h.

References PNS::ITEM::m_layers.

Referenced by PNS::LINE_PLACER::initPlacement(), PNS::DIFF_PAIR_PLACER::propagateDpHeadForces(), PNS::DIFF_PAIR_PLACER::routeHead(), and PNS::DIFF_PAIR::updateLine().

200  {
201  m_layers = LAYER_RANGE( aLayer, aLayer );
202  }
LAYER_RANGE m_layers
Definition: pns_item.h:362
Class LAYER_RANGE.
Definition: pns_layerset.h:32
void PNS::ITEM::SetLayers ( const LAYER_RANGE aLayers)
inlineinherited

Function SetLayers()

Sets the layers spanned by the item to aLayers.

Definition at line 189 of file pns_item.h.

References PNS::ITEM::m_layers.

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

190  {
191  m_layers = aLayers;
192  }
LAYER_RANGE m_layers
Definition: pns_item.h:362
void PNS::ITEM::SetNet ( int  aNet)
inlineinherited
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 stay unowned.

Definition at line 241 of file pns_item.h.

References PNS::ITEM::m_owner.

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

242  {
243  m_owner = aOwner;
244  }
NODE * m_owner
Definition: pns_item.h:361
void PNS::ITEM::SetParent ( BOARD_CONNECTED_ITEM aParent)
inlineinherited

Function SetParent()

Sets the corresponding parent object in the host application's model.

Definition at line 149 of file pns_item.h.

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

150  {
151  m_parent = aParent;
152  }
BOARD_CONNECTED_ITEM * m_parent
Definition: pns_item.h:360
void PNS::VIA::SetPos ( const VECTOR2I aPos)
inline

Definition at line 93 of file pns_via.h.

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

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

94  {
95  m_pos = aPos;
96  m_shape.SetCenter( aPos );
97  }
void SetCenter(const VECTOR2I &aCenter)
Definition: shape_circle.h:74
VECTOR2I m_pos
Definition: pns_via.h:160
SHAPE_CIRCLE m_shape
Definition: pns_via.h:161
virtual void PNS::ITEM::SetRank ( int  aRank)
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 318 of file pns_item.h.

References PNS::ITEM::m_rank.

319  {
320  m_rank = aRank;
321  }
int m_rank
Definition: pns_item.h:367
void PNS::ITEM::SetRoutable ( bool  aRoutable)
inlineinherited

Definition at line 343 of file pns_item.h.

References PNS::ITEM::m_routable.

344  {
345  m_routable = aRoutable;
346  }
bool m_routable
Definition: pns_item.h:368
void PNS::VIA::SetViaType ( VIATYPE_T  aViaType)
inline

Definition at line 104 of file pns_via.h.

References m_viaType.

105  {
106  m_viaType = aViaType;
107  }
VIATYPE_T m_viaType
Definition: pns_via.h:162
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 136 of file pns_via.h.

References Clone(), Hull(), and m_shape.

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

137  {
138  return &m_shape;
139  }
SHAPE_CIRCLE m_shape
Definition: pns_via.h:161
virtual void PNS::ITEM::Unmark ( int  aMarker = -1)
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 308 of file pns_item.h.

References PNS::ITEM::m_marker.

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

309  {
310  m_marker &= ~aMarker;
311  }
int m_marker
Definition: pns_item.h:366
VIATYPE_T PNS::VIA::ViaType ( ) const
inline

Definition at line 99 of file pns_via.h.

References m_viaType.

Referenced by PNS_KICAD_IFACE::AddItem().

100  {
101  return m_viaType;
102  }
VIATYPE_T m_viaType
Definition: pns_via.h:162

Member Data Documentation

int PNS::VIA::m_diameter
private

Definition at line 158 of file pns_via.h.

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

int PNS::VIA::m_drill
private

Definition at line 159 of file pns_via.h.

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

PnsKind PNS::ITEM::m_kind
protectedinherited
bool PNS::ITEM::m_movable
protectedinherited
NODE* PNS::ITEM::m_owner
protectedinherited
BOARD_CONNECTED_ITEM* PNS::ITEM::m_parent
protectedinherited

Definition at line 360 of file pns_item.h.

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

VECTOR2I PNS::VIA::m_pos
private

Definition at line 160 of file pns_via.h.

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

bool PNS::ITEM::m_routable
protectedinherited

Definition at line 368 of file pns_item.h.

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

SHAPE_CIRCLE PNS::VIA::m_shape
private

Definition at line 161 of file pns_via.h.

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

VIATYPE_T PNS::VIA::m_viaType
private

Definition at line 162 of file pns_via.h.

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

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: