LibrePCB Developers Documentation
boardeditorstate_drawplane.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWPLANE_H
21#define LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWPLANE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "boardeditorstate.h"
27
29
30#include <QtCore>
31#include <QtWidgets>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class BI_Plane;
39class Layer;
40class NetSignal;
41
42namespace editor {
43
44class CmdBoardPlaneEdit;
45class LayerComboBox;
46
47/*******************************************************************************
48 * Class BoardEditorState_DrawPlane
49 ******************************************************************************/
50
55 Q_OBJECT
56
57public:
58 // Constructors / Destructor
61 explicit BoardEditorState_DrawPlane(const Context& context) noexcept;
62 virtual ~BoardEditorState_DrawPlane() noexcept;
63
64 // General Methods
65 virtual bool entry() noexcept override;
66 virtual bool exit() noexcept override;
67
68 // Event Handlers
69 virtual bool processAbortCommand() noexcept override;
71 QGraphicsSceneMouseEvent& e) noexcept override;
73 QGraphicsSceneMouseEvent& e) noexcept override;
75 QGraphicsSceneMouseEvent& e) noexcept override;
76 virtual bool processSwitchToBoard(int index) noexcept override;
77
78 // Operator Overloadings
80 delete;
81
82private: // Methods
83 bool startAddPlane(const Point& pos) noexcept;
84 bool addSegment(const Point& pos) noexcept;
85 bool updateLastVertexPosition(const Point& pos) noexcept;
86 void setNetSignal(NetSignal* netsignal) noexcept;
87 bool abortCommand(bool showErrMsgBox) noexcept;
88 void layerComboBoxLayerChanged(const Layer& layer) noexcept;
89
90private: // Data
91 // State
96
97 // Information about the current text to place. Only valid if
98 // mIsUndoCmdActive == true.
101};
102
103/*******************************************************************************
104 * End of File
105 ******************************************************************************/
106
107} // namespace editor
108} // namespace librepcb
109
110#endif
The BI_Plane class.
Definition: bi_plane.h:52
The Layer class provides all supported geometry layers.
Definition: layer.h:40
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:79
The "draw plane" state/tool of the board editor.
Definition: boardeditorstate_drawplane.h:54
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept override
Definition: boardeditorstate_drawplane.cpp:162
virtual ~BoardEditorState_DrawPlane() noexcept
Definition: boardeditorstate_drawplane.cpp:64
void layerComboBoxLayerChanged(const Layer &layer) noexcept
Definition: boardeditorstate_drawplane.cpp:306
const Layer * mLastLayer
Definition: boardeditorstate_drawplane.h:94
Point mLastVertexPos
Definition: boardeditorstate_drawplane.h:95
NetSignal * mLastNetSignal
Definition: boardeditorstate_drawplane.h:93
virtual bool processSwitchToBoard(int index) noexcept override
Definition: boardeditorstate_drawplane.cpp:185
QScopedPointer< CmdBoardPlaneEdit > mCurrentPlaneEditCmd
Definition: boardeditorstate_drawplane.h:100
virtual bool processAbortCommand() noexcept override
Definition: boardeditorstate_drawplane.cpp:152
bool abortCommand(bool showErrMsgBox) noexcept
Definition: boardeditorstate_drawplane.cpp:284
void setNetSignal(NetSignal *netsignal) noexcept
Definition: boardeditorstate_drawplane.cpp:277
BI_Plane * mCurrentPlane
Definition: boardeditorstate_drawplane.h:99
bool mIsUndoCmdActive
Definition: boardeditorstate_drawplane.h:92
virtual bool exit() noexcept override
Definition: boardeditorstate_drawplane.cpp:137
bool startAddPlane(const Point &pos) noexcept
Definition: boardeditorstate_drawplane.cpp:194
bool addSegment(const Point &pos) noexcept
Definition: boardeditorstate_drawplane.cpp:226
BoardEditorState_DrawPlane(const BoardEditorState_DrawPlane &other)=delete
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept override
Definition: boardeditorstate_drawplane.cpp:168
bool updateLastVertexPosition(const Point &pos) noexcept
Definition: boardeditorstate_drawplane.cpp:265
virtual bool entry() noexcept override
Definition: boardeditorstate_drawplane.cpp:71
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept override
Definition: boardeditorstate_drawplane.cpp:180
The board editor state base class.
Definition: boardeditorstate.h:59
The CmdBoardPlaneEdit class.
Definition: cmdboardplaneedit.h:50
Definition: occmodel.cpp:77
FSM Context.
Definition: boardeditorfsm.h:88