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

#include <pns_solid.h>

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

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 , HOLE_T = 128 ,
  ANY_T = 0xffff
}
 

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 SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const override
 
void SetShape (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)
 
EDA_ANGLE GetOrientation () const
 
void SetOrientation (const EDA_ANGLE &aOrientation)
 
virtual void SetHole (HOLE *aHole) override
 
virtual bool HasHole () const override
 
virtual HOLEHole () const override
 
PnsKind Kind () const
 Return the type (kind) of the item. More...
 
bool OfKind (int aKindMask) const
 
std::string KindStr () const
 
void SetParent (BOARD_ITEM *aParent)
 
BOARD_ITEMParent () const
 
virtual BOARD_ITEMBoardItem () const
 
void SetNet (int aNet)
 
virtual 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...
 
bool Collide (const ITEM *aHead, const NODE *aNode, COLLISION_SEARCH_CONTEXT *aCtx=nullptr) 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
 
void SetIsFreePad (bool aIsFreePad=true)
 
bool IsFreePad () const
 
virtual ITEMParentPadVia () const
 
bool IsVirtual () const
 
void SetIsCompoundShapePrimitive ()
 
bool IsCompoundShapePrimitive () const
 
virtual const std::string Format () const
 
const ITEM_OWNEROwner () const
 Return the owner of this item, or NULL if there's none. More...
 
void SetOwner (const ITEM_OWNER *aOwner)
 Set the node that owns this item. More...
 
bool BelongsTo (const ITEM_OWNER *aNode) 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
 
LAYER_RANGE m_layers
 
bool m_movable
 
int 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, COLLISION_SEARCH_CONTEXT *aCtx) const
 

Private Attributes

VECTOR2I m_pos
 
SHAPEm_shape
 
VECTOR2I m_offset
 
int m_padToDie
 
EDA_ANGLE m_orientation
 
HOLEm_hole
 

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 
HOLE_T 
ANY_T 

Definition at line 96 of file pns_item.h.

Constructor & Destructor Documentation

◆ SOLID() [1/2]

PNS::SOLID::SOLID ( )
inline

Definition at line 38 of file pns_solid.h.

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

Referenced by Clone().

◆ ~SOLID()

PNS::SOLID::~SOLID ( )
inline

Definition at line 47 of file pns_solid.h.

References m_hole, and m_shape.

◆ SOLID() [2/2]

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

Member Function Documentation

◆ Anchor()

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

Reimplemented from PNS::ITEM.

Definition at line 94 of file pns_solid.h.

References m_pos.

◆ AnchorCount()

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

Reimplemented from PNS::ITEM.

Definition at line 99 of file pns_solid.h.

◆ BelongsTo()

bool PNS::OWNABLE_ITEM::BelongsTo ( const ITEM_OWNER aNode) const
inlineinherited
Returns
true if the item is owned by the node aNode.

Definition at line 75 of file pns_item.h.

References PNS::OWNABLE_ITEM::m_owner.

Referenced by PNS::NODE::addSolid(), PNS::NODE::addVia(), PNS::NODE::doRemove(), PNS::LINE::RemoveVia(), SetHole(), PNS::VIA::SetHole(), PNS::LINE::~LINE(), and PNS::VIA::~VIA().

◆ BoardItem()

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

◆ ClassOf()

static bool PNS::SOLID::ClassOf ( const ITEM aItem)
inlinestatic

Definition at line 69 of file pns_solid.h.

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 74 of file pns_solid.cpp.

References SOLID().

◆ Collide()

