KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_node.h
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef __PNS_NODE_H
24#define __PNS_NODE_H
25
26#include <vector>
27#include <list>
28#include <set>
29#include <core/minoptmax.h>
30
33
34#include "pns_item.h"
35#include "pns_joint.h"
36#include "pns_itemset.h"
37
38class ZONE;
39namespace PNS {
40
41class ARC;
42class SEGMENT;
43class LINE;
44class SOLID;
45class VIA;
46class INDEX;
47class ROUTER;
48class NODE;
49
50
52{
53 CT_CLEARANCE = 1,
55 CT_LENGTH = 3,
56 CT_WIDTH = 4,
58 CT_VIA_HOLE = 6,
65};
66
73{
77 wxString m_RuleName;
78 wxString m_FromName;
79 wxString m_ToName;
80};
81
82
87{
88 ITEM* m_head = nullptr;
89 ITEM* m_item = nullptr;
95
96 bool operator==(const OBSTACLE& other) const
97 {
98 return m_head == other.m_head && m_item == other.m_item;
99 }
100
101 bool operator<(const OBSTACLE& other) const
102 {
103 if( (uintptr_t)m_head < (uintptr_t)other.m_head )
104 return true;
105 else if ( m_head == other.m_head )
106 return (uintptr_t)m_item < (uintptr_t)other.m_item;
107 return false;
108 }
109};
110
111
113{
116 int m_limitCount = -1;
117 int m_kindMask = -1;
119 std::function<bool(const ITEM*)> m_filter = nullptr;
120 int m_layer = -1;
121};
122
123
125{
127 obstacles( aObs ),
128 options( aOpts )
129 {
130 }
131
132 std::set<OBSTACLE>& obstacles;
134};
135
136
138{
139public:
140 virtual ~RULE_RESOLVER() {}
141
142 virtual int Clearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) = 0;
143
144 virtual NET_HANDLE DpCoupledNet( NET_HANDLE aNet ) = 0;
145 virtual int DpNetPolarity( NET_HANDLE aNet ) = 0;
146 virtual bool DpNetPair( const ITEM* aItem, NET_HANDLE& aNetP, NET_HANDLE& aNetN ) = 0;
147
148 virtual int NetCode( NET_HANDLE aNet ) = 0;
149 virtual wxString NetName( NET_HANDLE aNet ) = 0;
150
151 virtual bool IsInNetTie( const ITEM* aA ) = 0;
152 virtual bool IsNetTieExclusion( const ITEM* aItem, const VECTOR2I& aCollisionPos,
153 const ITEM* aCollidingItem ) = 0;
154
155 virtual bool IsDrilledHole( const PNS::ITEM* aItem ) = 0;
156 virtual bool IsNonPlatedSlot( const PNS::ITEM* aItem ) = 0;
157
162 virtual bool IsKeepout( const ITEM* aObstacle, const ITEM* aItem, bool* aEnforce ) = 0;
163
164 virtual bool QueryConstraint( CONSTRAINT_TYPE aType, const ITEM* aItemA, const ITEM* aItemB,
165 int aLayer, CONSTRAINT* aConstraint ) = 0;
166
167 virtual void ClearCacheForItems( std::vector<const ITEM*>& aItems ) {}
168 virtual void ClearCaches() {}
169 virtual void ClearTemporaryCaches() {}
170
171 virtual int ClearanceEpsilon() const { return 0; }
172};
173
174
176{
177public:
178 OBSTACLE_VISITOR( const ITEM* aItem );
179
181 {
182 }
183
184 void SetWorld( const NODE* aNode, const NODE* aOverride = nullptr );
185
186 void SetLayerContext( int aLayer ) { m_layerContext = aLayer; }
187 void ClearLayerContext() { m_layerContext = std::nullopt; }
188
189 virtual bool operator()( ITEM* aCandidate ) = 0;
190
191protected:
192 bool visit( ITEM* aCandidate );
193
194protected:
195 const ITEM* m_item;
196
197 const NODE* m_node;
199 std::optional<int> m_layerContext;
200};
201
202
204{
205public:
206 LAYER_CONTEXT_SETTER( OBSTACLE_VISITOR& aVisitor, int aLayer ) :
207 m_visitor( aVisitor )
208 {
209 m_visitor.SetLayerContext( aLayer );
210 }
211
213 {
215 }
216
217private:
219};
220
230class NODE : public ITEM_OWNER
231{
232public:
233
236 {
239 };
240
241 typedef std::optional<OBSTACLE> OPT_OBSTACLE;
242 typedef std::vector<ITEM*> ITEM_VECTOR;
243 typedef std::set<OBSTACLE> OBSTACLES;
244
245 NODE();
246 ~NODE();
247
249 int GetClearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) const;
250
252 int GetMaxClearance() const
253 {
254 return m_maxClearance;
255 }
256
258 void SetMaxClearance( int aClearance )
259 {
260 m_maxClearance = aClearance;
261 }
262
265 {
266 m_ruleResolver = aFunc;
267 }
268
270 {
271 return m_ruleResolver;
272 }
273
275 int JointCount() const
276 {
277 return m_joints.size();
278 }
279
281 int Depth() const
282 {
283 return m_depth;
284 }
285
295 int QueryColliding( const ITEM* aItem, OBSTACLES& aObstacles,
296 const COLLISION_SEARCH_OPTIONS& aOpts = COLLISION_SEARCH_OPTIONS() ) const;
297
298 int QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints,
299 PNS_LAYER_RANGE aLayerMask = PNS_LAYER_RANGE::All(), int aKindMask = ITEM::ANY_T );
300
309 OPT_OBSTACLE NearestObstacle( const LINE* aLine,
311
320 OPT_OBSTACLE CheckColliding( const ITEM* aItem, int aKindMask = ITEM::ANY_T );
321
322
331 OPT_OBSTACLE CheckColliding( const ITEM_SET& aSet, int aKindMask = ITEM::ANY_T );
332
341 OPT_OBSTACLE CheckColliding( const ITEM* aItem, const COLLISION_SEARCH_OPTIONS& aOpts );
342
349 const ITEM_SET HitTest( const VECTOR2I& aPoint ) const;
350
359 bool Add( std::unique_ptr<SEGMENT> aSegment, bool aAllowRedundant = false );
360 void Add( std::unique_ptr<SOLID> aSolid );
361 void Add( std::unique_ptr<VIA> aVia );
362 bool Add( std::unique_ptr<ARC> aArc, bool aAllowRedundant = false );
363
364 void Add( LINE& aLine, bool aAllowRedundant = false );
365
366 void AddEdgeExclusion( std::unique_ptr<SHAPE> aShape );
367 bool QueryEdgeExclusions( const VECTOR2I& aPos ) const;
368
372 void Remove( ARC* aArc );
373 void Remove( SOLID* aSolid );
374 void Remove( VIA* aVia );
375 void Remove( SEGMENT* aSegment );
376 void Remove( ITEM* aItem );
377
383 void Remove( LINE& aLine );
384
391 void Replace( ITEM* aOldItem, std::unique_ptr< ITEM > aNewItem );
392 void Replace( LINE& aOldLine, LINE& aNewLine );
393
402 NODE* Branch();
403
415 const LINE AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex = nullptr,
416 bool aStopAtLockedJoints = false,
417 bool aFollowLockedSegments = false );
418
420 void Dump( bool aLong = false );
421
428 void GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded );
429
438 void Commit( NODE* aNode );
439
445 const JOINT* FindJoint( const VECTOR2I& aPos, int aLayer, NET_HANDLE aNet ) const;
446
447 void LockJoint( const VECTOR2I& aPos, const ITEM* aItem, bool aLock );
448
454 const JOINT* FindJoint( const VECTOR2I& aPos, const ITEM* aItem ) const
455 {
456 return FindJoint( aPos, aItem->Layers().Start(), aItem->Net() );
457 }
458
460 int FindLinesBetweenJoints( const JOINT& aA, const JOINT& aB, std::vector<LINE>& aLines );
461
463 void FindLineEnds( const LINE& aLine, JOINT& aA, JOINT& aB );
464
466 void KillChildren();
467
468 void AllItemsInNet( NET_HANDLE aNet, std::set<ITEM*>& aItems, int aKindMask = -1 );
469
470 void ClearRanks( int aMarkerMask = MK_HEAD | MK_VIOLATION );
471
472 void RemoveByMarker( int aMarker );
473
474 ITEM* FindItemByParent( const BOARD_ITEM* aParent );
475
476 std::vector<ITEM*> FindItemsByZone( const ZONE* aParent );
477
478 bool HasChildren() const
479 {
480 return !m_children.empty();
481 }
482
484 {
485 return m_parent;
486 }
487
489 bool Overrides( ITEM* aItem ) const
490 {
491 return m_override.find( aItem ) != m_override.end();
492 }
493
494 void FixupVirtualVias();
495
496 void AddRaw( ITEM* aItem, bool aAllowRedundant = false )
497 {
498 add( aItem, aAllowRedundant );
499 }
500
501 const std::unordered_set<ITEM*>& GetOverrides() const
502 {
503 return m_override;
504 }
505
506 VIA* FindViaByHandle ( const VIA_HANDLE& handle ) const;
507
508private:
509 void add( ITEM* aItem, bool aAllowRedundant = false );
510
512 NODE( const NODE& aB );
513 NODE& operator=( const NODE& aB );
514
516 JOINT& touchJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet );
517
519 void linkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
520 ITEM* aWhere );
521
523 void unlinkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
524 ITEM* aWhere );
525
527 void addSolid( SOLID* aSeg );
528 void addSegment( SEGMENT* aSeg );
529 void addVia( VIA* aVia );
530 void addArc( ARC* aVia );
531 void addHole( HOLE* aHole );
532
533 void removeSolidIndex( SOLID* aSeg );
534 void removeSegmentIndex( SEGMENT* aSeg );
535 void removeViaIndex( VIA* aVia );
536 void removeArcIndex( ARC* aVia );
537
538 void doRemove( ITEM* aItem );
539 void unlinkParent();
540 void releaseChildren();
541 void releaseGarbage();
542 void rebuildJoint( const JOINT* aJoint, const ITEM* aItem );
543
544 bool isRoot() const
545 {
546 return m_parent == nullptr;
547 }
548
549 SEGMENT* findRedundantSegment( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
550 NET_HANDLE aNet );
552
553 ARC* findRedundantArc( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
554 NET_HANDLE aNet );
555 ARC* findRedundantArc( ARC* aSeg );
556
558 void followLine( LINKED_ITEM* aCurrent, bool aScanDirection, int& aPos, int aLimit,
559 VECTOR2I* aCorners, LINKED_ITEM** aSegments, bool* aArcReversed,
560 bool& aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments );
561
562private:
563 struct DEFAULT_OBSTACLE_VISITOR;
564 typedef std::unordered_multimap<JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH> JOINT_MAP;
565 typedef JOINT_MAP::value_type TagJointPair;
566
569
572 std::set<NODE*> m_children;
573
574 std::unordered_set<ITEM*> m_override;
576
582
583 std::vector< std::unique_ptr<SHAPE> > m_edgeExclusions;
584
585 std::unordered_set<ITEM*> m_garbageItems;
586};
587
588}
589
590#endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Definition: line.h:36
INDEX.
Definition: pns_index.h:47
Base class for PNS router board items.
Definition: pns_item.h:97
const PNS_LAYER_RANGE & Layers() const
Definition: pns_item.h:199
virtual NET_HANDLE Net() const
Definition: pns_item.h:197
A 2D point on a given set of layers and belonging to a certain net, that links together a number of b...
Definition: pns_joint.h:43
LAYER_CONTEXT_SETTER(OBSTACLE_VISITOR &aVisitor, int aLayer)
Definition: pns_node.h:206
OBSTACLE_VISITOR & m_visitor
Definition: pns_node.h:218
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition: pns_line.h:62
Keep the router "world" - i.e.
Definition: pns_node.h:231
bool HasChildren() const
Definition: pns_node.h:478
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
Definition: pns_node.cpp:143
void RemoveByMarker(int aMarker)
Definition: pns_node.cpp:1568
NODE * m_root
root node of the whole hierarchy
Definition: pns_node.h:571
int FindLinesBetweenJoints(const JOINT &aA, const JOINT &aB, std::vector< LINE > &aLines)
Find the joints corresponding to the ends of line aLine.
Definition: pns_node.cpp:1137
NODE * GetParent() const
Check if this branch contains an updated version of the m_item from the root branch.
Definition: pns_node.h:483
std::vector< ITEM * > ITEM_VECTOR
Definition: pns_node.h:242
int GetClearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const
Return the pre-set worst case clearance between any pair of items.
Definition: pns_node.cpp:129
void followLine(LINKED_ITEM *aCurrent, bool aScanDirection, int &aPos, int aLimit, VECTOR2I *aCorners, LINKED_ITEM **aSegments, bool *aArcReversed, bool &aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments)
Definition: pns_node.cpp:989
void addSolid(SOLID *aSeg)
Definition: pns_node.cpp:519
void Replace(ITEM *aOldItem, std::unique_ptr< ITEM > aNewItem)
Replace an item with another one.
Definition: pns_node.cpp:866
bool Overrides(ITEM *aItem) const
Definition: pns_node.h:489
int GetMaxClearance() const
Set the worst-case clearance between any pair of items.
Definition: pns_node.h:252
void removeSegmentIndex(SEGMENT *aSeg)
Definition: pns_node.cpp:774
void SetMaxClearance(int aClearance)
Assign a clearance resolution function object.
Definition: pns_node.h:258
COLLISION_QUERY_SCOPE
< Supported item types
Definition: pns_node.h:236
@ CQS_IGNORE_HOLE_CLEARANCE
check everything except hole2hole / hole2copper
Definition: pns_node.h:238
@ CQS_ALL_RULES
check all rules
Definition: pns_node.h:237
void rebuildJoint(const JOINT *aJoint, const ITEM *aItem)
Definition: pns_node.cpp:788
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.
Definition: pns_node.cpp:1443
void addSegment(SEGMENT *aSeg)
Definition: pns_node.cpp:654
std::vector< std::unique_ptr< SHAPE > > m_edgeExclusions
Definition: pns_node.h:583
ARC * findRedundantArc(const VECTOR2I &A, const VECTOR2I &B, const PNS_LAYER_RANGE &lr, NET_HANDLE aNet)
Definition: pns_node.cpp:1618
void releaseChildren()
Definition: pns_node.cpp:1462
JOINT_MAP::value_type TagJointPair
Definition: pns_node.h:565
void addVia(VIA *aVia)
Definition: pns_node.cpp:542
bool QueryEdgeExclusions(const VECTOR2I &aPos) const
Definition: pns_node.cpp:715
void doRemove(ITEM *aItem)
Definition: pns_node.cpp:727
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.
Definition: pns_node.cpp:410
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.
Definition: pns_node.cpp:1242
void addHole(HOLE *aHole)
Definition: pns_node.cpp:560
std::optional< OBSTACLE > OPT_OBSTACLE
Definition: pns_node.h:241
void unlinkJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet, ITEM *aWhere)
Helpers for adding/removing items.
Definition: pns_node.cpp:1346
std::unordered_set< ITEM * > m_garbageItems
Definition: pns_node.h:585
void Dump(bool aLong=false)
Definition: pns_node.cpp:1356
void AddRaw(ITEM *aItem, bool aAllowRedundant=false)
Definition: pns_node.h:496
NODE(const NODE &aB)
nodes are not copyable
void releaseGarbage()
Definition: pns_node.cpp:1475
int Depth() const
Definition: pns_node.h:281
void addArc(ARC *aVia)
Definition: pns_node.cpp:683
void FindLineEnds(const LINE &aLine, JOINT &aA, JOINT &aB)
Destroy all child nodes. Applicable only to the root node.
Definition: pns_node.cpp:1130
RULE_RESOLVER * GetRuleResolver() const
Return the number of joints.
Definition: pns_node.h:269
JOINT & touchJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet)
Touch a joint and links it to an m_item.
Definition: pns_node.cpp:1276
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
Definition: pns_node.cpp:665
void FixupVirtualVias()
Definition: pns_node.cpp:1171
int QueryJoints(const BOX2I &aBox, std::vector< JOINT * > &aJoints, PNS_LAYER_RANGE aLayerMask=PNS_LAYER_RANGE::All(), int aKindMask=ITEM::ANY_T)
Definition: pns_node.cpp:1653
std::set< OBSTACLE > OBSTACLES
Definition: pns_node.h:243
std::unordered_multimap< JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH > JOINT_MAP
Definition: pns_node.h:564
INDEX * m_index
Geometric/Net index of the items.
Definition: pns_node.h:579
std::vector< ITEM * > FindItemsByZone(const ZONE *aParent)
Definition: pns_node.cpp:1712
std::unordered_set< ITEM * > m_override
hash of root's items that have been changed in this node
Definition: pns_node.h:574
void AllItemsInNet(NET_HANDLE aNet, std::set< ITEM * > &aItems, int aKindMask=-1)
Definition: pns_node.cpp:1529
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...
Definition: pns_node.cpp:286
void LockJoint(const VECTOR2I &aPos, const ITEM *aItem, bool aLock)
Definition: pns_node.cpp:1269
void SetRuleResolver(RULE_RESOLVER *aFunc)
Definition: pns_node.h:264
void removeArcIndex(ARC *aVia)
Definition: pns_node.cpp:781
int JointCount() const
Return the number of nodes in the inheritance chain (wrs to the root node).
Definition: pns_node.h:275
void AddEdgeExclusion(std::unique_ptr< SHAPE > aShape)
Definition: pns_node.cpp:709
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.
Definition: pns_node.cpp:255
NODE & operator=(const NODE &aB)
Try to find matching joint and creates a new one if not found.
int m_maxClearance
worst case item-item clearance
Definition: pns_node.h:577
const JOINT * FindJoint(const VECTOR2I &aPos, const ITEM *aItem) const
Search for a joint at a given position, linked to given item.
Definition: pns_node.h:454
bool isRoot() const
Definition: pns_node.h:544
const std::unordered_set< ITEM * > & GetOverrides() const
Definition: pns_node.h:501
VIA * FindViaByHandle(const VIA_HANDLE &handle) const
Definition: pns_node.cpp:1726
void removeViaIndex(VIA *aVia)
Definition: pns_node.cpp:846
void add(ITEM *aItem, bool aAllowRedundant=false)
Definition: pns_node.cpp:576
void KillChildren()
Definition: pns_node.cpp:1523
void removeSolidIndex(SOLID *aSeg)
Definition: pns_node.cpp:854
int m_depth
depth of the node (number of parent nodes in the inheritance chain)
Definition: pns_node.h:580
std::set< NODE * > m_children
list of nodes branched from this one
Definition: pns_node.h:572
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
Definition: pns_node.cpp:1691
JOINT_MAP m_joints
hash table with the joints, linking the items.
Definition: pns_node.h:567
NODE * m_parent
node this node was branched from
Definition: pns_node.h:570
void ClearRanks(int aMarkerMask=MK_HEAD|MK_VIOLATION)
Definition: pns_node.cpp:1558
void Remove(ARC *aArc)
Remove an item from this branch.
Definition: pns_node.cpp:906
void unlinkParent()
Definition: pns_node.cpp:179
void Commit(NODE *aNode)
Apply the changes from a given branch (aNode) to the root branch.
Definition: pns_node.cpp:1498
RULE_RESOLVER * m_ruleResolver
Design rules resolver.
Definition: pns_node.h:578
~NODE()
Return the expected clearance between items a and b.
Definition: pns_node.cpp:70
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false, bool aFollowLockedSegments=false)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
Definition: pns_node.cpp:1044
SEGMENT * findRedundantSegment(const VECTOR2I &A, const VECTOR2I &B, const PNS_LAYER_RANGE &lr, NET_HANDLE aNet)
Definition: pns_node.cpp:1583
void linkJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet, ITEM *aWhere)
Unlink an item from a joint.
Definition: pns_node.cpp:1337
const ITEM_SET HitTest(const VECTOR2I &aPoint) const
Find all items that contain the point aPoint.
Definition: pns_node.cpp:490
const NODE * m_node
node we are searching in (either root or a branch)
Definition: pns_node.h:197
const ITEM * m_item
the item we are looking for collisions with
Definition: pns_node.h:195
virtual bool operator()(ITEM *aCandidate)=0
void ClearLayerContext()
Definition: pns_node.h:187
bool visit(ITEM *aCandidate)
Definition: pns_node.cpp:203
std::optional< int > m_layerContext
Definition: pns_node.h:199
void SetLayerContext(int aLayer)
Definition: pns_node.h:186
void SetWorld(const NODE *aNode, const NODE *aOverride=nullptr)
Definition: pns_node.cpp:196
const NODE * m_override
node that overrides root entries
Definition: pns_node.h:198
virtual ~OBSTACLE_VISITOR()
Definition: pns_node.h:180
virtual int NetCode(NET_HANDLE aNet)=0
virtual ~RULE_RESOLVER()
Definition: pns_node.h:140
virtual void ClearCacheForItems(std::vector< const ITEM * > &aItems)
Definition: pns_node.h:167
virtual int ClearanceEpsilon() const
Definition: pns_node.h:171
virtual void ClearTemporaryCaches()
Definition: pns_node.h:169
virtual bool IsNonPlatedSlot(const PNS::ITEM *aItem)=0
virtual int Clearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true)=0
virtual bool IsNetTieExclusion(const ITEM *aItem, const VECTOR2I &aCollisionPos, const ITEM *aCollidingItem)=0
virtual bool IsDrilledHole(const PNS::ITEM *aItem)=0
virtual bool IsKeepout(const ITEM *aObstacle, const ITEM *aItem, bool *aEnforce)=0
virtual bool DpNetPair(const ITEM *aItem, NET_HANDLE &aNetP, NET_HANDLE &aNetN)=0
virtual bool QueryConstraint(CONSTRAINT_TYPE aType, const ITEM *aItemA, const ITEM *aItemB, int aLayer, CONSTRAINT *aConstraint)=0
virtual bool IsInNetTie(const ITEM *aA)=0
virtual NET_HANDLE DpCoupledNet(NET_HANDLE aNet)=0
virtual int DpNetPolarity(NET_HANDLE aNet)=0
virtual void ClearCaches()
Definition: pns_node.h:168
virtual wxString NetName(NET_HANDLE aNet)=0
Represent a contiguous set of PCB layers.
Definition: pns_layerset.h:32
int Start() const
Definition: pns_layerset.h:86
static PNS_LAYER_RANGE All()
Definition: pns_layerset.h:129
Handle a list of polygons defining a copper zone.
Definition: zone.h:73
Push and Shove diff pair dimensions (gap) settings dialog.
CONSTRAINT_TYPE
Definition: pns_node.h:52
void * NET_HANDLE
Definition: pns_item.h:54
@ MK_VIOLATION
Definition: pns_item.h:43
@ MK_HEAD
Definition: pns_item.h:42
@ VIA
Normal via.
Definition: router_tool.cpp:96
const COLLISION_SEARCH_OPTIONS options
Definition: pns_node.h:133
std::set< OBSTACLE > & obstacles
Definition: pns_node.h:132
COLLISION_SEARCH_CONTEXT(std::set< OBSTACLE > &aObs, const COLLISION_SEARCH_OPTIONS aOpts=COLLISION_SEARCH_OPTIONS())
Definition: pns_node.h:126
std::function< bool(const ITEM *)> m_filter
Definition: pns_node.h:119
An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between...
Definition: pns_node.h:73
wxString m_FromName
Definition: pns_node.h:78
bool m_Allowed
Definition: pns_node.h:76
wxString m_RuleName
Definition: pns_node.h:77
wxString m_ToName
Definition: pns_node.h:79
MINOPTMAX< int > m_Value
Definition: pns_node.h:75
CONSTRAINT_TYPE m_Type
Definition: pns_node.h:74
Hold an object colliding with another object, along with some useful data about the collision.
Definition: pns_node.h:87
VECTOR2I m_pos
Definition: pns_node.h:92
int m_distFirst
... and the distance thereof
Definition: pns_node.h:93
int m_clearance
Definition: pns_node.h:91
int m_maxFanoutWidth
worst case (largest) width of the tracks connected to the item
Definition: pns_node.h:94
bool operator==(const OBSTACLE &other) const
Definition: pns_node.h:96
ITEM * m_head
Line we search collisions against.
Definition: pns_node.h:88
bool operator<(const OBSTACLE &other) const
Definition: pns_node.h:101
VECTOR2I m_ipFirst
First intersection between m_head and m_hull.
Definition: pns_node.h:90
ITEM * m_item
Item found to be colliding with m_head.
Definition: pns_node.h:89