LibrePCB Developers Documentation
Loading...
Searching...
No Matches
schematiceditorstate_addlabel.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_ADDLABEL_H
21#define LIBREPCB_EDITOR_SCHEMATICEDITORSTATE_ADDLABEL_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29
30/*******************************************************************************
31 * Namespace / Forward Declarations
32 ******************************************************************************/
33namespace librepcb {
34
35class Point;
36class SI_BusLabel;
37class SI_NetLabel;
38class Schematic;
39
40namespace editor {
41
42class CmdSchematicBusLabelEdit;
43class CmdSchematicNetLabelEdit;
44
45/*******************************************************************************
46 * Class SchematicEditorState_AddLabel
47 ******************************************************************************/
48
53 Q_OBJECT
54
55public:
56 // Constructors / Destructor
59 delete;
60 explicit SchematicEditorState_AddLabel(const Context& context) noexcept;
61 virtual ~SchematicEditorState_AddLabel() noexcept;
62
63 // General Methods
64 virtual bool entry() noexcept override;
65 virtual bool exit() noexcept override;
66
67 // Event Handlers
68 virtual bool processRotate(const Angle& rotation) noexcept override;
69 virtual bool processMirror(Qt::Orientation orientation) noexcept override;
71 const GraphicsSceneMouseEvent& e) noexcept override;
73 const GraphicsSceneMouseEvent& e) noexcept override;
75 const GraphicsSceneMouseEvent& e) noexcept override;
77 const GraphicsSceneMouseEvent& e) noexcept override;
78
79 // Operator Overloadings
81 const SchematicEditorState_AddLabel& 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
95};
96
97/*******************************************************************************
98 * End of File
99 ******************************************************************************/
100
101} // namespace editor
102} // namespace librepcb
103
104#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_BusLabel class.
Definition si_buslabel.h:48
The SI_NetLabel class.
Definition si_netlabel.h:48
The CmdSchematicBusLabelEdit class.
Definition cmdschematicbuslabeledit.h:50
The CmdSchematicNetLabelEdit class.
Definition cmdschematicnetlabeledit.h:50
The SchematicEditorState_AddLabel class.
Definition schematiceditorstate_addlabel.h:52
CmdSchematicNetLabelEdit * mNetLabelEditCmd
Definition schematiceditorstate_addlabel.h:92
virtual bool processGraphicsSceneMouseMoved(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addlabel.cpp:124
virtual bool processGraphicsSceneRightMouseButtonReleased(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addlabel.cpp:149
SchematicEditorState_AddLabel(const SchematicEditorState_AddLabel &other)=delete
SI_BusLabel * mCurrentBusLabel
Definition schematiceditorstate_addlabel.h:93
virtual bool processGraphicsSceneLeftMouseButtonPressed(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addlabel.cpp:129
bool fixLabel(const Point &pos) noexcept
Definition schematiceditorstate_addlabel.cpp:238
bool mUndoCmdActive
Definition schematiceditorstate_addlabel.h:90
SI_NetLabel * mCurrentNetLabel
Definition schematiceditorstate_addlabel.h:91
bool addLabel(const Point &pos) noexcept
Definition schematiceditorstate_addlabel.cpp:172
virtual bool processRotate(const Angle &rotation) noexcept override
Definition schematiceditorstate_addlabel.cpp:96
virtual bool processGraphicsSceneLeftMouseButtonDoubleClicked(const GraphicsSceneMouseEvent &e) noexcept override
Definition schematiceditorstate_addlabel.cpp:139
bool abortCommand(bool showErrMsgBox) noexcept
Definition schematiceditorstate_addlabel.cpp:265
CmdSchematicBusLabelEdit * mBusLabelEditCmd
Definition schematiceditorstate_addlabel.h:94
virtual ~SchematicEditorState_AddLabel() noexcept
Definition schematiceditorstate_addlabel.cpp:64
virtual bool exit() noexcept override
Definition schematiceditorstate_addlabel.cpp:81
virtual bool processMirror(Qt::Orientation orientation) noexcept override
Definition schematiceditorstate_addlabel.cpp:109
bool updateLabel(const Point &pos) noexcept
Definition schematiceditorstate_addlabel.cpp:226
virtual bool entry() noexcept override
Definition schematiceditorstate_addlabel.cpp:72
The schematic editor state base class.
Definition schematiceditorstate.h:58
Definition occmodel.cpp:77
Definition graphicsscene.h:45
FSM Context.
Definition schematiceditorfsm.h:65