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,
121 const std::shared_ptr<
Footprint>& fpt) noexcept;
126 QGraphicsSceneMouseEvent& e) noexcept;
128 QGraphicsSceneMouseEvent& e) noexcept;
130 QGraphicsSceneMouseEvent& e) noexcept;
132 QGraphicsSceneMouseEvent& e) noexcept;
137 bool processMove(Qt::ArrowType direction) noexcept;
140 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 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:180
bool processGraphicsSceneRightMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:296
bool processKeyReleased(const QKeyEvent &e) noexcept
Definition: packageeditorfsm.cpp:246
bool processStartAddingNames() noexcept
Definition: packageeditorfsm.cpp:459
bool processStartAddingHoles() noexcept
Definition: packageeditorfsm.cpp:495
bool setNextState(State state) noexcept
Definition: packageeditorfsm.cpp:521
bool processStartAddingValues() noexcept
Definition: packageeditorfsm.cpp:463
bool processKeyPressed(const QKeyEvent &e) noexcept
Definition: packageeditorfsm.cpp:237
bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:285
void statusBarMessageChanged(const QString &message, int timeoutMs=-1)
PackageEditorState * getCurrentState() const noexcept
Definition: packageeditorfsm.cpp:517
bool processChangeCurrentFootprint(const std::shared_ptr< Footprint > &fpt) noexcept
Definition: packageeditorfsm.cpp:197
EditorWidgetBase::Tool getCurrentTool() const noexcept
Definition: packageeditorfsm.cpp:129
bool processStartSelecting() noexcept
Definition: packageeditorfsm.cpp:431
bool processStartDrawLines() noexcept
Definition: packageeditorfsm.cpp:467
bool processSelectAll() noexcept
Definition: packageeditorfsm.cpp:314
bool processStartDrawRects() noexcept
Definition: packageeditorfsm.cpp:475
bool processRemove() noexcept
Definition: packageeditorfsm.cpp:390
QSet< EditorWidgetBase::Feature > mAvailableFeatures
Definition: packageeditorfsm.h:185
bool processCopy() noexcept
Definition: packageeditorfsm.cpp:330
bool processStartAddingFootprintSmtPads(FootprintPad::Function function) noexcept
Definition: packageeditorfsm.cpp:439
bool processEditProperties() noexcept
Definition: packageeditorfsm.cpp:399
State mPreviousState
Definition: packageeditorfsm.h:183
State
Definition: packageeditorfsm.h:64
bool processCut() noexcept
Definition: packageeditorfsm.cpp:322
QMap< State, PackageEditorState * > mStates
Definition: packageeditorfsm.h:181
bool leaveCurrentState() noexcept
Definition: packageeditorfsm.cpp:537
bool switchToPreviousState() noexcept
Definition: packageeditorfsm.cpp:568
bool processStartDrawTexts() noexcept
Definition: packageeditorfsm.cpp:487
bool processStartDxfImport() noexcept
Definition: packageeditorfsm.cpp:499
bool processGenerateOutline() noexcept
Definition: packageeditorfsm.cpp:407
bool processAbortCommand() noexcept
Definition: packageeditorfsm.cpp:423
bool processFlip(Qt::Orientation orientation) noexcept
Definition: packageeditorfsm.cpp:373
void toolChanged(EditorWidgetBase::Tool newTool)
QScopedPointer< PrimitiveTextGraphicsItem > mSelectFootprintGraphicsItem
Definition: packageeditorfsm.h:184
bool processGraphicsSceneLeftMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:275
bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:265
bool processStartDrawCircles() noexcept
Definition: packageeditorfsm.cpp:483
void updateAvailableFeatures() noexcept
Definition: packageeditorfsm.cpp:182
bool enterNextState(State state) noexcept
Definition: packageeditorfsm.cpp:554
State mCurrentState
Definition: packageeditorfsm.h:182
bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept
Definition: packageeditorfsm.cpp:255
bool processRotate(const Angle &rotation) noexcept
Definition: packageeditorfsm.cpp:355
const QSet< EditorWidgetBase::Feature > & getAvailableFeatures() const noexcept
Definition: packageeditorfsm.h:112
bool processStartMeasure() noexcept
Definition: packageeditorfsm.cpp:509
PackageEditorFsm(const PackageEditorFsm &other)=delete
std::shared_ptr< Footprint > getCurrentFootprint() const noexcept
Definition: packageeditorfsm.cpp:173
virtual ~PackageEditorFsm() noexcept
Definition: packageeditorfsm.cpp:119
bool processStartDrawZones() noexcept
Definition: packageeditorfsm.cpp:491
bool processGenerateCourtyard() noexcept
Definition: packageeditorfsm.cpp:415
bool processMirror(Qt::Orientation orientation) noexcept
Definition: packageeditorfsm.cpp:364
void availableFeaturesChanged()
bool processStartDrawArcs() noexcept
Definition: packageeditorfsm.cpp:471
bool processStartAddingFootprintThtPads() noexcept
Definition: packageeditorfsm.cpp:435
bool processStartDrawPolygons() noexcept
Definition: packageeditorfsm.cpp:479
bool processMove(Qt::ArrowType direction) noexcept
Definition: packageeditorfsm.cpp:346
bool processPaste() noexcept
Definition: packageeditorfsm.cpp:338
bool processSnapToGrid() noexcept
Definition: packageeditorfsm.cpp:382
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:89
LengthUnit & lengthUnit
Definition: packageeditorfsm.h:95
PackageEditorWidget & editorWidget
Definition: packageeditorfsm.h:91
Package & package
Definition: packageeditorfsm.h:96
GraphicsView & graphicsView
Definition: packageeditorfsm.h:94
std::shared_ptr< FootprintGraphicsItem > currentGraphicsItem
Definition: packageeditorfsm.h:98
ToolBarProxy & commandToolBar
Definition: packageeditorfsm.h:99
GraphicsScene & graphicsScene
Definition: packageeditorfsm.h:93
EditorWidgetBase::Context & editorContext
Definition: packageeditorfsm.h:90
std::shared_ptr< Footprint > currentFootprint
Definition: packageeditorfsm.h:97
UndoStack & undoStack
Definition: packageeditorfsm.h:92