KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::ITEM Class Referenceabstract

Base class for PNS router board items. More...

#include <pns_item.h>

Inheritance diagram for PNS::ITEM:
PNS::OWNABLE_ITEM PNS::ITEM_OWNER PNS::HOLE PNS::JOINT PNS::LINKED_ITEM PNS::LINK_HOLDER PNS::SOLID PNS::ARC PNS::SEGMENT PNS::VIA PNS::DIFF_PAIR PNS::LINE PNS::VVIA

Public Types

enum  PnsKind {
  INVALID_T = 0 , SOLID_T = 1 , LINE_T = 2 , JOINT_T = 4 ,
  SEGMENT_T = 8 , ARC_T = 16 , VIA_T = 32 , DIFF_PAIR_T = 64 ,
  HOLE_T = 128 , ANY_T = 0xffff , LINKED_ITEM_MASK_T = SOLID_T | SEGMENT_T | ARC_T | VIA_T | HOLE_T
}
 < Supported item types More...
 

Public Member Functions

 ITEM (PnsKind aKind)
 
 ITEM (const ITEM &aOther)
 
virtual ~ITEM ()
 
virtual ITEMClone () const =0
 Return a deep copy of the item.
 
virtual const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const
 
PnsKind Kind () const
 Return the type (kind) of the item.
 
bool OfKind (int aKindMask) const
 
std::string KindStr () const
 
void SetParent (BOARD_ITEM *aParent)
 
BOARD_ITEMParent () const
 
virtual BOARD_ITEMBoardItem () const
 
void SetNet (NET_HANDLE aNet)
 
virtual NET_HANDLE Net () const
 
const PNS_LAYER_RANGELayers () const
 
void SetLayers (const PNS_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.
 
bool Collide (const ITEM *aHead, const NODE *aNode, int aLayer, COLLISION_SEARCH_CONTEXT *aCtx=nullptr) const
 Check for a collision (clearance violation) with between us and item aOther.
 
virtual const SHAPEShape (int aLayer) const
 Return the geometrical shape of the item.
 
virtual std::vector< int > UniqueShapeLayers () const
 Return a list of layers that have unique (potentially different) shapes.
 
virtual bool HasUniqueShapeLayers () const
 
std::set< int > RelevantShapeLayers (const ITEM *aOther) const
 Returns the set of layers on which either this or the other item can have a unique shape.
 
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
 
virtual VECTOR2I Anchor (int n) const
 
virtual int AnchorCount () const
 
bool IsLocked () const
 
void SetRoutable (bool aRoutable)
 
bool IsRoutable () const
 
void SetIsFreePad (bool aIsFreePad=true)
 
bool IsFreePad () const
 
virtual ITEMParentPadVia () const
 
bool IsVirtual () const
 
void SetIsCompoundShapePrimitive ()
 
bool IsCompoundShapePrimitive () const
 
virtual bool HasHole () const
 
virtual HOLEHole () const
 
virtual void SetHole (HOLE *aHole)
 
virtual const std::string Format () const
 
virtual const NODEOwningNode () const
 
const ITEM_OWNEROwner () const
 Return the owner of this item, or NULL if there's none.
 
void SetOwner (const ITEM_OWNER *aOwner)
 Set the node that owns this item.
 
bool BelongsTo (const ITEM_OWNER *aNode) const
 

Protected Attributes

PnsKind m_kind
 
BOARD_ITEMm_parent
 
PNS_LAYER_RANGE m_layers
 
bool m_movable
 
NET_HANDLE m_net
 
int m_marker
 
int m_rank
 
bool m_routable
 
bool m_isVirtual
 
bool m_isFreePad
 
bool m_isCompoundShapePrimitive
 
const ITEM_OWNERm_owner
 

Private Member Functions

bool collideSimple (const ITEM *aHead, const NODE *aNode, int aLayer, COLLISION_SEARCH_CONTEXT *aCtx) const
 

Detailed Description

Base class for PNS router board items.

Implements the shared properties of all PCB items net, spanned layers, geometric shape and reference to owning model.

Definition at line 96 of file pns_item.h.

Member Enumeration Documentation

◆ PnsKind

< Supported item types

Enumerator
INVALID_T 
SOLID_T 
LINE_T 
JOINT_T 
SEGMENT_T 
ARC_T 
VIA_T 
DIFF_PAIR_T 
HOLE_T 
ANY_T 
LINKED_ITEM_MASK_T 

Definition at line 100 of file pns_item.h.

Constructor & Destructor Documentation

◆ ITEM() [1/2]

PNS::ITEM::ITEM ( PnsKind  aKind)
inline

◆ ITEM() [2/2]

PNS::ITEM::ITEM ( const ITEM aOther)
inline

◆ ~ITEM()

PNS::ITEM::~ITEM ( )
virtual

Definition at line 324 of file pns_item.cpp.

Member Function Documentation

◆ Anchor()

◆ AnchorCount()

virtual int PNS::ITEM::AnchorCount ( ) const
inlinevirtual

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

Definition at line 260 of file pns_item.h.

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

◆ BelongsTo()

bool PNS::OWNABLE_ITEM::BelongsTo ( const ITEM_OWNER aNode) const
inlineinherited

◆ BoardItem()

virtual BOARD_ITEM * PNS::ITEM::BoardItem ( ) const
inlinevirtual

◆ Clone()

virtual ITEM * PNS::ITEM::Clone ( ) const
pure virtual

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aHead,
const NODE aNode,
int  aLayer,
COLLISION_SEARCH_CONTEXT aCtx = nullptr 
) const

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

