KiCad PCB EDA Suite
|
#include <pns_topology.h>
Public Types | |
typedef std::set< const JOINT * > | JOINT_SET |
Public Member Functions | |
TOPOLOGY (NODE *aNode) | |
~TOPOLOGY () | |
bool | SimplifyLine (LINE *aLine) |
ITEM * | NearestUnconnectedItem (const JOINT *aStart, int *aAnchor=nullptr, int aKindMask=ITEM::ANY_T) |
bool | NearestUnconnectedAnchorPoint (const LINE *aTrack, VECTOR2I &aPoint, LAYER_RANGE &aLayers, ITEM *&aItem) |
bool | LeadingRatLine (const LINE *aTrack, SHAPE_LINE_CHAIN &aRatLine) |
const JOINT_SET | ConnectedJoints (const JOINT *aStart) |
const ITEM_SET | ConnectedItems (const JOINT *aStart, int aKindMask=ITEM::ANY_T) |
const ITEM_SET | ConnectedItems (ITEM *aStart, int aKindMask=ITEM::ANY_T) |
int64_t | ShortestConnectionLength (ITEM *aFrom, ITEM *aTo) |
const ITEM_SET | AssembleTrivialPath (ITEM *aStart, std::pair< const JOINT *, const JOINT * > *aTerminalJoints=nullptr, bool aFollowLockedSegments=false) |
Assemble a trivial path between two joints given a starting item. More... | |
const ITEM_SET | AssembleTuningPath (ITEM *aStart, SOLID **aStartPad=nullptr, SOLID **aEndPad=nullptr) |
Like AssembleTrivialPath, but follows the track length algorithm, which discards segments that are fully inside pads, and truncates segments that cross into a pad (adding a straight- line segment from the intersection to the pad anchor). More... | |
const DIFF_PAIR | AssembleDiffPair (SEGMENT *aStart) |
bool | AssembleDiffPair (ITEM *aStart, DIFF_PAIR &aPair) |
const std::set< ITEM * > | AssembleCluster (ITEM *aStart, int aLayer) |
Private Member Functions | |
bool | followTrivialPath (LINE *aLine, bool aLeft, ITEM_SET &aSet, std::set< ITEM * > &aVisited, const JOINT **aTerminalJoint=nullptr, bool aFollowLockedSegments=false) |
Private Attributes | |
const int | DP_PARALLELITY_THRESHOLD = 5 |
NODE * | m_world |
Definition at line 39 of file pns_topology.h.
typedef std::set<const JOINT*> PNS::TOPOLOGY::JOINT_SET |
Definition at line 42 of file pns_topology.h.
|
inline |
Definition at line 44 of file pns_topology.h.
|
inline |
Definition at line 47 of file pns_topology.h.
Definition at line 541 of file pns_topology.cpp.
References PNS::COLLISION_SEARCH_OPTIONS::m_differentNetsOnly, PNS::COLLISION_SEARCH_OPTIONS::m_overrideClearance, m_world, PNS::MK_HEAD, PNS::ITEM::Net(), PNS::ITEM::OfKind(), PNS::NODE::QueryColliding(), and PNS::ITEM::SEGMENT_T.
Referenced by PNS::SHOVE::onCollidingSolid().
Definition at line 467 of file pns_topology.cpp.
References std::abs(), PNS::NODE::AllItemsInNet(), PNS::SEGMENT::Anchor(), PNS::NODE::AssembleLine(), PNS::commonParallelProjection(), VECTOR2< T >::Cross(), DP_PARALLELITY_THRESHOLD, PNS::RULE_RESOLVER::DpCoupledNet(), PNS::RULE_RESOLVER::DpNetPolarity(), VECTOR2< T >::EuclideanNorm(), PNS::NODE::GetRuleResolver(), PNS::ITEM::Layers(), m_world, PNS::ITEM::Net(), PNS::SEGMENT::Seg(), PNS::DIFF_PAIR::SetGap(), PNS::ITEM::SetLayers(), PNS::DIFF_PAIR::SetWidth(), and PNS::LINE::Width().
Referenced by PNS::DP_MEANDER_PLACER::Start(), and PNS::MEANDER_SKEW_PLACER::Start().
const ITEM_SET PNS::TOPOLOGY::AssembleTrivialPath | ( | ITEM * | aStart, |
std::pair< const JOINT *, const JOINT * > * | aTerminalJoints = nullptr , |
||
bool | aFollowLockedSegments = false |
||
) |
Assemble a trivial path between two joints given a starting item.
aStart | is the item to assemble from. |
aTerminalJoints | will be filled with the start and end points of the assembled path. |
aFollowLockedSegments | if true will assemble a path including locked segments |
Definition at line 271 of file pns_topology.cpp.
References PNS::ITEM::ARC_T, PNS::NODE::AssembleLine(), PNS::JOINT::CLinks(), PNS::NODE::FindJoint(), followTrivialPath(), PNS::JOINT::IsNonFanoutVia(), PNS::ITEM::Kind(), m_world, PNS::ITEM::OfKind(), path, PNS::ITEM::SEGMENT_T, via, and PNS::ITEM::VIA_T.
Referenced by AssembleTuningPath(), and PNS::MEANDER_SKEW_PLACER::Start().
const ITEM_SET PNS::TOPOLOGY::AssembleTuningPath | ( | ITEM * | aStart, |
SOLID ** | aStartPad = nullptr , |
||
SOLID ** | aEndPad = nullptr |
||
) |
Like AssembleTrivialPath, but follows the track length algorithm, which discards segments that are fully inside pads, and truncates segments that cross into a pad (adding a straight- line segment from the intersection to the pad anchor).
aStart | is the item to assemble a path from. |
aStartPad | will be filled with the starting pad of the path, if found. |
aEndPad | will be filled with the ending pad of the path, if found. |
Definition at line 328 of file pns_topology.cpp.
References SEG::A, AssembleTrivialPath(), SEG::B, PNS::LINE::CLine(), SHAPE_LINE_CHAIN::CPoint(), SHAPE_LINE_CHAIN::CPoints(), delta, SHAPE_LINE_CHAIN::GetPoint(), SHAPE_LINE_CHAIN::Insert(), PNS::ITEM::Layer(), PNS::LINE::Line(), PNS::ITEM::LINE_T, PNS::JOINT::LinkList(), PCB_PAD_T, SHAPE_LINE_CHAIN::PointCount(), PNS::JOINT::Pos(), SHAPE_LINE_CHAIN::Remove(), SHAPE_LINE_CHAIN::Replace(), PNS::ITEM_SET::Size(), PNS::ITEM::SOLID_T, and EDA_ITEM::Type().
Referenced by PNS::DP_MEANDER_PLACER::Start(), PNS::MEANDER_PLACER::Start(), and PNS::MEANDER_SKEW_PLACER::Start().
const ITEM_SET PNS::TOPOLOGY::ConnectedItems | ( | const JOINT * | aStart, |
int | aKindMask = ITEM::ANY_T |
||
) |
Definition at line 452 of file pns_topology.cpp.
const ITEM_SET PNS::TOPOLOGY::ConnectedItems | ( | ITEM * | aStart, |
int | aKindMask = ITEM::ANY_T |
||
) |
Definition at line 458 of file pns_topology.cpp.
const TOPOLOGY::JOINT_SET PNS::TOPOLOGY::ConnectedJoints | ( | const JOINT * | aStart | ) |
Definition at line 62 of file pns_topology.cpp.
References PNS::NODE::FindJoint(), PNS::JOINT::LinkList(), m_world, next(), and PNS::ITEM::SEGMENT_T.
Referenced by NearestUnconnectedItem().
|
private |
Definition at line 200 of file pns_topology.cpp.
References PNS::ITEM_SET::Add(), anchor, PNS::NODE::AssembleLine(), PNS::LINE::CLine(), PNS::JOINT::CLinks(), PNS::LINE::CPoint(), SHAPE_LINE_CHAIN::CPoint(), PNS::NODE::FindJoint(), followTrivialPath(), PNS::LINK_HOLDER::IsLinked(), PNS::JOINT::IsNonFanoutVia(), PNS::JOINT::IsTraceWidthChange(), PNS::LINK_HOLDER::Links(), m_world, PNS::ITEM_SET::Prepend(), PNS::LINE::Reverse(), via, and PNS::ITEM::VIA_T.
Referenced by AssembleTrivialPath(), and followTrivialPath().
bool PNS::TOPOLOGY::LeadingRatLine | ( | const LINE * | aTrack, |
SHAPE_LINE_CHAIN & | aRatLine | ||
) |
Definition at line 140 of file pns_topology.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::Clear(), PNS::LINE::CPoint(), and NearestUnconnectedAnchorPoint().
Referenced by PNS::DIFF_PAIR_PLACER::updateLeadingRatLine(), and PNS::LINE_PLACER::updateLeadingRatLine().
bool PNS::TOPOLOGY::NearestUnconnectedAnchorPoint | ( | const LINE * | aTrack, |
VECTOR2I & | aPoint, | ||
LAYER_RANGE & | aLayers, | ||
ITEM *& | aItem | ||
) |
Definition at line 96 of file pns_topology.cpp.
References anchor, PNS::ITEM::Anchor(), PNS::NODE::Branch(), PNS::LINE::CPoint(), PNS::LINE::EndsWithVia(), PNS::NODE::GetRuleResolver(), PNS::ITEM::Layers(), PNS::JOINT::LinkCount(), PNS::JOINT::LinkList(), m_world, NearestUnconnectedItem(), PNS::JOINT::Net(), PNS::RULE_RESOLVER::NetCode(), PNS::LINE::PointCount(), and PNS::JOINT::Pos().
Referenced by PNS::ROUTER::getNearestRatnestAnchor(), and LeadingRatLine().
ITEM * PNS::TOPOLOGY::NearestUnconnectedItem | ( | const JOINT * | aStart, |
int * | aAnchor = nullptr , |
||
int | aKindMask = ITEM::ANY_T |
||
) |
Definition at line 157 of file pns_topology.cpp.
References PNS::NODE::AllItemsInNet(), ConnectedJoints(), EuclideanNorm(), m_world, PNS::JOINT::Net(), and PNS::JOINT::Pos().
Referenced by PNS::ROUTER::getNearestRatnestAnchor(), and NearestUnconnectedAnchorPoint().
bool PNS::TOPOLOGY::SimplifyLine | ( | LINE * | aLine | ) |
Definition at line 38 of file pns_topology.cpp.
References PNS::NODE::Add(), PNS::NODE::AssembleLine(), PNS::LINE::CLine(), PNS::LINK_HOLDER::GetLink(), PNS::LINK_HOLDER::IsLinked(), m_world, SHAPE_LINE_CHAIN::PointCount(), PNS::LINE::PointCount(), PNS::NODE::Remove(), PNS::LINE::SegmentCount(), PNS::LINE::SetShape(), and SHAPE_LINE_CHAIN::Simplify().
Referenced by PNS::DIFF_PAIR_PLACER::FixRoute().
|
private |
Definition at line 96 of file pns_topology.h.
Referenced by AssembleDiffPair().
|
private |
Definition at line 101 of file pns_topology.h.
Referenced by AssembleCluster(), AssembleDiffPair(), AssembleTrivialPath(), ConnectedJoints(), followTrivialPath(), NearestUnconnectedAnchorPoint(), NearestUnconnectedItem(), and SimplifyLine().