KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::HOLE Class Reference

#include <pns_hole.h>

Inheritance diagram for PNS::HOLE:
PNS::ITEM PNS::OWNABLE_ITEM PNS::ITEM_OWNER

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

 HOLE (SHAPE *aShape)
 
 HOLE (const ITEM &aOther)
 
virtual ~HOLE ()
 
virtual HOLEClone () const override
 Return a deep copy of the item.
 
virtual NET_HANDLE Net () const override
 
virtual const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const override
 
int Radius () const
 
const SHAPEShape (int aLayer) const override
 Return the geometrical shape of the item.
 
void SetParentPadVia (ITEM *aParent)
 
ITEMParentPadVia () const override
 
BOARD_ITEMBoardItem () const override
 
void SetCenter (const VECTOR2I &aCenter)
 
void SetRadius (int aRadius)
 
void Move (const VECTOR2I &delta)
 
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
 
void SetNet (NET_HANDLE aNet)
 
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 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
 
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
 

Static Public Member Functions

static HOLEMakeCircularHole (const VECTOR2I &pos, int radius, PNS_LAYER_RANGE aLayers)
 

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
 

Private Attributes

SHAPEm_holeShape
 
ITEMm_parentPadVia
 

Detailed Description

Definition at line 33 of file pns_hole.h.

Member Enumeration Documentation

◆ PnsKind

enum PNS::ITEM::PnsKind
inherited

< 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

◆ HOLE() [1/2]

PNS::HOLE::HOLE ( SHAPE aShape)
inline

Definition at line 36 of file pns_hole.h.

◆ HOLE() [2/2]

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

Definition at line 43 of file pns_hole.h.

◆ ~HOLE()

PNS::HOLE::~HOLE ( )
virtual

Definition at line 35 of file pns_hole.cpp.

References m_holeShape.

Member Function Documentation

◆ Anchor()

◆ AnchorCount()

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

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

BOARD_ITEM * PNS::HOLE::BoardItem ( ) const
inlineoverridevirtual
Returns
the BOARD_ITEM, even if it's not the direct parent.

Reimplemented from PNS::ITEM.

Definition at line 74 of file pns_hole.h.

References PNS::ITEM::m_parent, m_parentPadVia, and PNS::ITEM::Parent().

◆ Clone()

HOLE * PNS::HOLE::Clone ( ) const
overridevirtual

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aHead,
const NODE aNode,
int  aLayer,
COLLISION_SEARCH_CONTEXT aCtx = nullptr 
) 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 296 of file pns_item.cpp.

References PNS::ITEM::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
inlinevirtualinherited

◆ HasUniqueShapeLayers()

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

Reimplemented in PNS::VIA.

Definition at line 239 of file pns_item.h.

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

◆ Hole()

◆ Hull()

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

◆ IsCompoundShapePrimitive()

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

Definition at line 288 of file pns_item.h.

References PNS::ITEM::m_isCompoundShapePrimitive.

◆ IsFreePad()

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

Definition at line 275 of file pns_item.h.

References PNS::ITEM::m_isFreePad, and PNS::ITEM::ParentPadVia().

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

◆ IsLocked()

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

◆ IsRoutable()

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

Definition at line 271 of file pns_item.h.

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

◆ Layer()

◆ Layers()

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

Definition at line 199 of file pns_item.h.

References PNS::ITEM::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(), Clone(), PNS::VIA::Clone(), PNS::ITEM::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(), PNS::ITEM::Layer(), PNS::ITEM::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
inlineinherited

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

Definition at line 208 of file pns_item.h.

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

◆ MakeCircularHole()

HOLE * PNS::HOLE::MakeCircularHole ( const VECTOR2I pos,
int  radius,
PNS_LAYER_RANGE  aLayers 
)
static

◆ Mark()

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

Reimplemented in PNS::LINE.

Definition at line 248 of file pns_item.h.

References PNS::ITEM::m_marker.

◆ Marker()

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

◆ Move()

void PNS::HOLE::Move ( const VECTOR2I delta)

Definition at line 125 of file pns_hole.cpp.

References delta, m_holeShape, and SHAPE::Move().

Referenced by PNS::SOLID::SetPos().

◆ Net()

virtual NET_HANDLE PNS::HOLE::Net ( ) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 56 of file pns_hole.h.

References PNS::ITEM::m_net, m_parentPadVia, and PNS::ITEM::Net().

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

◆ OfKind()

◆ Owner()

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

