LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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
29
30#include <QtCore>
31
32#include <memory>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38namespace editor {
39
40class CmdHoleEdit;
41class HoleGraphicsItem;
42
43/*******************************************************************************
44 * Class PackageEditorState_AddHoles
45 ******************************************************************************/
46
51 Q_OBJECT
52
53public:
54 // Constructors / Destructor
57 delete;
58 explicit PackageEditorState_AddHoles(Context& context) noexcept;
60
61 // General Methods
62 bool entry() noexcept override;
63 bool exit() noexcept override;
64
65 // Event Handlers
67 const GraphicsSceneMouseEvent& e) noexcept override;
69 const GraphicsSceneMouseEvent& e) noexcept override;
70
71 // Connection to UI
72 const PositiveLength& getDiameter() const noexcept {
74 }
75 void setDiameter(const PositiveLength& diameter) noexcept;
76
77 // Operator Overloadings
79 const PackageEditorState_AddHoles& rhs) = delete;
80
81signals:
82 void diameterChanged(const PositiveLength& diameter);
83
84private: // Methods
85 bool startAddHole(const Point& pos) noexcept;
86 bool finishAddHole(const Point& pos) noexcept;
87 bool abortAddHole() noexcept;
88
89private:
91
92 std::shared_ptr<Hole> mCurrentHole;
95};
96
97/*******************************************************************************
98 * End of File
99 ******************************************************************************/
100
101} // namespace editor
102} // namespace librepcb
103
104#endif
The Hole class.
Definition hole.h:45
const PositiveLength & getDiameter() const noexcept
Definition hole.h:70
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The CmdHoleEdit class.
Definition cmdholeedit.h:53
The HoleGraphicsItem class is the graphical representation of a librepcb::Hole.
Definition holegraphicsitem.h:48
The PackageEditorState_AddHoles class.
Definition packageeditorstate_addholes.h:50
std::shared_ptr< HoleGraphicsItem > mCurrentGraphicsItem
Definition packageeditorstate_addholes.h:93
bool processGraphicsSceneMouseMoved(const GraphicsSceneMouseEvent &e) noexcept override
Definition packageeditorstate_addholes.cpp:90
std::shared_ptr< Hole > mCurrentHole
Definition packageeditorstate_addholes.h:92
bool processGraphicsSceneLeftMouseButtonPressed(const GraphicsSceneMouseEvent &e) noexcept override
Definition packageeditorstate_addholes.cpp:101
void diameterChanged(const PositiveLength &diameter)
~PackageEditorState_AddHoles() noexcept
Definition packageeditorstate_addholes.cpp:56
bool startAddHole(const Point &pos) noexcept
Definition packageeditorstate_addholes.cpp:129
Hole mCurrentProperties
Definition packageeditorstate_addholes.h:90
const PositiveLength & getDiameter() const noexcept
Definition packageeditorstate_addholes.h:72
void setDiameter(const PositiveLength &diameter) noexcept
Definition packageeditorstate_addholes.cpp:114
bool exit() noexcept override
Definition packageeditorstate_addholes.cpp:76
bool finishAddHole(const Point &pos) noexcept
Definition packageeditorstate_addholes.cpp:154
std::unique_ptr< CmdHoleEdit > mCurrentEditCmd
Definition packageeditorstate_addholes.h:94
PackageEditorState_AddHoles(const PackageEditorState_AddHoles &other)=delete
bool abortAddHole() noexcept
Definition packageeditorstate_addholes.cpp:169
bool entry() noexcept override
Definition packageeditorstate_addholes.cpp:64
PackageEditorState_AddHoles & operator=(const PackageEditorState_AddHoles &rhs)=delete
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:810
Definition uuid.h:186
Definition graphicsscene.h:45
Definition packageeditorfsm.h:89