Power System Platform  2026w23a-beta
Loading...
Searching...
No Matches
ControlElementDataObject.h
1/*
2 * Copyright (C) 2026 Thales Lima Oliveira <thales.oliveira@uftm.edu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef CONTROLELEMENTDATAOBJECT_H
19#define CONTROLELEMENTDATAOBJECT_H
20
21#include <memory>
22#include <vector>
23
24#include <wx/dataobj.h>
25
26class ControlElement;
27class ConnectionLine;
28
30 std::vector<std::shared_ptr<ControlElement>> elementList;
31 std::vector<std::shared_ptr<ConnectionLine>> connectionList;
32};
33
43class ControlElementDataObject : public wxDataObjectSimple
44{
45public:
48 const std::vector<std::shared_ptr<ControlElement>>& elementList,
49 const std::vector<std::shared_ptr<ConnectionLine>>& connectionList);
51
52 size_t GetDataSize() const override;
53 bool GetDataHere(void* buf) const override;
54 bool SetData(size_t len, const void* buf) override;
55
56 ControlElementsLists* GetElementsLists() { return m_elementsLists; }
57
58private:
59 ControlElementsLists* m_elementsLists = nullptr;
60 bool m_ownsLists = false;
61};
62
63#endif // CONTROLELEMENTDATAOBJECT_H
64
Connection between two control elements or other connection line and an element.
Clipboard payload for ControlEditor copy/paste (control elements + connection lines).