20#ifndef LIBREPCB_EDITOR_BOARDEDITORSTATE_H
21#define LIBREPCB_EDITOR_BOARDEDITORSTATE_H
49class BoardGraphicsScene;
93 QObject* parent =
nullptr) noexcept;
97 virtual
bool entry() noexcept {
return true; }
98 virtual bool exit() noexcept {
return true; }
103 const Uuid& footprint)
noexcept {
123 Q_UNUSED(orientation);
148 QGraphicsSceneMouseEvent& e)
noexcept {
153 QGraphicsSceneMouseEvent& e)
noexcept {
158 QGraphicsSceneMouseEvent& e)
noexcept {
163 QGraphicsSceneMouseEvent& e)
noexcept {
168 QGraphicsSceneMouseEvent& e)
noexcept {
202 const
Point& pos, FindFlags flags, const
Layer* cuLayer =
nullptr,
203 const QSet<const
NetSignal*>& netsignals = {},
204 const QVector<std::shared_ptr<QGraphicsItem>>& except = {})
noexcept;
205 template <
typename T = QGraphicsItem>
207 const Point& pos, FindFlags flags,
const Layer* cuLayer =
nullptr,
208 const QSet<const NetSignal*>& netsignals = {},
209 const QVector<std::shared_ptr<QGraphicsItem>>& except = {})
noexcept {
210 const QList<std::shared_ptr<QGraphicsItem>> items =
213 std::shared_ptr<T> castedItem =
214 std::dynamic_pointer_cast<T>(items.value(0,
nullptr));
215 if ((!items.isEmpty()) && (!castedItem)) {
217 qCritical() <<
"Found a board item, but it has the wrong type!";
229Q_DECLARE_OPERATORS_FOR_FLAGS(librepcb::editor::BoardEditorState::FindFlags)
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The Board class represents a PCB of a project and is always part of a circuit.
Definition board.h:73
The ComponentInstance class.
Definition componentinstance.h:54
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 NetSignal class.
Definition netsignal.h:50
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The board editor state base class.
Definition boardeditorstate.h:59
Context mContext
Definition boardeditorstate.h:223
void requestLeavingState()
Signal to indicate that the current tool should be exited.
BoardEditorState & operator=(const BoardEditorState &rhs)=delete
virtual bool processEditProperties() noexcept
Definition boardeditorstate.h:137
virtual bool processAbortCommand() noexcept
Definition boardeditorstate.h:138
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept
Definition boardeditorstate.h:162
virtual bool exit() noexcept
Definition boardeditorstate.h:98
void statusBarMessageChanged(const QString &message, int timeoutMs=-1)
const LengthUnit & getLengthUnit() const noexcept
Definition boardeditorstate.cpp:98
virtual bool processKeyPressed(const QKeyEvent &e) noexcept
Definition boardeditorstate.h:139
virtual bool processSnapToGrid() noexcept
Definition boardeditorstate.h:126
virtual bool processSetLocked(bool locked) noexcept
Definition boardeditorstate.h:127
virtual bool entry() noexcept
Definition boardeditorstate.h:97
virtual bool processSelectAll() noexcept
Definition boardeditorstate.h:110
virtual bool processMove(const Point &delta) noexcept
Definition boardeditorstate.h:114
QWidget * parentWidget() noexcept
Definition boardeditorstate.cpp:164
virtual bool processGraphicsSceneRightMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition boardeditorstate.h:167
virtual bool processGraphicsSceneLeftMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept
Definition boardeditorstate.h:157
virtual bool processRotate(const Angle &rotation) noexcept
Definition boardeditorstate.h:118
virtual bool processImportDxf() noexcept
Definition boardeditorstate.h:109
virtual bool processKeyReleased(const QKeyEvent &e) noexcept
Definition boardeditorstate.h:143
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
Definition boardeditorstate.cpp:168
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
Definition boardeditorstate.h:206
BoardGraphicsScene * getActiveBoardScene() noexcept
Definition boardeditorstate.cpp:86
FindFlag
Definition boardeditorstate.h:65
@ SkipLowerPriorityMatches
virtual bool processResetAllTexts() noexcept
Definition boardeditorstate.h:135
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept
Definition boardeditorstate.h:147
bool getIgnoreLocks() const noexcept
Definition boardeditorstate.cpp:90
void abortBlockingToolsInOtherEditors() noexcept
Definition boardeditorstate.cpp:156
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept
Definition boardeditorstate.h:152
PositiveLength getGridInterval() const noexcept
Definition boardeditorstate.cpp:94
Board * getActiveBoard() noexcept
Definition boardeditorstate.cpp:82
virtual bool processCopy() noexcept
Definition boardeditorstate.h:112
virtual bool processCut() noexcept
Definition boardeditorstate.h:111
virtual bool processFlip(Qt::Orientation orientation) noexcept
Definition boardeditorstate.h:122
virtual bool processPaste() noexcept
Definition boardeditorstate.h:113
QSet< const Layer * > getAllowedGeometryLayers() noexcept
Definition boardeditorstate.cpp:107
bool execCmd(UndoCommand *cmd)
Definition boardeditorstate.cpp:160
virtual bool processRemove() noexcept
Definition boardeditorstate.h:136
virtual bool processSwitchToBoard(int index) noexcept
Definition boardeditorstate.h:172
virtual bool processChangeLineWidth(int step) noexcept
Definition boardeditorstate.h:131
virtual bool processAddDevice(ComponentInstance &component, const Uuid &device, const Uuid &footprint) noexcept
Definition boardeditorstate.h:101
void makeLayerVisible(const QString &layer) noexcept
Definition boardeditorstate.cpp:148
The BoardGraphicsScene class.
Definition boardgraphicsscene.h:77
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 boardeditorfsm.h:88