LibrePCB Developers Documentation
Loading...
Searching...
No Matches
boardeditorstate_drawzone.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_DRAWZONE_H
21#define LIBREPCB_EDITOR_BOARDEDITORSTATE_DRAWZONE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "boardeditorstate.h"
27
30
31#include <QtCore>
32#include <QtWidgets>
33
34#include <memory>
35
36/*******************************************************************************
37 * Namespace / Forward Declarations
38 ******************************************************************************/
39namespace librepcb {
40
41class BI_Zone;
42class Layer;
43
44namespace editor {
45
46class CmdBoardZoneEdit;
47
48/*******************************************************************************
49 * Class BoardEditorState_DrawZone
50 ******************************************************************************/
51
56 Q_OBJECT
57
58public:
59 // Constructors / Destructor
62 explicit BoardEditorState_DrawZone(const Context& context) noexcept;
63 virtual ~BoardEditorState_DrawZone() noexcept;
64
65 // General Methods
66 virtual bool entry() noexcept override;
67 virtual bool exit() noexcept override;
68
69 // Event Handlers
70 virtual bool processAbortCommand() noexcept override;
72 QGraphicsSceneMouseEvent& e) noexcept override;
74 QGraphicsSceneMouseEvent& e) noexcept override;
76 QGraphicsSceneMouseEvent& e) noexcept override;
77 virtual bool processSwitchToBoard(int index) noexcept override;
78
79 // Operator Overloadings
81 delete;
82
83private: // Methods
84 bool startAddZone(const Point& pos) noexcept;
85 bool addSegment(const Point& pos) noexcept;
86 bool updateLastVertexPosition(const Point& pos) noexcept;
87 bool abortCommand(bool showErrMsgBox) noexcept;
88
89private: // Data
90 // State
95
96 // Information about the current zone to place. Only valid if
97 // mIsUndoCmdActive == true.
100};
101
102/*******************************************************************************
103 * End of File
104 ******************************************************************************/
105
106} // namespace editor
107} // namespace librepcb
108
109#endif
The BI_Zone class.
Definition bi_zone.h:46
The Layer class provides all supported geometry layers.
Definition layer.h:42
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Zone class.
Definition zone.h:43
The "draw zone" state/tool of the board editor.
Definition boardeditorstate_drawzone.h:55
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawzone.cpp:170
virtual ~BoardEditorState_DrawZone() noexcept
Definition boardeditorstate_drawzone.cpp:62
const Layer * mLastLayer
Definition boardeditorstate_drawzone.h:92
Point mLastVertexPos
Definition boardeditorstate_drawzone.h:94
virtual bool processSwitchToBoard(int index) noexcept override
Definition boardeditorstate_drawzone.cpp:193
virtual bool processAbortCommand() noexcept override
Definition boardeditorstate_drawzone.cpp:160
BoardEditorState_DrawZone(const BoardEditorState_DrawZone &other)=delete
BI_Zone * mCurrentZone
Definition boardeditorstate_drawzone.h:98
std::unique_ptr< CmdBoardZoneEdit > mCurrentZoneEditCmd
Definition boardeditorstate_drawzone.h:99
bool abortCommand(bool showErrMsgBox) noexcept
Definition boardeditorstate_drawzone.cpp:292
bool mIsUndoCmdActive
Definition boardeditorstate_drawzone.h:91
virtual bool exit() noexcept override
Definition boardeditorstate_drawzone.cpp:145
bool addSegment(const Point &pos) noexcept
Definition boardeditorstate_drawzone.cpp:235
bool startAddZone(const Point &pos) noexcept
Definition boardeditorstate_drawzone.cpp:202
Zone::Rules mLastRules
Definition boardeditorstate_drawzone.h:93
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawzone.cpp:176
bool updateLastVertexPosition(const Point &pos) noexcept
Definition boardeditorstate_drawzone.cpp:280
virtual bool entry() noexcept override
Definition boardeditorstate_drawzone.cpp:69
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_drawzone.cpp:188
The board editor state base class.
Definition boardeditorstate.h:59
The CmdBoardZoneEdit class.
Definition cmdboardzoneedit.h:49
Definition occmodel.cpp:76
Definition uuid.h:186
FSM Context.
Definition boardeditorfsm.h:88