56 std::unordered_set<LINKED_ITEM*> seenItems;
61 if( seenItems.count( aItem ) )
64 seenItems.insert( aItem );
67 VECTOR2I otherEnd = ( aJoint->Pos() == aItem->Anchor( 0 ) ) ? aItem->Anchor( 1 )
69 const JOINT* otherJoint =
m_world->FindJoint( otherEnd, aItem->Layer(), aItem->Net() );
75 if( aPrimitives.
Contains( otherItem ) )
92 const JOINT* jA =
m_world->FindJoint( line.
CPoint( 0 ), aItem->Layer(), aItem->Net() );
95 wxASSERT( jA == aJoint || jB == aJoint );
96 const JOINT* jSearch = ( jA == aJoint ) ? jB : jA;
102 if( aPrimitives.
Contains( otherItem ) )
112 m_conns.push_back( std::move( cn ) );
124 if( !item->IsRoutable() )
132 addLinked( solid, jt,
static_cast<LINKED_ITEM*
>( link ) );
135 std::vector<JOINT*> extraJoints;
140 for(
JOINT* extraJoint : extraJoints )
142 if( extraJoint->Net() == jt->
Net() && extraJoint->LinkCount() == 1 )
147 addLinked( solid, extraJoint, li, extraJoint->Pos() - solid->
Pos() );
171 std::unique_ptr<SOLID> snew(
static_cast<SOLID*
>( s->Clone() ) );
172 snew->SetPos( p_next );
177 if( !s->IsRoutable() )
182 if( l.attachedPad == s )
184 l.p_orig = s->Pos() + l.offset;
185 l.p_next = p_next + l.offset;
194 switch( item->Kind() )
199 std::unique_ptr<SEGMENT> s_new( s->
Clone() );
202 s_new->SetEnds( aP -
m_p0 + orig.
A, aP -
m_p0 + orig.
B );
212 ARC* a =
static_cast<ARC*
>( item );
213 std::unique_ptr<ARC> a_new( a->
Clone() );
224 wxFAIL_MSG( wxT(
"Unexpected item type in COMPONENT_DRAGGER::m_fixedItems" ) );
230 LINE l_new( cn.origLine );
233 l_new.
DragCorner( cn.p_next, cn.origLine.CLine().Find( cn.p_orig ) );
235 PNS_DBG(
Dbg(), AddItem, &l_new,
BLUE, 0, wxT(
"cdrag-new-fanout" ) );
238 LINE l_orig( cn.origLine );
ROUTER * Router() const
Return the instance of our router.
ROUTING_SETTINGS & Settings() const
Return current router settings.
DEBUG_DECORATOR * Dbg() const
ARC * Clone() const override
Return a deep copy of the item.
COMPONENT_DRAGGER(ROUTER *aRouter)
const ITEM_SET Traces() override
Function Traces()
NODE * CurrentNode() const override
Function CurrentNode()
std::set< ITEM * > m_fixedItems
bool FixRoute(bool aForceCommit) override
Function FixRoute()
std::vector< DRAGGED_CONNECTION > m_conns
bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives) override
Function Start()
ITEM_SET m_initialDraggedItems
std::set< SOLID * > m_solids
bool Drag(const VECTOR2I &aP) override
Function Drag()
DRAG_ALGO(ROUTER *aRouter)
bool Contains(ITEM *aItem) const
std::vector< ITEM * > & Items()
Base class for PNS router board items.
const PNS_LAYER_RANGE & Layers() const
virtual int Layer() const
bool Collide(const ITEM *aHead, const NODE *aNode, int aLayer, COLLISION_SEARCH_CONTEXT *aCtx=nullptr) const
Check for a collision (clearance violation) with between us and item aOther.
A 2D point on a given set of layers and belonging to a certain net, that links together a number of b...
const std::vector< ITEM * > & LinkList() const
NET_HANDLE Net() const override
int LinkCount(int aMask=-1) const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
const SHAPE_LINE_CHAIN & CLine() const
void DragCorner(const VECTOR2I &aP, int aIndex, bool aFreeAngle=false, DIRECTION_45 aPreferredEndingDirection=DIRECTION_45())
virtual void Unmark(int aMarker=-1) const override
std::vector< LINKED_ITEM * > & Links()
Return the list of links from the owning node that constitute this line (or NULL if the line is not l...
virtual void ClearLinks()
Erase the linking information. Used to detach the line from the owning node.
Keep the router "world" - i.e.
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.
SEGMENT * Clone() const override
Return a deep copy of the item.
const SHAPE_LINE_CHAIN Hull(int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const override
const VECTOR2I & Pos() const
void Move(const VECTOR2I &aVector) override
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
const VECTOR2I & CLastPoint() const
Return the last point in the line chain.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
Push and Shove diff pair dimensions (gap) settings dialog.
#define PNS_DBG(dbg, method,...)
VECTOR2< int32_t > VECTOR2I