LibrePCB Developers Documentation
cmdpasteboarditems.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_CMDPASTEBOARDITEMS_H
21#define LIBREPCB_EDITOR_CMDPASTEBOARDITEMS_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommandgroup.h"
27
29
30#include <QtCore>
31
32#include <memory>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class Board;
40class NetSignal;
41class Project;
42
43namespace editor {
44
45class BoardClipboardData;
46class BoardGraphicsScene;
47
48/*******************************************************************************
49 * Class CmdPasteBoardItems
50 ******************************************************************************/
51
56public:
57 // Constructors / Destructor
59 CmdPasteBoardItems(const CmdPasteBoardItems& other) = delete;
61 std::unique_ptr<BoardClipboardData> data,
62 const Point& posOffset) noexcept;
63 ~CmdPasteBoardItems() noexcept;
64
65 // Operator Overloadings
66 CmdPasteBoardItems& operator=(const CmdPasteBoardItems& rhs) = delete;
67
68private: // Methods
70 bool performExecute() override;
71
72 NetSignal* getOrCreateNetSignal(const QString& name);
73
74private: // Data
78 std::unique_ptr<BoardClipboardData> mData;
80};
81
82/*******************************************************************************
83 * End of File
84 ******************************************************************************/
85
86} // namespace editor
87} // namespace librepcb
88
89#endif
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:73
The NetSignal class.
Definition: netsignal.h:50
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The BoardClipboardData class.
Definition: boardclipboarddata.h:64
The BoardGraphicsScene class.
Definition: boardgraphicsscene.h:77
The CmdPasteBoardItems class.
Definition: cmdpasteboarditems.h:55
NetSignal * getOrCreateNetSignal(const QString &name)
Definition: cmdpasteboarditems.cpp:348
CmdPasteBoardItems(const CmdPasteBoardItems &other)=delete
BoardGraphicsScene & mScene
Definition: cmdpasteboarditems.h:75
Board & mBoard
Definition: cmdpasteboarditems.h:76
std::unique_ptr< BoardClipboardData > mData
Definition: cmdpasteboarditems.h:78
Project & mProject
Definition: cmdpasteboarditems.h:77
~CmdPasteBoardItems() noexcept
Definition: cmdpasteboarditems.cpp:95
Point mPosOffset
Definition: cmdpasteboarditems.h:79
bool performExecute() override
Execute the command the first time.
Definition: cmdpasteboarditems.cpp:102
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