LibrePCB Developers Documentation
|
The "draw trace" state/tool of the board editor. More...
#include <boardeditorstate_drawtrace.h>
Public Member Functions | |
BoardEditorState_DrawTrace ()=delete | |
BoardEditorState_DrawTrace (const BoardEditorState_DrawTrace &other)=delete | |
BoardEditorState_DrawTrace (const Context &context) noexcept | |
virtual | ~BoardEditorState_DrawTrace () noexcept |
virtual bool | entry () noexcept override |
virtual bool | exit () noexcept override |
virtual bool | processAbortCommand () noexcept override |
virtual bool | processKeyPressed (const QKeyEvent &e) noexcept override |
virtual bool | processKeyReleased (const QKeyEvent &e) noexcept override |
virtual bool | processGraphicsSceneMouseMoved (QGraphicsSceneMouseEvent &e) noexcept override |
virtual bool | processGraphicsSceneLeftMouseButtonPressed (QGraphicsSceneMouseEvent &e) noexcept override |
virtual bool | processGraphicsSceneLeftMouseButtonDoubleClicked (QGraphicsSceneMouseEvent &e) noexcept override |
virtual bool | processGraphicsSceneRightMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept override |
virtual bool | processSwitchToBoard (int index) noexcept override |
BoardEditorState_DrawTrace & | operator= (const BoardEditorState_DrawTrace &rhs)=delete |
Public Member Functions inherited from BoardEditorState | |
BoardEditorState ()=delete | |
BoardEditorState (const BoardEditorState &other)=delete | |
BoardEditorState (const Context &context, QObject *parent=nullptr) noexcept | |
virtual | ~BoardEditorState () noexcept |
virtual bool | processAddDevice (ComponentInstance &component, const Uuid &device, const Uuid &footprint) noexcept |
virtual bool | processImportDxf () noexcept |
virtual bool | processSelectAll () noexcept |
virtual bool | processCut () noexcept |
virtual bool | processCopy () noexcept |
virtual bool | processPaste () noexcept |
virtual bool | processMove (const Point &delta) noexcept |
virtual bool | processRotate (const Angle &rotation) noexcept |
virtual bool | processFlip (Qt::Orientation orientation) noexcept |
virtual bool | processSnapToGrid () noexcept |
virtual bool | processSetLocked (bool locked) noexcept |
virtual bool | processChangeLineWidth (int step) noexcept |
virtual bool | processResetAllTexts () noexcept |
virtual bool | processRemove () noexcept |
virtual bool | processEditProperties () noexcept |
virtual bool | processGraphicsSceneLeftMouseButtonReleased (QGraphicsSceneMouseEvent &e) noexcept |
BoardEditorState & | operator= (const BoardEditorState &rhs)=delete |
Private Types | |
enum | SubState |
Internal FSM States (substates) More... | |
enum class | WireMode |
All available wire modes. More... | |
Private Member Functions | |
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. | |
bool | addNextNetPoint (BoardGraphicsScene &scene) noexcept |
Finalize the BI_NetLines and connect them to other existing traces if necessary. | |
bool | abortPositioning (bool showErrMsgBox) noexcept |
Abort or cancel the current drawing of the trace. | |
void | updateNetpointPositions () noexcept |
Update the currently active traces according to the set parameters. | |
void | showVia (bool isVisible) noexcept |
Sets the BI_Via of the currently active trace. | |
BI_NetLineAnchor * | combineAnchors (BI_NetLineAnchor &a, BI_NetLineAnchor &b) |
void | wireModeChanged (WireMode mode) noexcept |
void | layerChanged (const Layer &layer) noexcept |
void | sizeEditValueChanged (const PositiveLength &value) noexcept |
void | drillDiameterEditValueChanged (const PositiveLength &value) noexcept |
void | wireWidthEditValueChanged (const PositiveLength &value) noexcept |
void | wireAutoWidthEditToggled (const bool checked) noexcept |
Point | calcMiddlePointPos (const Point &p1, const Point p2, WireMode mode) const noexcept |
Calculate the 'middle point' of two point, according to the chosen WireMode. | |
Private Attributes | |
SubState | mSubState |
the current substate | |
WireMode | mCurrentWireMode |
the current wire mode | |
const Layer * | mCurrentLayer |
the current board layer name | |
bool | mAddVia |
whether a via add is requested | |
BI_Via * | mTempVia |
Via | mCurrentViaProperties |
const Layer * | mViaLayer |
Layer where the via was started. | |
Point | mTargetPos |
Point | mCursorPos |
the current cursor position | |
PositiveLength | mCurrentWidth |
the current wire width | |
bool | mCurrentAutoWidth |
automatically adjust wire width | |
bool | mCurrentSnapActive |
the current active snap to target | |
BI_NetLineAnchor * | mFixedStartAnchor |
BI_NetSegment * | mCurrentNetSegment |
BI_NetLine * | mPositioningNetLine1 |
line between fixed point and p1 | |
BI_NetPoint * | mPositioningNetPoint1 |
the first netpoint to place | |
BI_NetLine * | mPositioningNetLine2 |
line between p1 and p2 | |
BI_NetPoint * | mPositioningNetPoint2 |
the second netpoint to place | |
QPointer< LayerComboBox > | mLayerComboBox |
QPointer< PositiveLengthEdit > | mSizeEdit |
QPointer< PositiveLengthEdit > | mDrillEdit |
QPointer< PositiveLengthEdit > | mWidthEdit |
QPointer< QActionGroup > | mWireModeActionGroup |
Additional Inherited Members | |
Public Types inherited from BoardEditorState | |
enum class | FindFlag |
using | Context = BoardEditorFsm::Context |
Signals inherited from BoardEditorState | |
void | requestLeavingState () |
Signal to indicate that the current tool should be exited. | |
void | statusBarMessageChanged (const QString &message, int timeoutMs=-1) |
Protected Member Functions inherited from BoardEditorState | |
Board * | getActiveBoard () noexcept |
BoardGraphicsScene * | getActiveBoardScene () noexcept |
bool | getIgnoreLocks () const noexcept |
PositiveLength | getGridInterval () const noexcept |
const LengthUnit & | getLengthUnit () const noexcept |
QSet< const Layer * > | getAllowedGeometryLayers () noexcept |
void | makeLayerVisible (const QString &layer) noexcept |
void | abortBlockingToolsInOtherEditors () noexcept |
bool | execCmd (UndoCommand *cmd) |
QWidget * | parentWidget () noexcept |
QList< std::shared_ptr< QGraphicsItem > > | findItemsAtPos (const Point &pos, FindFlags flags, const Layer *cuLayer=nullptr, const QSet< const NetSignal * > &netsignals={}, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept |
template<typename T = QGraphicsItem> | |
std::shared_ptr< T > | findItemAtPos (const Point &pos, FindFlags flags, const Layer *cuLayer=nullptr, const QSet< const NetSignal * > &netsignals={}, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept |
Protected Attributes inherited from BoardEditorState | |
Context | mContext |
The "draw trace" state/tool of the board editor.
|
private |
|
strongprivate |
|
delete |
|
delete |
|
explicitnoexcept |
|
virtualnoexcept |
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
overridevirtualnoexcept |
Reimplemented from BoardEditorState.
|
delete |
|
privatenoexcept |
Begin drawing the next BI_NetLine.
board | On which board the new traces are drawn. |
pos | The position, where the tracing should begin. If necessary, a new BI_NetPoint is created. |
fixedPoint | The BI_NetPoint used as the start anchor, when beginning a new trace. |
fixedVia | The BI_Via used as the start anchor, when beginning a new trace. |
fixedPad | The BI_FootprintPad used as the start anchor, when beginning a new trace. |
|
privatenoexcept |
Finalize the BI_NetLines and connect them to other existing traces if necessary.
scene | On which board scene the drawing is finalized. |
|
privatenoexcept |
Abort or cancel the current drawing of the trace.
showErrMsgBox | When true, show an error message in a pop-up box. |
|
privatenoexcept |
Update the currently active traces according to the set parameters.
Uses the current mCursorPos to where the currently active trace is snapped to and how its BI_NetLine are palced. Also determines whether a BI_Via should be added or if the target anchor can provide the desired layer change.
|
privatenoexcept |
Sets the BI_Via of the currently active trace.
When true, adds a BI_Via instead of the current last BI_NetPoint to the currently active trace. Otherwise removes it if necessary and replaces it again with a BI_NetPoint. It also updates the BI_Via according to the currently selected parameters.
isVisible | Whether the BI_Via is shown or not |
|
private |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
Calculate the 'middle point' of two point, according to the chosen WireMode.
p1 | Start point. |
p2 | End point. |
mode | The selected WireMode. |
|
private |
the current substate
|
private |
the current wire mode
|
private |
the current board layer name
|
private |
whether a via add is requested
|
private |
|
private |
the current target position of the active trace
|
private |
the current cursor position
|
private |
the current wire width
|
private |
automatically adjust wire width
|
private |
the current active snap to target
|
private |
the fixed netline anchor (start point of the line)
|
private |
the net segment that is currently edited
|
private |
line between fixed point and p1
|
private |
the first netpoint to place
|
private |
line between p1 and p2
|
private |
the second netpoint to place
|
private |
|
private |
|
private |
|
private |
|
private |