History

Dialogbox for import fully functionnal

atlante45 committed 13 years ago

Commit 24531fd1 parent b41575912 files · +270 −81Browse files

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

Unified · Split

interface/src/Application.cpp+17−7
@@ -1199,13 +1199,13 @@ void Application::importVoxelsToClipboard() { · 1198 unmodified lines
1199 QByteArray fileNameAscii = fileNameString.toLocal8Bit();1199 QByteArray fileNameAscii = fileNameString.toLocal8Bit();
1200 const char* fileName = fileNameAscii.data();1200 const char* fileName = fileNameAscii.data();
1201 1201
1202 _clipboardTree.eraseAllVoxels();1202 _clipboard.killLocalVoxels();
1203 if (fileNameString.endsWith(".png", Qt::CaseInsensitive)) {1203 if (fileNameString.endsWith(".png", Qt::CaseInsensitive)) {
1204 _clipboardTree.readFromSquareARGB32Pixels(fileName);1204 _clipboard.readFromSquareARGB32Pixels(fileName);
1205 } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) {1205 } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) {
1206 _clipboardTree.readFromSVOFile(fileName);1206 _clipboard.readFromSVOFile(fileName);
1207 } else if (fileNameString.endsWith(".schematic", Qt::CaseInsensitive)) {1207 } else if (fileNameString.endsWith(".schematic", Qt::CaseInsensitive)) {
1208 _clipboardTree.readFromSchematicFile(fileName);1208 _clipboard.readFromSchematicFile(fileName);
1209 }1209 }
1210 1210
1211 // restore the main window's active state1211 // restore the main window's active state
@@ -1213,6 +1213,16 @@ void Application::importVoxelsToClipboard() { · 1 unmodified line
1213}1213}
1214 1214
1215void Application::importVoxels() {1215void Application::importVoxels() {
1216 if (_voxelImporter.exec()) {
1217 qDebug("[DEBUG] Import succedded.\n");
1218
1219
1220 } else {
1221 qDebug("[DEBUG] Import failed.\n");
1222 }
1223
1224 return;
1225
1216 QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);1226 QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
1217 1227
1218 QStringList fileNameStringList = QFileDialog::getOpenFileNames(_glWidget, tr("Import Voxels"), desktopLocation, 1228 QStringList fileNameStringList = QFileDialog::getOpenFileNames(_glWidget, tr("Import Voxels"), desktopLocation,
@@ -1369,10 +1379,10 @@ void Application::copyVoxels() { · 150 unmodified lines
1369 VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);1379 VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
1370 if (selectedNode) {1380 if (selectedNode) {
1371 // clear the clipboard first...1381 // clear the clipboard first...
1372 _clipboardTree.eraseAllVoxels();1382 _clipboard.killLocalVoxels();
1373 1383
1374 // then copy onto it1384 // then copy onto it
1375 _voxels.copySubTreeIntoNewTree(selectedNode, &_clipboardTree, true);1385 //_voxels.copySubTreeIntoNewTree(selectedNode, _clipboard, true);
1376 }1386 }
1377}1387}
1378 1388
@@ -1393,7 +1403,7 @@ void Application::pasteVoxels() { · 14 unmodified lines
1393 args.newBaseOctCode = calculatedOctCode = pointToVoxel(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);1403 args.newBaseOctCode = calculatedOctCode = pointToVoxel(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
1394 }1404 }
1395 1405
1396 _clipboardTree.recurseTreeWithOperation(sendVoxelsOperation, &args);1406 //_clipboard.recurseTreeWithOperation(sendVoxelsOperation, &args);
1397 _voxelEditSender.flushQueue();1407 _voxelEditSender.flushQueue();
1398 1408
1399 if (calculatedOctCode) {1409 if (calculatedOctCode) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t