23 #ifndef __PNS_LINE_PLACER_H 24 #define __PNS_LINE_PLACER_H 64 std::vector<FIX_POINT>
pts;
122 bool ToggleVia(
bool aEnabled )
override;
127 bool SetLayer(
int aLayer )
override;
368 #endif // __PNS_LINE_PLACER_H Base class for PNS router board items.
const ITEM_SET Traces() override
Return the complete routed line, as a single-member ITEM_SET.
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).
Keep the router "world" - i.e.
NODE * m_lastNode
Postprocessed world state (including marked collisions & removed loops)
void routeStep(const VECTOR2I &aP)
Perform a single routing algorithm step, for the end point aP.
std::vector< STAGE > m_stages
NODE * m_world
pointer to world to search colliding items
void removeLoops(NODE *aNode, LINE &aLatest)
Searches aNode for traces concurrent to aLatest and removes them.
const std::vector< int > CurrentNets() const override
Return the net code of currently routed track.
void simplifyNewLine(NODE *aNode, LINKED_ITEM *aLatest)
Assemble a line starting from segment or arc aLatest, removes collinear segments and redundant vertex...
Single track placement algorithm.
LINE m_head
the volatile part of the track from the previously analyzed point to the current routing destination
bool rhWalkOnly(const VECTOR2I &aP, LINE &aNewHead)
Route step shove mode.
std::vector< FIX_POINT > pts
bool PopStage(STAGE &aStage)
FIXED_TAIL(int aLineCount=1)
const LINE Trace() const
Return the complete routed line.
bool reduceTail(const VECTOR2I &aEnd)
Attempt to reduce the number of segments in the tail by trying to replace a certain number of latest ...
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
bool buildInitialLine(const VECTOR2I &aP, LINE &aHead)
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 as...
const LINE & Tail() const
Return the "tail" of the line being placed, the part which has already wrapped around and shoved some...
bool handlePullback()
Deal with pull-back: reduces the tail if head trace is moved backwards wrs to the current tail direct...
LINE_PLACER(ROUTER *aRouter)
void UpdateSizes(const SIZES_SETTINGS &aSizes) override
Perform on-the-fly update of the width, via diameter & drill size from a settings class.
DIRECTION_45 m_initial_direction
routing direction for new traces
LINE m_tail
routing "tail": part of the track that has been already fixed due to collisions with obstacles
void setInitialDirection(const DIRECTION_45 &aDirection)
Set preferred direction of the very first track segment to be laid.
Represent route directions & corner angles in a 45-degree metric.
bool SplitAdjacentSegments(NODE *aNode, ITEM *aSeg, const VECTOR2I &aP)
Check if point aP lies on segment aSeg.
std::unique_ptr< SHOVE > m_shove
The shove engine.
DIRECTION_45 m_direction
current routing direction
void initPlacement()
Initialize placement of a new line with given parameters.
void updateLeadingRatLine()
Draw the "leading" rats nest line, which connects the end of currently routed track and the nearest y...
bool routeHead(const VECTOR2I &aP, LINE &aNewHead)
Compute the head trace between the current start point (m_p_start) and point aP, starting with direct...
bool HasPlacedAnything() const override
MOUSE_TRAIL_TRACER m_mouseTrailTracer
bool handleSelfIntersections()
Check if the head of the track intersects its tail.
bool route(const VECTOR2I &aP)
Re-route the current track to point aP.
void GetModifiedNets(std::vector< int > &aNets) const override
Function GetModifiedNets.
bool CommitPlacement() override
bool rhMarkObstacles(const VECTOR2I &aP, LINE &aNewHead)
bool rhShoveOnly(const VECTOR2I &aP, LINE &aNewHead)
Route step mark obstacles mode.
NODE * m_currentNode
Current world state.
void setWorld(NODE *aWorld)
Set the board to route.
bool optimizeTailHeadTransition()
Try to reduce the corner count of the most recent part of tail/head by merging obtuse/collinear segme...
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Return the most recent world state.
bool ToggleVia(bool aEnabled) override
Enable/disable a via at the end of currently routed trace.
void AddStage(VECTOR2I aStart, int aLayer, bool placingVias, DIRECTION_45 direction, NODE *aNode)
void FlipPosture() override
Toggle the current posture (straight/diagonal) of the trace head.
const VECTOR2I & CurrentEnd() const override
Return the current end of the line being placed.
bool SetLayer(int aLayer) override
Set the current routing layer.
VECTOR2I m_p_start
current routing start (end of tail, beginning of head)
bool IsPlacingVia() const override
Function IsPlacingVia()
bool mergeHead()
Moves "established" segments from the head to the tail if certain conditions are met.
void SetOrthoMode(bool aOrthoMode) override
Function SetOrthoMode()
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Start routing a single track at point aP, taking item aStartItem as anchor (unless NULL).
bool AbortPlacement() override
const VIA makeVia(const VECTOR2I &aP)
Push and Shove diff pair dimensions (gap) settings dialog.
bool UnfixRoute() override
const LINE & Head() const
Return the "head" of the line being placed, that is the volatile part that has not been "fixed" yet.
int CurrentLayer() const override
Return the layer of currently routed track.