| 
    KiCad PCB EDA Suite
    
   | 
 
Keep the router "world" - i.e. More...
#include <pns_node.h>
  
Classes | |
| struct | DEFAULT_OBSTACLE_VISITOR | 
Public Types | |
| enum | COLLISION_QUERY_SCOPE { CQS_ALL_RULES = 1 , CQS_IGNORE_HOLE_CLEARANCE = 2 } | 
| < Supported item types  More... | |
| typedef std::optional< OBSTACLE > | OPT_OBSTACLE | 
| typedef std::vector< ITEM * > | ITEM_VECTOR | 
| typedef std::set< OBSTACLE > | OBSTACLES | 
Public Member Functions | |
| NODE () | |
| ~NODE () | |
| Return the expected clearance between items a and b.   | |
| int | GetClearance (const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const | 
| Return the pre-set worst case clearance between any pair of items.   | |
| int | GetMaxClearance () const | 
| Set the worst-case clearance between any pair of items.   | |
| void | SetMaxClearance (int aClearance) | 
| Assign a clearance resolution function object.   | |
| void | SetRuleResolver (RULE_RESOLVER *aFunc) | 
| RULE_RESOLVER * | GetRuleResolver () const | 
| Return the number of joints.   | |
| int | JointCount () const | 
| Return the number of nodes in the inheritance chain (wrs to the root node).   | |
| int | Depth () const | 
| int | QueryColliding (const ITEM *aItem, OBSTACLES &aObstacles, const COLLISION_SEARCH_OPTIONS &aOpts=COLLISION_SEARCH_OPTIONS()) const | 
| Find items colliding (closer than clearance) with the item aItem.   | |
| int | QueryJoints (const BOX2I &aBox, std::vector< JOINT * > &aJoints, PNS_LAYER_RANGE aLayerMask=PNS_LAYER_RANGE::All(), int aKindMask=ITEM::ANY_T) | 
| OPT_OBSTACLE | NearestObstacle (const LINE *aLine, const COLLISION_SEARCH_OPTIONS &aOpts=COLLISION_SEARCH_OPTIONS()) | 
| Follow the line in search of an obstacle that is nearest to the starting to the line's starting point.   | |
| OPT_OBSTACLE | CheckColliding (const ITEM *aItem, int aKindMask=ITEM::ANY_T) | 
| Check if the item collides with anything else in the world, and if found, returns the obstacle.   | |
| OPT_OBSTACLE | CheckColliding (const ITEM_SET &aSet, int aKindMask=ITEM::ANY_T) | 
| Check if any item in the set collides with anything else in the world, and if found, returns the obstacle.   | |
| OPT_OBSTACLE | CheckColliding (const ITEM *aItem, const COLLISION_SEARCH_OPTIONS &aOpts) | 
| Check if the item collides with anything else in the world, and if found, returns the obstacle.   | |
| const ITEM_SET | HitTest (const VECTOR2I &aPoint) const | 
| Find all items that contain the point aPoint.   | |
| bool | Add (std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false) | 
| Add an item to the current node.   | |
| void | Add (std::unique_ptr< SOLID > aSolid) | 
| void | Add (std::unique_ptr< VIA > aVia) | 
| bool | Add (std::unique_ptr< ARC > aArc, bool aAllowRedundant=false) | 
| void | Add (LINE &aLine, bool aAllowRedundant=false) | 
| void | AddEdgeExclusion (std::unique_ptr< SHAPE > aShape) | 
| bool | QueryEdgeExclusions (const VECTOR2I &aPos) const | 
| void | Remove (ARC *aArc) | 
| Remove an item from this branch.   | |
| void | Remove (SOLID *aSolid) | 
| void | Remove (VIA *aVia) | 
| void | Remove (SEGMENT *aSegment) | 
| void | Remove (ITEM *aItem) | 
| void | Remove (LINE &aLine) | 
| Removes a line from this branch.   | |
| void | Replace (ITEM *aOldItem, std::unique_ptr< ITEM > aNewItem) | 
| Replace an item with another one.   | |
| void | Replace (LINE &aOldLine, LINE &aNewLine, bool aAllowRedundantSegments=false) | 
| NODE * | Branch () | 
| Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs to the root.   | |
| const LINE | AssembleLine (LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false, bool aFollowLockedSegments=false, bool aAllowSegmentSizeMismatch=true) | 
| Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.   | |
| void | Dump (bool aLong=false) | 
| void | GetUpdatedItems (ITEM_VECTOR &aRemoved, ITEM_VECTOR &aAdded) | 
| Return the list of items removed and added in this branch with respect to the root branch.   | |
| void | Commit (NODE *aNode) | 
| Apply the changes from a given branch (aNode) to the root branch.   | |
| const JOINT * | FindJoint (const VECTOR2I &aPos, int aLayer, NET_HANDLE aNet) const | 
| Search for a joint at a given position, layer and belonging to given net.   | |
| void | LockJoint (const VECTOR2I &aPos, const ITEM *aItem, bool aLock) | 
| const JOINT * | FindJoint (const VECTOR2I &aPos, const ITEM *aItem) const | 
| Search for a joint at a given position, linked to given item.   | |
| int | FindLinesBetweenJoints (const JOINT &aA, const JOINT &aB, std::vector< LINE > &aLines) | 
| Find the joints corresponding to the ends of line aLine.   | |
| void | FindLineEnds (const LINE &aLine, JOINT &aA, JOINT &aB) | 
| Destroy all child nodes. Applicable only to the root node.   | |
| void | KillChildren () | 
| void | AllItemsInNet (NET_HANDLE aNet, std::set< ITEM * > &aItems, int aKindMask=-1) | 
| void | ClearRanks (int aMarkerMask=MK_HEAD|MK_VIOLATION) | 
| void | RemoveByMarker (int aMarker) | 
| ITEM * | FindItemByParent (const BOARD_ITEM *aParent) | 
| std::vector< ITEM * > | FindItemsByParent (const BOARD_ITEM *aParent) | 
| bool | HasChildren () const | 
| NODE * | GetParent () const | 
| Check if this branch contains an updated version of the m_item from the root branch.   | |
| bool | Overrides (ITEM *aItem) const | 
| void | FixupVirtualVias () | 
| void | AddRaw (ITEM *aItem, bool aAllowRedundant=false) | 
| const std::unordered_set< ITEM * > & | GetOverrides () const | 
| VIA * | FindViaByHandle (const VIA_HANDLE &handle) const | 
Private Types | |
| typedef std::unordered_multimap< JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH > | JOINT_MAP | 
| typedef JOINT_MAP::value_type | TagJointPair | 
Private Member Functions | |
| void | add (ITEM *aItem, bool aAllowRedundant=false) | 
| NODE (const NODE &aB) | |
| nodes are not copyable   | |
| NODE & | operator= (const NODE &aB) | 
| Try to find matching joint and creates a new one if not found.   | |
| JOINT & | touchJoint (const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet) | 
| Touch a joint and links it to an m_item.   | |
| void | linkJoint (const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet, ITEM *aWhere) | 
| Unlink an item from a joint.   | |
| void | unlinkJoint (const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet, ITEM *aWhere) | 
| Helpers for adding/removing items.   | |
| void | addSolid (SOLID *aSeg) | 
| void | addSegment (SEGMENT *aSeg) | 
| void | addVia (VIA *aVia) | 
| void | addArc (ARC *aVia) | 
| void | addHole (HOLE *aHole) | 
| void | removeSolidIndex (SOLID *aSeg) | 
| void | removeSegmentIndex (SEGMENT *aSeg) | 
| void | removeViaIndex (VIA *aVia) | 
| void | removeArcIndex (ARC *aVia) | 
| void | doRemove (ITEM *aItem) | 
| void | unlinkParent () | 
| void | releaseChildren () | 
| void | releaseGarbage () | 
| void | rebuildJoint (const JOINT *aJoint, const ITEM *aItem) | 
| bool | isRoot () const | 
| SEGMENT * | findRedundantSegment (const VECTOR2I &A, const VECTOR2I &B, const PNS_LAYER_RANGE &lr, NET_HANDLE aNet) | 
| SEGMENT * | findRedundantSegment (SEGMENT *aSeg) | 
| ARC * | findRedundantArc (const VECTOR2I &A, const VECTOR2I &B, const PNS_LAYER_RANGE &lr, NET_HANDLE aNet) | 
| ARC * | findRedundantArc (ARC *aSeg) | 
| Scan the joint map, forming a line starting from segment (current).   | |
| void | followLine (LINKED_ITEM *aCurrent, bool aScanDirection, int &aPos, int aLimit, VECTOR2I *aCorners, LINKED_ITEM **aSegments, bool *aArcReversed, bool &aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments) | 
Private Attributes | |
| JOINT_MAP | m_joints | 
| hash table with the joints, linking the items.   | |
| NODE * | m_parent | 
| node this node was branched from   | |
| NODE * | m_root | 
| root node of the whole hierarchy   | |
| std::set< NODE * > | m_children | 
| list of nodes branched from this one   | |
| std::unordered_set< ITEM * > | m_override | 
| hash of root's items that have been changed in this node   | |
| int | m_maxClearance | 
| worst case item-item clearance   | |
| RULE_RESOLVER * | m_ruleResolver | 
| Design rules resolver.   | |
| INDEX * | m_index | 
| Geometric/Net index of the items.   | |
| int | m_depth | 
| depth of the node (number of parent nodes in the inheritance chain)   | |
| std::vector< std::unique_ptr< SHAPE > > | m_edgeExclusions | 
| std::unordered_set< ITEM * > | m_garbageItems | 
Keep the router "world" - i.e.
all the tracks, vias, solids in a hierarchical and indexed way.
Features:
Definition at line 231 of file pns_node.h.
| typedef std::vector<ITEM*> PNS::NODE::ITEM_VECTOR | 
Definition at line 243 of file pns_node.h.
      
  | 
  private | 
Definition at line 567 of file pns_node.h.
| typedef std::set<OBSTACLE> PNS::NODE::OBSTACLES | 
Definition at line 244 of file pns_node.h.
| typedef std::optional<OBSTACLE> PNS::NODE::OPT_OBSTACLE | 
Definition at line 242 of file pns_node.h.
      
  | 
  private | 
Definition at line 568 of file pns_node.h.
< Supported item types
| Enumerator | |
|---|---|
| CQS_ALL_RULES | check all rules  | 
| CQS_IGNORE_HOLE_CLEARANCE | check everything except hole2hole / hole2copper  | 
Definition at line 236 of file pns_node.h.
| PNS::NODE::NODE | ( | ) | 
Definition at line 55 of file pns_node.cpp.
References m_depth, m_index, m_maxClearance, m_parent, m_root, and m_ruleResolver.
Referenced by Branch(), Commit(), GetParent(), NODE(), operator=(), and releaseChildren().
| PNS::NODE::~NODE | ( | ) | 
Return the expected clearance between items a and b.
Definition at line 70 of file pns_node.cpp.
References PNS::OWNABLE_ITEM::BelongsTo(), PNS::ITEM::HOLE_T, m_children, m_index, m_joints, m_ruleResolver, PNS::HOLE::ParentPadVia(), releaseGarbage(), and unlinkParent().
| void PNS::NODE::Add | ( | LINE & | aLine, | 
| bool | aAllowRedundant = false ) | 
Definition at line 601 of file pns_node.cpp.
References SEG::A, Add(), SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcCount(), SEG::B, PNS::LINK_HOLDER::ContainsLink(), SHAPE_LINE_CHAIN::CSegment(), findRedundantArc(), findRedundantSegment(), SHAPE_LINE_CHAIN::IsArcSegment(), PNS::LINK_HOLDER::IsLinked(), PNS::ITEM::Layers(), PNS::LINE::Line(), PNS::LINK_HOLDER::Link(), PNS::ITEM::Net(), and SHAPE_LINE_CHAIN::SegmentCount().
| bool PNS::NODE::Add | ( | std::unique_ptr< ARC > | aArc, | 
| bool | aAllowRedundant = false ) | 
Definition at line 694 of file pns_node.cpp.
References addArc(), findRedundantArc(), SHAPE_ARC::GetP0(), and SHAPE_ARC::GetP1().
| bool PNS::NODE::Add | ( | std::unique_ptr< SEGMENT > | aSegment, | 
| bool | aAllowRedundant = false ) | 
Add an item to the current node.
| aSegment | item to add. | 
| aAllowRedundant | if true, duplicate items are allowed (e.g. a segment or via at the same coordinates as an existing one). | 
Definition at line 665 of file pns_node.cpp.
References addSegment(), and findRedundantSegment().
Referenced by Add(), FixupVirtualVias(), PNS::MULTI_DRAGGER::multidragWalkaround(), PCB_TUNING_PATTERN::recoverBaseline(), PNS::LINE_PLACER::removeLoops(), PCB_TUNING_PATTERN::removeToBaseline(), Replace(), PCB_TUNING_PATTERN::resetToBaseline(), PNS::LINE_PLACER::simplifyNewLine(), PNS::LINE_PLACER::SplitAdjacentArcs(), PNS::LINE_PLACER::SplitAdjacentSegments(), PNS_KICAD_IFACE_BASE::syncBarcode(), PNS_KICAD_IFACE_BASE::syncGraphicalItem(), PNS_KICAD_IFACE_BASE::syncTextItem(), PNS_KICAD_IFACE_BASE::SyncWorld(), and PNS_KICAD_IFACE_BASE::syncZone().
| void PNS::NODE::Add | ( | std::unique_ptr< SOLID > | aSolid | ) | 
Definition at line 535 of file pns_node.cpp.
References addSolid().
| void PNS::NODE::Add | ( | std::unique_ptr< VIA > | aVia | ) | 
Definition at line 570 of file pns_node.cpp.
References addVia().
      
  | 
  private | 
Definition at line 576 of file pns_node.cpp.
References addArc(), addSegment(), addSolid(), addVia(), PNS::ITEM::ARC_T, PNS::ITEM::HOLE_T, PNS::ITEM::Kind(), PNS::ITEM::SEGMENT_T, PNS::ITEM::SOLID_T, and PNS::ITEM::VIA_T.
      
  | 
  private | 
Definition at line 683 of file pns_node.cpp.
References PNS::ARC::Anchor(), PNS::ITEM::Layers(), linkJoint(), m_index, PNS::ITEM::Net(), and PNS::OWNABLE_ITEM::SetOwner().
| void PNS::NODE::AddEdgeExclusion | ( | std::unique_ptr< SHAPE > | aShape | ) | 
Definition at line 709 of file pns_node.cpp.
References m_edgeExclusions.
Referenced by PNS_KICAD_IFACE_BASE::SyncWorld().
      
  | 
  private | 
Definition at line 560 of file pns_node.cpp.
References m_index, and PNS::OWNABLE_ITEM::SetOwner().
Referenced by addSolid(), and addVia().
      
  | 
  inline | 
Definition at line 499 of file pns_node.h.
References add().
      
  | 
  private | 
Definition at line 654 of file pns_node.cpp.
References SEG::A, SEG::B, PNS::ITEM::Layers(), linkJoint(), m_index, PNS::ITEM::Net(), PNS::SEGMENT::Seg(), and PNS::OWNABLE_ITEM::SetOwner().
      
  | 
  private | 
Definition at line 519 of file pns_node.cpp.
References addHole(), PNS::OWNABLE_ITEM::BelongsTo(), PNS::SOLID::HasHole(), PNS::SOLID::Hole(), PNS::ITEM::IsRoutable(), PNS::ITEM::Layers(), linkJoint(), m_index, PNS::ITEM::Net(), PNS::SOLID::Pos(), and PNS::OWNABLE_ITEM::SetOwner().
      
  | 
  private | 
Definition at line 542 of file pns_node.cpp.
References addHole(), PNS::OWNABLE_ITEM::BelongsTo(), PNS::VIA::HasHole(), PNS::VIA::Hole(), PNS::ITEM::Layers(), linkJoint(), m_index, PNS::ITEM::Net(), PNS::VIA::Pos(), and PNS::OWNABLE_ITEM::SetOwner().
| void PNS::NODE::AllItemsInNet | ( | NET_HANDLE | aNet, | 
| std::set< ITEM * > & | aItems, | ||
| int | aKindMask = -1 ) | 
Definition at line 1555 of file pns_node.cpp.
References isRoot(), m_index, m_root, and Overrides().
Referenced by PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair().
| const LINE PNS::NODE::AssembleLine | ( | LINKED_ITEM * | aSeg, | 
| int * | aOriginSegmentIndex = nullptr, | ||
| bool | aStopAtLockedJoints = false, | ||
| bool | aFollowLockedSegments = false, | ||
| bool | aAllowSegmentSizeMismatch = true ) | 
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
| aSeg | the initial segment. | 
| aOriginSegmentIndex | index of aSeg in the resulting line. | 
| aStopAtLockedJoints | will terminate the line at the first locked joint encountered | 
| aFollowLockedSegments | will consider a joint between a locked segment and an unlocked segment of the same width as a trivial joint. | 
| aAllowSegmentSizeMismatch | will allow segments of different widths to be connected | 
Definition at line 1047 of file pns_node.cpp.
References SHAPE_LINE_CHAIN::Append(), PNS::ITEM::ARC_T, SHAPE_LINE_CHAIN::ArcIndex(), SHAPE_LINE_CHAIN::CLastPoint(), followLine(), PNS::ITEM::GetSourceItem(), PNS::ITEM::Kind(), PNS::ITEM::Layers(), PNS::LINE::Line(), PNS::LINK_HOLDER::Link(), PNS::ITEM::Net(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::RemoveDuplicatePoints(), SHAPE_ARC::Reversed(), PNS::ITEM::SEGMENT_T, PNS::LINE::SegmentCount(), SHAPE_LINE_CHAIN::SegmentCount(), PNS::ITEM::SetLayers(), PNS::ITEM::SetNet(), PNS::OWNABLE_ITEM::SetOwner(), PNS::ITEM::SetParent(), PNS::ITEM::SetSourceItem(), PNS::LINE::SetWidth(), PNS::ARC::Shape(), and PNS::LINKED_ITEM::Width().
Referenced by Dump(), FindLinesBetweenJoints(), PNS::DRAGGER::findViaFanoutByHandle(), getPNSLine(), PCB_TUNING_PATTERN::initBaseLine(), PNS::LINE_PLACER::removeLoops(), and PNS::LINE_PLACER::simplifyNewLine().
| NODE * PNS::NODE::Branch | ( | ) | 
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs to the root.
Definition at line 143 of file pns_node.cpp.
References PNS::INDEX::Add(), isRoot(), m_children, m_depth, m_index, m_joints, m_maxClearance, m_override, m_parent, m_root, m_ruleResolver, NODE(), and PNS::INDEX::Size().
Referenced by PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), PNS::DIFF_PAIR_PLACER::Move(), PNS::LINE_PLACER::Move(), PNS::MULTI_DRAGGER::multidragWalkaround(), PCB_TUNING_PATTERN::recoverBaseline(), PCB_TUNING_PATTERN::resetToBaseline(), PNS::SHOVE::Run(), PNS::DP_MEANDER_PLACER::Start(), PNS::MEANDER_PLACER::Start(), and PNS::MEANDER_SKEW_PLACER::Start().
| NODE::OPT_OBSTACLE PNS::NODE::CheckColliding | ( | const ITEM * | aItem, | 
| const COLLISION_SEARCH_OPTIONS & | aOpts ) | 
Check if the item collides with anything else in the world, and if found, returns the obstacle.
| aItem | the item to find collisions with | 
| aOpts | options for the search | 
Definition at line 420 of file pns_node.cpp.
References PNS::LINE::CLine(), SHAPE_LINE_CHAIN::CSegment(), PNS::LINE::EndsWithVia(), PNS::ITEM::Kind(), PNS::ITEM::LINE_T, QueryColliding(), SHAPE_LINE_CHAIN::SegmentCount(), and PNS::LINE::Via().
| NODE::OPT_OBSTACLE PNS::NODE::CheckColliding | ( | const ITEM * | aItem, | 
| int | aKindMask = ITEM::ANY_T ) | 
Check if the item collides with anything else in the world, and if found, returns the obstacle.
| aItem | the item to find collisions with | 
| aKindMask | mask of obstacle types to take into account | 
Definition at line 410 of file pns_node.cpp.
References CheckColliding(), PNS::COLLISION_SEARCH_OPTIONS::m_kindMask, and PNS::COLLISION_SEARCH_OPTIONS::m_limitCount.
Referenced by PNS::DIFF_PAIR_PLACER::attemptWalk(), CheckColliding(), CheckColliding(), PNS::checkDpColliding(), PNS::COMPONENT_DRAGGER::FixRoute(), PNS::LINE_PLACER::FixRoute(), PNS::VIA::PushoutForce(), PNS::SHOVE::reduceSpringback(), PNS::tightenSegment(), and PNS::verifyDpBypass().
| NODE::OPT_OBSTACLE PNS::NODE::CheckColliding | ( | const ITEM_SET & | aSet, | 
| int | aKindMask = ITEM::ANY_T ) | 
Check if any item in the set collides with anything else in the world, and if found, returns the obstacle.
| aSet | set of items to find collisions with. | 
| aKindMask | mask of obstacle types to take into account. | 
Definition at line 396 of file pns_node.cpp.
References CheckColliding(), and PNS::ITEM_SET::CItems().
| void PNS::NODE::ClearRanks | ( | int | aMarkerMask = MK_HEAD | MK_VIOLATION | ) | 
Definition at line 1584 of file pns_node.cpp.
References m_index.
| void PNS::NODE::Commit | ( | NODE * | aNode | ) | 
Apply the changes from a given branch (aNode) to the root branch.
Calling on a non-root branch will fail. Calling commit also kills all children nodes of the root branch.
| aNode | node to commit changes from. | 
Definition at line 1524 of file pns_node.cpp.
References add(), PNS::ITEM::HasHole(), PNS::ITEM::Hole(), isRoot(), m_index, m_override, NODE(), releaseChildren(), releaseGarbage(), Remove(), PNS::OWNABLE_ITEM::SetOwner(), PNS::ITEM::SetRank(), and PNS::ITEM::Unmark().
      
  | 
  inline | 
Definition at line 282 of file pns_node.h.
References m_depth.
Referenced by PNS::LINE_PLACER::Move(), PNS::NodeStats(), PNS::SHOVE::pushSpringback(), PNS::SHOVE::reduceSpringback(), PNS::SHOVE::shoveIteration(), and PNS::WALKAROUND::singleStep().
      
  | 
  private | 
Definition at line 727 of file pns_node.cpp.
References PNS::OWNABLE_ITEM::BelongsTo(), PNS::ITEM::HasHole(), PNS::ITEM::Hole(), isRoot(), m_index, m_override, m_root, and PNS::OWNABLE_ITEM::SetOwner().
| void PNS::NODE::Dump | ( | bool | aLong = false | ) | 
Definition at line 1382 of file pns_node.cpp.
References AssembleLine(), PNS::ITEM::Format(), PNS::SEGMENT::Format(), isRoot(), m_joints, m_root, and PNS::ITEM::SEGMENT_T.
| ITEM * PNS::NODE::FindItemByParent | ( | const BOARD_ITEM * | aParent | ) | 
Definition at line 1717 of file pns_node.cpp.
References BOARD_CONNECTED_ITEM::GetNet(), BOARD_ITEM::IsConnected(), and m_index.
| std::vector< ITEM * > PNS::NODE::FindItemsByParent | ( | const BOARD_ITEM * | aParent | ) | 
Definition at line 1738 of file pns_node.cpp.
References m_index.
Search for a joint at a given position, linked to given item.
Definition at line 457 of file pns_node.h.
References FindJoint(), PNS::ITEM::Layers(), PNS::ITEM::Net(), and PNS_LAYER_RANGE::Start().
| const JOINT * PNS::NODE::FindJoint | ( | const VECTOR2I & | aPos, | 
| int | aLayer, | ||
| NET_HANDLE | aNet ) const | 
Search for a joint at a given position, layer and belonging to given net.
Definition at line 1268 of file pns_node.cpp.
References end, isRoot(), m_joints, m_root, PNS::JOINT::HASH_TAG::net, and PNS::JOINT::HASH_TAG::pos.
Referenced by FindJoint(), FindLineEnds(), findRedundantArc(), findRedundantSegment(), FindViaByHandle(), PNS::DRAGGER::findViaFanoutByHandle(), followLine(), PNS::getDanglingAnchor(), PNS::ROUTER::GetNearestRatnestAnchor(), PNS_KICAD_IFACE_BASE::inheritTrackWidth(), removeSolidIndex(), removeViaIndex(), PNS::LINE_PLACER::simplifyNewLine(), PNS::LINE_PLACER::SplitAdjacentArcs(), and PNS::LINE_PLACER::SplitAdjacentSegments().
Destroy all child nodes. Applicable only to the root node.
Definition at line 1138 of file pns_node.cpp.
References PNS::LINE::CLastPoint(), PNS::LINE::CPoint(), and FindJoint().
Referenced by FindLinesBetweenJoints(), and PNS::LINE_PLACER::removeLoops().
| int PNS::NODE::FindLinesBetweenJoints | ( | const JOINT & | aA, | 
| const JOINT & | aB, | ||
| std::vector< LINE > & | aLines ) | 
Find the joints corresponding to the ends of line aLine.
Definition at line 1145 of file pns_node.cpp.
References PNS::ITEM::ARC_T, AssembleLine(), PNS::LINE::CLine(), PNS::LINE::ClipVertexRange(), SHAPE_LINE_CHAIN::Find(), FindLineEnds(), PNS::ITEM::Layers(), PNS::JOINT::LinkList(), PNS_LAYER_RANGE::Overlaps(), PNS::JOINT::Pos(), and PNS::ITEM::SEGMENT_T.
Referenced by PNS::LINE_PLACER::removeLoops().
Scan the joint map, forming a line starting from segment (current).
Definition at line 1673 of file pns_node.cpp.
References PNS::ARC::Anchor(), findRedundantArc(), PNS::ITEM::Layers(), and PNS::ITEM::Net().
      
  | 
  private | 
Definition at line 1644 of file pns_node.cpp.
References PNS::ARC::Anchor(), PNS::ITEM::ARC_T, FindJoint(), PNS::ITEM::Layers(), PNS::JOINT::LinkList(), and PNS_LAYER_RANGE::Start().
Referenced by Add(), Add(), and findRedundantArc().
      
  | 
  private | 
Definition at line 1609 of file pns_node.cpp.
References SEG::A, SEG::B, FindJoint(), PNS::ITEM::Layers(), PNS::JOINT::LinkList(), PNS::SEGMENT::Seg(), PNS::ITEM::SEGMENT_T, and PNS_LAYER_RANGE::Start().
Referenced by Add(), Add(), and findRedundantSegment().
Definition at line 1638 of file pns_node.cpp.
References SEG::A, SEG::B, findRedundantSegment(), PNS::ITEM::Layers(), PNS::ITEM::Net(), and PNS::SEGMENT::Seg().
| VIA * PNS::NODE::FindViaByHandle | ( | const VIA_HANDLE & | handle | ) | const | 
Definition at line 1752 of file pns_node.cpp.
References FindJoint(), PNS::VIA_HANDLE::layers, PNS::JOINT::LinkList(), PNS::VIA_HANDLE::net, PNS::VIA_HANDLE::pos, PNS_LAYER_RANGE::Start(), and PNS::ITEM::VIA_T.
| void PNS::NODE::FixupVirtualVias | ( | ) | 
Definition at line 1179 of file pns_node.cpp.
References SEG::A, Add(), SEG::B, dyn_cast(), PNS_LAYER_RANGE::IsMultilayer(), PNS::ItemCast(), PNS::ITEM::Layers(), PNS::JOINT::LinkList(), m_joints, PNS::JOINT::Net(), PNS_HULL_MARGIN, PNS::JOINT::Pos(), PNS::SEGMENT::Seg(), PNS::ITEM::SOLID_T, PNS_LAYER_RANGE::Start(), and PNS::ITEM::VIA_T.
      
  | 
  private | 
Definition at line 992 of file pns_node.cpp.
References PNS::ITEM::Anchor(), PNS::ITEM::ARC_T, FindJoint(), PNS::JOINT::IsLocked(), PNS::ITEM::Kind(), locked, PNS::JOINT::NextSegment(), and PNS::JOINT::Pos().
Referenced by AssembleLine().
| int PNS::NODE::GetClearance | ( | const ITEM * | aA, | 
| const ITEM * | aB, | ||
| bool | aUseClearanceEpsilon = true ) const | 
Return the pre-set worst case clearance between any pair of items.
Definition at line 129 of file pns_node.cpp.
References PNS::ITEM::IsVirtual(), and m_ruleResolver.
Referenced by PNS::ITEM::collideSimple(), PNS::ROUTER::markViolations(), NearestObstacle(), and PNS::VIA::PushoutForce().
      
  | 
  inline | 
Set the worst-case clearance between any pair of items.
Definition at line 253 of file pns_node.h.
References m_maxClearance.
      
  | 
  inline | 
Definition at line 504 of file pns_node.h.
References m_override.
      
  | 
  inline | 
Check if this branch contains an updated version of the m_item from the root branch.
Definition at line 486 of file pns_node.h.
      
  | 
  inline | 
Return the number of joints.
Definition at line 270 of file pns_node.h.
References m_ruleResolver.
Referenced by PNS::ITEM::collideSimple(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), and NearestObstacle().
| void PNS::NODE::GetUpdatedItems | ( | ITEM_VECTOR & | aRemoved, | 
| ITEM_VECTOR & | aAdded ) | 
Return the list of items removed and added in this branch with respect to the root branch.
| aRemoved | removed items. | 
| aAdded | added items. | 
Definition at line 1469 of file pns_node.cpp.
References isRoot(), m_index, and m_override.
Referenced by PNS::ROUTER::CommitRouting(), PNS::ROUTER::GetUpdatedItems(), PNS::NodeStats(), PNS::SHOVE::pruneRootLines(), PNS_LOG_PLAYER::ReplayLog(), PNS::LINE_PLACER::simplifyNewLine(), and PNS::ROUTER::updateView().
      
  | 
  inline | 
Definition at line 481 of file pns_node.h.
References m_children.
Find all items that contain the point aPoint.
| aPoint | the point. | 
Definition at line 490 of file pns_node.cpp.
References PNS::ITEM_SET::Add(), isRoot(), PNS::ITEM_SET::Items(), m_index, m_maxClearance, m_root, Overrides(), and PNS::OBSTACLE_VISITOR::SetWorld().
Referenced by PNS::ROUTER::QueryHoverItems().
      
  | 
  inlineprivate | 
Definition at line 547 of file pns_node.h.
References m_parent.
Referenced by AllItemsInNet(), Branch(), Commit(), doRemove(), Dump(), FindJoint(), GetUpdatedItems(), HitTest(), QueryColliding(), QueryJoints(), rebuildJoint(), releaseGarbage(), touchJoint(), and unlinkParent().
      
  | 
  inline | 
Return the number of nodes in the inheritance chain (wrs to the root node).
Definition at line 276 of file pns_node.h.
References m_joints.
| void PNS::NODE::KillChildren | ( | ) | 
Definition at line 1549 of file pns_node.cpp.
References releaseChildren().
Referenced by PNS::DIFF_PAIR_PLACER::initPlacement(), PNS::LINE_PLACER::initPlacement(), and PNS::SHOVE::RewindSpringbackTo().
      
  | 
  private | 
Unlink an item from a joint.
Definition at line 1363 of file pns_node.cpp.
References PNS::JOINT::Link(), and touchJoint().
Referenced by addArc(), addSegment(), addSolid(), addVia(), and rebuildJoint().
Definition at line 1295 of file pns_node.cpp.
References PNS::ITEM::Layers(), PNS::JOINT::Lock(), PNS::ITEM::Net(), and touchJoint().
| NODE::OPT_OBSTACLE PNS::NODE::NearestObstacle | ( | const LINE * | aLine, | 
| const COLLISION_SEARCH_OPTIONS & | aOpts = COLLISION_SEARCH_OPTIONS() ) | 
Follow the line in search of an obstacle that is nearest to the starting to the line's starting point.
| aLine | the item to find collisions with | 
| aOpts | options for the search | 
Definition at line 286 of file pns_node.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::BBox(), SHAPE_LINE_CHAIN::Clear(), clearance, PNS::RULE_RESOLVER::ClearanceEpsilon(), PNS::LINE::CLine(), SHAPE_LINE_CHAIN::CSegment(), PNS::LINE::EndsWithVia(), BOX2< Vec >::GetBottom(), GetClearance(), PNS::ROUTING_SETTINGS::GetCornerMode(), PNS::ROUTER_IFACE::GetDebugDecorator(), PNS::ROUTER::GetInstance(), PNS::ROUTER::GetInterface(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), GetRuleResolver(), BOX2< Vec >::GetTop(), PNS::HullIntersection(), SHAPE_LINE_CHAIN::INTERSECTION::index_their, PNS::ITEM::Layer(), PNS::OBSTACLE::m_distFirst, PNS::OBSTACLE::m_head, PNS::OBSTACLE::m_ipFirst, PNS::OBSTACLE::m_item, PNS::OBSTACLE::m_maxFanoutWidth, PNS::COLLISION_SEARCH_OPTIONS::m_useClearanceEpsilon, DIRECTION_45::MITERED_90, SHAPE_LINE_CHAIN::INTERSECTION::p, SHAPE_LINE_CHAIN::PathLength(), QueryColliding(), DIRECTION_45::ROUNDED_90, PNS::ROUTER::Settings(), PNS::LINE::Via(), via, and PNS::LINE::Width().
Referenced by PNS::LINE::ClipToNearestObstacle().
Try to find matching joint and creates a new one if not found.
References NODE().
      
  | 
  inline | 
Definition at line 492 of file pns_node.h.
References m_override.
Referenced by AllItemsInNet(), HitTest(), and QueryJoints().
| int PNS::NODE::QueryColliding | ( | const ITEM * | aItem, | 
| NODE::OBSTACLES & | aObstacles, | ||
| const COLLISION_SEARCH_OPTIONS & | aOpts = COLLISION_SEARCH_OPTIONS() ) const | 
Find items colliding (closer than clearance) with the item aItem.
| aItem | item to check collisions against | 
| aObstacles | set of colliding objects found | 
| aKindMask | mask of obstacle types to take into account | 
| aLimitCount | stop looking for collisions after finding this number of colliding items | 
By default, virtual items cannot collide
Definition at line 255 of file pns_node.cpp.
References isRoot(), PNS::ITEM::IsVirtual(), m_index, PNS::COLLISION_SEARCH_OPTIONS::m_limitCount, m_maxClearance, m_root, PNS::COLLISION_SEARCH_CONTEXT::obstacles, and PNS::OBSTACLE_VISITOR::SetWorld().
Referenced by CheckColliding(), PNS::ROUTER::markViolations(), NearestObstacle(), PNS::ROUTER::QueryHoverItems(), and PCB_TUNING_PATTERN::recoverBaseline().
| bool PNS::NODE::QueryEdgeExclusions | ( | const VECTOR2I & | aPos | ) | const | 
Definition at line 715 of file pns_node.cpp.
References m_edgeExclusions.
Referenced by PNS::ITEM::collideSimple().
| int PNS::NODE::QueryJoints | ( | const BOX2I & | aBox, | 
| std::vector< JOINT * > & | aJoints, | ||
| PNS_LAYER_RANGE | aLayerMask = PNS_LAYER_RANGE::All(), | ||
| int | aKindMask = ITEM::ANY_T ) | 
Definition at line 1679 of file pns_node.cpp.
References BOX2< Vec >::Contains(), isRoot(), m_joints, m_root, and Overrides().
Definition at line 788 of file pns_node.cpp.
References isRoot(), PNS::ITEM::LayersOverlap(), linkJoint(), PNS::JOINT::LinkList(), m_joints, PNS::ITEM::Net(), PNS::JOINT::HASH_TAG::net, PNS::JOINT::Pos(), PNS::JOINT::HASH_TAG::pos, split(), and unlinkJoint().
Referenced by removeSolidIndex(), and removeViaIndex().
      
  | 
  private | 
Definition at line 1488 of file pns_node.cpp.
References m_children, and NODE().
Referenced by Commit(), and KillChildren().
      
  | 
  private | 
Definition at line 1501 of file pns_node.cpp.
References isRoot(), m_garbageItems, and m_ruleResolver.
| void PNS::NODE::Remove | ( | ARC * | aArc | ) | 
Remove an item from this branch.
Definition at line 909 of file pns_node.cpp.
References doRemove(), and removeArcIndex().
Referenced by Commit(), PNS::MULTI_DRAGGER::multidragWalkaround(), PCB_TUNING_PATTERN::recoverBaseline(), Remove(), Remove(), RemoveByMarker(), PNS::removeHead(), PNS::LINE_PLACER::removeLoops(), PCB_TUNING_PATTERN::removeToBaseline(), Replace(), Replace(), PCB_TUNING_PATTERN::resetToBaseline(), PNS::LINE_PLACER::simplifyNewLine(), PNS::LINE_PLACER::SplitAdjacentArcs(), and PNS::LINE_PLACER::SplitAdjacentSegments().
| void PNS::NODE::Remove | ( | ITEM * | aItem | ) | 
Definition at line 916 of file pns_node.cpp.
References PNS::ITEM::ARC_T, PNS::SOLID::HasHole(), PNS::SOLID::Hole(), PNS::ITEM::Kind(), PNS::ITEM::LINE_T, PNS::LINK_HOLDER::Links(), Remove(), PNS::ITEM::SEGMENT_T, PNS::OWNABLE_ITEM::SetOwner(), PNS::ITEM::SOLID_T, via, and PNS::ITEM::VIA_T.
| void PNS::NODE::Remove | ( | LINE & | aLine | ) | 
Removes a line from this branch.
| aLine | item to remove | 
Definition at line 972 of file pns_node.cpp.
References PNS::ITEM::ARC_T, PNS::LINK_HOLDER::ClearLinks(), PNS::LINK_HOLDER::Links(), Remove(), PNS::ITEM::SEGMENT_T, PNS::OWNABLE_ITEM::SetOwner(), and PNS::ITEM::VIA_T.
| void PNS::NODE::Remove | ( | SEGMENT * | aSegment | ) | 
Definition at line 902 of file pns_node.cpp.
References doRemove(), and removeSegmentIndex().
| void PNS::NODE::Remove | ( | SOLID * | aSolid | ) | 
Definition at line 883 of file pns_node.cpp.
References doRemove(), and removeSolidIndex().
| void PNS::NODE::Remove | ( | VIA * | aVia | ) | 
Definition at line 890 of file pns_node.cpp.
References PNS::OWNABLE_ITEM::BelongsTo(), doRemove(), PNS::VIA::Hole(), PNS::OWNABLE_ITEM::Owner(), and removeViaIndex().
      
  | 
  private | 
Definition at line 781 of file pns_node.cpp.
References PNS::ARC::Anchor(), PNS::ITEM::Layers(), PNS::ITEM::Net(), and unlinkJoint().
Referenced by Remove().
| void PNS::NODE::RemoveByMarker | ( | int | aMarker | ) | 
Definition at line 1594 of file pns_node.cpp.
      
  | 
  private | 
Definition at line 774 of file pns_node.cpp.
References SEG::A, SEG::B, PNS::ITEM::Layers(), PNS::ITEM::Net(), PNS::SEGMENT::Seg(), and unlinkJoint().
Referenced by Remove().
      
  | 
  private | 
Definition at line 857 of file pns_node.cpp.
References FindJoint(), PNS::ITEM::IsRoutable(), PNS::ITEM::Layers(), PNS::ITEM::Net(), PNS::SOLID::Pos(), rebuildJoint(), and PNS_LAYER_RANGE::Start().
Referenced by Remove().
      
  | 
  private | 
Definition at line 849 of file pns_node.cpp.
References FindJoint(), PNS::ITEM::Layers(), PNS::ITEM::Net(), PNS::VIA::Pos(), rebuildJoint(), and PNS_LAYER_RANGE::Start().
Referenced by Remove().
Replace an item with another one.
| aOldItem | item to be removed | 
| aNewItem | item add instead | 
Definition at line 869 of file pns_node.cpp.
References add(), and Remove().
Referenced by PNS::SHOVE::replaceLine().
Definition at line 876 of file pns_node.cpp.
      
  | 
  inline | 
Assign a clearance resolution function object.
Definition at line 259 of file pns_node.h.
References m_maxClearance.
Referenced by PNS_KICAD_IFACE_BASE::SyncWorld().
      
  | 
  inline | 
Definition at line 265 of file pns_node.h.
References m_ruleResolver.
Referenced by PNS_KICAD_IFACE_BASE::SyncWorld().
      
  | 
  private | 
Touch a joint and links it to an m_item.
Definition at line 1302 of file pns_node.cpp.
References isRoot(), m_joints, m_root, PNS::JOINT::Merge(), PNS::JOINT::HASH_TAG::net, PNS_LAYER_RANGE::Overlaps(), and PNS::JOINT::HASH_TAG::pos.
Referenced by linkJoint(), LockJoint(), and unlinkJoint().
      
  | 
  private | 
Helpers for adding/removing items.
Definition at line 1372 of file pns_node.cpp.
References touchJoint(), and PNS::JOINT::Unlink().
Referenced by rebuildJoint(), removeArcIndex(), and removeSegmentIndex().
      
  | 
  private | 
Definition at line 179 of file pns_node.cpp.
References isRoot(), and m_parent.
Referenced by ~NODE().
      
  | 
  private | 
list of nodes branched from this one
Definition at line 575 of file pns_node.h.
Referenced by Branch(), HasChildren(), releaseChildren(), and ~NODE().
      
  | 
  private | 
depth of the node (number of parent nodes in the inheritance chain)
Definition at line 583 of file pns_node.h.
      
  | 
  private | 
Definition at line 586 of file pns_node.h.
Referenced by AddEdgeExclusion(), and QueryEdgeExclusions().
      
  | 
  private | 
Definition at line 588 of file pns_node.h.
Referenced by releaseGarbage().
      
  | 
  private | 
Geometric/Net index of the items.
Definition at line 582 of file pns_node.h.
Referenced by addArc(), addHole(), addSegment(), addSolid(), addVia(), AllItemsInNet(), Branch(), ClearRanks(), Commit(), doRemove(), FindItemByParent(), FindItemsByParent(), GetUpdatedItems(), HitTest(), NODE(), QueryColliding(), RemoveByMarker(), and ~NODE().
      
  | 
  private | 
hash table with the joints, linking the items.
Joints are hashed by their position, layer set and net.
Definition at line 570 of file pns_node.h.
Referenced by Branch(), Dump(), FindJoint(), FixupVirtualVias(), JointCount(), QueryJoints(), rebuildJoint(), touchJoint(), and ~NODE().
      
  | 
  private | 
worst case item-item clearance
Definition at line 580 of file pns_node.h.
Referenced by Branch(), GetMaxClearance(), HitTest(), NODE(), QueryColliding(), and SetMaxClearance().
      
  | 
  private | 
hash of root's items that have been changed in this node
Definition at line 577 of file pns_node.h.
Referenced by Branch(), Commit(), doRemove(), GetOverrides(), GetUpdatedItems(), and Overrides().
      
  | 
  private | 
node this node was branched from
Definition at line 573 of file pns_node.h.
Referenced by Branch(), GetParent(), isRoot(), NODE(), and unlinkParent().
      
  | 
  private | 
root node of the whole hierarchy
Definition at line 574 of file pns_node.h.
Referenced by AllItemsInNet(), Branch(), doRemove(), Dump(), FindJoint(), HitTest(), NODE(), QueryColliding(), QueryJoints(), and touchJoint().
      
  | 
  private | 
Design rules resolver.
Definition at line 581 of file pns_node.h.
Referenced by Branch(), GetClearance(), GetRuleResolver(), NODE(), releaseGarbage(), SetRuleResolver(), and ~NODE().