36 printf(
"&&&& %zu obstacles: \n", obstacles.size() );
38 for(
const auto& obs : obstacles )
40 printf(
"%p [%s] - %p [%s], clearance %d\n",
41 obs.m_head, obs.m_head->KindStr().c_str(),
42 obs.m_item, obs.m_item->KindStr().c_str(),
58 if( !parentH || !parentI )
61 const VIA* parentViaI = dyn_cast<const VIA*>( parentI );
62 const VIA* parentViaH = dyn_cast<const VIA*>( parentH );
75 if( parentViaI && parentViaH && parentViaI->
Pos() == parentViaH->
Pos()
77 && parentViaI->
Net() == parentViaH->
Net()
78 && parentViaI->
Drill() == parentViaH->
Drill() )
81 return parentI != parentH;
106 bool collisionsFound =
false;
118 if(
const auto line = dyn_cast<const LINE*>(
this ) )
120 if( line->EndsWithVia() )
121 collisionsFound |= line->Via().
collideSimple( aHead, aNode, aCtx );
124 if(
const auto line = dyn_cast<const LINE*>( aHead ) )
126 if( line->EndsWithVia() )
127 collisionsFound |= line->Via().collideSimple(
this, aNode, aCtx );
134 collisionsFound =
true;
140 lineWidthI =
static_cast<const LINE*
>( this )->Width() / 2;
143 lineWidthH =
static_cast<const LINE*
>( aHead )->Width() / 2;
152 bool differentNetsOnly =
true;
153 bool enforce =
false;
161 differentNetsOnly =
false;
163 if( differentNetsOnly &&
Net() == aHead->
Net() && aHead->
Net() )
208 if( checkCastellation || checkNetTie )
217 if( shapeH->
Collide( shapeI, clearance + lineWidthH + lineWidthI - 1, &actual, &pos ) )
227 collisionsFound =
true;
248 if( shapeH->
Collide( shapeI, clearance + lineWidthH + lineWidthI - 1 ) )
252 collisionsFound =
true;
269 return collisionsFound;
286 case ARC_T:
return "arc";
287 case LINE_T:
return "line";
289 case VIA_T:
return "via";
293 case HOLE_T:
return "hole";
295 default:
return "unknown";
310 std::stringstream ss;
326 return static_cast<const NODE*
>(
Owner() );
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
ITEM * ParentPadVia() const override
Base class for PNS router board items.
virtual const std::string Format() const
virtual ITEM * ParentPadVia() const
const PNS_LAYER_RANGE & Layers() const
virtual NET_HANDLE Net() const
PnsKind Kind() const
Return the type (kind) of the item.
bool collideSimple(const ITEM *aHead, const NODE *aNode, COLLISION_SEARCH_CONTEXT *aCtx) const
virtual const SHAPE * Shape() const
Return the geometrical shape of the item.
virtual const NODE * OwningNode() const
bool OfKind(int aKindMask) const
std::string KindStr() const
virtual HOLE * Hole() const
bool Collide(const ITEM *aHead, const NODE *aNode, COLLISION_SEARCH_CONTEXT *aCtx=nullptr) const
Check for a collision (clearance violation) with between us and item aOther.
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Keep the router "world" - i.e.
int GetClearance(const ITEM *aA, const ITEM *aB, bool aUseClearanceEpsilon=true) const
Return the pre-set worst case clearance between any pair of items.
bool QueryEdgeExclusions(const VECTOR2I &aPos) const
RULE_RESOLVER * GetRuleResolver() const
Return the number of joints.
std::set< OBSTACLE > OBSTACLES
const ITEM_OWNER * Owner() const
Return the owner of this item, or NULL if there's none.
virtual wxString GetNetName(PNS::NET_HANDLE aNet) const =0
virtual bool IsFlashedOnLayer(const PNS::ITEM *aItem, int aLayer) const =0
ROUTER_IFACE * GetInterface() const
static ROUTER * GetInstance()
virtual bool IsNonPlatedSlot(const PNS::ITEM *aItem)=0
virtual bool IsNetTieExclusion(const ITEM *aItem, const VECTOR2I &aCollisionPos, const ITEM *aCollidingItem)=0
virtual bool IsKeepout(const ITEM *aObstacle, const ITEM *aItem, bool *aEnforce)=0
virtual bool IsInNetTie(const ITEM *aA)=0
const VECTOR2I & Pos() const
bool Overlaps(const PNS_LAYER_RANGE &aOther) const
An abstract shape on 2D plane.
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
VECTOR2_TRAITS< int32_t >::extended_type extended_type
Push and Shove diff pair dimensions (gap) settings dialog.
static void dumpObstacles(const PNS::NODE::OBSTACLES &obstacles)
static bool shouldWeConsiderHoleCollisions(const ITEM *aItem, const ITEM *aHead)
VECTOR2I::extended_type ecoord
const COLLISION_SEARCH_OPTIONS options
std::set< OBSTACLE > & obstacles
bool m_useClearanceEpsilon
Hold an object colliding with another object, along with some useful data about the collision.
int m_distFirst
... and the distance thereof
int m_maxFanoutWidth
worst case (largest) width of the tracks connected to the item
ITEM * m_head
Line we search collisions against.
ITEM * m_item
Item found to be colliding with m_head.