Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -1322,7 +1322,7 @@ void Application::exportVoxels() { · 1321 unmodified lines | ||
| 1322 | 1322 | void Application::importVoxels() { |
| 1323 | 1323 | QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); |
| 1324 | 1324 | QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels"), desktopLocation, |
| 1325 | − tr("Sparse Voxel Octree Files, Square PNG (*.svo *.png)")); | |
| 1325 | + tr("Sparse Voxel Octree Files, Square PNG, Schematic Files (*.svo *.png *.schematic)")); | |
| 1326 | 1326 | QByteArray fileNameAscii = fileNameString.toAscii(); |
| 1327 | 1327 | const char* fileName = fileNameAscii.data(); |
| 1328 | 1328 | |
| @@ -1343,8 +1343,10 @@ void Application::importVoxels() { · 14 unmodified lines | ||
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | importVoxels.readFromSquareARGB32Pixels(pixels, pngImage.height()); |
| 1346 | − } else { | |
| 1346 | + } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) { | |
| 1347 | 1347 | importVoxels.readFromSVOFile(fileName); |
| 1348 | + } else { | |
| 1349 | + importVoxels.readFromSchematicsFile(fileName); | |
| 1348 | 1350 | } |
| 1349 | 1351 | |
| 1350 | 1352 | VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s); |
| @@ -1534,11 +1536,11 @@ void Application::initMenu() { · 183 unmodified lines | ||
| 1534 | 1536 | _voxelPaintColor->setIcon(createSwatchIcon(paintColor)); |
| 1535 | 1537 | (_destructiveAddVoxel = voxelMenu->addAction("Create Voxel is Destructive"))->setCheckable(true); |
| 1536 | 1538 | |
| 1537 | − voxelMenu->addAction("Export Voxels", this, SLOT(exportVoxels()), Qt::CTRL | Qt::Key_E); | |
| 1538 | − voxelMenu->addAction("Import Voxels", this, SLOT(importVoxels()), Qt::CTRL | Qt::Key_I); | |
| 1539 | − voxelMenu->addAction("Cut Voxels", this, SLOT(cutVoxels()), Qt::CTRL | Qt::Key_X); | |
| 1540 | − voxelMenu->addAction("Copy Voxels", this, SLOT(copyVoxels()), Qt::CTRL | Qt::Key_C); | |
| 1541 | − voxelMenu->addAction("Paste Voxels", this, SLOT(pasteVoxels()), Qt::CTRL | Qt::Key_V); | |
| 1539 | + voxelMenu->addAction("Export Voxels", this, SLOT(exportVoxels()), Qt::CTRL | Qt::Key_E); | |
| 1540 | + voxelMenu->addAction("Import Voxels", this, SLOT(importVoxels()), Qt::CTRL | Qt::Key_I); | |
| 1541 | + voxelMenu->addAction("Cut Voxels", this, SLOT(cutVoxels()), Qt::CTRL | Qt::Key_X); | |
| 1542 | + voxelMenu->addAction("Copy Voxels", this, SLOT(copyVoxels()), Qt::CTRL | Qt::Key_C); | |
| 1543 | + voxelMenu->addAction("Paste Voxels", this, SLOT(pasteVoxels()), Qt::CTRL | Qt::Key_V); | |
| 1542 | 1544 | |
| 1543 | 1545 | QMenu* debugMenu = menuBar->addMenu("Debug"); |
| 1544 | 1546 | |