QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
bridgeterminalscommand.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BRIDGETERMINALSCOMMAND_H
19#define BRIDGETERMINALSCOMMAND_H
20
21#include <QUndoCommand>
22#include <QVector>
23#include <QPointer>
24#include <QMultiMap>
25
26#include "../terminalstrip.h"
27
33class BridgeTerminalsCommand : public QUndoCommand
34{
35 public:
36 BridgeTerminalsCommand(TerminalStrip *strip, QVector<QSharedPointer<RealTerminal>> real_terminal, QUndoCommand *parent = nullptr);
38
39 void undo() override;
40 void redo() override;
41
42 private:
43 QPointer<TerminalStrip> m_strip;
44 QVector<QSharedPointer<RealTerminal>> m_real_terminal_vector;
45 QSharedPointer<TerminalStripBridge> m_bridge;
46};
47
48
54class UnBridgeTerminalsCommand : public QUndoCommand
55{
56 public:
57 UnBridgeTerminalsCommand(TerminalStrip *strip, QVector<QSharedPointer<RealTerminal>> real_terminal, QUndoCommand *parent = nullptr);
59
60 void undo() override;
61 void redo() override;
62
63 private:
64 QPointer<TerminalStrip> m_strip;
65 QSharedPointer<TerminalStripBridge> m_bridge;
66 QVector<QSharedPointer<RealTerminal>> m_terminals;
67};
68
69#endif // BRIDGETERMINALSCOMMAND_H
The BridgeTerminalsCommand class UndoCommand use to create bridge between terminals of a terminals st...
Definition bridgeterminalscommand.h:34
QVector< QSharedPointer< RealTerminal > > m_real_terminal_vector
Definition bridgeterminalscommand.h:44
~BridgeTerminalsCommand() override
Definition bridgeterminalscommand.h:37
void redo() override
Definition bridgeterminalscommand.cpp:38
QSharedPointer< TerminalStripBridge > m_bridge
Definition bridgeterminalscommand.h:45
void undo() override
Definition bridgeterminalscommand.cpp:31
QPointer< TerminalStrip > m_strip
Definition bridgeterminalscommand.h:43
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45
The UnBridgeTerminalsCommand class UndoCommand use to remove bridge between terminals of a terminals ...
Definition bridgeterminalscommand.h:55
QSharedPointer< TerminalStripBridge > m_bridge
Definition bridgeterminalscommand.h:65
QVector< QSharedPointer< RealTerminal > > m_terminals
Definition bridgeterminalscommand.h:66
void undo() override
Definition bridgeterminalscommand.cpp:76
QPointer< TerminalStrip > m_strip
Definition bridgeterminalscommand.h:64
~UnBridgeTerminalsCommand() override
Definition bridgeterminalscommand.h:58
void redo() override
Definition bridgeterminalscommand.cpp:83