LibrePCB Developers Documentation
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#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Point;
37class SI_NetLabel;
38class Schematic;
39
40namespace editor {
41
42class CmdSchematicNetLabelEdit;
43
44/*******************************************************************************
45 * Class SchematicEditorState_AddNetLabel
46 ******************************************************************************/
47
52 Q_OBJECT
53
54public:
55 // Constructors / Destructor
58 const SchematicEditorState_AddNetLabel& other) = delete;
59 explicit SchematicEditorState_AddNetLabel(const Context& context) noexcept;
60 virtual ~SchematicEditorState_AddNetLabel() noexcept;
61
62 // General Methods
63 virtual bool entry() noexcept override;
64 virtual bool exit() noexcept override;
65
66 // Event Handlers
68 QGraphicsSceneMouseEvent& e) noexcept override;
70 QGraphicsSceneMouseEvent& e) noexcept override;
72 QGraphicsSceneMouseEvent& e) noexcept override;
74 QGraphicsSceneMouseEvent& e) noexcept override;
75 virtual bool processSwitchToSchematicPage(int index) noexcept override;
76 virtual bool processRotate(const Angle& rotation) noexcept override;
77 virtual bool processMirror(Qt::Orientation orientation) noexcept override;
78
79 // Operator Overloadings
81 const SchematicEditorState_AddNetLabel& rhs) = delete;
82
83private: // Methods
84 bool addLabel(const Point& pos) noexcept;
85 bool updateLabel(const Point& pos) noexcept;
86 bool fixLabel(const Point& pos) noexcept;
87 bool abortCommand(bool showErrMsgBox) noexcept;
88
89private: // Data
93};
94
95/*******************************************************************************
96 * End of File
97 ******************************************************************************/
98
99} // namespace editor
100} // namespace librepcb
101
102#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The SI_NetLabel class.
Definition: si_netlabel.h:49
The CmdSchematicNetLabelEdit class.
Definition: cmdschematicnetlabeledit.h:50
The SchematicEditorState_AddNetLabel class.
Definition: schematiceditorstate_addnetlabel.h:51
virtual bool processGraphicsSceneMouseMoved(QGraphicsSceneMouseEvent &e) noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:86
bool fixLabel(const Point &pos) noexcept
Definition: schematiceditorstate_addnetlabel.cpp:213
bool mUndoCmdActive
Definition: schematiceditorstate_addnetlabel.h:90
SI_NetLabel * mCurrentNetLabel
Definition: schematiceditorstate_addnetlabel.h:91
bool addLabel(const Point &pos) noexcept
Definition: schematiceditorstate_addnetlabel.cpp:165
virtual bool processRotate(const Angle &rotation) noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:141
SchematicEditorState_AddNetLabel(const SchematicEditorState_AddNetLabel &other)=delete
virtual ~SchematicEditorState_AddNetLabel() noexcept
Definition: schematiceditorstate_addnetlabel.cpp:58
bool abortCommand(bool showErrMsgBox) noexcept
Definition: schematiceditorstate_addnetlabel.cpp:230
virtual bool processSwitchToSchematicPage(int index) noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:135
virtual bool exit() noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:73
virtual bool processGraphicsSceneRightMouseButtonReleased(QGraphicsSceneMouseEvent &e) noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:119
virtual bool processMirror(Qt::Orientation orientation) noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:151
virtual bool processGraphicsSceneLeftMouseButtonPressed(QGraphicsSceneMouseEvent &e) noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:95
CmdSchematicNetLabelEdit * mEditCmd
Definition: schematiceditorstate_addnetlabel.h:92
bool updateLabel(const Point &pos) noexcept
Definition: schematiceditorstate_addnetlabel.cpp:204
virtual bool entry() noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:66
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(QGraphicsSceneMouseEvent &e) noexcept override
Definition: schematiceditorstate_addnetlabel.cpp:107
The schematic editor state base class.
Definition: schematiceditorstate.h:57
Definition: occmodel.cpp:77
FSM Context.
Definition: schematiceditorfsm.h:81