diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui index 32a1a5f..dc7d020 100644 --- a/forms/mainwindow.ui +++ b/forms/mainwindow.ui @@ -730,10 +730,13 @@ :/icons/open.svg:/icons/open.svg - Import + Import Model - Import a new obj file + Import an external model from an obj file + + + Import an external model from an obj file Ctrl+N @@ -748,7 +751,10 @@ Export - Export data as + Export Unfolded Model as Graph + + + Export Unfolded Model as Graph Ctrl+E @@ -883,10 +889,13 @@ :/icons/save.svg:/icons/save.svg - Save + Save Model - Save a file + Save current model to disk + + + Save current model to disk Ctrl+S diff --git a/src/hds_mesh.cpp b/src/hds_mesh.cpp index bb78f60..3b2089a 100644 --- a/src/hds_mesh.cpp +++ b/src/hds_mesh.cpp @@ -1358,7 +1358,10 @@ void HDS_Mesh::save(const string &filename) // save the faces for (int i = 0; i < faceMap.size(); ++i) { - auto corners = faceMap[i]->corners(); + auto& curFace = faceMap[i]; + if (curFace->isCutFace) continue; + + auto corners = curFace->corners(); ss << "f "; for (auto v : corners) { ss << v->index + 1 << ' '; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d858014..83f97b0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -519,8 +519,10 @@ void MainWindow::closeFile() //later add this function void MainWindow::saveFile() { QString filename = QFileDialog::getSaveFileName(this, "Input a file name","",tr("OBJ files(*.obj)")); +#if _DEBUG cout << "saving file " << filename.toStdString() << endl; - MeshManager::getInstance()->saveMeshes(); +#endif + MeshManager::getInstance()->saveMeshes(filename.toStdString()); } void MainWindow::triggerExportSVG() diff --git a/src/meshmanager.cpp b/src/meshmanager.cpp index 824d272..4e1aa25 100644 --- a/src/meshmanager.cpp +++ b/src/meshmanager.cpp @@ -643,9 +643,9 @@ bool MeshManager::smoothMesh() } -bool MeshManager::saveMeshes() +bool MeshManager::saveMeshes(const string &filename) { - // save only the cutted and unfolded + operationStack->getCurrentMesh()->save(filename); return true; } diff --git a/src/meshmanager.h b/src/meshmanager.h index a98571c..5ad3cec 100644 --- a/src/meshmanager.h +++ b/src/meshmanager.h @@ -95,7 +95,7 @@ class MeshManager bool createDFormMesh(); // Export as SVG files bool exportSVGFile(const QString &filename, const confMap &conf); - bool saveMeshes(); + bool saveMeshes(const string &filename); void setCurrentOpFlag(OperationStack::Flag curFlag) { operationStack->setCurrentFlag(curFlag); } public slots: