LibrePCB Developers Documentation
packageeditorstate_addholes.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_PACKAGEEDITORSTATE_ADDHOLES_H
21#define LIBREPCB_EDITOR_PACKAGEEDITORSTATE_ADDHOLES_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "packageeditorstate.h"
27
28#include <QtCore>
29#include <QtWidgets>
30
31#include <memory>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Hole;
39
40namespace editor {
41
42class CmdHoleEdit;
43class HoleGraphicsItem;
44
45/*******************************************************************************
46 * Class PackageEditorState_AddHoles
47 ******************************************************************************/
48
53 Q_OBJECT
54
55public:
56 // Constructors / Destructor
59 delete;
60 explicit PackageEditorState_AddHoles(Context& context) noexcept;
62
63 // General Methods
64 bool entry() noexcept override;
65 bool exit() noexcept override;
67 const noexcept override;
68
69 // Event Handlers
71 QGraphicsSceneMouseEvent& e) noexcept override;
73 QGraphicsSceneMouseEvent& e) noexcept override;
74
75 // Operator Overloadings
77 const PackageEditorState_AddHoles& rhs) = delete;
78
79private: // Methods
80 bool startAddHole(const Point& pos) noexcept;
81 bool finishAddHole(const Point& pos) noexcept;
82 bool abortAddHole() noexcept;
83 void diameterEditValueChanged(const PositiveLength& value) noexcept;
84
85private: // Data
86 QScopedPointer<CmdHoleEdit> mEditCmd;
87 std::shared_ptr<Hole> mCurrentHole;
89
90 // parameter memory
92};
93
94/*******************************************************************************
95 * End of File
96 ******************************************************************************/
97
98} // namespace editor
99} // namespace librepcb
100
101#endif
The Hole class.
Definition: hole.h:45
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The CmdHoleEdit class.
Definition: cmdholeedit.h:53
The EditorWidgetBase class.
Definition: editorwidgetbase.h:62
The HoleGraphicsItem class is the graphical representation of a librepcb::Hole.
Definition: holegraphicsitem.h:48
The PackageEditorState_AddHoles class.
Definition: packageeditorstate_addholes.h:52
bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept override
Definition: packageeditorstate_addholes.cpp:116
QScopedPointer< CmdHoleEdit > mEditCmd
Definition: packageeditorstate_addholes.h:86
std::shared_ptr< HoleGraphicsItem > mCurrentGraphicsItem
Definition: packageeditorstate_addholes.h:88
PositiveLength mLastDiameter
Definition: packageeditorstate_addholes.h:91
std::shared_ptr< Hole > mCurrentHole
Definition: packageeditorstate_addholes.h:87
void diameterEditValueChanged(const PositiveLength &value) noexcept
Definition: packageeditorstate_addholes.cpp:194
~PackageEditorState_AddHoles() noexcept
Definition: packageeditorstate_addholes.cpp:58
bool startAddHole(const Point &pos) noexcept
Definition: packageeditorstate_addholes.cpp:142
bool exit() noexcept override
Definition: packageeditorstate_addholes.cpp:93
bool finishAddHole(const Point &pos) noexcept
Definition: packageeditorstate_addholes.cpp:165
PackageEditorState_AddHoles(const PackageEditorState_AddHoles &other)=delete
QSet< EditorWidgetBase::Feature > getAvailableFeatures() const noexcept override
Definition: packageeditorstate_addholes.cpp:106
bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept override
Definition: packageeditorstate_addholes.cpp:128
bool abortAddHole() noexcept
Definition: packageeditorstate_addholes.cpp:180
bool entry() noexcept override
Definition: packageeditorstate_addholes.cpp:66
The PackageEditorState class is the base class of all package editor FSM states.
Definition: packageeditorstate.h:52
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
Definition: packageeditorfsm.h:90