References collideSimple().

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

◆ collideSimple()

◆ Format()

◆ HasHole()

virtual bool PNS::ITEM::HasHole ( ) const
inlinevirtual

◆ HasUniqueShapeLayers()

virtual bool PNS::ITEM::HasUniqueShapeLayers ( ) const
inlinevirtual

Reimplemented in PNS::VIA.

Definition at line 239 of file pns_item.h.

Referenced by RelevantShapeLayers().

◆ Hole()

◆ Hull()

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

Reimplemented in PNS::ARC, PNS::SEGMENT, PNS::HOLE, PNS::SOLID, and PNS::VIA.

Definition at line 161 of file pns_item.h.

◆ IsCompoundShapePrimitive()

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

Definition at line 288 of file pns_item.h.

References m_isCompoundShapePrimitive.

◆ IsFreePad()

bool PNS::ITEM::IsFreePad ( ) const
inline

Definition at line 275 of file pns_item.h.

References m_isFreePad, and ParentPadVia().

Referenced by collideSimple().

◆ IsLocked()

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

◆ IsRoutable()

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

Definition at line 271 of file pns_item.h.

References m_routable.

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

◆ IsVirtual()

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

◆ Kind()

◆ KindStr()

std::string PNS::ITEM::KindStr ( ) const
Returns
the kind of the item, as string

Definition at line 306 of file pns_item.cpp.

References ARC_T, DIFF_PAIR_T, HOLE_T, JOINT_T, LINE_T, m_kind, SEGMENT_T, SOLID_T, and VIA_T.

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

◆ Layer()

◆ Layers()

const PNS_LAYER_RANGE & PNS::ITEM::Layers ( ) const
inline

Definition at line 199 of file pns_item.h.

References m_layers.

Referenced by PNS::INDEX::Add(), PNS::NODE::Add(), PNS::NODE::addArc(), 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(), MOCK_RULE_RESOLVER::Clearance(), PNS::HOLE::Clone(), PNS::VIA::Clone(), collideSimple(), comparePnsItems(), PNS_KICAD_IFACE::createBoardItem(), PNS::DP_MEANDER_PLACER::CurrentLayer(), PNS::MEANDER_PLACER::CurrentLayer(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), PNS::NODE::FindJoint(), PNS::NODE::FindLinesBetweenJoints(), PNS::NODE::findRedundantArc(), PNS::NODE::findRedundantSegment(), PNS::NODE::FixupVirtualVias(), PNS::ROUTER::getNearestRatnestAnchor(), ROUTER_TOOL::getStartLayer(), PNS_KICAD_IFACE_BASE::IsFlashedOnLayer(), Layer(), LayersOverlap(), PNS::LINE::LINE(), PNS::NODE::LockJoint(), PNS::VIA::MakeHandle(), PNS::ROUTER::markViolations(), PNS::TOPOLOGY::NearestUnconnectedAnchorPoint(), PNS::JOINT::NextSegment(), PNS::SHOVE::onCollidingSolid(), PNS::VIA::operator=(), PNS::TOOL_BASE::pickSingleItem(), PNS::INDEX::Query(), PNS::INDEX::Remove(), PNS::NODE::removeArcIndex(), PNS::NODE::removeSegmentIndex(), PNS::NODE::removeSolidIndex(), PNS::NODE::removeViaIndex(), PNS_LOG_PLAYER::ReplayLog(), PNS::SEGMENT::SEGMENT(), PNS::LINE_PLACER::SetLayer(), PNS::SHOVE::shoveIteration(), 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
inline

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

