20#ifndef LIBREPCB_EDITOR_SCHEMATICEDITORSTATE_H
21#define LIBREPCB_EDITOR_SCHEMATICEDITORSTATE_H
47class SchematicGraphicsScene;
89 QObject* parent =
nullptr) noexcept;
93 virtual
bool entry() noexcept {
return true; }
94 virtual bool exit() noexcept {
return true; }
98 const QString& searchTerm = QString()) noexcept {
103 const Uuid& symbVar)
noexcept {
121 Q_UNUSED(orientation);
137 QGraphicsSceneMouseEvent& e)
noexcept {
142 QGraphicsSceneMouseEvent& e)
noexcept {
147 QGraphicsSceneMouseEvent& e)
noexcept {
152 QGraphicsSceneMouseEvent& e)
noexcept {
157 QGraphicsSceneMouseEvent& e)
noexcept {
182 const
Point& pos, FindFlags flags,
183 const QVector<
std::shared_ptr<QGraphicsItem>>& except = {})
noexcept;
184 template <
typename T = QGraphicsItem>
186 const Point& pos, FindFlags flags,
187 const QVector<std::shared_ptr<QGraphicsItem>>& except = {})
noexcept {
188 const QList<std::shared_ptr<QGraphicsItem>> items =
190 std::shared_ptr<T> castedItem =
191 std::dynamic_pointer_cast<T>(items.value(0,
nullptr));
192 if ((!items.isEmpty()) && (!castedItem)) {
194 qCritical() <<
"Found a schematic item, but it has the wrong type!";
206Q_DECLARE_OPERATORS_FOR_FLAGS(librepcb::editor::SchematicEditorState::FindFlags)
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The Layer class provides all supported geometry layers.
Definition layer.h:42
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition lengthunit.h:60
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Schematic class represents one schematic page of a project and is always part of a circuit.
Definition schematic.h:74
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The schematic editor state base class.
Definition schematiceditorstate.h:57
Context mContext
Definition schematiceditorstate.h:200
virtual bool processEditProperties() noexcept
Definition schematiceditorstate.h:126
virtual bool processAbortCommand() noexcept
Definition schematiceditorstate.h:127
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept
Definition schematiceditorstate.h:151
virtual bool exit() noexcept
Definition schematiceditorstate.h:94
static const QSet< const Layer * > & getAllowedGeometryLayers() noexcept
Definition schematiceditorstate.cpp:99
void statusBarMessageChanged(const QString &message, int timeoutMs=-1)
const LengthUnit & getLengthUnit() const noexcept
Definition schematiceditorstate.cpp:89
virtual bool processAddComponent(const QString &searchTerm=QString()) noexcept
Definition schematiceditorstate.h:97
virtual bool processKeyPressed(const QKeyEvent &e) noexcept
Definition schematiceditorstate.h:128
QList< std::shared_ptr< QGraphicsItem > > findItemsAtPos(const Point &pos, FindFlags flags, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept
Definition schematiceditorstate.cpp:125
virtual bool entry() noexcept
Definition schematiceditorstate.h:93
virtual bool processSelectAll() noexcept
Definition schematiceditorstate.h:108
virtual bool processMove(const Point &delta) noexcept
Definition schematiceditorstate.h:112
QWidget * parentWidget() noexcept
Definition schematiceditorstate.cpp:121
virtual bool processGraphicsSceneRightMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition schematiceditorstate.h:156
virtual bool processGraphicsSceneLeftMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition schematiceditorstate.h:146
virtual bool processRotate(const Angle &rotation) noexcept
Definition schematiceditorstate.h:116
virtual bool processKeyReleased(const QKeyEvent &e) noexcept
Definition schematiceditorstate.h:132
SchematicEditorState & operator=(const SchematicEditorState &rhs)=delete
virtual bool processSwitchToSchematicPage(int index) noexcept
Definition schematiceditorstate.h:161
FindFlag
Definition schematiceditorstate.h:63
@ SkipLowerPriorityMatches
@ SymbolPinsWithComponentSignal
@ AcceptNearestWithinGrid
virtual bool processResetAllTexts() noexcept
Definition schematiceditorstate.h:124
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept
Definition schematiceditorstate.h:136
Schematic * getActiveSchematic() noexcept
Definition schematiceditorstate.cpp:76
void abortBlockingToolsInOtherEditors() noexcept
Definition schematiceditorstate.cpp:113
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept
Definition schematiceditorstate.h:141
PositiveLength getGridInterval() const noexcept
Definition schematiceditorstate.cpp:85
virtual bool processAddComponent(const Uuid &cmp, const Uuid &symbVar) noexcept
Definition schematiceditorstate.h:102
virtual bool processMirror(Qt::Orientation orientation) noexcept
Definition schematiceditorstate.h:120
SchematicGraphicsScene * getActiveSchematicScene() noexcept
Definition schematiceditorstate.cpp:81
std::shared_ptr< T > findItemAtPos(const Point &pos, FindFlags flags, const QVector< std::shared_ptr< QGraphicsItem > > &except={}) noexcept
Definition schematiceditorstate.h:185
virtual bool processCopy() noexcept
Definition schematiceditorstate.h:110
virtual bool processCut() noexcept
Definition schematiceditorstate.h:109
virtual bool processPaste() noexcept
Definition schematiceditorstate.h:111
bool execCmd(UndoCommand *cmd)
Definition schematiceditorstate.cpp:117
virtual bool processRemove() noexcept
Definition schematiceditorstate.h:125
The SchematicGraphicsScene class.
Definition schematicgraphicsscene.h:67
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
FSM Context.
Definition schematiceditorfsm.h:81