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 The 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
66
71
82
83
88{
89 ITEM* m_head = nullptr;
90 ITEM* m_item = nullptr;
96
97 bool operator==(const OBSTACLE& other) const
98 {
99 return m_head == other.m_head && m_item == other.m_item;
100 }
101
102 bool operator<(const OBSTACLE& other) const
103 {
104 if( (uintptr_t)m_head < (uintptr_t)other.m_head )
105 return true;
106 else if ( m_head == other.m_head )
107 return (uintptr_t)m_item < (uintptr_t)other.m_item;
108 return false;
109 }
110};
111
112
114{
117 int m_limitCount = -1;
118 int m_kindMask = -1;
120 std::function<bool(const ITEM*)> m_filter = nullptr;
121 int m_layer = -1;
122};
123
124
126{
128 obstacles( aObs ),
129 options( aOpts )
130 {
131 }
132
133 std::set<OBSTACLE>& obstacles;
135};
136
137
139{
140public:
141 virtual ~RULE_RESOLVER() {}
142
143 virtual int Clearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) = 0;
144
145 virtual NET_HANDLE DpCoupledNet( NET_HANDLE aNet ) = 0;
146 virtual int DpNetPolarity( NET_HANDLE aNet ) = 0;
147 virtual bool DpNetPair( const ITEM* aItem, NET_HANDLE& aNetP, NET_HANDLE& aNetN ) = 0;
148
149 virtual int NetCode( NET_HANDLE aNet ) = 0;
150 virtual wxString NetName( NET_HANDLE aNet ) = 0;
151
152 virtual bool IsInNetTie( const ITEM* aA ) = 0;
153 virtual bool IsNetTieExclusion( const ITEM* aItem, const VECTOR2I& aCollisionPos,
154 const ITEM* aCollidingItem ) = 0;
155
156 virtual bool IsDrilledHole( const PNS::ITEM* aItem ) = 0;
157 virtual bool IsNonPlatedSlot( const PNS::ITEM* aItem ) = 0;
158
163 virtual bool IsKeepout( const ITEM* aObstacle, const ITEM* aItem, bool* aEnforce ) = 0;
164
165 virtual bool QueryConstraint( CONSTRAINT_TYPE aType, const ITEM* aItemA, const ITEM* aItemB,
166 int aLayer, CONSTRAINT* aConstraint ) = 0;
167
168 virtual void ClearCacheForItems( std::vector<const ITEM*>& aItems ) {}
169 virtual void ClearCaches() {}
170 virtual void ClearTemporaryCaches() {}
171
172 virtual int ClearanceEpsilon() const { return 0; }
173
174 virtual const SHAPE_LINE_CHAIN& HullCache( const ITEM* aItem, int aClearance,
175 int aWalkaroundThickness, int aLayer )
176 {
177 static SHAPE_LINE_CHAIN empty;
178 empty = aItem->Hull( aClearance, aWalkaroundThickness, aLayer );
179 return empty;
180 }
181};
182
183
185{
186public:
187 OBSTACLE_VISITOR( const ITEM* aItem );
188
190 {
191 }
192
193 void SetWorld( const NODE* aNode, const NODE* aOverride = nullptr );
194
195 void SetLayerContext( int aLayer ) { m_layerContext = aLayer; }
196 void ClearLayerContext() { m_layerContext = std::nullopt; }
197
198 virtual bool operator()( ITEM* aCandidate ) = 0;
199
200protected:
201 bool visit( ITEM* aCandidate );
202
203protected:
204 const ITEM* m_item;
205
206 const NODE* m_node;
208 std::optional<int> m_layerContext;
209};
210
211
213{
214public:
215 LAYER_CONTEXT_SETTER( OBSTACLE_VISITOR& aVisitor, int aLayer ) :
216 m_visitor( aVisitor )
217 {
218 m_visitor.SetLayerContext( aLayer );
219 }
220
222 {
223 m_visitor.ClearLayerContext();
224 }
225
226private:
228};
229
239class NODE : public ITEM_OWNER
240{
241public:
242
249
250 typedef std::optional<OBSTACLE> OPT_OBSTACLE;
251 typedef std::vector<ITEM*> ITEM_VECTOR;
252 typedef std::set<OBSTACLE> OBSTACLES;
253
254 NODE();
255 ~NODE();
256
258 int GetClearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) const;
259
261 int GetMaxClearance() const
262 {
263 return m_maxClearance;
264 }
265
267 void SetMaxClearance( int aClearance )
268 {
269 m_maxClearance = aClearance;
270 }
271
274 {
275 m_ruleResolver = aFunc;
276 }
277
279 {
280 return m_ruleResolver;
281 }
282
284 int JointCount() const
285 {
286 return m_joints.size();
287 }
288
290 int Depth() const
291 {
292 return m_depth;
293 }
294
304 int QueryColliding( const ITEM* aItem, OBSTACLES& aObstacles,
305 const COLLISION_SEARCH_OPTIONS& aOpts = COLLISION_SEARCH_OPTIONS() ) const;
306
307 int QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints,
308 PNS_LAYER_RANGE aLayerMask = PNS_LAYER_RANGE::All(), int aKindMask = ITEM::ANY_T );
309
318 OPT_OBSTACLE NearestObstacle( const LINE* aLine,
320
329 OPT_OBSTACLE CheckColliding( const ITEM* aItem, int aKindMask = ITEM::ANY_T );
330
331
340 OPT_OBSTACLE CheckColliding( const ITEM_SET& aSet, int aKindMask = ITEM::ANY_T );
341
350 OPT_OBSTACLE CheckColliding( const ITEM* aItem, const COLLISION_SEARCH_OPTIONS& aOpts );
351
358 const ITEM_SET HitTest( const VECTOR2I& aPoint ) const;
359
368 bool Add( std::unique_ptr<SEGMENT> aSegment, bool aAllowRedundant = false );
369 void Add( std::unique_ptr<SOLID> aSolid );
370 void Add( std::unique_ptr<VIA> aVia );
371 bool Add( std::unique_ptr<ARC> aArc, bool aAllowRedundant = false );
372
373 void Add( LINE& aLine, bool aAllowRedundant = false );
374
375 void AddEdgeExclusion( std::unique_ptr<SHAPE> aShape );
376 bool QueryEdgeExclusions( const VECTOR2I& aPos ) const;
377
381 void Remove( ARC* aArc );
382 void Remove( SOLID* aSolid );
383 void Remove( VIA* aVia );
384 void Remove( SEGMENT* aSegment );
385 void Remove( ITEM* aItem );
386
392 void Remove( LINE& aLine );
393
400 void Replace( ITEM* aOldItem, std::unique_ptr< ITEM > aNewItem );
401 void Replace( LINE& aOldLine, LINE& aNewLine, bool aAllowRedundantSegments = false );
402
411 NODE* Branch();
412
425 const LINE AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex = nullptr,
426 bool aStopAtLockedJoints = false,
427 bool aFollowLockedSegments = false,
428 bool aAllowSegmentSizeMismatch = true );
429
431 void Dump( bool aLong = false );
432
439 void GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded );
440
449 void Commit( NODE* aNode );
450
456 const JOINT* FindJoint( const VECTOR2I& aPos, int aLayer, NET_HANDLE aNet ) const;
457
458 void LockJoint( const VECTOR2I& aPos, const ITEM* aItem, bool aLock );
459
465 const JOINT* FindJoint( const VECTOR2I& aPos, const ITEM* aItem ) const
466 {
467 return FindJoint( aPos, aItem->Layers().Start(), aItem->Net() );
468 }
469
471 int FindLinesBetweenJoints( const JOINT& aA, const JOINT& aB, std::vector<LINE>& aLines );
472
474 void FindLineEnds( const LINE& aLine, JOINT& aA, JOINT& aB );
475
477 void KillChildren();
478
479 void AllItemsInNet( NET_HANDLE aNet, std::set<ITEM*>& aItems, int aKindMask = -1 );
480
481 void ClearRanks( int aMarkerMask = MK_HEAD | MK_VIOLATION );
482
483 void RemoveByMarker( int aMarker );
484
485 ITEM* FindItemByParent( const BOARD_ITEM* aParent );
486
487 std::vector<ITEM*> FindItemsByParent( const BOARD_ITEM* aParent );
488
489 bool HasChildren() const
490 {
491 return !m_children.empty();
492 }
493
495 {
496 return m_parent;
497 }
498
500 bool Overrides( ITEM* aItem ) const
501 {
502 return m_override.find( aItem ) != m_override.end();
503 }
504
505 void FixupVirtualVias();
506
507 void AddRaw( ITEM* aItem, bool aAllowRedundant = false )
508 {
509 add( aItem, aAllowRedundant );
510 }
511
512 const std::unordered_set<ITEM*>& GetOverrides() const
513 {
514 return m_override;
515 }
516
517 VIA* FindViaByHandle ( const VIA_HANDLE& handle ) const;
518
519private:
520 void add( ITEM* aItem, bool aAllowRedundant = false );
521
523 NODE( const NODE& aB );
524 NODE& operator=( const NODE& aB );
525
527 JOINT& touchJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet );
528
530 void linkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
531 ITEM* aWhere );
532
534 void unlinkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
535 ITEM* aWhere );
536
538 void addSolid( SOLID* aSeg );
539 void addSegment( SEGMENT* aSeg );
540 void addVia( VIA* aVia );
541 void addArc( ARC* aVia );
542 void addHole( HOLE* aHole );
543
544 void removeSolidIndex( SOLID* aSeg );
545 void removeSegmentIndex( SEGMENT* aSeg );
546 void removeViaIndex( VIA* aVia );
547 void removeArcIndex( ARC* aVia );
548
549 void doRemove( ITEM* aItem );
550 void unlinkParent();
551 void releaseChildren();
552 void releaseGarbage();
553 void rebuildJoint( const JOINT* aJoint, const ITEM* aItem );
554
555 bool isRoot() const
556 {
557 return m_parent == nullptr;
558 }
559
560 SEGMENT* findRedundantSegment( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
561 NET_HANDLE aNet );
563
564 ARC* findRedundantArc( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
565 NET_HANDLE aNet );
566 ARC* findRedundantArc( ARC* aSeg );
567
569 void followLine( LINKED_ITEM* aCurrent, bool aScanDirection, int& aPos, int aLimit,
570 VECTOR2I* aCorners, LINKED_ITEM** aSegments, bool* aArcReversed,
571 bool& aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments );
572
573private:
574 struct DEFAULT_OBSTACLE_VISITOR;
575 typedef std::unordered_multimap<JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH> JOINT_MAP;
576 typedef JOINT_MAP::value_type TagJointPair;
577
580
583 std::set<NODE*> m_children;
584
585 std::unordered_set<ITEM*> m_override;
587
593
594 std::vector< std::unique_ptr<SHAPE> > m_edgeExclusions;
595
596 std::unordered_set<ITEM*> m_garbageItems;
597};
598
599}
600
601#endif
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
INDEX.
Definition pns_index.h:47
Base class for PNS router board items.
Definition pns_item.h:98
const PNS_LAYER_RANGE & Layers() const
Definition pns_item.h:212
virtual NET_HANDLE Net() const
Definition pns_item.h:210
virtual const SHAPE_LINE_CHAIN Hull(int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const
Definition pns_item.h:164
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:215
OBSTACLE_VISITOR & m_visitor
Definition pns_node.h:227
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:240
bool HasChildren() const
Definition pns_node.h:489
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
Definition pns_node.cpp:155
void RemoveByMarker(int aMarker)
NODE * m_root
root node of the whole hierarchy
Definition pns_node.h:582
int FindLinesBetweenJoints(const JOINT &aA, const JOINT &aB, std::vector< LINE > &aLines)
Find the joints corresponding to the ends of line aLine.
NODE * GetParent() const
Check if this branch contains an updated version of the m_item from the root branch.
Definition pns_node.h:494
std::vector< ITEM * > ITEM_VECTOR
Definition pns_node.h:251
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:141
void followLine(LINKED_ITEM *aCurrent, bool aScanDirection, int &aPos, int aLimit, VECTOR2I *aCorners, LINKED_ITEM **aSegments, bool *aArcReversed, bool &aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments)
void addSolid(SOLID *aSeg)
Definition pns_node.cpp:549
void Replace(ITEM *aOldItem, std::unique_ptr< ITEM > aNewItem)
Replace an item with another one.
Definition pns_node.cpp:899
bool Overrides(ITEM *aItem) const
Definition pns_node.h:500
int GetMaxClearance() const
Set the worst-case clearance between any pair of items.
Definition pns_node.h:261
void removeSegmentIndex(SEGMENT *aSeg)
Definition pns_node.cpp:804
void SetMaxClearance(int aClearance)
Assign a clearance resolution function object.
Definition pns_node.h:267
COLLISION_QUERY_SCOPE
< Supported item types
Definition pns_node.h:245
@ CQS_IGNORE_HOLE_CLEARANCE
check everything except hole2hole / hole2copper
Definition pns_node.h:247
@ CQS_ALL_RULES
check all rules
Definition pns_node.h:246
void rebuildJoint(const JOINT *aJoint, const ITEM *aItem)
Definition pns_node.cpp:818
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 addSegment(SEGMENT *aSeg)
Definition pns_node.cpp:684
std::vector< std::unique_ptr< SHAPE > > m_edgeExclusions
Definition pns_node.h:594
ARC * findRedundantArc(const VECTOR2I &A, const VECTOR2I &B, const PNS_LAYER_RANGE &lr, NET_HANDLE aNet)
void releaseChildren()
JOINT_MAP::value_type TagJointPair
Definition pns_node.h:576
void addVia(VIA *aVia)
Definition pns_node.cpp:572
bool QueryEdgeExclusions(const VECTOR2I &aPos) const
Definition pns_node.cpp:745
void doRemove(ITEM *aItem)
Definition pns_node.cpp:757
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:440
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 addHole(HOLE *aHole)
Definition pns_node.cpp:590
std::optional< OBSTACLE > OPT_OBSTACLE
Definition pns_node.h:250
void unlinkJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet, ITEM *aWhere)
Helpers for adding/removing items.
std::unordered_set< ITEM * > m_garbageItems
Definition pns_node.h:596
void Dump(bool aLong=false)
void AddRaw(ITEM *aItem, bool aAllowRedundant=false)
Definition pns_node.h:507
NODE(const NODE &aB)
nodes are not copyable
void releaseGarbage()
int Depth() const
Definition pns_node.h:290
void addArc(ARC *aVia)
Definition pns_node.cpp:713
void FindLineEnds(const LINE &aLine, JOINT &aA, JOINT &aB)
Destroy all child nodes. Applicable only to the root node.
RULE_RESOLVER * GetRuleResolver() const
Return the number of joints.
Definition pns_node.h:278
JOINT & touchJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet)
Touch a joint and links it to an m_item.
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
Definition pns_node.cpp:695
void FixupVirtualVias()
int QueryJoints(const BOX2I &aBox, std::vector< JOINT * > &aJoints, PNS_LAYER_RANGE aLayerMask=PNS_LAYER_RANGE::All(), int aKindMask=ITEM::ANY_T)
std::set< OBSTACLE > OBSTACLES
Definition pns_node.h:252
std::unordered_multimap< JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH > JOINT_MAP
Definition pns_node.h:575
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.
INDEX * m_index
Geometric/Net index of the items.
Definition pns_node.h:590
std::unordered_set< ITEM * > m_override
hash of root's items that have been changed in this node
Definition pns_node.h:585
void AllItemsInNet(NET_HANDLE aNet, std::set< ITEM * > &aItems, int aKindMask=-1)
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:298
void LockJoint(const VECTOR2I &aPos, const ITEM *aItem, bool aLock)
void SetRuleResolver(RULE_RESOLVER *aFunc)
Definition pns_node.h:273
void removeArcIndex(ARC *aVia)
Definition pns_node.cpp:811
int JointCount() const
Return the number of nodes in the inheritance chain (wrs to the root node).
Definition pns_node.h:284
void AddEdgeExclusion(std::unique_ptr< SHAPE > aShape)
Definition pns_node.cpp:739
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:267
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:588
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:465
bool isRoot() const
Definition pns_node.h:555
const std::unordered_set< ITEM * > & GetOverrides() const
Definition pns_node.h:512
VIA * FindViaByHandle(const VIA_HANDLE &handle) const
void removeViaIndex(VIA *aVia)
Definition pns_node.cpp:879
void add(ITEM *aItem, bool aAllowRedundant=false)
Definition pns_node.cpp:606
void KillChildren()
void removeSolidIndex(SOLID *aSeg)
Definition pns_node.cpp:887
int m_depth
depth of the node (number of parent nodes in the inheritance chain)
Definition pns_node.h:591
std::set< NODE * > m_children
list of nodes branched from this one
Definition pns_node.h:583
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
JOINT_MAP m_joints
hash table with the joints, linking the items.
Definition pns_node.h:578
std::vector< ITEM * > FindItemsByParent(const BOARD_ITEM *aParent)
NODE * m_parent
node this node was branched from
Definition pns_node.h:581
void ClearRanks(int aMarkerMask=MK_HEAD|MK_VIOLATION)
void Remove(ARC *aArc)
Remove an item from this branch.
Definition pns_node.cpp:939
void unlinkParent()
Definition pns_node.cpp:191
void Commit(NODE *aNode)
Apply the changes from a given branch (aNode) to the root branch.
RULE_RESOLVER * m_ruleResolver
Design rules resolver.
Definition pns_node.h:589
~NODE()
Return the expected clearance between items a and b.
Definition pns_node.cpp:70
SEGMENT * findRedundantSegment(const VECTOR2I &A, const VECTOR2I &B, const PNS_LAYER_RANGE &lr, NET_HANDLE aNet)
void linkJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet, ITEM *aWhere)
Unlink an item from a joint.
const ITEM_SET HitTest(const VECTOR2I &aPoint) const
Find all items that contain the point aPoint.
Definition pns_node.cpp:520
OBSTACLE_VISITOR(const ITEM *aItem)
Definition pns_node.cpp:200
const NODE * m_node
node we are searching in (either root or a branch)
Definition pns_node.h:206
const ITEM * m_item
the item we are looking for collisions with
Definition pns_node.h:204
virtual bool operator()(ITEM *aCandidate)=0
bool visit(ITEM *aCandidate)
Definition pns_node.cpp:215
std::optional< int > m_layerContext
Definition pns_node.h:208
void SetLayerContext(int aLayer)
Definition pns_node.h:195
void SetWorld(const NODE *aNode, const NODE *aOverride=nullptr)
Definition pns_node.cpp:208
const NODE * m_override
node that overrides root entries
Definition pns_node.h:207
virtual ~OBSTACLE_VISITOR()
Definition pns_node.h:189
virtual int NetCode(NET_HANDLE aNet)=0
virtual ~RULE_RESOLVER()
Definition pns_node.h:141
virtual void ClearCacheForItems(std::vector< const ITEM * > &aItems)
Definition pns_node.h:168
virtual int ClearanceEpsilon() const
Definition pns_node.h:172
virtual void ClearTemporaryCaches()
Definition pns_node.h:170
virtual const SHAPE_LINE_CHAIN & HullCache(const ITEM *aItem, int aClearance, int aWalkaroundThickness, int aLayer)
Definition pns_node.h:174
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:169
virtual wxString NetName(NET_HANDLE aNet)=0
Represent a contiguous set of PCB layers.
int Start() const
static PNS_LAYER_RANGE All()
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Handle a list of polygons defining a copper zone.
Definition zone.h:74
static bool empty(const wxTextEntryBase *aCtrl)
Push and Shove diff pair dimensions (gap) settings dialog.
CONSTRAINT_TYPE
Definition pns_node.h:52
void * NET_HANDLE
Definition pns_item.h:55
@ MK_VIOLATION
Definition pns_item.h:44
@ MK_HEAD
Definition pns_item.h:43
const COLLISION_SEARCH_OPTIONS options
Definition pns_node.h:134
std::set< OBSTACLE > & obstacles
Definition pns_node.h:133
COLLISION_SEARCH_CONTEXT(std::set< OBSTACLE > &aObs, const COLLISION_SEARCH_OPTIONS aOpts=COLLISION_SEARCH_OPTIONS())
Definition pns_node.h:127
std::function< bool(const ITEM *)> m_filter
Definition pns_node.h:120
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
wxString m_RuleName
Definition pns_node.h:77
wxString m_ToName
Definition pns_node.h:79
bool m_IsTimeDomain
Definition pns_node.h:80
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:88
VECTOR2I m_pos
Definition pns_node.h:93
int m_distFirst
... and the distance thereof
Definition pns_node.h:94
int m_clearance
Definition pns_node.h:92
int m_maxFanoutWidth
worst case (largest) width of the tracks connected to the item
Definition pns_node.h:95
bool operator==(const OBSTACLE &other) const
Definition pns_node.h:97
ITEM * m_head
Line we search collisions against.
Definition pns_node.h:89
bool operator<(const OBSTACLE &other) const
Definition pns_node.h:102
VECTOR2I m_ipFirst
First intersection between m_head and m_hull.
Definition pns_node.h:91
ITEM * m_item
Item found to be colliding with m_head.
Definition pns_node.h:90
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695