20#ifndef LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWTRACE_H
21#define LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWTRACE_H
39class BI_NetLineAnchor;
79 virtual
bool entry() noexcept override;
80 virtual
bool exit() noexcept override;
165 bool autoWidthFromExistingTraces =
true,
167 BI_Via* fixedVia =
nullptr,
168 BI_Pad* fixedPad =
nullptr) noexcept;
212 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:53
A pad in a board (either standalone or from a footprint)
Definition bi_pad.h:49
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:74
The Layer class provides all supported geometry layers.
Definition layer.h:42
The NetClass class.
Definition netclass.h:47
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:55
const std::optional< PositiveLength > & getDrillDiameter() const noexcept
Definition via.h:86
const std::optional< PositiveLength > & getSize() const noexcept
Definition via.h:89
The "draw trace" state/tool of the board editor.
Definition boardeditorstate_drawtrace.h:56
WireMode
All available wire modes.
Definition boardeditorstate_drawtrace.h:63
@ VH
vertical - horizontal
@ HV
horizontal - vertical [default]
bool addNextNetPoint(BoardGraphicsScene &scene) noexcept
Finalize the BI_NetLines and connect them to other existing traces if necessary.
Definition boardeditorstate_drawtrace.cpp:663
NetClass * getNetClass() const noexcept
Definition boardeditorstate_drawtrace.h:98
BI_NetLine * mPositioningNetLine2
line between p1 and p2
Definition boardeditorstate_drawtrace.h:255
virtual bool processGraphicsSceneMouseMoved(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:174
const PositiveLength & getWidth() const noexcept
Definition boardeditorstate_drawtrace.h:106
const Layer * mCurrentLayer
the current board layer name
Definition boardeditorstate_drawtrace.h:236
const Layer * mViaLayer
Layer where the via was started.
Definition boardeditorstate_drawtrace.h:241
bool mAddVia
whether a via add is requested
Definition boardeditorstate_drawtrace.h:237
void saveWidthInNetClass() noexcept
Definition boardeditorstate_drawtrace.cpp:327
BI_NetLine * mPositioningNetLine1
line between fixed point and p1
Definition boardeditorstate_drawtrace.h:253
bool getAutoViaSize() const noexcept
Definition boardeditorstate_drawtrace.h:118
BoardEditorState_DrawTrace()=delete
bool mCurrentAutoWidth
automatically adjust wire width
Definition boardeditorstate_drawtrace.h:247
WireMode mCurrentWireMode
the current wire mode
Definition boardeditorstate_drawtrace.h:235
virtual ~BoardEditorState_DrawTrace() noexcept
Definition boardeditorstate_drawtrace.cpp:101
virtual bool processGraphicsSceneRightMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:218
PositiveLength mCurrentWidth
the current wire width
Definition boardeditorstate_drawtrace.h:246
PositiveLength getViaSize() const noexcept
Definition boardeditorstate_drawtrace.cpp:431
void updateNetpointPositions() noexcept
Update the currently active traces according to the set parameters.
Definition boardeditorstate_drawtrace.cpp:898
void updateNetClass() noexcept
Update mCurrentNetClass and emit netClassChanged.
Definition boardeditorstate_drawtrace.cpp:1064
void setLayer(const Layer &layer) noexcept
Definition boardeditorstate_drawtrace.cpp:253
BI_NetPoint * mPositioningNetPoint2
the second netpoint to place
Definition boardeditorstate_drawtrace.h:256
QSet< const Layer * > getAvailableLayers() noexcept
Definition boardeditorstate_drawtrace.cpp:249
Point mTargetPos
Definition boardeditorstate_drawtrace.h:242
virtual bool processGraphicsSceneLeftMouseButtonPressed(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:188
BI_NetLineAnchor * mFixedStartAnchor
Definition boardeditorstate_drawtrace.h:249
void saveViaDrillDiameterInBoard() noexcept
Definition boardeditorstate_drawtrace.cpp:390
void setWireMode(WireMode mode) noexcept
Definition boardeditorstate_drawtrace.cpp:238
BI_Via * mTempVia
Definition boardeditorstate_drawtrace.h:238
void viaDrillDiameterChanged(bool autoSize, const PositiveLength &diameter)
void setWidth(const PositiveLength &width) noexcept
Definition boardeditorstate_drawtrace.cpp:297
virtual bool processAbortCommand() noexcept override
Definition boardeditorstate_drawtrace.cpp:129
const Layer & getLayer() const noexcept
Definition boardeditorstate_drawtrace.h:102
PositiveLength getViaDrillDiameter() const noexcept
Definition boardeditorstate_drawtrace.cpp:347
BoardEditorState_DrawTrace(const BoardEditorState_DrawTrace &other)=delete
void autoWidthChanged(bool autoWidth)
void netClassChanged(NetClass *nc)
Via mCurrentViaProperties
Definition boardeditorstate_drawtrace.h:239
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(const GraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:213
WireMode getWireMode() const noexcept
Definition boardeditorstate_drawtrace.h:99
BI_NetPoint * mPositioningNetPoint1
the first netpoint to place
Definition boardeditorstate_drawtrace.h:254
virtual bool processKeyPressed(const GraphicsSceneKeyEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:140
void saveViaDrillDiameterInNetClass() noexcept
Definition boardeditorstate_drawtrace.cpp:409
void setViaDrillDiameter(const std::optional< PositiveLength > &diameter) noexcept
Definition boardeditorstate_drawtrace.cpp:361
bool getAutoWidth() const noexcept
Definition boardeditorstate_drawtrace.h:104
bool mCurrentSnapActive
the current active snap to target
Definition boardeditorstate_drawtrace.h:248
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:1036
QPointer< NetClass > mCurrentNetClass
nullptr in idle state
Definition boardeditorstate_drawtrace.h:234
virtual bool exit() noexcept override
Definition boardeditorstate_drawtrace.cpp:116
bool startPositioning(Board &board, const Point &pos, bool autoWidthFromExistingTraces=true, BI_NetPoint *fixedPoint=nullptr, BI_Via *fixedVia=nullptr, BI_Pad *fixedPad=nullptr) noexcept
Begin drawing the next BI_NetLine.
Definition boardeditorstate_drawtrace.cpp:466
void wireModeChanged(WireMode mode)
BI_NetSegment * mCurrentNetSegment
Definition boardeditorstate_drawtrace.h:251
void widthChanged(const PositiveLength &width)
void saveWidthInBoard() noexcept
Definition boardeditorstate_drawtrace.cpp:308
void setAutoWidth(bool autoWidth) noexcept
Definition boardeditorstate_drawtrace.cpp:286
virtual bool processKeyReleased(const GraphicsSceneKeyEvent &e) noexcept override
Definition boardeditorstate_drawtrace.cpp:157
void viaSizeChanged(bool autoSize, const PositiveLength &size)
void layerChanged(const Layer &layer)
void showVia(bool isVisible) noexcept
Sets the BI_Via of the currently active trace.
Definition boardeditorstate_drawtrace.cpp:958
void setViaSize(const std::optional< PositiveLength > &size) noexcept
Definition boardeditorstate_drawtrace.cpp:441
BI_NetLineAnchor * combineAnchors(BI_NetLineAnchor &a, BI_NetLineAnchor &b)
Definition boardeditorstate_drawtrace.cpp:1001
bool abortPositioning(bool showErrMsgBox, bool simplifySegment) noexcept
Abort or cancel the current drawing of the trace.
Definition boardeditorstate_drawtrace.cpp:856
SubState
Internal FSM States (substates)
Definition boardeditorstate_drawtrace.h:139
@ SubState_Idle
idle state [initial state]
Definition boardeditorstate_drawtrace.h:140
@ SubState_PositioningNetPoint
in this state, an undo command is active!
Definition boardeditorstate_drawtrace.h:142
@ SubState_Initializing
beginning to start
Definition boardeditorstate_drawtrace.h:141
SubState mSubState
the current substate
Definition boardeditorstate_drawtrace.h:233
Point mCursorPos
the current cursor position
Definition boardeditorstate_drawtrace.h:245
virtual bool entry() noexcept override
Definition boardeditorstate_drawtrace.cpp:108
bool getViaAutoDrillDiameter() const noexcept
Definition boardeditorstate_drawtrace.h:110
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:99
Definition graphicsscene.h:52
Definition graphicsscene.h:45