| 38 | namespace colmap { |
| 39 | |
| 40 | int RunGraphicalUserInterface(int argc, char** argv) { |
| 41 | #if !defined(COLMAP_GUI_ENABLED) |
| 42 | LOG(ERROR) |
| 43 | << "Cannot start graphical user interface. COLMAP was built without GUI " |
| 44 | "support or Qt dependency was not found."; |
| 45 | return EXIT_FAILURE; |
| 46 | #else |
| 47 | OptionManager options; |
| 48 | |
| 49 | std::filesystem::path import_path; |
| 50 | |
| 51 | if (argc > 1) { |
| 52 | options.AddDefaultOption("import_path", &import_path); |
| 53 | options.AddAllOptions(); |
| 54 | if (!options.Parse(argc, argv)) { |
| 55 | return EXIT_FAILURE; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | QApplication app(argc, argv); |
| 60 | |
| 61 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) && \ |
| 62 | (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) |
| 63 | app.setAttribute(Qt::AA_EnableHighDpiScaling); |
| 64 | app.setAttribute(Qt::AA_UseHighDpiPixmaps); |
| 65 | #endif |
| 66 | app.setAttribute(Qt::AA_DontShowIconsInMenus, false); |
| 67 | |
| 68 | MainWindow main_window(std::move(options)); |
| 69 | main_window.show(); |
| 70 | |
| 71 | if (!import_path.empty()) { |
| 72 | main_window.ImportReconstruction(import_path); |
| 73 | } |
| 74 | |
| 75 | return app.exec(); |
| 76 | #endif |
| 77 | } |
| 78 | |
| 79 | int RunProjectGenerator(int argc, char** argv) { |
| 80 | std::filesystem::path output_path; |
nothing calls this directly
no test coverage detected