KiCad PCB EDA Suite
PNS::SOLID Class Reference

#include <pns_solid.h>

Inheritance diagram for PNS::SOLID:
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

 SOLID ()
 
 ~SOLID ()
 
 SOLID (const SOLID &aSolid)
 
ITEMClone () const override
 Return a deep copy of the item. More...
 
const SHAPEShape () const override
 Return the geometrical shape of the item. More...
 
const SHAPEHole () const override
 
const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const override
 
const SHAPE_LINE_CHAIN HoleHull (int aClearance, int aWalkaroundThickness, int aLayer) const override
 
void SetShape (SHAPE *shape)
 
void SetHole (SHAPE *shape)
 
const VECTOR2IPos () const
 
void SetPos (const VECTOR2I &aCenter)
 
int GetPadToDie () const
 
void SetPadToDie (int aLen)
 
virtual VECTOR2I Anchor (int aN) const override
 
virtual int AnchorCount () const override
 
VECTOR2I Offset () const
 
void SetOffset (const VECTOR2I &aOffset)
 
double GetOrientation () const
 
void SetOrientation (double aOrientation)
 
PnsKind Kind () const
 Return the type (kind) of the item. More...
 
bool OfKind (int aKindMask) const
 Return true if the item's type matches the mask aKindMask. More...
 
std::string KindStr () const
 Returns the kind of the item, as string. More...
 
void SetParent (BOARD_ITEM *aParent)
 
BOARD_ITEMParent () const
 
void SetNet (int aNet)
 
int Net () const
 
const LAYER_RANGELayers () const
 
void SetLayers (const LAYER_RANGE &aLayers)
 
void SetLayer (int aLayer)
 
virtual int Layer () const
 
bool LayersOverlap (const ITEM *aOther) const
 Return true if the set of layers spanned by aOther overlaps our layers. More...
 
NODEOwner () const
 Return the owner of this item, or NULL if there's none. More...
 
void SetOwner (NODE *aOwner)
 Set the node that owns this item. More...
 
bool BelongsTo (NODE *aNode) const
 
bool Collide (const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly=true) const
 Check for a collision (clearance violation) with between us and item aOther. More...
 
virtual 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 Attributes

VECTOR2I m_pos
 
SHAPEm_shape
 
SHAPEm_hole
 
VECTOR2I m_offset
 
int m_padToDie
 
double m_orientation
 

Detailed Description

Definition at line 35 of file pns_solid.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  };

Constructor & Destructor Documentation

◆ SOLID() [1/2]

PNS::SOLID::SOLID ( )
inline

Definition at line 38 of file pns_solid.h.

38  :
39  ITEM( SOLID_T ),
40  m_shape( nullptr ),
41  m_hole( nullptr )
42  {
43  m_movable = false;
44  m_padToDie = 0;
45  m_orientation = 0;
46  }
double m_orientation
Definition: pns_solid.h:129
bool m_movable
Definition: pns_item.h:253
ITEM(PnsKind aKind)
Definition: pns_item.h:73
SHAPE * m_shape
Definition: pns_solid.h:125
int m_padToDie
Definition: pns_solid.h:128
SHAPE * m_hole
Definition: pns_solid.h:126

References PNS::ITEM::m_movable, m_orientation, and m_padToDie.

Referenced by Clone().

◆ ~SOLID()

PNS::SOLID::~SOLID ( )
inline

Definition at line 48 of file pns_solid.h.

49  {
50  delete m_shape;
51  delete m_hole;
52  }
SHAPE * m_shape
Definition: pns_solid.h:125
SHAPE * m_hole
Definition: pns_solid.h:126

References m_hole, and m_shape.

◆ SOLID() [2/2]

PNS::SOLID::SOLID ( const SOLID aSolid)
inline

Definition at line 54 of file pns_solid.h.

54  :
55  ITEM( aSolid )
56  {
57  if( aSolid.m_shape )
58  m_shape = aSolid.m_shape->Clone();
59  else
60  m_shape = nullptr;
61 
62  if( aSolid.m_hole )
63  m_hole = aSolid.m_hole->Clone();
64  else
65  m_hole = nullptr;
66 
67  m_pos = aSolid.m_pos;
68  m_padToDie = aSolid.m_padToDie;
69  m_orientation = aSolid.m_orientation;
70  }
double m_orientation
Definition: pns_solid.h:129
ITEM(PnsKind aKind)
Definition: pns_item.h:73
SHAPE * m_shape
Definition: pns_solid.h:125
int m_padToDie
Definition: pns_solid.h:128
virtual SHAPE * Clone() const
Return a dynamically allocated copy of the shape.
Definition: shape.h:139
SHAPE * m_hole
Definition: pns_solid.h:126
VECTOR2I m_pos
Definition: pns_solid.h:124

