Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all
Unified · Split
| @@ -1364,8 +1364,10 @@ void Application::exportVoxels() { · 1363 unmodified lines | ||
| 1364 | 1364 | |
| 1365 | 1365 | void Application::importVoxels() { |
| 1366 | 1366 | QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); |
| 1367 | − QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels"), desktopLocation, | |
| 1368 | − tr("Sparse Voxel Octree Files, Square PNG (*.svo *.png)")); | |
| 1367 | + QString fileNameString = QFileDialog::getOpenFileName( | |
| 1368 | + _glWidget, tr("Import Voxels"), desktopLocation, | |
| 1369 | + tr("Sparse Voxel Octree Files, Square PNG, Schematic Files (*.svo *.png *.schematic)")); | |
| 1370 | + | |
| 1369 | 1371 | QByteArray fileNameAscii = fileNameString.toAscii(); |
| 1370 | 1372 | const char* fileName = fileNameAscii.data(); |
| 1371 | 1373 | |
| @@ -1386,8 +1388,10 @@ void Application::importVoxels() { · 14 unmodified lines | ||
| 1386 | 1388 | } |
| 1387 | 1389 | |
| 1388 | 1390 | importVoxels.readFromSquareARGB32Pixels(pixels, pngImage.height()); |
| 1389 | − } else { | |
| 1391 | + } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) { | |
| 1390 | 1392 | importVoxels.readFromSVOFile(fileName); |
| 1393 | + } else { | |
| 1394 | + importVoxels.readFromSchematicFile(fileName); | |
| 1391 | 1395 | } |
| 1392 | 1396 | |
| 1393 | 1397 | VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s); |
| @@ -1583,11 +1587,11 @@ void Application::initMenu() { · 189 unmodified lines | ||
| 1583 | 1587 | _voxelPaintColor->setIcon(createSwatchIcon(paintColor)); |
| 1584 | 1588 | (_destructiveAddVoxel = voxelMenu->addAction("Create Voxel is Destructive"))->setCheckable(true); |
| 1585 | 1589 | |
| 1586 | − voxelMenu->addAction("Export Voxels", this, SLOT(exportVoxels()), Qt::CTRL | Qt::Key_E); | |
| 1587 | − voxelMenu->addAction("Import Voxels", this, SLOT(importVoxels()), Qt::CTRL | Qt::Key_I); | |
| 1588 | − voxelMenu->addAction("Cut Voxels", this, SLOT(cutVoxels()), Qt::CTRL | Qt::Key_X); | |
| 1589 | − voxelMenu->addAction("Copy Voxels", this, SLOT(copyVoxels()), Qt::CTRL | Qt::Key_C); | |
| 1590 | − voxelMenu->addAction("Paste Voxels", this, SLOT(pasteVoxels()), Qt::CTRL | Qt::Key_V); | |
| 1590 | + voxelMenu->addAction("Export Voxels", this, SLOT(exportVoxels()), Qt::CTRL | Qt::Key_E); | |
| 1591 | + voxelMenu->addAction("Import Voxels", this, SLOT(importVoxels()), Qt::CTRL | Qt::Key_I); | |
| 1592 | + voxelMenu->addAction("Cut Voxels", this, SLOT(cutVoxels()), Qt::CTRL | Qt::Key_X); | |
| 1593 | + voxelMenu->addAction("Copy Voxels", this, SLOT(copyVoxels()), Qt::CTRL | Qt::Key_C); | |
| 1594 | + voxelMenu->addAction("Paste Voxels", this, SLOT(pasteVoxels()), Qt::CTRL | Qt::Key_V); | |
| 1591 | 1595 | |
| 1592 | 1596 | QMenu* debugMenu = menuBar->addMenu("Debug"); |
| 1593 | 1597 | |