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 )
75 if( aPrimitives.
Contains( otherItem ) )
95 wxASSERT( jA == aJoint || jB == aJoint );
96 const JOINT* jSearch = ( jA == aJoint ) ? jB : jA;
102 if( aPrimitives.
Contains( otherItem ) )
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 current router settings.
ROUTING_SETTINGS & Settings() const
Return the logger object, allowing to dump geometry to a file.
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()
void Add(const LINE &aLine)
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()
virtual void ClearLinks()
Return the number of segments that were assembled together to form this line.
Keep the router "world" - i.e.
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
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.
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.
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
int QueryJoints(const BOX2I &aBox, std::vector< JOINT * > &aJoints, PNS_LAYER_RANGE aLayerMask=PNS_LAYER_RANGE::All(), int aKindMask=ITEM::ANY_T)
void Remove(ARC *aArc)
Remove an item from this branch.
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false, bool aFollowLockedSegments=false)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
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 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,...)