53 std::unordered_set<LINKED_ITEM*> seenItems;
58 if( seenItems.count( aItem ) )
61 seenItems.insert( aItem );
73 for(
auto item : aPrimitives.
Items() )
78 if( ! item.item->IsRoutable() )
81 auto solid = static_cast<SOLID*>( item.item );
86 for(
auto link : jt->LinkList() )
89 addLinked( solid, static_cast<LINKED_ITEM*>( link.item ) );
92 std::vector<JOINT*> extraJoints;
97 for(
JOINT* extraJoint : extraJoints )
99 if( extraJoint->Net() == jt->Net() && extraJoint->LinkCount() == 1 )
101 LINKED_ITEM* li = static_cast<LINKED_ITEM*>( extraJoint->LinkList()[0].item );
104 addLinked( solid, li, extraJoint->Pos() - solid->Pos() );
124 SOLID* s = static_cast<SOLID*>( item );
125 auto p_next = aP -
m_p0 + s->
Pos();
126 std::unique_ptr<SOLID> snew( static_cast<SOLID*>( s->
Clone() ) );
127 snew->SetPos( p_next );
134 if( l.attachedPad == s )
136 l.p_orig = s->
Pos() + l.offset;
137 l.p_next = p_next + l.offset;
144 auto l_new( cn.origLine );
147 l_new.DragCorner( cn.p_next, cn.origLine.CLine().Find( cn.p_orig ) );
152 auto l_orig( cn.origLine );
COMPONENT_DRAGGER(ROUTER *aRouter)
ROUTER * Router() const
Return current router settings.
Keep the router "world" - i.e.
virtual void AddLine(const SHAPE_LINE_CHAIN &aLine, int aType=0, int aWidth=0, const std::string aName="")
NODE * CurrentNode() const override
Function CurrentNode()
ITEM_SET m_initialDraggedItems
bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives) override
Function Start()
void Add(const LINE &aLine)
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
void Remove(ARC *aArc)
Remove an item from this branch.
std::set< SOLID * > m_solids
ROUTING_SETTINGS & Settings() const
Return the logger object, allowing to dump geometry to a file.
Represents a 2D point on a given set of layers and belonging to a certain net, that links together a ...
bool Drag(const VECTOR2I &aP) override
Function Drag()
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=NULL, bool aStopAtLockedJoints=false)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
ITEM * Clone() const override
Return a deep copy of the item.
std::vector< DRAGGED_CONNECTION > m_conns
DEBUG_DECORATOR * Dbg() const
bool Collide(const ITEM *aOther, const NODE *aNode, bool aDifferentNetsOnly=true) const
Check for a collision (clearance violation) with between us and item aOther.
int QueryJoints(const BOX2I &aBox, std::vector< JOINT * > &aJoints, LAYER_RANGE aLayerMask=LAYER_RANGE::All(), int aKindMask=ITEM::ANY_T)
JOINT * FindJoint(const VECTOR2I &aPos, int aLayer, int aNet)
Search for a joint at a given position, layer and belonging to given net.
const VECTOR2I & Pos() const
const ITEM_SET Traces() override
Function Traces()
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.
Push and Shove diff pair dimensions (gap) settings dialog.
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
bool FixRoute() override
Function FixRoute()