MCPcopy Create free account
hub / github.com/MrKepzie/Natron / copyNodesInternal

Method copyNodesInternal

Gui/NodeGraphPrivate.cpp:193–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void
194NodeGraphPrivate::copyNodesInternal(const NodesGuiList& selection,
195 NodeClipBoard & clipboard)
196{
197 ///Clear clipboard
198 clipboard.nodes.clear();
199 clipboard.nodesUI.clear();
200
201 NodesGuiList nodesToCopy = selection;
202 for (NodesGuiList::iterator it = nodesToCopy.begin(); it != nodesToCopy.end(); ++it) {
203 ///Also copy all nodes within the backdrop
204 NodesGuiList nodesWithinBD = _publicInterface->getNodesWithinBackdrop(*it);
205 for (NodesGuiList::iterator it2 = nodesWithinBD.begin(); it2 != nodesWithinBD.end(); ++it2) {
206 NodesGuiList::iterator found = std::find(nodesToCopy.begin(), nodesToCopy.end(), *it2);
207 if ( found == nodesToCopy.end() ) {
208 nodesToCopy.push_back(*it2);
209 }
210 }
211 }
212
213 for (NodesGuiList::iterator it = nodesToCopy.begin(); it != nodesToCopy.end(); ++it) {
214 if ( (*it)->isVisible() ) {
215 boost::shared_ptr<NodeSerialization> ns( new NodeSerialization( (*it)->getNode(), true ) );
216 boost::shared_ptr<NodeGuiSerialization> nGuiS(new NodeGuiSerialization);
217 (*it)->serialize( nGuiS.get() );
218 clipboard.nodes.push_back(ns);
219 clipboard.nodesUI.push_back(nGuiS);
220 }
221 }
222}
223
224NATRON_NAMESPACE_EXIT

Callers 4

copyNodesMethod · 0.80
copySelectedNodesMethod · 0.80

Calls 9

clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
isVisibleMethod · 0.45
getNodeMethod · 0.45
serializeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected