mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-24 09:36:53 +02:00
Added copyTo and pasteFrom to ClipboardScriptingInterface
- Supports LocalVoxels
This commit is contained in:
parent
b07081407a
commit
5986fcafae
2 changed files with 23 additions and 0 deletions
|
@ -5,6 +5,8 @@
|
|||
// Copyright (c) 2014 High Fidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include <LocalVoxelsList.h>
|
||||
|
||||
#include "Application.h"
|
||||
#include "ClipboardScriptingInterface.h"
|
||||
|
||||
|
@ -92,3 +94,21 @@ void ClipboardScriptingInterface::nudgeVoxel(float x, float y, float z, float s,
|
|||
Application::getInstance()->nudgeVoxelsByVector(sourceVoxel, nudgeVecInTreeSpace);
|
||||
}
|
||||
|
||||
void ClipboardScriptingInterface::copyTo(float x, float y, float z, float s,
|
||||
const QString source, const QString destination) {
|
||||
StrongVoxelTreePointer sourceTree = LocalVoxelsList::getInstance()->getTree(source);
|
||||
StrongVoxelTreePointer destinationTree = LocalVoxelsList::getInstance()->getTree(destination);
|
||||
|
||||
VoxelTreeElement* destinationNode = destinationTree->getVoxelAt(x, y, z, s);
|
||||
destinationTree->copyFromTreeIntoSubTree(sourceTree.data(), destinationNode);
|
||||
|
||||
}
|
||||
|
||||
void ClipboardScriptingInterface::pasteFrom(float x, float y, float z, float s,
|
||||
const QString source, const QString destination) {
|
||||
StrongVoxelTreePointer sourceTree = LocalVoxelsList::getInstance()->getTree(source);
|
||||
StrongVoxelTreePointer destinationTree = LocalVoxelsList::getInstance()->getTree(destination);
|
||||
|
||||
VoxelTreeElement* sourceNode = sourceTree->getVoxelAt(x, y, z, s);
|
||||
destinationTree->copySubTreeIntoNewTree(sourceNode, destinationTree.data(), true);
|
||||
}
|
|
@ -38,6 +38,9 @@ public slots:
|
|||
|
||||
void nudgeVoxel(const VoxelDetail& sourceVoxel, const glm::vec3& nudgeVec);
|
||||
void nudgeVoxel(float x, float y, float z, float s, const glm::vec3& nudgeVec);
|
||||
|
||||
void copyTo(float x, float y, float z, float s, const QString source, const QString destination);
|
||||
void pasteFrom(float x, float y, float z, float s, const QString source, const QString destination);
|
||||
};
|
||||
|
||||
#endif // __interface__Clipboard__
|
||||
|
|
Loading…
Reference in a new issue