20#ifndef LIBREPCB_EDITOR_PACKAGEEDITORFSM_H
21#define LIBREPCB_EDITOR_PACKAGEEDITORFSM_H
26#include "../../editorwidgetbase.h"
44class FootprintGraphicsItem;
47class PackageEditorState;
48class PackageEditorWidget;
49class PrimitiveTextGraphicsItem;
68 ADD_SMT_PADS_STANDARD,
71 ADD_SMT_PADS_EDGE_CONNECTOR,
73 ADD_SMT_PADS_LOCAL_FIDUCIAL,
74 ADD_SMT_PADS_GLOBAL_FIDUCIAL,
122 const std::shared_ptr<
Footprint>& fpt) noexcept;
127 QGraphicsSceneMouseEvent& e) noexcept;
129 QGraphicsSceneMouseEvent& e) noexcept;
131 QGraphicsSceneMouseEvent& e) noexcept;
133 QGraphicsSceneMouseEvent& e) noexcept;
141 bool processFlip(Qt::Orientation orientation) noexcept;
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The Package class represents a package of a component (including footprint and 3D model)
Definition: package.h:59
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The GraphicsScene class.
Definition: graphicsscene.h:45
The GraphicsView class.
Definition: graphicsview.h:51
The PackageEditorFsm class is the finit state machine (FSM) of the package editor.
Definition: packageeditorfsm.h:60
PackageEditorFsm()=delete
Context mContext
Definition: packageeditorfsm.h:183
bool processGraphicsSceneRightMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:301
bool processKeyReleased(const QKeyEvent &e) noexcept
Definition: packageeditorfsm.cpp:251
bool processStartAddingNames() noexcept
Definition: packageeditorfsm.cpp:472
bool processStartAddingHoles() noexcept
Definition: packageeditorfsm.cpp:508
bool setNextState(State state) noexcept
Definition: packageeditorfsm.cpp:538
bool processStartAddingValues() noexcept
Definition: packageeditorfsm.cpp:476
bool processKeyPressed(const QKeyEvent &e) noexcept
Definition: packageeditorfsm.cpp:242
bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:290
void statusBarMessageChanged(const QString &message, int timeoutMs=-1)
PackageEditorState * getCurrentState() const noexcept
Definition: packageeditorfsm.cpp:534
bool processChangeCurrentFootprint(const std::shared_ptr< Footprint > &fpt) noexcept
Definition: packageeditorfsm.cpp:202
EditorWidgetBase::Tool getCurrentTool() const noexcept
Definition: packageeditorfsm.cpp:132
bool processStartSelecting() noexcept
Definition: packageeditorfsm.cpp:444
bool processStartDrawLines() noexcept
Definition: packageeditorfsm.cpp:480
bool processSelectAll() noexcept
Definition: packageeditorfsm.cpp:319
bool processStartDrawRects() noexcept
Definition: packageeditorfsm.cpp:488
bool processRemove() noexcept
Definition: packageeditorfsm.cpp:403
QSet< EditorWidgetBase::Feature > mAvailableFeatures
Definition: packageeditorfsm.h:188
bool processCopy() noexcept
Definition: packageeditorfsm.cpp:335
bool processStartAddingFootprintSmtPads(FootprintPad::Function function) noexcept
Definition: packageeditorfsm.cpp:452
bool processEditProperties() noexcept
Definition: packageeditorfsm.cpp:412
State mPreviousState
Definition: packageeditorfsm.h:186
State
Definition: packageeditorfsm.h:64
bool processCut() noexcept
Definition: packageeditorfsm.cpp:327
QMap< State, PackageEditorState * > mStates
Definition: packageeditorfsm.h:184
bool leaveCurrentState() noexcept
Definition: packageeditorfsm.cpp:554
bool switchToPreviousState() noexcept
Definition: packageeditorfsm.cpp:589
bool processStartDrawTexts() noexcept
Definition: packageeditorfsm.cpp:500
bool processStartDxfImport() noexcept
Definition: packageeditorfsm.cpp:512
bool processGenerateOutline() noexcept
Definition: packageeditorfsm.cpp:420
bool processAbortCommand() noexcept
Definition: packageeditorfsm.cpp:436
bool processFlip(Qt::Orientation orientation) noexcept
Definition: packageeditorfsm.cpp:378
void toolChanged(EditorWidgetBase::Tool newTool)
QScopedPointer< PrimitiveTextGraphicsItem > mSelectFootprintGraphicsItem
Definition: packageeditorfsm.h:187
bool processGraphicsSceneLeftMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:280
bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:270
bool processStartDrawCircles() noexcept
Definition: packageeditorfsm.cpp:496
bool processMove(const Point &delta) noexcept
Definition: packageeditorfsm.cpp:351
void updateAvailableFeatures() noexcept
Definition: packageeditorfsm.cpp:187
bool enterNextState(State state) noexcept
Definition: packageeditorfsm.cpp:573
State mCurrentState
Definition: packageeditorfsm.h:185
bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:260
bool processRotate(const Angle &rotation) noexcept
Definition: packageeditorfsm.cpp:360
const QSet< EditorWidgetBase::Feature > & getAvailableFeatures() const noexcept
Definition: packageeditorfsm.h:113
bool processStartMeasure() noexcept
Definition: packageeditorfsm.cpp:522
PackageEditorFsm(const PackageEditorFsm &other)=delete
std::shared_ptr< Footprint > getCurrentFootprint() const noexcept
Definition: packageeditorfsm.cpp:178
virtual ~PackageEditorFsm() noexcept
Definition: packageeditorfsm.cpp:122
bool processStartDrawZones() noexcept
Definition: packageeditorfsm.cpp:504
bool processStartReNumberPads() noexcept
Definition: packageeditorfsm.cpp:526
bool processMoveAlign() noexcept
Definition: packageeditorfsm.cpp:387
bool processGenerateCourtyard() noexcept
Definition: packageeditorfsm.cpp:428
bool processMirror(Qt::Orientation orientation) noexcept
Definition: packageeditorfsm.cpp:369
void availableFeaturesChanged()
bool processStartDrawArcs() noexcept
Definition: packageeditorfsm.cpp:484
bool processStartAddingFootprintThtPads() noexcept
Definition: packageeditorfsm.cpp:448
bool processStartDrawPolygons() noexcept
Definition: packageeditorfsm.cpp:492
bool processPaste() noexcept
Definition: packageeditorfsm.cpp:343
bool processSnapToGrid() noexcept
Definition: packageeditorfsm.cpp:395
The PackageEditorState class is the base class of all package editor FSM states.
Definition: packageeditorstate.h:52
The PrimitiveTextGraphicsItem class is the graphical representation of a text.
Definition: primitivetextgraphicsitem.h:52
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
Definition: occmodel.cpp:77
Definition: editorwidgetbase.h:68
Definition: packageeditorfsm.h:90
LengthUnit & lengthUnit
Definition: packageeditorfsm.h:96
PackageEditorWidget & editorWidget
Definition: packageeditorfsm.h:92
Package & package
Definition: packageeditorfsm.h:97
GraphicsView & graphicsView
Definition: packageeditorfsm.h:95
std::shared_ptr< FootprintGraphicsItem > currentGraphicsItem
Definition: packageeditorfsm.h:99
ToolBarProxy & commandToolBar
Definition: packageeditorfsm.h:100
GraphicsScene & graphicsScene
Definition: packageeditorfsm.h:94
EditorWidgetBase::Context & editorContext
Definition: packageeditorfsm.h:91
std::shared_ptr< Footprint > currentFootprint
Definition: packageeditorfsm.h:98
UndoStack & undoStack
Definition: packageeditorfsm.h:93