Showing the changes to interface/src/ClipboardScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -5,6 +5,8 @@ · 4 unmodified lines | ||
| 5 | 5 | // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. |
| 6 | 6 | // |
| 7 | 7 | |
| 8 | +#include <LocalVoxelsList.h> | |
| 9 | + | |
| 8 | 10 | #include "Application.h" |
| 9 | 11 | #include "ClipboardScriptingInterface.h" |
| 10 | 12 | |
| @@ -92,3 +94,21 @@ void ClipboardScriptingInterface::nudgeVoxel(float x, float y, float z, float s, · 81 unmodified lines | ||
| 92 | 94 | Application::getInstance()->nudgeVoxelsByVector(sourceVoxel, nudgeVecInTreeSpace); |
| 93 | 95 | } |
| 94 | 96 | |
| 97 | +void ClipboardScriptingInterface::copyTo(float x, float y, float z, float s, | |
| 98 | + const QString source, const QString destination) { | |
| 99 | + StrongVoxelTreePointer sourceTree = LocalVoxelsList::getInstance()->getTree(source); | |
| 100 | + StrongVoxelTreePointer destinationTree = LocalVoxelsList::getInstance()->getTree(destination); | |
| 101 | + | |
| 102 | + VoxelTreeElement* destinationNode = destinationTree->getVoxelAt(x, y, z, s); | |
| 103 | + destinationTree->copyFromTreeIntoSubTree(sourceTree.data(), destinationNode); | |
| 104 | + | |
| 105 | +} | |
| 106 | + | |
| 107 | +void ClipboardScriptingInterface::pasteFrom(float x, float y, float z, float s, | |
| 108 | + const QString source, const QString destination) { | |
| 109 | + StrongVoxelTreePointer sourceTree = LocalVoxelsList::getInstance()->getTree(source); | |
| 110 | + StrongVoxelTreePointer destinationTree = LocalVoxelsList::getInstance()->getTree(destination); | |
| 111 | + | |
| 112 | + VoxelTreeElement* sourceNode = sourceTree->getVoxelAt(x, y, z, s); | |
| 113 | + destinationTree->copySubTreeIntoNewTree(sourceNode, destinationTree.data(), true); | |
| 114 | +} | |