References SHAPE::Clone(), m_hole, m_orientation, m_padToDie, m_pos, and m_shape.

Member Function Documentation

◆ Anchor()

virtual VECTOR2I PNS::SOLID::Anchor ( int  aN) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 107 of file pns_solid.h.

108  {
109  return m_pos;
110  }
VECTOR2I m_pos
Definition: pns_solid.h:124

References m_pos.

◆ AnchorCount()

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

Reimplemented from PNS::ITEM.

Definition at line 112 of file pns_solid.h.

113  {
114  return 1;
115  }

◆ 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::SOLID::ClassOf ( const ITEM aItem)
inlinestatic

Definition at line 72 of file pns_solid.h.

73  {
74  return aItem && SOLID_T == aItem->Kind();
75  }

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

◆ Clone()

ITEM * PNS::SOLID::Clone ( ) const
overridevirtual

Return a deep copy of the item.

Implements PNS::ITEM.

Definition at line 155 of file pns_solid.cpp.

156 {
157  ITEM* solid = new SOLID( *this );
158  return solid;
159 }
ITEM(PnsKind aKind)
Definition: pns_item.h:73

References SOLID().

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aOther,
const NODE aNode,
bool  aDifferentNetsOnly = true 
) 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 131 of file pns_item.cpp.

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

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

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

◆ GetOrientation()

double PNS::SOLID::GetOrientation ( ) const
inline

Definition at line 120 of file pns_solid.h.

120 { return m_orientation; }
double m_orientation
Definition: pns_solid.h:129

References m_orientation.

◆ GetPadToDie()

int PNS::SOLID::GetPadToDie ( ) const
inline

Definition at line 104 of file pns_solid.h.

104 { return m_padToDie; }
int m_padToDie
Definition: pns_solid.h:128

References m_padToDie.

Referenced by PNS::MEANDER_SKEW_PLACER::Start(), PNS::MEANDER_PLACER::Start(), and PNS::DP_MEANDER_PLACER::Start().

◆ Hole()

const SHAPE* PNS::SOLID::Hole ( ) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 81 of file pns_solid.h.

81 { return m_hole; }
SHAPE * m_hole
Definition: pns_solid.h:126

References m_hole.

Referenced by PNS::ROUTER::markViolations().

◆ HoleHull()

const SHAPE_LINE_CHAIN PNS::SOLID::HoleHull ( int  aClearance,
int  aWalkaroundThickness,
int  aLayer 
) const
overridevirtual

Reimplemented from PNS::ITEM.

Definition at line 127 of file pns_solid.cpp.

128 {
129  if( !m_hole )
130  return SHAPE_LINE_CHAIN();
131 
132  if( m_hole->Type() == SH_COMPOUND )
133  {
134  SHAPE_COMPOUND* cmpnd = static_cast<SHAPE_COMPOUND*>( m_hole );
135 
136  if ( cmpnd->Shapes().size() == 1 )
137  {
138  return buildHullForPrimitiveShape( cmpnd->Shapes()[0], aClearance,
139  aWalkaroundThickness );
140  }
141  else
142  {
143  // fixme - shouldn't happen but one day we should move
144  // TransformShapeWithClearanceToPolygon() to the Geometry Library
145  return SHAPE_LINE_CHAIN();
146  }
147  }
148  else
149  {
150  return buildHullForPrimitiveShape( m_hole, aClearance, aWalkaroundThickness );
151  }
152 }
compound shape, consisting of multiple simple shapes
Definition: shape.h:49
static const SHAPE_LINE_CHAIN buildHullForPrimitiveShape(const SHAPE *aShape, int aClearance, int aWalkaroundThickness)
Definition: pns_solid.cpp:39
SHAPE * m_hole
Definition: pns_solid.h:126
const std::vector< SHAPE * > & Shapes() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
SHAPE_TYPE Type() const
Return the type of the shape.
Definition: shape.h:94

References PNS::buildHullForPrimitiveShape(), m_hole, SH_COMPOUND, SHAPE_COMPOUND::Shapes(), and SHAPE_BASE::Type().

Referenced by Hull().

◆ Hull()

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

Reimplemented from PNS::ITEM.

Definition at line 96 of file pns_solid.cpp.

