LibrePCB Developers Documentation
cmdaddsymboltoschematic.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_CMDADDSYMBOLTOSCHEMATIC_H
21#define LIBREPCB_EDITOR_CMDADDSYMBOLTOSCHEMATIC_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommandgroup.h"
27
31
32#include <QtCore>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class ComponentInstance;
40class SI_Symbol;
41class Schematic;
42class Symbol;
43class Workspace;
44
45namespace editor {
46
47/*******************************************************************************
48 * Class CmdAddSymbolToSchematic
49 ******************************************************************************/
50
55public:
56 // Constructors / Destructor
57 CmdAddSymbolToSchematic(Workspace& workspace, Schematic& schematic,
58 ComponentInstance& cmpInstance,
59 const Uuid& symbolItem,
60 const Point& position = Point(),
61 const Angle& angle = Angle()) noexcept;
62 ~CmdAddSymbolToSchematic() noexcept;
63
64 // Getters
65 SI_Symbol* getSymbolInstance() const noexcept { return mSymbolInstance; }
66
67private:
68 // Private Methods
69
71 bool performExecute() override;
72
73 // Private Member Variables
74
75 // Attributes from the constructor
82
83 SI_Symbol* mSymbolInstance; // the created symbol instance
84};
85
86/*******************************************************************************
87 * End of File
88 ******************************************************************************/
89
90} // namespace editor
91} // namespace librepcb
92
93#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The ComponentInstance class.
Definition: componentinstance.h:54
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The SI_Symbol class.
Definition: si_symbol.h:54
The Schematic class represents one schematic page of a project and is always part of a circuit.
Definition: schematic.h:74
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The CmdAddSymbolToSchematic class.
Definition: cmdaddsymboltoschematic.h:54
Angle mAngle
Definition: cmdaddsymboltoschematic.h:81
Schematic & mSchematic
Definition: cmdaddsymboltoschematic.h:77
Uuid mSymbolItemUuid
Definition: cmdaddsymboltoschematic.h:79
ComponentInstance & mComponentInstance
Definition: cmdaddsymboltoschematic.h:78
SI_Symbol * mSymbolInstance
Definition: cmdaddsymboltoschematic.h:83
CmdAddSymbolToSchematic(Workspace &workspace, Schematic &schematic, ComponentInstance &cmpInstance, const Uuid &symbolItem, const Point &position=Point(), const Angle &angle=Angle()) noexcept
Definition: cmdaddsymboltoschematic.cpp:52
~CmdAddSymbolToSchematic() noexcept
Definition: cmdaddsymboltoschematic.cpp:65
Workspace & mWorkspace
Definition: cmdaddsymboltoschematic.h:76
SI_Symbol * getSymbolInstance() const noexcept
Definition: cmdaddsymboltoschematic.h:65
bool performExecute() override
Execute the command the first time.
Definition: cmdaddsymboltoschematic.cpp:72
Point mPosition
Definition: cmdaddsymboltoschematic.h:80
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:44
Definition: occmodel.cpp:77