20 #include <QMessageBox> |
20 #include <QMessageBox> |
21 #include "../canvas.h" |
21 #include "../canvas.h" |
22 #include "../lddocument.h" |
22 #include "../lddocument.h" |
23 #include "../mainwindow.h" |
23 #include "../mainwindow.h" |
24 #include "../partdownloader.h" |
24 #include "../partdownloader.h" |
|
25 #include "../parser.h" |
25 #include "../primitives.h" |
26 #include "../primitives.h" |
26 #include "../dialogs/configdialog.h" |
27 #include "../dialogs/configdialog.h" |
27 #include "../dialogs/ldrawpathdialog.h" |
28 #include "../dialogs/ldrawpathdialog.h" |
28 #include "../dialogs/newpartdialog.h" |
29 #include "../dialogs/newpartdialog.h" |
29 #include "../dialogs/generateprimitivedialog.h" |
30 #include "../dialogs/generateprimitivedialog.h" |
115 QFile file = {filePath}; |
116 QFile file = {filePath}; |
116 |
117 |
117 if (file.open(QIODevice::ReadOnly)) |
118 if (file.open(QIODevice::ReadOnly)) |
118 { |
119 { |
119 Model model {m_documents}; |
120 Model model {m_documents}; |
120 m_documents->loadFileContents(&file, model, nullptr, nullptr); |
121 Parser parser {file}; |
|
122 parser.parseBody(model); |
121 |
123 |
122 mainWindow()->clearSelection(); |
124 mainWindow()->clearSelection(); |
123 |
125 |
124 for (LDObject* object : model.objects()) |
126 for (LDObject* object : model.objects()) |
125 { |
127 { |