97 {
98  if( !ROUTER::GetInstance()->GetInterface()->IsFlashedOnLayer( this, aLayer ) )
99  return HoleHull( aClearance, aWalkaroundThickness, aLayer );
100 
101  if( !m_shape )
102  return SHAPE_LINE_CHAIN();
103 
104  if( m_shape->Type() == SH_COMPOUND )
105  {
106  SHAPE_COMPOUND* cmpnd = static_cast<SHAPE_COMPOUND*>( m_shape );
107 
108  if ( cmpnd->Shapes().size() == 1 )
109  {
110  return buildHullForPrimitiveShape( cmpnd->Shapes()[0], aClearance,
111  aWalkaroundThickness );
112  }
113  else
114  {
115  // fixme - shouldn't happen but one day we should move
116  // TransformShapeWithClearanceToPolygon() to the Geometry Library
117  return SHAPE_LINE_CHAIN();
118  }
119  }
120  else
121  {
122  return buildHullForPrimitiveShape( m_shape, aClearance, aWalkaroundThickness );
123  }
124 }
compound shape, consisting of multiple simple shapes
Definition: shape.h:49
static const SHAPE_LINE_CHAIN buildHullForPrimitiveShape(const SHAPE *aShape, int aClearance, int aWalkaroundThickness)
Definition: pns_solid.cpp:39
const SHAPE_LINE_CHAIN HoleHull(int aClearance, int aWalkaroundThickness, int aLayer) const override
Definition: pns_solid.cpp:127
SHAPE * m_shape
Definition: pns_solid.h:125
const std::vector< SHAPE * > & Shapes() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
SHAPE_TYPE Type() const
Return the type of the shape.
Definition: shape.h:94
static ROUTER * GetInstance()
Definition: pns_router.cpp:78

References PNS::buildHullForPrimitiveShape(), PNS::ROUTER::GetInstance(), HoleHull(), m_shape, SH_COMPOUND, SHAPE_COMPOUND::Shapes(), and SHAPE_BASE::Type().

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

◆ IsCompoundShapePrimitive()

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

Definition at line 241 of file pns_item.h.

241 { return m_isCompoundShapePrimitive; }
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  }
virtual int Marker() const
Definition: pns_item.h:212

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

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

References 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; }
LAYER_RANGE m_layers
Definition: pns_item.h:251

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::MEANDER_PLACER::CurrentLayer(), PNS::DP_MEANDER_PLACER::CurrentLayer(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), PNS::NODE::FindJoint(), PNS::NODE::FindLinesBetweenJoints(), PNS::NODE::findRedundantArc(), PNS::NODE::findRedundantSegment(), PNS::NODE::FixupVirtualVias(), ROUTER_TOOL::getStartLayer(), PNS_PCBNEW_RULE_RESOLVER::HoleClearance(), PNS_PCBNEW_RULE_RESOLVER::HoleToHoleClearance(), PNS_KICAD_IFACE::IsFlashedOnLayer(), 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_TEST_ENVIRONMENT::ReplayLog(), PNS::SEGMENT::SEGMENT(), PNS::LINE_PLACER::SetLayer(), PNS::COMPONENT_DRAGGER::Start(), ROUTER_PREVIEW_ITEM::Update(), PNS::TOOL_BASE::updateEndItem(), PNS::DIFF_PAIR::updateLine(), PNS::TOOL_BASE::updateStartItem(), and PNS::VIA::VIA().

◆ LayersOverlap()

bool PNS::ITEM::LayersOverlap ( const ITEM aOther) const
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  }
bool Overlaps(const LAYER_RANGE &aOther) const
Definition: pns_layerset.h:67
const LAYER_RANGE & Layers() const
Definition: pns_item.h:154

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

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

◆ Mark()

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

Reimplemented in PNS::LINE.

Definition at line 210 of file pns_item.h.

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

References 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

◆ Offset()

VECTOR2I PNS::SOLID::Offset ( ) const
inline

Definition at line 117 of file pns_solid.h.

117 { return m_offset; }
VECTOR2I m_offset
Definition: pns_solid.h:127

References m_offset.

Referenced by PNS::OPTIMIZER::smartPadsSingle().

◆ 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; }
NODE * m_owner
Definition: pns_item.h:250

References PNS::ITEM::m_owner.

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

◆ Parent()

◆ Pos()

const VECTOR2I& PNS::SOLID::Pos ( ) const
inline

Definition at line 101 of file pns_solid.h.

101 { return m_pos; }
VECTOR2I m_pos
Definition: pns_solid.h:124

References m_pos.

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

◆ 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; }
int m_rank
Definition: pns_item.h:256

References PNS::ITEM::m_rank.

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

◆ SetHole()

void PNS::SOLID::SetHole ( SHAPE shape)
inline

Definition at line 95 of file pns_solid.h.

96  {
97  delete m_hole;
98  m_hole = shape;
99  }
SHAPE * m_hole
Definition: pns_solid.h:126

