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
20 * along with this program. If not, see <https://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
67
72
83
84
89{
90 ITEM* m_head = nullptr;
91 ITEM* m_item = nullptr;
97
98 bool operator==(const OBSTACLE& other) const
99 {
100 return m_head == other.m_head && m_item == other.m_item;
101 }
102
103 bool operator<(const OBSTACLE& other) const
104 {
105 if( (uintptr_t)m_head < (uintptr_t)other.m_head )
106 return true;
107 else if ( m_head == other.m_head )
108 return (uintptr_t)m_item < (uintptr_t)other.m_item;
109 return false;
110 }
111};
112
113typedef std::function<bool(const ITEM* aTestItem, const ITEM* aRefItem)> COLLISION_FILTER_FUNC;
114
125
126
128{
130 obstacles( aObs ),
131 options( aOpts )
132 {
133 }
134
135 std::set<OBSTACLE>& obstacles;
137};
138
139
141{
142public:
143 virtual ~RULE_RESOLVER() {}
144
145 virtual int Clearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) = 0;
146 virtual bool HasUserDefinedPhysicalConstraint() { return false; }
147
148 virtual NET_HANDLE DpCoupledNet( NET_HANDLE aNet ) = 0;
149 virtual int DpNetPolarity( NET_HANDLE aNet ) = 0;
150 virtual bool DpNetPair( const ITEM* aItem, NET_HANDLE& aNetP, NET_HANDLE& aNetN ) = 0;
151
152 virtual int NetCode( NET_HANDLE aNet ) = 0;
153 virtual wxString NetName( NET_HANDLE aNet ) = 0;
154
155 virtual bool IsInNetTie( const ITEM* aA ) = 0;
156 virtual bool IsNetTieExclusion( const ITEM* aItem, const VECTOR2I& aCollisionPos,
157 const ITEM* aCollidingItem ) = 0;
158
159 virtual bool IsDrilledHole( const PNS::ITEM* aItem ) = 0;
160 virtual bool IsNonPlatedSlot( const PNS::ITEM* aItem ) = 0;
161
166 virtual bool IsKeepout( const ITEM* aObstacle, const ITEM* aItem, bool* aEnforce ) = 0;
167
168 virtual bool QueryConstraint( CONSTRAINT_TYPE aType, const ITEM* aItemA, const ITEM* aItemB,
169 int aLayer, CONSTRAINT* aConstraint ) = 0;
170
171 virtual void ClearCacheForItems( std::vector<const ITEM*>& aItems ) {}
172 virtual void ClearCaches() {}
173 virtual void ClearTemporaryCaches() {}
174
175 virtual int ClearanceEpsilon() const { return 0; }
176
177 virtual const SHAPE_LINE_CHAIN& HullCache( const ITEM* aItem, int aClearance,
178 int aWalkaroundThickness, int aLayer )
179 {
180 static SHAPE_LINE_CHAIN empty;
181 empty = aItem->Hull( aClearance, aWalkaroundThickness, aLayer );
182 return empty;
183 }
184};
185
186
188{
189public:
190 OBSTACLE_VISITOR( const ITEM* aItem );
191
193 {
194 }
195
196 void SetWorld( const NODE* aNode, const NODE* aOverride = nullptr );
197
198 void SetLayerContext( int aLayer ) { m_layerContext = aLayer; }
199 void ClearLayerContext() { m_layerContext = std::nullopt; }
200
201 virtual bool operator()( ITEM* aCandidate ) = 0;
202
203protected:
204 bool visit( ITEM* aCandidate );
205
206protected:
207 const ITEM* m_item;
208
209 const NODE* m_node;
211 std::optional<int> m_layerContext;
212};
213
214
216{
217public:
218 LAYER_CONTEXT_SETTER( OBSTACLE_VISITOR& aVisitor, int aLayer ) :
219 m_visitor( aVisitor )
220 {
221 m_visitor.SetLayerContext( aLayer );
222 }
223
225 {
226 m_visitor.ClearLayerContext();
227 }
228
229private:
231};
232
242class NODE : public ITEM_OWNER
243{
244public:
245
252
253 typedef std::optional<OBSTACLE> OPT_OBSTACLE;
254 typedef std::vector<ITEM*> ITEM_VECTOR;
255 typedef std::set<OBSTACLE> OBSTACLES;
256
257 NODE();
258 ~NODE();
259
261 int GetClearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) const;
262
264 int GetMaxClearance() const
265 {
266 return m_maxClearance;
267 }
268
273 void BeginBulkAdd();
274
278 void FinalizeBulkAdd();
279
281 void SetMaxClearance( int aClearance )
282 {
283 m_maxClearance = aClearance;
284 }
285
288 {
289 m_ruleResolver = aFunc;
290 }
291
293 {
294 return m_ruleResolver;
295 }
296
298 int JointCount() const
299 {
300 return m_joints.size();
301 }
302
304 int Depth() const
305 {
306 return m_depth;
307 }
308
318 int QueryColliding( const ITEM* aItem, OBSTACLES& aObstacles,
319 const COLLISION_SEARCH_OPTIONS& aOpts = COLLISION_SEARCH_OPTIONS() ) const;
320
321 int QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints,
322 PNS_LAYER_RANGE aLayerMask = PNS_LAYER_RANGE::All(), int aKindMask = ITEM::ANY_T );
323
332 OPT_OBSTACLE NearestObstacle( const LINE* aLine,
334
343 OPT_OBSTACLE CheckColliding( const ITEM* aItem, int aKindMask = ITEM::ANY_T );
344
345
354 OPT_OBSTACLE CheckColliding( const ITEM_SET& aSet, int aKindMask = ITEM::ANY_T );
355
364 OPT_OBSTACLE CheckColliding( const ITEM* aItem, const COLLISION_SEARCH_OPTIONS& aOpts );
365
372 const ITEM_SET HitTest( const VECTOR2I& aPoint ) const;
373
382 bool Add( std::unique_ptr<SEGMENT> aSegment, bool aAllowRedundant = false );
383 void Add( std::unique_ptr<SOLID> aSolid );
384 void Add( std::unique_ptr<VIA> aVia );
385 bool Add( std::unique_ptr<ARC> aArc, bool aAllowRedundant = false );
386
387 void Add( LINE& aLine, bool aAllowRedundant = false );
388
389 void AddEdgeExclusion( std::unique_ptr<SHAPE> aShape );
390 bool QueryEdgeExclusions( const VECTOR2I& aPos ) const;
391
395 void Remove( ARC* aArc );
396 void Remove( SOLID* aSolid );
397 void Remove( VIA* aVia );
398 void Remove( SEGMENT* aSegment );
399 void Remove( ITEM* aItem );
400
406 void Remove( LINE& aLine );
407
414 void Replace( ITEM* aOldItem, std::unique_ptr< ITEM > aNewItem );
415 void Replace( LINE& aOldLine, LINE& aNewLine, bool aAllowRedundantSegments = false );
416
425 NODE* Branch();
426
439 const LINE AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex = nullptr,
440 bool aStopAtLockedJoints = false,
441 bool aFollowLockedSegments = false,
442 bool aAllowSegmentSizeMismatch = true );
443
445 void Dump( bool aLong = false );
446
453 void GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded );
454
463 void Commit( NODE* aNode );
464
470 const JOINT* FindJoint( const VECTOR2I& aPos, int aLayer, NET_HANDLE aNet ) const;
471
472 void LockJoint( const VECTOR2I& aPos, const ITEM* aItem, bool aLock );
473
479 const JOINT* FindJoint( const VECTOR2I& aPos, const ITEM* aItem ) const
480 {
481 return FindJoint( aPos, aItem->Layers().Start(), aItem->Net() );
482 }
483
485 int FindLinesBetweenJoints( const JOINT& aA, const JOINT& aB, std::vector<LINE>& aLines );
486
488 void FindLineEnds( const LINE& aLine, JOINT& aA, JOINT& aB );
489
491 void KillChildren();
492
493 void AllItemsInNet( NET_HANDLE aNet, std::set<ITEM*>& aItems, int aKindMask = -1 );
494
495 void ClearRanks( int aMarkerMask = MK_HEAD | MK_VIOLATION );
496
497 void RemoveByMarker( int aMarker );
498
499 ITEM* FindItemByParent( const BOARD_ITEM* aParent );
500
501 std::vector<ITEM*> FindItemsByParent( const BOARD_ITEM* aParent );
502
503 bool HasChildren() const
504 {
505 return !m_children.empty();
506 }
507
509 {
510 return m_parent;
511 }
512
514 bool Overrides( ITEM* aItem ) const
515 {
516 return m_override.find( aItem ) != m_override.end();
517 }
518
519 void FixupVirtualVias();
520
521 void AddRaw( ITEM* aItem, bool aAllowRedundant = false )
522 {
523 add( aItem, aAllowRedundant );
524 }
525
526 const std::unordered_set<ITEM*>& GetOverrides() const
527 {
528 return m_override;
529 }
530
531 VIA* FindViaByHandle ( const VIA_HANDLE& handle ) const;
532
533private:
534 void add( ITEM* aItem, bool aAllowRedundant = false );
535
537 NODE( const NODE& aB );
538 NODE& operator=( const NODE& aB );
539
541 JOINT& touchJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet );
542
544 void linkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
545 ITEM* aWhere );
546
548 void unlinkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
549 ITEM* aWhere );
550
552 void addSolid( SOLID* aSeg );
553 void addSegment( SEGMENT* aSeg );
554 void addVia( VIA* aVia );
555 void addArc( ARC* aVia );
556 void addHole( HOLE* aHole );
557
558 void removeSolidIndex( SOLID* aSeg );
559 void removeSegmentIndex( SEGMENT* aSeg );
560 void removeViaIndex( VIA* aVia );
561 void removeArcIndex( ARC* aVia );
562
563 void doRemove( ITEM* aItem );
564 void unlinkParent();
565 void releaseChildren();
566 void releaseGarbage();
567 void rebuildJoint( const JOINT* aJoint, const ITEM* aItem );
568
569 bool isRoot() const
570 {
571 return m_parent == nullptr;
572 }
573
574 SEGMENT* findRedundantSegment( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
575 NET_HANDLE aNet );
577
578 ARC* findRedundantArc( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
579 NET_HANDLE aNet );
580 ARC* findRedundantArc( ARC* aSeg );
581
583 void followLine( LINKED_ITEM* aCurrent, bool aScanDirection, int& aPos, int aLimit,
584 VECTOR2I* aCorners, LINKED_ITEM** aSegments, bool* aArcReversed,
585 bool& aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments,
586 bool aAllowSegmentSizeMismatch );
587
588private:
589 struct DEFAULT_OBSTACLE_VISITOR;
590 typedef std::unordered_multimap<JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH> JOINT_MAP;
591 typedef JOINT_MAP::value_type TagJointPair;
592
595
598 std::set<NODE*> m_children;
599
600 std::unordered_set<ITEM*> m_override;
602
608
609 std::vector< std::unique_ptr<SHAPE> > m_edgeExclusions;
610
611 std::unordered_set<ITEM*> m_garbageItems;
612};
613
614}
615
616#endif
BOX2< VECTOR2I > BOX2I
Definition box2.h:927
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
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:218
OBSTACLE_VISITOR & m_visitor
Definition pns_node.h:230
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:243
bool HasChildren() const
Definition pns_node.h:503
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
Definition pns_node.cpp:157
void RemoveByMarker(int aMarker)
NODE * m_root
root node of the whole hierarchy
Definition pns_node.h:597
int FindLinesBetweenJoints(const JOINT &aA, const JOINT &aB, std::vector< LINE > &aLines)
Find the joints corresponding to the ends of line aLine.
void BeginBulkAdd()
Defer spatial index insertion during bulk population.
NODE * GetParent() const
Check if this branch contains an updated version of the m_item from the root branch.
Definition pns_node.h:508
std::vector< ITEM * > ITEM_VECTOR
Definition pns_node.h:254
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:143
void addSolid(SOLID *aSeg)
Definition pns_node.cpp:601
void Replace(ITEM *aOldItem, std::unique_ptr< ITEM > aNewItem)
Replace an item with another one.
Definition pns_node.cpp:951
bool Overrides(ITEM *aItem) const
Definition pns_node.h:514
int GetMaxClearance() const
Definition pns_node.h:264
void removeSegmentIndex(SEGMENT *aSeg)
Definition pns_node.cpp:856
void SetMaxClearance(int aClearance)
Assign a clearance resolution function object.
Definition pns_node.h:281
COLLISION_QUERY_SCOPE
< Supported item types
Definition pns_node.h:248
@ CQS_IGNORE_HOLE_CLEARANCE
check everything except hole2hole / hole2copper
Definition pns_node.h:250
@ CQS_ALL_RULES
check all rules
Definition pns_node.h:249
void rebuildJoint(const JOINT *aJoint, const ITEM *aItem)
Definition pns_node.cpp:870
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:736
std::vector< std::unique_ptr< SHAPE > > m_edgeExclusions
Definition pns_node.h:609
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:591
void addVia(VIA *aVia)
Definition pns_node.cpp:624
bool QueryEdgeExclusions(const VECTOR2I &aPos) const
Definition pns_node.cpp:797
void doRemove(ITEM *aItem)
Definition pns_node.cpp:809
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:492
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:642
std::optional< OBSTACLE > OPT_OBSTACLE
Definition pns_node.h:253
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:611
void Dump(bool aLong=false)
void AddRaw(ITEM *aItem, bool aAllowRedundant=false)
Definition pns_node.h:521
NODE(const NODE &aB)
nodes are not copyable
void releaseGarbage()
int Depth() const
Definition pns_node.h:304
void addArc(ARC *aVia)
Definition pns_node.cpp:765
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:292
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:747
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:255
std::unordered_multimap< JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH > JOINT_MAP
Definition pns_node.h:590
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:605
std::unordered_set< ITEM * > m_override
hash of root's items that have been changed in this node
Definition pns_node.h:600
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:287
void removeArcIndex(ARC *aVia)
Definition pns_node.cpp:863
int JointCount() const
Return the number of nodes in the inheritance chain (wrs to the root node).
Definition pns_node.h:298
void AddEdgeExclusion(std::unique_ptr< SHAPE > aShape)
Definition pns_node.cpp:791
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:603
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:479
bool isRoot() const
Definition pns_node.h:569
const std::unordered_set< ITEM * > & GetOverrides() const
Definition pns_node.h:526
VIA * FindViaByHandle(const VIA_HANDLE &handle) const
void removeViaIndex(VIA *aVia)
Definition pns_node.cpp:931
void add(ITEM *aItem, bool aAllowRedundant=false)
Definition pns_node.cpp:658
void followLine(LINKED_ITEM *aCurrent, bool aScanDirection, int &aPos, int aLimit, VECTOR2I *aCorners, LINKED_ITEM **aSegments, bool *aArcReversed, bool &aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments, bool aAllowSegmentSizeMismatch)
void KillChildren()
void removeSolidIndex(SOLID *aSeg)
Definition pns_node.cpp:939
int m_depth
depth of the node (number of parent nodes in the inheritance chain)
Definition pns_node.h:606
std::set< NODE * > m_children
list of nodes branched from this one
Definition pns_node.h:598
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
JOINT_MAP m_joints
hash table with the joints, linking the items.
Definition pns_node.h:593
std::vector< ITEM * > FindItemsByParent(const BOARD_ITEM *aParent)
NODE * m_parent
node this node was branched from
Definition pns_node.h:596
void ClearRanks(int aMarkerMask=MK_HEAD|MK_VIOLATION)
void Remove(ARC *aArc)
Remove an item from this branch.
Definition pns_node.cpp:991
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:604
~NODE()
Return the expected clearance between items a and b.
Definition pns_node.cpp:72
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.
void FinalizeBulkAdd()
Build the spatial index from all items added since BeginBulkAdd().
const ITEM_SET HitTest(const VECTOR2I &aPoint) const
Find all items that contain the point aPoint.
Definition pns_node.cpp:572
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:209
const ITEM * m_item
the item we are looking for collisions with
Definition pns_node.h:207
virtual bool operator()(ITEM *aCandidate)=0
bool visit(ITEM *aCandidate)
Definition pns_node.cpp:215
std::optional< int > m_layerContext
Definition pns_node.h:211
void SetLayerContext(int aLayer)
Definition pns_node.h:198
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:210
virtual ~OBSTACLE_VISITOR()
Definition pns_node.h:192
virtual int NetCode(NET_HANDLE aNet)=0
virtual ~RULE_RESOLVER()
Definition pns_node.h:143
virtual void ClearCacheForItems(std::vector< const ITEM * > &aItems)
Definition pns_node.h:171
virtual int ClearanceEpsilon() const
Definition pns_node.h:175
virtual void ClearTemporaryCaches()
Definition pns_node.h:173
virtual const SHAPE_LINE_CHAIN & HullCache(const ITEM *aItem, int aClearance, int aWalkaroundThickness, int aLayer)
Definition pns_node.h:177
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 HasUserDefinedPhysicalConstraint()
Definition pns_node.h:146
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:172
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:70
static bool empty(const wxTextEntryBase *aCtrl)
Push and Shove diff pair dimensions (gap) settings dialog.
CONSTRAINT_TYPE
Definition pns_node.h:52
std::function< bool(const ITEM *aTestItem, const ITEM *aRefItem)> COLLISION_FILTER_FUNC
Definition pns_node.h:113
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:136
std::set< OBSTACLE > & obstacles
Definition pns_node.h:135
COLLISION_SEARCH_CONTEXT(std::set< OBSTACLE > &aObs, const COLLISION_SEARCH_OPTIONS aOpts=COLLISION_SEARCH_OPTIONS())
Definition pns_node.h:129
COLLISION_FILTER_FUNC m_filter
Definition pns_node.h:122
An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between...
Definition pns_node.h:74
wxString m_FromName
Definition pns_node.h:79
wxString m_RuleName
Definition pns_node.h:78
wxString m_ToName
Definition pns_node.h:80
bool m_IsTimeDomain
Definition pns_node.h:81
MINOPTMAX< int > m_Value
Definition pns_node.h:76
CONSTRAINT_TYPE m_Type
Definition pns_node.h:75
Hold an object colliding with another object, along with some useful data about the collision.
Definition pns_node.h:89
VECTOR2I m_pos
Definition pns_node.h:94
int m_distFirst
... and the distance thereof
Definition pns_node.h:95
int m_clearance
Definition pns_node.h:93
int m_maxFanoutWidth
worst case (largest) width of the tracks connected to the item
Definition pns_node.h:96
bool operator==(const OBSTACLE &other) const
Definition pns_node.h:98
ITEM * m_head
Line we search collisions against.
Definition pns_node.h:90
bool operator<(const OBSTACLE &other) const
Definition pns_node.h:103
VECTOR2I m_ipFirst
First intersection between m_head and m_hull.
Definition pns_node.h:92
ITEM * m_item
Item found to be colliding with m_head.
Definition pns_node.h:91
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683