From 1cc6288899437eb4916607bf2429fb6cd93dc804 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 27 Feb 2014 15:41:36 -0800 Subject: [PATCH] add back in entry point for import voxels --- interface/src/Application.cpp | 20 ++++++++++++++++++++ interface/src/Application.h | 1 + 2 files changed, 21 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index fc9cb9fb2d..cdc4954794 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1379,6 +1379,26 @@ void Application::exportVoxels(const VoxelDetail& sourceVoxel) { _window->activateWindow(); } +void Application::importVoxels() { + if (!_voxelImporter) { + _voxelImporter = new VoxelImporter(_window); + _voxelImporter->loadSettings(_settings); + } + + if (!_voxelImporter->exec()) { + qDebug() << "[DEBUG] Import succeeded." << endl; + } else { + qDebug() << "[DEBUG] Import failed." << endl; + if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) { + _sharedVoxelSystem.killLocalVoxels(); + _sharedVoxelSystem.changeTree(&_clipboard); + } + } + + // restore the main window's active state + _window->activateWindow(); +} + void Application::cutVoxels(const VoxelDetail& sourceVoxel) { copyVoxels(sourceVoxel); deleteVoxelAt(sourceVoxel); diff --git a/interface/src/Application.h b/interface/src/Application.h index 51c6734e7a..4e91876dfb 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -235,6 +235,7 @@ public slots: void nodeKilled(SharedNodePointer node); void packetSent(quint64 length); + void importVoxels(); // doesn't include source voxel because it goes to clipboard void cutVoxels(const VoxelDetail& sourceVoxel); void copyVoxels(const VoxelDetail& sourceVoxel); void pasteVoxels(const VoxelDetail& sourceVoxel);