LibrePCB Developers Documentation
Loading...
Searching...
No Matches
boardeditorstate_addhole.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_ADDHOLE_H
21#define LIBREPCB_EDITOR_BOARDEDITORSTATE_ADDHOLE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "boardeditorstate.h"
27
29
30#include <QtCore>
31
32#include <memory>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class Board;
40
41namespace editor {
42
43class CmdBoardHoleEdit;
44class PositiveLengthEdit;
45
46/*******************************************************************************
47 * Class BoardEditorState_AddHole
48 ******************************************************************************/
49
54 Q_OBJECT
55
56public:
57 // Constructors / Destructor
60 explicit BoardEditorState_AddHole(const Context& context) noexcept;
61 virtual ~BoardEditorState_AddHole() noexcept;
62
63 // General Methods
64 virtual bool entry() noexcept override;
65 virtual bool exit() noexcept override;
66
67 // Event Handlers
69 QGraphicsSceneMouseEvent& e) noexcept override;
71 QGraphicsSceneMouseEvent& e) noexcept override;
73 QGraphicsSceneMouseEvent& e) noexcept override;
74
75 // Operator Overloadings
77 delete;
78
79private: // Methods
80 bool addHole(const Point& pos) noexcept;
81 bool updatePosition(const Point& pos) noexcept;
82 bool fixPosition(const Point& pos) noexcept;
83 bool abortCommand(bool showErrMsgBox) noexcept;
84 void diameterEditValueChanged(const PositiveLength& value) noexcept;
85
86private: // Data
87 // State
90
91 // Information about the current hole to place. Only valid if
92 // mIsUndoCmdActive == true.
95};
96
97/*******************************************************************************
98 * End of File
99 ******************************************************************************/
100
101} // namespace editor
102} // namespace librepcb
103
104#endif
The BI_Hole class.
Definition bi_hole.h:46
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The "add hole" state/tool of the board editor.
Definition boardeditorstate_addhole.h:53
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_addhole.cpp:107
BI_Hole * mCurrentHoleToPlace
Definition boardeditorstate_addhole.h:93
PositiveLength mLastDiameter
Definition boardeditorstate_addhole.h:89
void diameterEditValueChanged(const PositiveLength &value) noexcept
Definition boardeditorstate_addhole.cpp:207
virtual ~BoardEditorState_AddHole() noexcept
Definition boardeditorstate_addhole.cpp:57
bool addHole(const Point &pos) noexcept
Definition boardeditorstate_addhole.cpp:130
bool updatePosition(const Point &pos) noexcept
Definition boardeditorstate_addhole.cpp:157
BoardEditorState_AddHole(const BoardEditorState_AddHole &other)=delete
std::unique_ptr< CmdBoardHoleEdit > mCurrentHoleEditCmd
Definition boardeditorstate_addhole.h:94
bool abortCommand(bool showErrMsgBox) noexcept
Definition boardeditorstate_addhole.cpp:185
bool mIsUndoCmdActive
Definition boardeditorstate_addhole.h:88
virtual bool exit() noexcept override
Definition boardeditorstate_addhole.cpp:92
bool fixPosition(const Point &pos) noexcept
Definition boardeditorstate_addhole.cpp:166
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_addhole.cpp:113
virtual bool entry() noexcept override
Definition boardeditorstate_addhole.cpp:64
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept override
Definition boardeditorstate_addhole.cpp:121
The board editor state base class.
Definition boardeditorstate.h:59
The CmdBoardHoleEdit class.
Definition cmdboardholeedit.h:49
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
Definition uuid.h:186
FSM Context.
Definition boardeditorfsm.h:88