20#ifndef __PNS_BLOCK_DRAGGER_H
21#define __PNS_BLOCK_DRAGGER_H
24#include <unordered_set>
78 bool FixRoute(
bool aForceCommit )
override;
84 const std::vector<NET_HANDLE>
CurrentNets()
const override {
return std::vector<NET_HANDLE>(); }
void clipToBlock(LINE &aLine, const VECTOR2I &aEntry, LINKED_ITEM *aLink) const
Cut an assembled line back to the stretch between aEntry and the first block joint.
BLOCK_DRAGGER(ROUTER *aRouter)
std::set< const JOINT * > m_carriedJoints
Ends of selected copper that travel.
void SetMode(PNS::DRAG_MODE aDragMode) override
bool GetForceMarkObstaclesMode(bool *aDragStatus) const override
bool Start(const VECTOR2I &aP, ITEM_SET &aPrimitives) override
Sort the selection and the unselected copper touching it.
bool isBlockBoundary(const JOINT *aJoint) const
Copper at this joint is already sorted, so a walk stops here.
void scanRigidItem(ITEM *aItem)
Sort the copper touching a selected pad or via.
bool isHeldByBlock(const JOINT *aJoint) const
A selected pad or via sits on this joint.
virtual int CurrentLayer() const override
Unused for block dragging.
bool isPinned(const JOINT *aJoint, const LINE &aOwnLine) const
Held in place by something outside the block. Links of aOwnLine do not count.
const std::vector< LINE > & AnchoredLines() const
Selected arcs held at both ends, which cannot move.
std::vector< DRAGGED_CONNECTION > m_conns
Copper rerouted to follow the block.
std::unordered_set< ITEM * > m_selectedLinks
Selected segments and arcs.
std::vector< LINE > m_anchoredLines
Selected arcs that cannot move.
static LINE wrapLink(LINKED_ITEM *aLink)
A one link line, so no unselected copper is assembled into a selected segment.
void classifyNeighbour(const JOINT *aJoint, LINKED_ITEM *aLink)
Sort unselected copper that touches the block at aJoint.
std::set< ITEM * > m_bridgeItems
Copper displaced whole with the block.
bool isFixedByLock(ITEM *aItem) const
Unselected and locked, so it neither moves nor is rerouted.
bool Drag(const VECTOR2I &aP) override
Rebuild the block at aP: displace rigid and bridge items, reroute connections.
void displaceItem(ITEM *aItem, const VECTOR2I &aDelta)
Replace aItem in the current branch with a copy moved by aDelta.
NODE * CurrentNode() const override
The current branch, or the world before the first Drag().
std::set< ITEM * > m_rigidItems
Selected pads and vias.
void classifySelectedLink(LINKED_ITEM *aLink)
Sort a selected segment or arc by what holds its ends.
const ITEM_SET Traces() override
Everything displaced or rerouted by the last Drag().
virtual PNS::DRAG_MODE Mode() const override
const std::vector< NET_HANDLE > CurrentNets() const override
Unused for block dragging.
void scanJoint(const JOINT *aJoint)
Sort every unselected segment and arc on a joint.
std::unordered_set< LINKED_ITEM * > m_seenLinks
Already sorted.
bool FixRoute(bool aForceCommit) override
Commit the current branch if it is collision free or aForceCommit is set.
bool coveredBySolid(const JOINT *aJoint, bool aSelected) const
A pad covers more than its anchor, so ask what really sits on the joint.
DRAG_ALGO(ROUTER *aRouter)
Base class for PNS router board items.
A 2D point on a given set of layers and belonging to a certain net, that links together a number of b...
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Keep the router "world" - i.e.
Push and Shove diff pair dimensions (gap) settings dialog.
VECTOR2I p_orig
The corner that follows the block, or a body point.
bool dragBody
Both ends held, the body moves and the ends reroute.
VECTOR2< int32_t > VECTOR2I