References m_hole.

◆ SetIsCompoundShapePrimitive()

void PNS::ITEM::SetIsCompoundShapePrimitive ( )
inlineinherited

Definition at line 240 of file pns_item.h.

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

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; }
LAYER_RANGE m_layers
Definition: pns_item.h:251

References PNS::ITEM::m_layers.

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

◆ SetNet()

◆ SetOffset()

void PNS::SOLID::SetOffset ( const VECTOR2I aOffset)
inline

Definition at line 118 of file pns_solid.h.

118 { m_offset = aOffset; }
VECTOR2I m_offset
Definition: pns_solid.h:127

References m_offset.

◆ SetOrientation()

void PNS::SOLID::SetOrientation ( double  aOrientation)
inline

Definition at line 121 of file pns_solid.h.

121 { m_orientation = aOrientation; }
double m_orientation
Definition: pns_solid.h:129

References m_orientation.

◆ 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; }
NODE * m_owner
Definition: pns_item.h:250

References PNS::ITEM::m_owner.

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

◆ SetPadToDie()

void PNS::SOLID::SetPadToDie ( int  aLen)
inline

Definition at line 105 of file pns_solid.h.

105 { m_padToDie = aLen; }
int m_padToDie
Definition: pns_solid.h:128

References m_padToDie.

◆ SetParent()

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

Definition at line 148 of file pns_item.h.

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

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ SetPos()

void PNS::SOLID::SetPos ( const VECTOR2I aCenter)

Definition at line 161 of file pns_solid.cpp.

162 {
163  VECTOR2I delta = aCenter - m_pos;
164 
165  if( m_shape )
166  m_shape->Move( delta );
167 
168  if( m_hole )
169  m_hole->Move( delta );
170 
171  m_pos = aCenter;
172 }
SHAPE * m_shape
Definition: pns_solid.h:125
SHAPE * m_hole
Definition: pns_solid.h:126
constexpr int delta
virtual void Move(const VECTOR2I &aVector)=0
VECTOR2I m_pos
Definition: pns_solid.h:124

References delta, m_hole, m_pos, m_shape, and SHAPE::Move().

◆ 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; }
int m_rank
Definition: pns_item.h:256

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; }
bool m_routable
Definition: pns_item.h:257

References PNS::ITEM::m_routable.

◆ SetShape()

void PNS::SOLID::SetShape ( SHAPE shape)
inline

Definition at line 89 of file pns_solid.h.

90  {
91  delete m_shape;
92  m_shape = shape;
93  }
SHAPE * m_shape
Definition: pns_solid.h:125

References m_shape.

Referenced by PNS::ROUTER::markViolations().

◆ Shape()

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

Return the geometrical shape of the item.

Used for collision detection and spatial indexing.

Reimplemented from PNS::ITEM.

Definition at line 79 of file pns_solid.h.

79 { return m_shape; }
SHAPE * m_shape
Definition: pns_solid.h:125

References m_shape.

Referenced by PNS::OPTIMIZER::smartPadsSingle().

◆ 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; }
int m_marker
Definition: pns_item.h:255

References PNS::ITEM::m_marker.

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

Member Data Documentation

◆ m_hole

SHAPE* PNS::SOLID::m_hole
private

Definition at line 126 of file pns_solid.h.

Referenced by Hole(), HoleHull(), SetHole(), SetPos(), SOLID(), and ~SOLID().

◆ 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

Definition at line 253 of file pns_item.h.

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

◆ m_net

◆ m_offset

VECTOR2I PNS::SOLID::m_offset
private

Definition at line 127 of file pns_solid.h.

Referenced by Offset(), and SetOffset().

◆ m_orientation

double PNS::SOLID::m_orientation
private

Definition at line 129 of file pns_solid.h.

Referenced by GetOrientation(), SetOrientation(), and SOLID().

◆ m_owner

NODE* PNS::ITEM::m_owner
protectedinherited

◆ m_padToDie

int PNS::SOLID::m_padToDie
private

Definition at line 128 of file pns_solid.h.

Referenced by GetPadToDie(), SetPadToDie(), and SOLID().

◆ m_parent

BOARD_ITEM* PNS::ITEM::m_parent
protectedinherited

◆ m_pos

VECTOR2I PNS::SOLID::m_pos
private

Definition at line 124 of file pns_solid.h.

Referenced by Anchor(), Pos(), SetPos(), and SOLID().

◆ 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_shape

SHAPE* PNS::SOLID::m_shape
private

Definition at line 125 of file pns_solid.h.

Referenced by Hull(), SetPos(), SetShape(), Shape(), SOLID(), and ~SOLID().

◆ 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: