LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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#include <memory>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39
40class BI_Plane;
41class Layer;
42class NetSignal;
43
44namespace editor {
45
46class CmdBoardPlaneEdit;
47class LayerComboBox;
48
49/*******************************************************************************
50 * Class BoardEditorState_DrawPlane
51 ******************************************************************************/
52
57 Q_OBJECT
58
59public:
60 // Constructors / Destructor
63 explicit BoardEditorState_DrawPlane(const Context& context) noexcept;
64 virtual ~BoardEditorState_DrawPlane() noexcept;
65
66 // General Methods
67 virtual bool entry() noexcept override;
68 virtual bool exit() noexcept override;
69
70 // Event Handlers
71 virtual bool processAbortCommand() noexcept override;
73 QGraphicsSceneMouseEvent& e) noexcept override;
75 QGraphicsSceneMouseEvent& e) noexcept override;
77 QGraphicsSceneMouseEvent& e) noexcept override;
78 virtual bool processSwitchToBoard(int index) noexcept override;
79
80 // Operator Overloadings
82 delete;
83
84private: // Methods
85 bool startAddPlane(const Point& pos) noexcept;
86 bool addSegment(const Point& pos) noexcept;
87 bool updateLastVertexPosition(const Point& pos) noexcept;
88 void setNetSignal(NetSignal* netsignal) noexcept;
89 bool abortCommand(bool showErrMsgBox) noexcept;
90 void layerComboBoxLayerChanged(const Layer& layer) noexcept;
91
92private: // Data
93 // State
98
99 // Information about the current text to place. Only valid if
100 // mIsUndoCmdActive == true.
103};
104
105/*******************************************************************************
106 * End of File
107 ******************************************************************************/
108
109} // namespace editor
110} // namespace librepcb
111
112#endif
The BI_Plane class.
Definition bi_plane.h:52
The Layer class provides all supported geometry layers.
Definition layer.h:42
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 "draw plane" state/tool of the board editor.
Definition boardeditorstate_drawplane.h:56
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:96
Point mLastVertexPos
Definition boardeditorstate_drawplane.h:97
NetSignal * mLastNetSignal
Definition boardeditorstate_drawplane.h:95
virtual bool processSwitchToBoard(int index) noexcept override
Definition boardeditorstate_drawplane.cpp:185
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:101
bool mIsUndoCmdActive
Definition boardeditorstate_drawplane.h:94
std::unique_ptr< CmdBoardPlaneEdit > mCurrentPlaneEditCmd
Definition boardeditorstate_drawplane.h:102
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:76
Definition uuid.h:186
FSM Context.
Definition boardeditorfsm.h:88