2024-11-19 01:04:06 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "node.h"
|
|
|
|
|
|
|
|
|
|
namespace VISEQ::APP {
|
|
|
|
|
class Clipboard {
|
|
|
|
|
public:
|
|
|
|
|
Clipboard() {}
|
|
|
|
|
|
2024-11-21 02:03:32 +01:00
|
|
|
std::vector<GRAPH::NODES::VEC_SPTR_Node> clipboard;
|
2024-11-19 01:04:06 +01:00
|
|
|
|
2024-12-03 11:08:40 +01:00
|
|
|
GRAPH::NODES::VEC_SPTR_Node pasteNodes(){
|
2024-11-19 01:04:06 +01:00
|
|
|
return clipboard.back();
|
|
|
|
|
}
|
2024-11-21 02:03:32 +01:00
|
|
|
|
2024-12-03 11:08:40 +01:00
|
|
|
void copyNodes(GRAPH::NODES::VEC_WPTR_Node selected_nodes){
|
2024-11-21 02:03:32 +01:00
|
|
|
clipboard.emplace_back();
|
2024-12-03 11:08:40 +01:00
|
|
|
for(auto n : selected_nodes){
|
|
|
|
|
clipboard.back().push_back(n.lock());
|
|
|
|
|
n.lock().deselect();
|
|
|
|
|
}
|
|
|
|
|
//std::ranges::copy(selected_nodes.begin(), selected_nodes.end(), std::back_inserter(clipboard.back()));
|
|
|
|
|
//std::ranges::for_each(selected_nodes.begin(), selected_nodes.end(), [](GRAPH::NODES::SPTR_Node n){n->selected = false;});
|
2024-11-19 01:04:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|