LibrePCB Developers Documentation
Loading...
Searching...
No Matches
schematiceditorstate_addnetlabel.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_SCHEMATICEDITORSTATE_ADDNETLABEL_H
21#define LIBREPCB_EDITOR_SCHEMATICEDITORSTATE_ADDNETLABEL_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29
30/*******************************************************************************
31 * Namespace / Forward Declarations
32 ******************************************************************************/
33namespace librepcb {
34
35class Point;
36class SI_NetLabel;
37class Schematic;
38
39namespace editor {
40
41class CmdSchematicNetLabelEdit;
42
43/*******************************************************************************
44 * Class SchematicEditorState_AddNetLabel
45 ******************************************************************************/
46
51 Q_OBJECT
52
53public:
54 // Constructors / Destructor
57 const SchematicEditorState_AddNetLabel& other) = delete;
58 explicit SchematicEditorState_AddNetLabel(const Context& context) noexcept;
59 virtual ~SchematicEditorState_AddNetLabel() noexcept;
60
61 // General Methods
62 virtual bool entry() noexcept override;
63 virtual bool exit() noexcept override;
64
65 // Event Handlers
66 virtual bool processRotate(const Angle& rotation) noexcept override;
67 virtual bool processMirror(Qt::Orientation orientation) noexcept override;
69 const GraphicsSceneMouseEvent& e) noexcept override;
71 const GraphicsSceneMouseEvent& e) noexcept override;
73 const GraphicsSceneMouseEvent& e) noexcept override;
75 const GraphicsSceneMouseEvent& e) noexcept override;
76
77 // Operator Overloadings
79 const SchematicEditorState_AddNetLabel& rhs) = delete;
80
81private: // Methods
82 bool addLabel(const Point& pos) noexcept;
83 bool updateLabel(const Point& pos) noexcept;
84 bool fixLabel(const Point& pos) noexcept;
85 bool abortCommand(bool showErrMsgBox) noexcept;
86
87private: // Data
91};
92
93/*******************************************************************************
94 * End of File
95 ******************************************************************************/
96
97} // namespace editor
98} // namespace librepcb
99
100#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The SI_NetLabel class.
Definition si_netlabel.h:49
The CmdSchematicNetLabelEdit class.
Definition cmdschematicnetlabeledit.h:50
The SchematicEditorState_AddNetLabel class.
Definition schematiceditorstate_addnetlabel.h:50
virtual bool processGraphicsSceneMouseMoved(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addnetlabel.cpp:108
virtual bool processGraphicsSceneRightMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addnetlabel.cpp:134
virtual bool processGraphicsSceneLeftMouseButtonPressed(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addnetlabel.cpp:114
bool fixLabel(const Point &pos) noexcept
Definition schematiceditorstate_addnetlabel.cpp:203
bool mUndoCmdActive
Definition schematiceditorstate_addnetlabel.h:88
SI_NetLabel * mCurrentNetLabel
Definition schematiceditorstate_addnetlabel.h:89
bool addLabel(const Point &pos) noexcept
Definition schematiceditorstate_addnetlabel.cpp:153
virtual bool processRotate(const Angle &rotation) noexcept override
Definition schematiceditorstate_addnetlabel.cpp:88
SchematicEditorState_AddNetLabel(const SchematicEditorState_AddNetLabel &other)=delete
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addnetlabel.cpp:124
virtual ~SchematicEditorState_AddNetLabel() noexcept
Definition schematiceditorstate_addnetlabel.cpp:56
bool abortCommand(bool showErrMsgBox) noexcept
Definition schematiceditorstate_addnetlabel.cpp:221
virtual bool exit() noexcept override
Definition schematiceditorstate_addnetlabel.cpp:73
virtual bool processMirror(Qt::Orientation orientation) noexcept override
Definition schematiceditorstate_addnetlabel.cpp:98
CmdSchematicNetLabelEdit * mEditCmd
Definition schematiceditorstate_addnetlabel.h:90
bool updateLabel(const Point &pos) noexcept
Definition schematiceditorstate_addnetlabel.cpp:194
virtual bool entry() noexcept override
Definition schematiceditorstate_addnetlabel.cpp:64
The schematic editor state base class.
Definition schematiceditorstate.h:58
Definition occmodel.cpp:77
Definition graphicsscene.h:45
FSM Context.
Definition schematiceditorfsm.h:62