20#ifndef LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWTRACE_H
21#define LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWTRACE_H
39class BI_NetLineAnchor;
78 virtual
bool entry() noexcept override;
79 virtual
bool exit() noexcept override;
151 BI_Via* fixedVia =
nullptr,
194 void showVia(
bool isVisible) noexcept;
Definition bi_netline.h:46
The BI_NetLine class.
Definition bi_netline.h:71
The BI_NetPoint class.
Definition bi_netpoint.h:46
The BI_NetSegment class.
Definition bi_netsegment.h:52
The BI_Via class.
Definition bi_via.h:44
The Board class represents a PCB of a project and is always part of a circuit.
Definition board.h:73
The Layer class provides all supported geometry layers.
Definition layer.h:42
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Via class represents a via of a board.
Definition via.h:52
const PositiveLength & getDrillDiameter() const noexcept
Definition via.h:85
const PositiveLength & getSize() const noexcept
Definition via.h:84
The "draw trace" state/tool of the board editor.
Definition boardeditorstate_drawtrace.h:55
WireMode
All available wire modes.
Definition boardeditorstate_drawtrace.h:62
@ VH
vertical - horizontal
@ HV
horizontal - vertical [default]
bool startPositioning(Board &board, const Point &pos, BI_NetPoint *fixedPoint=nullptr, BI_Via *fixedVia=nullptr, BI_FootprintPad *fixedPad=nullptr) noexcept
Begin drawing the next BI_NetLine.
Definition boardeditorstate_drawtrace.cpp:317
const PositiveLength & getViaDrillDiameter() const noexcept
Definition boardeditorstate_drawtrace.h:110
bool addNextNetPoint(BoardGraphicsScene &scene) noexcept
Finalize the BI_NetLines and connect them to other existing traces if necessary.
Definition boardeditorstate_drawtrace.cpp:485
BI_NetLine * mPositioningNetLine2
line between p1 and p2
Definition boardeditorstate_drawtrace.h:231
virtual bool processGraphicsSceneMouseMoved(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:168
const PositiveLength & getWidth() const noexcept
Definition boardeditorstate_drawtrace.h:104
const Layer * mCurrentLayer
the current board layer name
Definition boardeditorstate_drawtrace.h:212
const Layer * mViaLayer
Layer where the via was started.
Definition boardeditorstate_drawtrace.h:217
bool mAddVia
whether a via add is requested
Definition boardeditorstate_drawtrace.h:213
BI_NetLine * mPositioningNetLine1
line between fixed point and p1
Definition boardeditorstate_drawtrace.h:229
BoardEditorState_DrawTrace()=delete
bool mCurrentAutoWidth
automatically adjust wire width
Definition boardeditorstate_drawtrace.h:223
WireMode mCurrentWireMode
the current wire mode
Definition boardeditorstate_drawtrace.h:211
virtual ~BoardEditorState_DrawTrace() noexcept
Definition boardeditorstate_drawtrace.cpp:95
virtual bool processGraphicsSceneRightMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:205
PositiveLength mCurrentWidth
the current wire width
Definition boardeditorstate_drawtrace.h:222
void updateNetpointPositions() noexcept
Update the currently active traces according to the set parameters.
Definition boardeditorstate_drawtrace.cpp:700
void setLayer(const Layer &layer) noexcept
Definition boardeditorstate_drawtrace.cpp:240
BI_NetPoint * mPositioningNetPoint2
the second netpoint to place
Definition boardeditorstate_drawtrace.h:232
QSet< const Layer * > getAvailableLayers() noexcept
Definition boardeditorstate_drawtrace.cpp:236
Point mTargetPos
Definition boardeditorstate_drawtrace.h:218
void setViaDrillDiameter(const PositiveLength &diameter) noexcept
Definition boardeditorstate_drawtrace.cpp:304
virtual bool processGraphicsSceneLeftMouseButtonPressed(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:179
BI_NetLineAnchor * mFixedStartAnchor
Definition boardeditorstate_drawtrace.h:225
void setWireMode(WireMode mode) noexcept
Definition boardeditorstate_drawtrace.cpp:225
BI_Via * mTempVia
Definition boardeditorstate_drawtrace.h:214
void setWidth(const PositiveLength &width) noexcept
Definition boardeditorstate_drawtrace.cpp:284
virtual bool processAbortCommand() noexcept override
Definition boardeditorstate_drawtrace.cpp:123
const Layer & getLayer() const noexcept
Definition boardeditorstate_drawtrace.h:100
void viaDrillDiameterChanged(const PositiveLength &diameter)
BoardEditorState_DrawTrace(const BoardEditorState_DrawTrace &other)=delete
bool abortPositioning(bool showErrMsgBox) noexcept
Abort or cancel the current drawing of the trace.
Definition boardeditorstate_drawtrace.cpp:674
void autoWidthChanged(bool autoWidth)
void setViaSize(const PositiveLength &size) noexcept
Definition boardeditorstate_drawtrace.cpp:295
Via mCurrentViaProperties
Definition boardeditorstate_drawtrace.h:215
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:200
WireMode getWireMode() const noexcept
Definition boardeditorstate_drawtrace.h:97
BI_NetPoint * mPositioningNetPoint1
the first netpoint to place
Definition boardeditorstate_drawtrace.h:230
virtual bool processKeyPressed(const GraphicsSceneKeyEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:134
bool getAutoWidth() const noexcept
Definition boardeditorstate_drawtrace.h:102
bool mCurrentSnapActive
the current active snap to target
Definition boardeditorstate_drawtrace.h:224
const PositiveLength & getViaSize() const noexcept
Definition boardeditorstate_drawtrace.h:106
Point calcMiddlePointPos(const Point &p1, const Point p2, WireMode mode) const noexcept
Calculate the 'middle point' of two point, according to the chosen WireMode.
Definition boardeditorstate_drawtrace.cpp:837
virtual bool exit() noexcept override
Definition boardeditorstate_drawtrace.cpp:110
void viaSizeChanged(const PositiveLength &size)
void wireModeChanged(WireMode mode)
BI_NetSegment * mCurrentNetSegment
Definition boardeditorstate_drawtrace.h:227
void widthChanged(const PositiveLength &width)
void setAutoWidth(bool autoWidth) noexcept
Definition boardeditorstate_drawtrace.cpp:273
virtual bool processKeyReleased(const GraphicsSceneKeyEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:151
void layerChanged(const Layer &layer)
void showVia(bool isVisible) noexcept
Sets the BI_Via of the currently active trace.
Definition boardeditorstate_drawtrace.cpp:759
BoardEditorState_DrawTrace & operator=(const BoardEditorState_DrawTrace &rhs)=delete
BI_NetLineAnchor * combineAnchors(BI_NetLineAnchor &a, BI_NetLineAnchor &b)
Definition boardeditorstate_drawtrace.cpp:802
SubState
Internal FSM States (substates)
Definition boardeditorstate_drawtrace.h:129
@ SubState_Idle
idle state [initial state]
Definition boardeditorstate_drawtrace.h:130
@ SubState_PositioningNetPoint
in this state, an undo command is active!
Definition boardeditorstate_drawtrace.h:132
@ SubState_Initializing
beginning to start
Definition boardeditorstate_drawtrace.h:131
SubState mSubState
the current substate
Definition boardeditorstate_drawtrace.h:210
Point mCursorPos
the current cursor position
Definition boardeditorstate_drawtrace.h:221
virtual bool entry() noexcept override
Definition boardeditorstate_drawtrace.cpp:102
The board editor state base class.
Definition boardeditorstate.h:60
The BoardGraphicsScene class.
Definition boardgraphicsscene.h:77
Definition occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
FSM Context.
Definition boardeditorfsm.h:88
Definition graphicsscene.h:52
Definition graphicsscene.h:45