20#ifndef LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWTRACE_H
21#define LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWTRACE_H
40class BI_NetLineAnchor;
50class PositiveLengthEdit;
70 virtual
bool entry() noexcept override;
71 virtual
bool exit() noexcept override;
78 QGraphicsSceneMouseEvent& e) noexcept override;
80 QGraphicsSceneMouseEvent& e) noexcept override;
82 QGraphicsSceneMouseEvent& e) noexcept override;
84 QGraphicsSceneMouseEvent& e) noexcept override;
126 BI_Via* fixedVia =
nullptr,
169 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:79
The Via class represents a via of a board.
Definition: via.h:52
The "draw trace" state/tool of the board editor.
Definition: boardeditorstate_drawtrace.h:59
WireMode
All available wire modes.
Definition: boardeditorstate_drawtrace.h:102
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:377
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept override
Definition: boardeditorstate_drawtrace.cpp:308
QPointer< PositiveLengthEdit > mSizeEdit
Definition: boardeditorstate_drawtrace.h:219
bool addNextNetPoint(BoardGraphicsScene &scene) noexcept
Finalize the BI_NetLines and connect them to other existing traces if necessary.
Definition: boardeditorstate_drawtrace.cpp:542
BI_NetLine * mPositioningNetLine2
line between p1 and p2
Definition: boardeditorstate_drawtrace.h:214
const Layer * mCurrentLayer
the current board layer name
Definition: boardeditorstate_drawtrace.h:195
bool mAddVia
whether a via add is requested
Definition: boardeditorstate_drawtrace.h:196
BI_NetLine * mPositioningNetLine1
line between fixed point and p1
Definition: boardeditorstate_drawtrace.h:212
BoardEditorState_DrawTrace()=delete
QPointer< PositiveLengthEdit > mWidthEdit
Definition: boardeditorstate_drawtrace.h:221
bool mCurrentAutoWidth
automatically adjust wire width
Definition: boardeditorstate_drawtrace.h:206
WireMode mCurrentWireMode
the current wire mode
Definition: boardeditorstate_drawtrace.h:194
virtual ~BoardEditorState_DrawTrace() noexcept
Definition: boardeditorstate_drawtrace.cpp:98
PositiveLength mCurrentWidth
the current wire width
Definition: boardeditorstate_drawtrace.h:205
void updateNetpointPositions() noexcept
Update the currently active traces according to the set parameters.
Definition: boardeditorstate_drawtrace.cpp:757
tl::optional< const Layer & > mViaLayer
Layer where the via was started.
Definition: boardeditorstate_drawtrace.h:200
BI_NetPoint * mPositioningNetPoint2
the second netpoint to place
Definition: boardeditorstate_drawtrace.h:215
Point mTargetPos
Definition: boardeditorstate_drawtrace.h:201
virtual bool processSwitchToBoard(int index) noexcept override
Definition: boardeditorstate_drawtrace.cpp:368
BI_NetLineAnchor * mFixedStartAnchor
Definition: boardeditorstate_drawtrace.h:208
BI_Via * mTempVia
Definition: boardeditorstate_drawtrace.h:197
virtual bool processAbortCommand() noexcept override
Definition: boardeditorstate_drawtrace.cpp:263
virtual bool processKeyPressed(const QKeyEvent &e) noexcept override
Definition: boardeditorstate_drawtrace.cpp:274
void drillDiameterEditValueChanged(const PositiveLength &value) noexcept
Definition: boardeditorstate_drawtrace.cpp:938
QPointer< PositiveLengthEdit > mDrillEdit
Definition: boardeditorstate_drawtrace.h:220
BoardEditorState_DrawTrace(const BoardEditorState_DrawTrace &other)=delete
void wireModeChanged(WireMode mode) noexcept
Definition: boardeditorstate_drawtrace.cpp:894
bool abortPositioning(bool showErrMsgBox) noexcept
Abort or cancel the current drawing of the trace.
Definition: boardeditorstate_drawtrace.cpp:731
void wireAutoWidthEditToggled(const bool checked) noexcept
Definition: boardeditorstate_drawtrace.cpp:951
void layerChanged(const Layer &layer) noexcept
Definition: boardeditorstate_drawtrace.cpp:899
Via mCurrentViaProperties
Definition: boardeditorstate_drawtrace.h:198
BI_NetPoint * mPositioningNetPoint1
the first netpoint to place
Definition: boardeditorstate_drawtrace.h:213
bool mCurrentSnapActive
the current active snap to target
Definition: boardeditorstate_drawtrace.h:207
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:956
virtual bool exit() noexcept override
Definition: boardeditorstate_drawtrace.cpp:248
BI_NetSegment * mCurrentNetSegment
Definition: boardeditorstate_drawtrace.h:210
QPointer< LayerComboBox > mLayerComboBox
Definition: boardeditorstate_drawtrace.h:218
virtual bool processGraphicsSceneRightMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept override
Definition: boardeditorstate_drawtrace.cpp:345
QPointer< QActionGroup > mWireModeActionGroup
Definition: boardeditorstate_drawtrace.h:222
void showVia(bool isVisible) noexcept
Sets the BI_Via of the currently active trace.
Definition: boardeditorstate_drawtrace.cpp:816
BI_NetLineAnchor * combineAnchors(BI_NetLineAnchor &a, BI_NetLineAnchor &b)
Definition: boardeditorstate_drawtrace.cpp:859
virtual bool processKeyReleased(const QKeyEvent &e) noexcept override
Definition: boardeditorstate_drawtrace.cpp:291
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept override
Definition: boardeditorstate_drawtrace.cpp:319
SubState
Internal FSM States (substates)
Definition: boardeditorstate_drawtrace.h:93
@ SubState_Idle
idle state [initial state]
Definition: boardeditorstate_drawtrace.h:94
@ SubState_PositioningNetPoint
in this state, an undo command is active!
Definition: boardeditorstate_drawtrace.h:96
@ SubState_Initializing
beginning to start
Definition: boardeditorstate_drawtrace.h:95
SubState mSubState
the current substate
Definition: boardeditorstate_drawtrace.h:193
void sizeEditValueChanged(const PositiveLength &value) noexcept
Definition: boardeditorstate_drawtrace.cpp:932
Point mCursorPos
the current cursor position
Definition: boardeditorstate_drawtrace.h:204
virtual bool entry() noexcept override
Definition: boardeditorstate_drawtrace.cpp:105
void wireWidthEditValueChanged(const PositiveLength &value) noexcept
Definition: boardeditorstate_drawtrace.cpp:944
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept override
Definition: boardeditorstate_drawtrace.cpp:340
The board editor state base class.
Definition: boardeditorstate.h:59
The BoardGraphicsScene class.
Definition: boardgraphicsscene.h:77
The LayerComboBox class.
Definition: layercombobox.h:47
The PositiveLengthEdit class is a widget to view/edit librepcb::PositiveLength values.
Definition: positivelengthedit.h:42
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
FSM Context.
Definition: boardeditorfsm.h:88