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{
129 COLLISION_SEARCH_CONTEXT( std::set<OBSTACLE>& aObs,
131 obstacles( aObs ),
132 options( aOpts )
133 {
134 }
135
136 std::set<OBSTACLE>& obstacles;
138};
139
140
142{
143public:
144 virtual ~RULE_RESOLVER() {}
145
146 virtual int Clearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) = 0;
147 virtual bool HasUserDefinedPhysicalConstraint() { return false; }
148
149 virtual NET_HANDLE DpCoupledNet( NET_HANDLE aNet ) = 0;
150 virtual int DpNetPolarity( NET_HANDLE aNet ) = 0;
151 virtual bool DpNetPair( const ITEM* aItem, NET_HANDLE& aNetP, NET_HANDLE& aNetN ) = 0;
152
153 virtual int NetCode( NET_HANDLE aNet ) = 0;
154 virtual wxString NetName( NET_HANDLE aNet ) = 0;
155
156 virtual bool IsInNetTie( const ITEM* aA ) = 0;
157 virtual bool IsNetTieExclusion( const ITEM* aItem, const VECTOR2I& aCollisionPos,
158 const ITEM* aCollidingItem ) = 0;
159
160 virtual bool IsDrilledHole( const PNS::ITEM* aItem ) = 0;
161 virtual bool IsNonPlatedSlot( const PNS::ITEM* aItem ) = 0;
162
167 virtual bool IsKeepout( const ITEM* aObstacle, const ITEM* aItem, bool* aEnforce ) = 0;
168
169 virtual bool QueryConstraint( CONSTRAINT_TYPE aType, const ITEM* aItemA, const ITEM* aItemB,
170 int aLayer, CONSTRAINT* aConstraint ) = 0;
171
172 virtual void ClearCacheForItems( std::vector<const ITEM*>& aItems ) {}
173 virtual void ClearCaches() {}
174 virtual void ClearTemporaryCaches() {}
175
176 virtual int ClearanceEpsilon() const { return 0; }
177
178 virtual const SHAPE_LINE_CHAIN& HullCache( const ITEM* aItem, int aClearance,
179 int aWalkaroundThickness, int aLayer )
180 {
181 static SHAPE_LINE_CHAIN empty;
182 empty = aItem->Hull( aClearance, aWalkaroundThickness, aLayer );
183 return empty;
184 }
185};
186
187
189{
190public:
191 OBSTACLE_VISITOR( const ITEM* aItem );
192
194 {
195 }
196
197 void SetWorld( const NODE* aNode, const NODE* aOverride = nullptr );
198
199 void SetLayerContext( int aLayer ) { m_layerContext = aLayer; }
200 void ClearLayerContext() { m_layerContext = std::nullopt; }
201
202 virtual bool operator()( ITEM* aCandidate ) = 0;
203
204protected:
205 bool visit( ITEM* aCandidate );
206
207protected:
208 const ITEM* m_item;
209
210 const NODE* m_node;
212 std::optional<int> m_layerContext;
213};
214
215
217{
218public:
219 LAYER_CONTEXT_SETTER( OBSTACLE_VISITOR& aVisitor, int aLayer ) :
220 m_visitor( aVisitor )
221 {
222 m_visitor.SetLayerContext( aLayer );
223 }
224
226 {
227 m_visitor.ClearLayerContext();
228 }
229
230private:
232};
233
243class NODE : public ITEM_OWNER
244{
245public:
246
253
254 typedef std::optional<OBSTACLE> OPT_OBSTACLE;
255 typedef std::vector<ITEM*> ITEM_VECTOR;
256 typedef std::set<OBSTACLE> OBSTACLES;
257
258 NODE();
259 ~NODE();
260
262 int GetClearance( const ITEM* aA, const ITEM* aB, bool aUseClearanceEpsilon = true ) const;
263
265 int GetMaxClearance() const
266 {
267 return m_maxClearance;
268 }
269
274 void BeginBulkAdd();
275
279 void FinalizeBulkAdd();
280
282 void SetMaxClearance( int aClearance )
283 {
284 m_maxClearance = aClearance;
285 }
286
289 {
290 m_ruleResolver = aFunc;
291 }
292
294 {
295 return m_ruleResolver;
296 }
297
299 int JointCount() const
300 {
301 return m_joints.size();
302 }
303
305 int Depth() const
306 {
307 return m_depth;
308 }
309
319 int QueryColliding( const ITEM* aItem, OBSTACLES& aObstacles,
320 const COLLISION_SEARCH_OPTIONS& aOpts = COLLISION_SEARCH_OPTIONS() ) const;
321
322 int QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints,
323 PNS_LAYER_RANGE aLayerMask = PNS_LAYER_RANGE::All(), int aKindMask = ITEM::ANY_T );
324
333 OPT_OBSTACLE NearestObstacle( const LINE* aLine,
335
344 OPT_OBSTACLE CheckColliding( const ITEM* aItem, int aKindMask = ITEM::ANY_T );
345
346
355 OPT_OBSTACLE CheckColliding( const ITEM_SET& aSet, int aKindMask = ITEM::ANY_T );
356
365 OPT_OBSTACLE CheckColliding( const ITEM* aItem, const COLLISION_SEARCH_OPTIONS& aOpts );
366
373 const ITEM_SET HitTest( const VECTOR2I& aPoint ) const;
374
383 bool Add( std::unique_ptr<SEGMENT> aSegment, bool aAllowRedundant = false );
384 void Add( std::unique_ptr<SOLID> aSolid );
385 void Add( std::unique_ptr<VIA> aVia );
386 bool Add( std::unique_ptr<ARC> aArc, bool aAllowRedundant = false );
387
388 void Add( LINE& aLine, bool aAllowRedundant = false );
389
390 void AddEdgeExclusion( std::unique_ptr<SHAPE> aShape );
391 bool QueryEdgeExclusions( const VECTOR2I& aPos ) const;
392
396 void Remove( ARC* aArc );
397 void Remove( SOLID* aSolid );
398 void Remove( VIA* aVia );
399 void Remove( SEGMENT* aSegment );
400 void Remove( ITEM* aItem );
401
407 void Remove( LINE& aLine );
408
415 void Replace( ITEM* aOldItem, std::unique_ptr< ITEM > aNewItem );
416 void Replace( LINE& aOldLine, LINE& aNewLine, bool aAllowRedundantSegments = false );
417
426 NODE* Branch();
427
440 const LINE AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex = nullptr,
441 bool aStopAtLockedJoints = false,
442 bool aFollowLockedSegments = false,
443 bool aAllowSegmentSizeMismatch = true );
444
446 void Dump( bool aLong = false );
447
454 void GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded );
455
464 void Commit( NODE* aNode );
465
471 const JOINT* FindJoint( const VECTOR2I& aPos, int aLayer, NET_HANDLE aNet ) const;
472
473 void LockJoint( const VECTOR2I& aPos, const ITEM* aItem, bool aLock );
474
480 const JOINT* FindJoint( const VECTOR2I& aPos, const ITEM* aItem ) const
481 {
482 return FindJoint( aPos, aItem->Layers().Start(), aItem->Net() );
483 }
484
486 int FindLinesBetweenJoints( const JOINT& aA, const JOINT& aB, std::vector<LINE>& aLines );
487
489 void FindLineEnds( const LINE& aLine, JOINT& aA, JOINT& aB );
490
492 void KillChildren();
493
494 void AllItemsInNet( NET_HANDLE aNet, std::set<ITEM*>& aItems, int aKindMask = -1 );
495
496 void ClearRanks( int aMarkerMask = MK_HEAD | MK_VIOLATION );
497
498 void RemoveByMarker( int aMarker );
499
500 ITEM* FindItemByParent( const BOARD_ITEM* aParent );
501
502 std::vector<ITEM*> FindItemsByParent( const BOARD_ITEM* aParent );
503
504 bool HasChildren() const
505 {
506 return !m_children.empty();
507 }
508
510 {
511 return m_parent;
512 }
513
515 bool Overrides( ITEM* aItem ) const
516 {
517 return m_override.find( aItem ) != m_override.end();
518 }
519
520 void FixupVirtualVias();
521
522 void AddRaw( ITEM* aItem, bool aAllowRedundant = false )
523 {
524 add( aItem, aAllowRedundant );
525 }
526
527 const std::unordered_set<ITEM*>& GetOverrides() const
528 {
529 return m_override;
530 }
531
532 VIA* FindViaByHandle ( const VIA_HANDLE& handle ) const;
533
534private:
535 void add( ITEM* aItem, bool aAllowRedundant = false );
536
538 NODE( const NODE& aB );
539 NODE& operator=( const NODE& aB );
540
542 JOINT& touchJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet );
543
545 void linkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
546 ITEM* aWhere );
547
549 void unlinkJoint( const VECTOR2I& aPos, const PNS_LAYER_RANGE& aLayers, NET_HANDLE aNet,
550 ITEM* aWhere );
551
553 void addSolid( SOLID* aSeg );
554 void addSegment( SEGMENT* aSeg );
555 void addVia( VIA* aVia );
556 void addArc( ARC* aVia );
557 void addHole( HOLE* aHole );
558
559 void removeSolidIndex( SOLID* aSeg );
560 void removeSegmentIndex( SEGMENT* aSeg );
561 void removeViaIndex( VIA* aVia );
562 void removeArcIndex( ARC* aVia );
563
564 void doRemove( ITEM* aItem );
565 void unlinkParent();
566 void releaseChildren();
567 void releaseGarbage();
568 void rebuildJoint( const JOINT* aJoint, const ITEM* aItem );
569
570 bool isRoot() const
571 {
572 return m_parent == nullptr;
573 }
574
575 SEGMENT* findRedundantSegment( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
576 NET_HANDLE aNet );
578
579 ARC* findRedundantArc( const VECTOR2I& A, const VECTOR2I& B, const PNS_LAYER_RANGE& lr,
580 NET_HANDLE aNet );
581 ARC* findRedundantArc( ARC* aSeg );
582
584 void followLine( LINKED_ITEM* aCurrent, bool aScanDirection, int& aPos, int aLimit,
585 VECTOR2I* aCorners, LINKED_ITEM** aSegments, bool* aArcReversed,
586 bool& aGuardHit, bool aStopAtLockedJoints, bool aFollowLockedSegments,
587 bool aAllowSegmentSizeMismatch );
588
589private:
590 struct DEFAULT_OBSTACLE_VISITOR;
591 typedef std::unordered_multimap<JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH> JOINT_MAP;
592 typedef JOINT_MAP::value_type TagJointPair;
593
596
599 std::set<NODE*> m_children;
600
601 std::unordered_set<ITEM*> m_override;
603
609
610 std::vector< std::unique_ptr<SHAPE> > m_edgeExclusions;
611
612 std::unordered_set<ITEM*> m_garbageItems;
613};
614
615}
616
617#endif
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
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:219
OBSTACLE_VISITOR & m_visitor
Definition pns_node.h:231
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:244
bool HasChildren() const
Definition pns_node.h:504
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:598
int FindLinesBetweenJoints(const JOINT &aA, const JOINT &aB, std::vector< LINE > &aLines)
Find all lines between a pair of joints. Used by the loop removal procedure.
void BeginBulkAdd()
Defer spatial index insertion during bulk population.
NODE * GetParent() const
Definition pns_node.h:509
std::vector< ITEM * > ITEM_VECTOR
Definition pns_node.h:255
int GetClearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const
Return the expected clearance between items a and b.
Definition pns_node.cpp:143
void addSolid(SOLID *aSeg)
Helpers for adding/removing items.
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
Check if this branch contains an updated version of the m_item from the root branch.
Definition pns_node.h:515
int GetMaxClearance() const
Return the pre-set worst case clearance between any pair of items.
Definition pns_node.h:265
void removeSegmentIndex(SEGMENT *aSeg)
Definition pns_node.cpp:856
void SetMaxClearance(int aClearance)
Set the worst-case clearance between any pair of items.
Definition pns_node.h:282
COLLISION_QUERY_SCOPE
Supported item types.
Definition pns_node.h:249
@ CQS_IGNORE_HOLE_CLEARANCE
check everything except hole2hole / hole2copper
Definition pns_node.h:251
@ CQS_ALL_RULES
check all rules
Definition pns_node.h:250
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:610
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:592
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:254
void unlinkJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet, ITEM *aWhere)
Unlink an item from a joint.
std::unordered_set< ITEM * > m_garbageItems
Definition pns_node.h:612
void Dump(bool aLong=false)
Print the contents and joints structure.
void AddRaw(ITEM *aItem, bool aAllowRedundant=false)
Definition pns_node.h:522
NODE(const NODE &aB)
nodes are not copyable
void releaseGarbage()
int Depth() const
Return the number of nodes in the inheritance chain (wrs to the root node).
Definition pns_node.h:305
void addArc(ARC *aVia)
Definition pns_node.cpp:765
void FindLineEnds(const LINE &aLine, JOINT &aA, JOINT &aB)
Find the joints corresponding to the ends of line aLine.
RULE_RESOLVER * GetRuleResolver() const
Definition pns_node.h:293
JOINT & touchJoint(const VECTOR2I &aPos, const PNS_LAYER_RANGE &aLayers, NET_HANDLE aNet)
Try to find matching joint and creates a new one if not found.
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:256
std::unordered_multimap< JOINT::HASH_TAG, JOINT, JOINT::JOINT_TAG_HASH > JOINT_MAP
Definition pns_node.h:591
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:606
std::unordered_set< ITEM * > m_override
hash of root's items that have been changed in this node
Definition pns_node.h:601
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)
Assign a clearance resolution function object.
Definition pns_node.h:288
void removeArcIndex(ARC *aVia)
Definition pns_node.cpp:863
int JointCount() const
Return the number of joints.
Definition pns_node.h:299
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)
int m_maxClearance
worst case item-item clearance
Definition pns_node.h:604
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:480
bool isRoot() const
Definition pns_node.h:570
const std::unordered_set< ITEM * > & GetOverrides() const
Definition pns_node.h:527
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)
Scan the joint map, forming a line starting from segment (current).
void KillChildren()
Destroy all child nodes. Applicable only to the root node.
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:607
std::set< NODE * > m_children
list of nodes branched from this one
Definition pns_node.h:599
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
JOINT_MAP m_joints
hash table with the joints, linking the items.
Definition pns_node.h:594
std::vector< ITEM * > FindItemsByParent(const BOARD_ITEM *aParent)
NODE * m_parent
node this node was branched from
Definition pns_node.h:597
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:605
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)
Touch a joint and links it to an m_item.
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:210
const ITEM * m_item
the item we are looking for collisions with
Definition pns_node.h:208
virtual bool operator()(ITEM *aCandidate)=0
bool visit(ITEM *aCandidate)
Definition pns_node.cpp:215
std::optional< int > m_layerContext
Definition pns_node.h:212
void SetLayerContext(int aLayer)
Definition pns_node.h:199
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:211
virtual ~OBSTACLE_VISITOR()
Definition pns_node.h:193
virtual int NetCode(NET_HANDLE aNet)=0
virtual ~RULE_RESOLVER()
Definition pns_node.h:144
virtual void ClearCacheForItems(std::vector< const ITEM * > &aItems)
Definition pns_node.h:172
virtual int ClearanceEpsilon() const
Definition pns_node.h:176
virtual void ClearTemporaryCaches()
Definition pns_node.h:174
virtual const SHAPE_LINE_CHAIN & HullCache(const ITEM *aItem, int aClearance, int aWalkaroundThickness, int aLayer)
Definition pns_node.h:178
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:147
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:173
virtual wxString NetName(NET_HANDLE aNet)=0
Represent a contiguous set of PCB layers.
int Start() const
static PNS_LAYER_RANGE All()
Shortcut for comparisons/overlap tests.
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:137
std::set< OBSTACLE > & obstacles
Definition pns_node.h:136
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:708