61 virtual LOGGER* Logger()
override
66 SHOVE_STATUS ShoveLines(
const LINE& aCurrentHead );
67 SHOVE_STATUS ShoveMultiLines(
const ITEM_SET& aHeadSet );
71 SHOVE_STATUS ShoveObstacleLine(
const LINE& aCurLine,
const LINE& aObstacleLine,
74 void ForceClearance (
bool aEnabled,
int aClearance )
77 m_forceClearance = aClearance;
79 m_forceClearance = -1;
84 const LINE NewHead()
const;
86 void SetInitialLine(
LINE& aInitial );
88 bool AddLockedSpringbackNode(
NODE* aNode );
89 void UnlockSpringbackNode(
NODE* aNode );
90 bool RewindSpringbackTo(
NODE* aNode );
91 bool RewindToLastLockedNode();
92 void DisablePostShoveOptimizations(
int aMask );
93 void SetSpringbackDoNotTouchNode(
NODE *aNode );
96 typedef std::vector<SHAPE_LINE_CHAIN> HULL_SET;
97 typedef std::optional<LINE> OPT_LINE;
98 typedef std::pair<LINE, LINE> LINE_PAIR;
99 typedef std::vector<LINE_PAIR> LINE_PAIR_VEC;
101 struct SPRINGBACK_TAG
115 OPT_BOX2I m_affectedArea;
120 SHOVE_STATUS shoveLineToHullSet(
const LINE& aCurLine,
const LINE& aObstacleLine,
121 LINE& aResultLine,
const HULL_SET& aHulls );
125 bool pushSpringback(
NODE* aNode,
const OPT_BOX2I& aAffectedArea,
VIA* aDraggedVia );
127 SHOVE_STATUS shoveLineFromLoneVia(
const LINE& aCurLine,
const LINE& aObstacleLine,
129 bool checkShoveDirection(
const LINE& aCurLine,
const LINE& aObstacleLine,
130 const LINE& aShovedLine )
const;
132 SHOVE_STATUS onCollidingArc(
LINE& aCurrent,
ARC* aObstacleArc );
133 SHOVE_STATUS onCollidingLine(
LINE& aCurrent,
LINE& aObstacle );
134 SHOVE_STATUS onCollidingSegment(
LINE& aCurrent,
SEGMENT* aObstacleSeg );
135 SHOVE_STATUS onCollidingSolid(
LINE& aCurrent,
ITEM* aObstacle );
136 SHOVE_STATUS onCollidingVia(
ITEM* aCurrent,
VIA* aObstacleVia );
137 SHOVE_STATUS onReverseCollidingVia(
LINE& aCurrent,
VIA* aObstacleVia );
138 SHOVE_STATUS pushOrShoveVia(
VIA* aVia,
const VECTOR2I& aForce,
int aCurrentRank );
140 OPT_BOX2I totalAffectedArea()
const;
143 void unwindLineStack(
ITEM* aItem );
145 void runOptimizer(
NODE* aNode );
147 bool pushLineStack(
const LINE& aL,
bool aKeepCurrentOnTop =
false );
152 void replaceItems(
ITEM* aOld, std::unique_ptr< ITEM > aNew );
153 void replaceLine(
LINE& aOld,
LINE& aNew,
bool aIncludeInChangedArea =
true,
154 NODE *aNode =
nullptr );
158 OPT_BOX2I m_affectedArea;
160 SHOVE_STATUS shoveIteration(
int aIter );
161 SHOVE_STATUS shoveMainLoop();
163 int getClearance(
const ITEM* aA,
const ITEM* aB )
const;
164 int getHoleClearance(
const ITEM* aA,
const ITEM* aB )
const;
166 void sanityCheck(
LINE* aOld,
LINE* aNew );
168 std::vector<SPRINGBACK_TAG> m_nodeStack;
169 std::vector<LINE> m_lineStack;
170 std::vector<LINE> m_optimizerQueue;
171 std::unordered_map<const LINKED_ITEM*, LINE*> m_rootLineHistory;
175 NODE* m_springbackDoNotTouchNode;
176 int m_restrictSpringbackTagId;
184 int m_forceClearance;
185 bool m_multiLineMode;
187 int m_optFlagDisableMask;
Base class for all P&S algorithms (shoving, walkaround, line placement, dragging, etc....
Definition pns_algo_base.h:43
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
Definition pns_line.h:61