23#ifndef __PNS_DIFF_PLACER_H
24#define __PNS_DIFF_PLACER_H
99 bool SetLayer(
int aLayer )
override;
126 const std::vector<NET_HANDLE>
CurrentNets()
const override;
220 bool aWindCw,
bool aSolidsOnly );
228 wxString* aErrorMsg );
Represent route directions & corner angles in a 45-degree metric.
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Return the most recent world state.
void SetOrthoMode(bool aOrthoMode) override
Force the router to place a straight 90/45 degree trace (with the end as near to the cursor as possib...
bool HasPlacedAnything() const override
NODE * m_world
pointer to world to search colliding items
bool tryWalkDp(NODE *aNode, DIFF_PAIR &aPair, bool aSolidsOnly)
bool propagateDpHeadForces(const VECTOR2I &aP, VECTOR2I &aNewP)
bool rhMarkObstacles(const VECTOR2I &aP)
route step, mark obstacles mode
void setInitialDirection(const DIRECTION_45 &aDirection)
Set preferred direction of the very first track segment to be laid.
int m_currentWidth
current track width
int m_viaDiameter
current via diameter
static constexpr int DP_DEFAULT_GAP_EPSILON
VECTOR2I m_p_start
current routing start point (end of tail, beginning of head)
std::optional< DP_PRIMITIVE_PAIR > m_prevPair
bool ToggleVia(bool aEnabled) override
Enable/disable a via at the end of currently routed trace.
bool route(const VECTOR2I &aP)
Re-route the current track to point aP.
bool AbortPlacement() override
int m_iteration
current algorithm iteration
const VECTOR2I & CurrentStart() const override
Return the current start of the line being placed.
bool rhShoveOnly(const VECTOR2I &aP)
route step, shove mode
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Start routing a single track at point aP, taking item aStartItem as anchor (unless NULL).
bool CommitPlacement() override
bool findDpEndingPrimitives(NODE *aWorld, const VECTOR2I &aP, ITEM *aStartItem, DP_PRIMITIVE_PAIR &aPair, wxString *aErrorMsg)
const ITEM_SET Traces() override
Return the complete routed line, as a single-member ITEM_SET.
void GetModifiedNets(std::vector< NET_HANDLE > &aNets) const override
Return the nets of all currently routed trace(s)
int m_viaDrill
current via drill
const DIFF_PAIR CurrentTrace() const
static constexpr double DP_CPR_SWITCH_POSTURE_RATIO
void FlipPosture() override
Toggle the current posture (straight/diagonal) of the trace head.
DIFF_PAIR_PLACER(ROUTER *aRouter)
bool findDpMidtraceIntersection(NODE *aWorld, const VECTOR2I &aP, ITEM *aStartItem, DP_PRIMITIVE_PAIR &aPair, wxString *aErrorMsg)
bool attemptWalk(NODE *aNode, DIFF_PAIR *aCurrent, DIFF_PAIR &aWalk, bool aPFirst, bool aWindCw, bool aSolidsOnly)
void setWorld(NODE *aWorld)
Set the board to route.
NODE * m_currentNode
Current world state.
void initPlacement()
Initialize placement of a new line with given parameters.
const std::vector< NET_HANDLE > CurrentNets() const override
Return the net of currently routed track.
std::optional< DP_PRIMITIVE_PAIR > m_target
bool routeHead(const VECTOR2I &aP)
void UpdateSizes(const SIZES_SETTINGS &aSizes) override
Perform on-the-fly update of the width, via diameter & drill size from a settings class.
bool FindDpPrimitivePair(NODE *aWorld, const VECTOR2I &aP, ITEM *aItem, DP_PRIMITIVE_PAIR &aPair, wxString *aErrorMsg=nullptr)
bool rhWalkOnly(const VECTOR2I &aP)
route step, walk around mode
bool Move(const VECTOR2I &aP, ITEM *aEndItem) override
Move the end of the currently routed trace to the point aP, taking aEndItem as anchor (if not NULL).
DP_PRIMITIVE_PAIR m_start
bool IsPlacingVia() const override
Return true if the placer is placing a via (or more vias).
bool FixRoute(const VECTOR2I &aP, ITEM *aEndItem, bool aForceFinish) override
Commit the currently routed track to the parent node, taking aP as the final end point and aEndItem a...
NODE * m_lastNode
Postprocessed world state (including marked collisions & removed loops)
int CurrentLayer() const override
Return the layer of currently routed track.
bool m_placingVia
Are we placing a via?
void updateLeadingRatLine()
Draw the "leading" ratsnest line, which connects the end of currently routed track and the nearest ye...
const VIA makeVia(const VECTOR2I &aP, NET_HANDLE aNet)
bool SetLayer(int aLayer) override
Set the current routing layer.
std::unique_ptr< SHOVE > m_shove
The shove engine.
const VECTOR2I & CurrentEnd() const override
Return the current end of the line being placed.
Basic class for a differential pair.
Store starting/ending primitives (pads, vias or segments) for a differential pair.
Base class for PNS router board items.
Keep the router "world" - i.e.
Perform various optimizations of the lines being routed, attempting to make the lines shorter and les...
PLACEMENT_ALGO(ROUTER *aRouter)
The actual Push and Shove algorithm.
Push and Shove diff pair dimensions (gap) settings dialog.
VECTOR2< int32_t > VECTOR2I