◆ OwningNode()

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

Definition at line 345 of file pns_item.cpp.

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

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

◆ Parent()

◆ ParentPadVia()

ITEM * PNS::HOLE::ParentPadVia ( ) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 72 of file pns_hole.h.

References m_parentPadVia.

Referenced by PNS::shouldWeConsiderHoleCollisions(), and PNS::NODE::~NODE().

◆ Radius()

int PNS::HOLE::Radius ( ) const

Definition at line 103 of file pns_hole.cpp.

References m_holeShape, SH_CIRCLE, and SHAPE_BASE::Type().

Referenced by PNS::VIA::Hull().

◆ Rank()

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

Reimplemented in PNS::LINE.

Definition at line 253 of file pns_item.h.

References PNS::ITEM::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
inherited

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

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

◆ SetCenter()

void PNS::HOLE::SetCenter ( const VECTOR2I aCenter)

Definition at line 111 of file pns_hole.cpp.

References m_holeShape, SetCenter(), SH_CIRCLE, and SHAPE_BASE::Type().

Referenced by SetCenter(), and PNS::VIA::SetPos().

◆ SetHole()

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

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

Definition at line 292 of file pns_item.h.

◆ SetIsCompoundShapePrimitive()

void PNS::ITEM::SetIsCompoundShapePrimitive ( )
inlineinherited

Definition at line 287 of file pns_item.h.

References PNS::ITEM::m_isCompoundShapePrimitive.

◆ SetIsFreePad()

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

Definition at line 273 of file pns_item.h.

References PNS::ITEM::m_isFreePad.

◆ SetLayer()

◆ SetLayers()

◆ SetNet()

◆ SetOwner()

◆ SetParent()

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

◆ SetParentPadVia()

void PNS::HOLE::SetParentPadVia ( ITEM aParent)
inline

Definition at line 71 of file pns_hole.h.

References m_parentPadVia.

Referenced by PNS::SOLID::SetHole(), and PNS::VIA::SetHole().

◆ SetRadius()

void PNS::HOLE::SetRadius ( int  aRadius)

Definition at line 118 of file pns_hole.cpp.

References m_holeShape, SetRadius(), SH_CIRCLE, and SHAPE_BASE::Type().

Referenced by PNS::VIA::SetDrill(), and SetRadius().

◆ SetRank()

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

Reimplemented in PNS::LINE.

Definition at line 252 of file pns_item.h.

References PNS::ITEM::m_rank.

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

◆ SetRoutable()

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

Definition at line 270 of file pns_item.h.

References PNS::ITEM::m_routable.

◆ Shape()

const SHAPE * PNS::HOLE::Shape ( int  aLayer) const
inlineoverridevirtual

Return the geometrical shape of the item.

Used for collision detection and spatial indexing.

Parameters
aLayeris the layer to query shape for (items may have different shapes on different layers)

Reimplemented from PNS::ITEM.

Definition at line 69 of file pns_hole.h.

References m_holeShape.

Referenced by PNS::SOLID::operator=(), ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM(), and ROUTER_PREVIEW_ITEM::Update().

◆ UniqueShapeLayers()

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

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 PNS::ITEM::RelevantShapeLayers().

◆ Unmark()

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

Reimplemented in PNS::LINE.

Definition at line 249 of file pns_item.h.

References PNS::ITEM::m_marker.

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

Member Data Documentation

◆ m_holeShape

SHAPE* PNS::HOLE::m_holeShape
private

Definition at line 94 of file pns_hole.h.

Referenced by Clone(), Hull(), Move(), Radius(), SetCenter(), SetRadius(), Shape(), and ~HOLE().

◆ m_isCompoundShapePrimitive

bool PNS::ITEM::m_isCompoundShapePrimitive
protectedinherited

◆ m_isFreePad

bool PNS::ITEM::m_isFreePad
protectedinherited

Definition at line 314 of file pns_item.h.

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

◆ 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

◆ m_net

◆ m_owner

const ITEM_OWNER* PNS::OWNABLE_ITEM::m_owner
protectedinherited

◆ m_parent

◆ m_parentPadVia

ITEM* PNS::HOLE::m_parentPadVia
private

Definition at line 95 of file pns_hole.h.

Referenced by BoardItem(), Net(), ParentPadVia(), and SetParentPadVia().

◆ m_rank

◆ m_routable

bool PNS::ITEM::m_routable
protectedinherited

Definition at line 312 of file pns_item.h.

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


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