23#ifndef __PNS_LINE_PLACER_H
24#define __PNS_LINE_PLACER_H
26#include <math/vector2d.h>
28#include <geometry/shape.h>
29#include <geometry/shape_line_chain.h>
32#include "pns_mouse_trail_tracer.h"
34#include "pns_placement_algo.h"
35#include "pns_sizes_settings.h"
64 std::vector<FIX_POINT> pts;
70 bool PopStage(
STAGE& aStage );
71 int StageCount()
const;
74 std::vector<STAGE> m_stages;
111 bool UnfixRoute()
override;
113 bool CommitPlacement()
override;
115 bool AbortPlacement()
override;
117 bool HasPlacedAnything()
const override;
122 bool ToggleVia(
bool aEnabled )
override;
127 bool SetLayer(
int aLayer )
override;
165 return std::vector<int>( 1, m_currentNet );
173 return m_currentLayer;
221 void updateLeadingRatLine();
226 void setWorld(
NODE* aWorld );
231 void initPlacement();
237 void setInitialDirection(
const DIRECTION_45& aDirection );
243 void removeLoops(
NODE* aNode,
LINE& aLatest );
259 bool handleSelfIntersections();
267 bool handlePullback();
284 bool reduceTail(
const VECTOR2I& aEnd );
292 bool optimizeTailHeadTransition();
308 void routeStep(
const VECTOR2I& aP );
317 bool rhMarkObstacles(
const VECTOR2I& aP,
LINE& aNewHead );
321 bool buildInitialLine(
const VECTOR2I& aP,
LINE& aHead,
bool aForceNoVia =
false );
338 std::unique_ptr<SHOVE> m_shove;
359 bool m_chainedPlacement;
361 bool m_placementCorrect;
Represent route directions & corner angles in a 45-degree metric.
Definition direction45.h:37
Definition pns_line_placer.h:48
Definition pns_itemset.h:37
Base class for PNS router board items.
Definition pns_item.h:57
Single track placement algorithm.
Definition pns_line_placer.h:85
bool SetLayer(int aLayer) override
Set the current routing layer.
Definition pns_line_placer.cpp:1082
const LINE Trace() const
Return the complete routed line.
Definition pns_line_placer.cpp:1021
const std::vector< int > CurrentNets() const override
Return the net code of currently routed track.
Definition pns_line_placer.h:163
void UpdateSizes(const SIZES_SETTINGS &aSizes) override
Perform on-the-fly update of the width, via diameter & drill size from a settings class.
Definition pns_line_placer.cpp:1652
void SetOrthoMode(bool aOrthoMode) override
Function SetOrthoMode()
Definition pns_line_placer.cpp:1689
bool Start(const VECTOR2I &aP, ITEM *aStartItem) override
Start routing a single track at point aP, taking item aStartItem as anchor (unless NULL).
Definition pns_line_placer.cpp:1117
const LINE & Tail() const
Return the "tail" of the line being placed, the part which has already wrapped around and shoved some...
Definition pns_line_placer.h:139
NODE * CurrentNode(bool aLoopsRemoved=false) const override
Return the most recent world state.
Definition pns_line_placer.cpp:1045
bool SplitAdjacentSegments(NODE *aNode, ITEM *aSeg, const VECTOR2I &aP)
Check if point aP lies on segment aSeg.
Definition pns_line_placer.cpp:1054
int CurrentLayer() const override
Return the layer of currently routed track.
Definition pns_line_placer.h:171
void FlipPosture() override
Toggle the current posture (straight/diagonal) of the trace head.
Definition pns_line_placer.cpp:1039
void GetModifiedNets(std::vector< int > &aNets) const override
Function GetModifiedNets.
Definition pns_line_placer.cpp:1770
bool IsPlacingVia() const override
Function IsPlacingVia()
Definition pns_line_placer.h:196
const LINE & Head() const
Return the "head" of the line being placed, that is the volatile part that has not been "fixed" yet.
Definition pns_line_placer.h:133
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).
Definition pns_line_placer.cpp:1217
const VECTOR2I & CurrentEnd() const override
Return the current end of the line being placed.
Definition pns_line_placer.h:155
const ITEM_SET Traces() override
Return the complete routed line, as a single-member ITEM_SET.
Definition pns_line_placer.cpp:1032
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...
Definition pns_line_placer.cpp:1263
bool ToggleVia(bool aEnabled) override
Enable/disable a via at the end of currently routed trace.
Definition pns_line_placer.cpp:84
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition pns_line.h:61
Definition pns_linked_item.h:30
Definition pns_mouse_trail_tracer.h:32
Keep the router "world" - i.e.
Definition pns_node.h:148
PLACEMENT_ALGO.
Definition pns_placement_algo.h:46
Definition pns_router.h:116
Definition pns_sizes_settings.h:42
Definition pns_line_placer.h:54
Definition pns_line_placer.h:62