History

Added copyTo and pasteFrom to ClipboardScriptingInterface - Supports LocalVoxels

Atlante45 committed 12 years ago

Commit 5986fca1 parent b0708142 files · +23 −0Browse files

Showing the changes to interface/src/ClipboardScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/ClipboardScriptingInterface.cpp+20−0
@@ -5,6 +5,8 @@ · 4 unmodified lines
55 // Copyright (c) 2014 High Fidelity, Inc. All rights reserved.
66 //
77
8+#include <LocalVoxelsList.h>
9+
810 #include "Application.h"
911 #include "ClipboardScriptingInterface.h"
1012
@@ -92,3 +94,21 @@ void ClipboardScriptingInterface::nudgeVoxel(float x, float y, float z, float s, · 81 unmodified lines
9294 Application::getInstance()->nudgeVoxelsByVector(sourceVoxel, nudgeVecInTreeSpace);
9395 }
9496
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+}