Definition at line 208 of file pns_item.h.

References Layers(), and PNS_LAYER_RANGE::Overlaps().

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

◆ Mark()

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

Reimplemented in PNS::LINE.

Definition at line 248 of file pns_item.h.

References m_marker.

◆ Marker()

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

Reimplemented in PNS::LINE.

Definition at line 250 of file pns_item.h.

References m_marker.

Referenced by PNS::ARC::ARC(), IsLocked(), PNS::SHOVE::pushOrShoveVia(), and ROUTER_PREVIEW_ITEM::Update().

◆ Net()

virtual NET_HANDLE PNS::ITEM::Net ( ) const
inlinevirtual

Reimplemented in PNS::HOLE, and PNS::JOINT.

Definition at line 197 of file pns_item.h.

References m_net.

Referenced by PNS::INDEX::Add(), PNS::NODE::Add(), PNS::NODE::addArc(), PNS::NODE::addSegment(), PNS::NODE::addSolid(), PNS::NODE::addVia(), PNS::ARC::ARC(), PNS::TOPOLOGY::AssembleCluster(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::LINE_PLACER::buildInitialLine(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS::VIA::Clone(), collideSimple(), comparePnsItems(), PNS_KICAD_IFACE::createBoardItem(), PNS::DRAGGER::CurrentNets(), PNS::MEANDER_PLACER::CurrentNets(), PNS::DIFF_PAIR::DIFF_PAIR(), PNS_PCBNEW_RULE_RESOLVER::DpNetPair(), PNS::OPTIMIZER::fanoutCleanup(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), PNS::NODE::FindJoint(), PNS::NODE::findRedundantArc(), PNS::NODE::findRedundantSegment(), PNS::LINE_PLACER::FixRoute(), Format(), PNS_PCBNEW_RULE_RESOLVER::getBoardItem(), PNS_KICAD_IFACE_BASE::ImportSizes(), PNS_PCBNEW_RULE_RESOLVER::IsNetTieExclusion(), PNS::ROUTER::isStartingPointRoutable(), PNS::LINE::LINE(), PNS::NODE::LockJoint(), PNS::VIA::MakeHandle(), PNS::LINE_PLACER::Move(), PNS::MEANDER_SKEW_PLACER::Move(), PNS::HOLE::Net(), PNS::JOINT::NextSegment(), PNS::VIA::operator=(), PNS::MEANDER_SKEW_PLACER::origPathLength(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::prepareInteractive(), PNS::NODE::rebuildJoint(), PNS::INDEX::Remove(), PNS::NODE::removeArcIndex(), PNS::NODE::removeSegmentIndex(), PNS::NODE::removeSolidIndex(), PNS::NODE::removeViaIndex(), PNS::SHOVE::Run(), PNS::OPTIMIZER::runSmartPads(), PNS::SEGMENT::SEGMENT(), PNS::shouldWeConsiderHoleCollisions(), PNS::SHOVE::shoveIteration(), PNS::DIFF_PAIR_PLACER::Start(), PNS::LINE_PLACER::Start(), PNS::MEANDER_SKEW_PLACER::Start(), PCB_TUNING_PATTERN::Update(), and PNS::VIA::VIA().

◆ OfKind()

◆ Owner()

const ITEM_OWNER * PNS::OWNABLE_ITEM::Owner ( ) const
inlineinherited

◆ OwningNode()

const NODE * PNS::ITEM::OwningNode ( ) const
virtual

Definition at line 345 of file pns_item.cpp.

References PNS::OWNABLE_ITEM::Owner(), and ParentPadVia().

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

◆ Parent()

◆ ParentPadVia()

virtual ITEM * PNS::ITEM::ParentPadVia ( ) const
inlinevirtual

Reimplemented in PNS::HOLE.

Definition at line 280 of file pns_item.h.

Referenced by IsFreePad(), PNS_PCBNEW_RULE_RESOLVER::IsNonPlatedSlot(), and OwningNode().

◆ Rank()

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

Reimplemented in PNS::LINE.

Definition at line 253 of file pns_item.h.

References m_rank.

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

◆ RelevantShapeLayers()

std::set< int > PNS::ITEM::RelevantShapeLayers ( const ITEM aOther) const

Returns the set of layers on which either this or the other item can have a unique shape.

Use this to loop over layers when hit-testing objects that can have different shapes on each layer (currently only VIA)

Definition at line 94 of file pns_item.cpp.

References HasUniqueShapeLayers(), and UniqueShapeLayers().

Referenced by PNS::SHOVE::onCollidingVia(), PNS::SHOVE::onReverseCollidingVia(), PNS::DIFF_PAIR_PLACER::propagateDpHeadForces(), and PNS::VIA::PushoutForce().

◆ SetHole()

virtual void PNS::ITEM::SetHole ( HOLE aHole)
inlinevirtual

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

Definition at line 292 of file pns_item.h.

◆ SetIsCompoundShapePrimitive()

void PNS::ITEM::SetIsCompoundShapePrimitive ( )
inline

Definition at line 287 of file pns_item.h.

References m_isCompoundShapePrimitive.

◆ SetIsFreePad()

void PNS::ITEM::SetIsFreePad ( bool  aIsFreePad = true)
inline

Definition at line 273 of file pns_item.h.

References m_isFreePad.

◆ SetLayer()

◆ SetLayers()

◆ SetNet()

◆ SetOwner()

◆ SetParent()

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

◆ SetRank()

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

Reimplemented in PNS::LINE.

Definition at line 252 of file pns_item.h.

References m_rank.

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

◆ SetRoutable()

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

Definition at line 270 of file pns_item.h.

References m_routable.

◆ Shape()

virtual const SHAPE * PNS::ITEM::Shape ( int  aLayer) const
inlinevirtual

◆ UniqueShapeLayers()

virtual std::vector< int > PNS::ITEM::UniqueShapeLayers ( ) const
inlinevirtual

Return a list of layers that have unique (potentially different) shapes.

Reimplemented in PNS::VIA.

Definition at line 237 of file pns_item.h.

Referenced by RelevantShapeLayers().

◆ Unmark()

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

Reimplemented in PNS::LINE.

Definition at line 249 of file pns_item.h.

References m_marker.

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

Member Data Documentation

◆ m_isCompoundShapePrimitive

bool PNS::ITEM::m_isCompoundShapePrimitive
protected

Definition at line 315 of file pns_item.h.

Referenced by IsCompoundShapePrimitive(), ITEM(), and SetIsCompoundShapePrimitive().

◆ m_isFreePad

bool PNS::ITEM::m_isFreePad
protected

Definition at line 314 of file pns_item.h.

Referenced by IsFreePad(), ITEM(), and SetIsFreePad().

◆ m_isVirtual

bool PNS::ITEM::m_isVirtual
protected

◆ m_kind

PnsKind PNS::ITEM::m_kind
protected

Definition at line 303 of file pns_item.h.

Referenced by collideSimple(), ITEM(), Kind(), KindStr(), and OfKind().

◆ m_layers

◆ m_marker

◆ m_movable

bool PNS::ITEM::m_movable
protected

Definition at line 308 of file pns_item.h.

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

◆ m_net

◆ m_owner

const ITEM_OWNER* PNS::OWNABLE_ITEM::m_owner
protectedinherited

◆ m_parent

BOARD_ITEM* PNS::ITEM::m_parent
protected

◆ m_rank

◆ m_routable

bool PNS::ITEM::m_routable
protected

Definition at line 312 of file pns_item.h.

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


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