Skip to content

Commit f829768

Browse files
committed
minor ui change, enable saving mesh
1 parent 12e1769 commit f829768

5 files changed

Lines changed: 24 additions & 10 deletions

File tree

forms/mainwindow.ui

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,13 @@
730730
<normaloff>:/icons/open.svg</normaloff>:/icons/open.svg</iconset>
731731
</property>
732732
<property name="text">
733-
<string>Import</string>
733+
<string>Import Model</string>
734734
</property>
735735
<property name="toolTip">
736-
<string>Import a new obj file</string>
736+
<string>Import an external model from an obj file</string>
737+
</property>
738+
<property name="statusTip">
739+
<string>Import an external model from an obj file</string>
737740
</property>
738741
<property name="shortcut">
739742
<string>Ctrl+N</string>
@@ -748,7 +751,10 @@
748751
<string>Export</string>
749752
</property>
750753
<property name="toolTip">
751-
<string>Export data as</string>
754+
<string>Export Unfolded Model as Graph</string>
755+
</property>
756+
<property name="statusTip">
757+
<string>Export Unfolded Model as Graph</string>
752758
</property>
753759
<property name="shortcut">
754760
<string>Ctrl+E</string>
@@ -883,10 +889,13 @@
883889
<normaloff>:/icons/save.svg</normaloff>:/icons/save.svg</iconset>
884890
</property>
885891
<property name="text">
886-
<string>Save</string>
892+
<string>Save Model</string>
887893
</property>
888894
<property name="toolTip">
889-
<string>Save a file</string>
895+
<string>Save current model to disk</string>
896+
</property>
897+
<property name="statusTip">
898+
<string>Save current model to disk</string>
890899
</property>
891900
<property name="shortcut">
892901
<string>Ctrl+S</string>

src/hds_mesh.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,10 @@ void HDS_Mesh::save(const string &filename)
13581358

13591359
// save the faces
13601360
for (int i = 0; i < faceMap.size(); ++i) {
1361-
auto corners = faceMap[i]->corners();
1361+
auto& curFace = faceMap[i];
1362+
if (curFace->isCutFace) continue;
1363+
1364+
auto corners = curFace->corners();
13621365
ss << "f ";
13631366
for (auto v : corners) {
13641367
ss << v->index + 1 << ' ';

src/mainwindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,10 @@ void MainWindow::closeFile() //later add this function
519519
void MainWindow::saveFile()
520520
{
521521
QString filename = QFileDialog::getSaveFileName(this, "Input a file name","",tr("OBJ files(*.obj)"));
522+
#if _DEBUG
522523
cout << "saving file " << filename.toStdString() << endl;
523-
MeshManager::getInstance()->saveMeshes();
524+
#endif
525+
MeshManager::getInstance()->saveMeshes(filename.toStdString());
524526
}
525527

526528
void MainWindow::triggerExportSVG()

src/meshmanager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,9 @@ bool MeshManager::smoothMesh()
643643
}
644644

645645

646-
bool MeshManager::saveMeshes()
646+
bool MeshManager::saveMeshes(const string &filename)
647647
{
648-
// save only the cutted and unfolded
648+
operationStack->getCurrentMesh()->save(filename);
649649
return true;
650650
}
651651

src/meshmanager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class MeshManager
9595
bool createDFormMesh();
9696
// Export as SVG files
9797
bool exportSVGFile(const QString &filename, const confMap &conf);
98-
bool saveMeshes();
98+
bool saveMeshes(const string &filename);
9999

100100
void setCurrentOpFlag(OperationStack::Flag curFlag) { operationStack->setCurrentFlag(curFlag); }
101101
public slots:

0 commit comments

Comments
 (0)