bool PNS::ITEM::Collide ( const ITEM aHead,
const NODE aNode,
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 237 of file pns_item.cpp.

References PNS::ITEM::collideSimple().

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

◆ collideSimple()

◆ Format()

const std::string PNS::ITEM::Format ( ) const
virtualinherited

◆ GetOrientation()

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

Definition at line 107 of file pns_solid.h.

References m_orientation.

◆ GetPadToDie()

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

◆ HasHole()

virtual bool PNS::SOLID::HasHole ( ) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 122 of file pns_solid.h.

References m_hole.

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

◆ Hole()

virtual HOLE * PNS::SOLID::Hole ( ) const
inlineoverridevirtual

Reimplemented from PNS::ITEM.

Definition at line 123 of file pns_solid.h.

References m_hole.

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

◆ Hull()

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

◆ IsCompoundShapePrimitive()

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

Definition at line 261 of file pns_item.h.

References PNS::ITEM::m_isCompoundShapePrimitive.

◆ IsFreePad()

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

Definition at line 251 of file pns_item.h.

References PNS::ITEM::m_isFreePad.

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

◆ IsLocked()

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

◆ IsRoutable()

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

Definition at line 248 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 LAYER_RANGE & PNS::ITEM::Layers ( ) const
inlineinherited

Definition at line 191 of file pns_item.h.

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(), MOCK_RULE_RESOLVER::Clearance(), PNS::HOLE::Clone(), PNS::VIA::Clone(), PNS::ITEM::collideSimple(), comparePnsItems(), 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::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_LOG_PLAYER::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 200 of file pns_item.h.

References PNS::ITEM::Layers(), and 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
inlinevirtualinherited

Reimplemented in PNS::LINE.

Definition at line 225 of file pns_item.h.

References PNS::ITEM::m_marker.

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

◆ Marker()

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

◆ Net()

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

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

Definition at line 189 of file pns_item.h.

References PNS::ITEM::m_net.

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::AssembleCluster(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::NODE::AssembleLine(), PNS::LINE_PLACER::buildInitialLine(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS::VIA::Clone(), PNS::ITEM::collideSimple(), comparePnsItems(), 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(), PNS::ITEM::Format(), PNS_KICAD_IFACE_BASE::ImportSizes(), ROUTER_TOOL::InlineDrag(), PNS_PCBNEW_RULE_RESOLVER::IsNetTieExclusion(), PNS::ROUTER::isStartingPointRoutable(), PNS::LINE::LINE(), PNS::NODE::LockJoint(), PNS::VIA::MakeHandle(), PNS::MEANDER_SKEW_PLACER::Move(), PNS::HOLE::Net(), PNS::MEANDER_SKEW_PLACER::origPathLength(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), ROUTER_TOOL::prepareInteractive(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), PNS::NODE::rebuildJoint(), PNS::INDEX::Remove(), PNS::NODE::removeArcIndex(), PNS::NODE::removeSegmentIndex(), PNS::NODE::removeSolidIndex(), PNS::NODE::removeViaIndex(), PNS::OPTIMIZER::runSmartPads(), PNS::SEGMENT::SEGMENT(), PNS::SHOVE::ShoveObstacleLine(), PNS::DIFF_PAIR_PLACER::Start(), PNS::LINE_PLACER::Start(), PNS::MEANDER_SKEW_PLACER::Start(), and PNS::VIA::VIA().

◆ Offset()

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

Definition at line 104 of file pns_solid.h.

References m_offset.

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

◆ OfKind()

◆ Owner()

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

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

Definition at line 65 of file pns_item.h.

References PNS::OWNABLE_ITEM::m_owner.

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

◆ Parent()

◆ ParentPadVia()

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

Reimplemented in PNS::HOLE.

Definition at line 253 of file pns_item.h.

◆ Pos()

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

Definition at line 88 of file pns_solid.h.

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

References PNS::ITEM::m_rank.

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

◆ SetHole()

virtual void PNS::SOLID::SetHole ( HOLE aHole)
inlineoverridevirtual

◆ SetIsCompoundShapePrimitive()

void PNS::ITEM::SetIsCompoundShapePrimitive ( )
inlineinherited

Definition at line 260 of file pns_item.h.

References PNS::ITEM::m_isCompoundShapePrimitive.

◆ SetIsFreePad()

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

Definition at line 250 of file pns_item.h.

References PNS::ITEM::m_isFreePad.

◆ SetLayer()

◆ SetLayers()

◆ SetNet()

◆ SetOffset()

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

Definition at line 105 of file pns_solid.h.

References m_offset.

◆ SetOrientation()

void PNS::SOLID::SetOrientation ( const EDA_ANGLE aOrientation)
inline

Definition at line 108 of file pns_solid.h.

References m_orientation.

◆ SetOwner()

◆ SetPadToDie()

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

Definition at line 92 of file pns_solid.h.

References m_padToDie.

◆ SetParent()

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

Definition at line 180 of file pns_item.h.

References PNS::ITEM::m_parent.

Referenced by PNS_KICAD_IFACE::AddItem().

◆ SetPos()

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

Definition at line 81 of file pns_solid.cpp.

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

◆ SetRank()

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

Reimplemented in PNS::LINE.

Definition at line 229 of file pns_item.h.

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

References PNS::ITEM::m_routable.

◆ SetShape()

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

Definition at line 82 of file pns_solid.h.

References m_shape.

Referenced by SOLID().

◆ 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 76 of file pns_solid.h.

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

References PNS::ITEM::m_marker.

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

Member Data Documentation

◆ m_hole

HOLE* PNS::SOLID::m_hole
private

Definition at line 131 of file pns_solid.h.

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

◆ m_isCompoundShapePrimitive

bool PNS::ITEM::m_isCompoundShapePrimitive
protectedinherited

◆ m_isFreePad

bool PNS::ITEM::m_isFreePad
protectedinherited

Definition at line 285 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

Definition at line 279 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 128 of file pns_solid.h.

Referenced by Offset(), and SetOffset().

◆ m_orientation

EDA_ANGLE PNS::SOLID::m_orientation
private

Definition at line 130 of file pns_solid.h.

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

◆ m_owner

const ITEM_OWNER* PNS::OWNABLE_ITEM::m_owner
protectedinherited

◆ m_padToDie

int PNS::SOLID::m_padToDie
private

Definition at line 129 of file pns_solid.h.

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

◆ m_parent

◆ m_pos

VECTOR2I PNS::SOLID::m_pos
private

Definition at line 126 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 283 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 127 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 93 of file pns_item.h.

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


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