KiCad PCB EDA Suite
|
#include <pns_topology.h>
Classes | |
struct | CLUSTER |
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, PNS_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. | |
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). | |
const DIFF_PAIR | AssembleDiffPair (SEGMENT *aStart) |
bool | AssembleDiffPair (ITEM *aStart, DIFF_PAIR &aPair) |
const CLUSTER | AssembleCluster (ITEM *aStart, int aLayer, double aAreaExpansionLimit=0.0, NET_HANDLE aExcludedNet=nullptr) |
Private Member Functions | |
bool | followTrivialPath (LINE *aLine, bool aLeft, ITEM_SET &aSet, 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 49 of file pns_topology.h.
|
inline |
Definition at line 51 of file pns_topology.h.
|
inline |
Definition at line 54 of file pns_topology.h.
const TOPOLOGY::CLUSTER PNS::TOPOLOGY::AssembleCluster | ( | ITEM * | aStart, |
int | aLayer, | ||
double | aAreaExpansionLimit = 0.0 , |
||
NET_HANDLE | aExcludedNet = nullptr |
||
) |
Definition at line 625 of file pns_topology.cpp.
References PNS::ITEM::ARC_T, PNS::NODE::AssembleLine(), SHAPE::BBox(), BOX2< Vec >::GetArea(), PNS::COLLISION_SEARCH_OPTIONS::m_differentNetsOnly, PNS::TOPOLOGY::CLUSTER::m_items, PNS::COLLISION_SEARCH_OPTIONS::m_overrideClearance, m_world, BOX2< Vec >::Merge(), PNS::MK_HEAD, PNS::ITEM::Net(), PNS::ITEM::OfKind(), PNS::NODE::QueryColliding(), PNS::ITEM::SEGMENT_T, and PNS::ITEM::Shape().
Referenced by PNS::SHOVE::onCollidingSolid(), and PNS::WALKAROUND::singleStep().
Definition at line 474 of file pns_topology.cpp.
References std::abs(), PNS::NODE::AllItemsInNet(), PNS::ITEM::Anchor(), PNS::ITEM::AnchorCount(), SEG::ApproxParallel(), PNS::ITEM::ARC_T, PNS::NODE::AssembleLine(), PNS::ARC::CArc(), SHAPE::Centre(), PNS::commonParallelProjection(), VECTOR2< T >::Cross(), DP_PARALLELITY_THRESHOLD, PNS::RULE_RESOLVER::DpCoupledNet(), PNS::RULE_RESOLVER::DpNetPolarity(), VECTOR2< T >::EuclideanNorm(), PNS::NODE::FindJoint(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetRadius(), PNS::NODE::GetRuleResolver(), PNS::ITEM::Kind(), PNS::ITEM::Layers(), PNS::JOINT::LinkList(), PNS::LINK_HOLDER::Links(), m_world, PNS::ITEM::Net(), PNS::SEGMENT::Seg(), PNS::ITEM::SEGMENT_T, PNS::DIFF_PAIR::SetGap(), PNS::ITEM::SetLayers(), PNS::DIFF_PAIR::SetWidth(), PNS::ITEM::Shape(), SEG::Square(), SEG::SquaredDistance(), VECTOR2< T >::SquaredEuclideanNorm(), PNS::LINE::Width(), PNS::ARC::Width(), and PNS::SEGMENT::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 278 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 334 of file pns_topology.cpp.
References SEG::A, AssembleTrivialPath(), SEG::B, PNS::LINE::CLine(), SHAPE_LINE_CHAIN::CPoint(), SHAPE_LINE_CHAIN::CPoints(), delta, ERROR_INSIDE, 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 459 of file pns_topology.cpp.
const ITEM_SET PNS::TOPOLOGY::ConnectedItems | ( | ITEM * | aStart, |
int | aKindMask = ITEM::ANY_T |
||
) |
Definition at line 465 of file pns_topology.cpp.
const TOPOLOGY::JOINT_SET PNS::TOPOLOGY::ConnectedJoints | ( | const JOINT * | aStart | ) |
Definition at line 63 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 203 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(), PNS::LINK_HOLDER::IsLinked(), PNS::JOINT::IsNonFanoutVia(), PNS::JOINT::IsTraceWidthChange(), PNS::LINK_HOLDER::Links(), m_world, PNS::ITEM_SET::Prepend(), PNS::LINE::Reverse(), PNS::ITEM_SET::Size(), via, and PNS::ITEM::VIA_T.
Referenced by AssembleTrivialPath().
bool PNS::TOPOLOGY::LeadingRatLine | ( | const LINE * | aTrack, |
SHAPE_LINE_CHAIN & | aRatLine | ||
) |
Definition at line 143 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, | ||
PNS_LAYER_RANGE & | aLayers, | ||
ITEM *& | aItem | ||
) |
Definition at line 97 of file pns_topology.cpp.
References anchor, PNS::ITEM::Anchor(), PNS::NODE::Branch(), PNS::LINK_HOLDER::ClearLinks(), 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 160 of file pns_topology.cpp.
References PNS::NODE::AllItemsInNet(), ConnectedJoints(), 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 39 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 103 of file pns_topology.h.
Referenced by AssembleDiffPair().
|
private |
Definition at line 108 of file pns_topology.h.
Referenced by AssembleCluster(), AssembleDiffPair(), AssembleTrivialPath(), ConnectedJoints(), followTrivialPath(), NearestUnconnectedAnchorPoint(), NearestUnconnectedItem(), and SimplifyLine().