ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
main_window.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <QtCore>
11 #include <QtGui>
12 #include <QtWidgets>
13 
14 #include "base/reconstruction.h"
22 #include "ui/license_widget.h"
23 #include "ui/log_widget.h"
24 #include "ui/match_matrix_widget.h"
25 #include "ui/model_viewer_widget.h"
26 #include "ui/project_widget.h"
31 #include "ui/undistortion_widget.h"
32 #include "util/bitmap.h"
33 
34 namespace colmap {
35 
36 class MainWindow : public QMainWindow {
37 public:
38  explicit MainWindow(const OptionManager& options);
39 
40  void ImportReconstruction(const std::string& path);
41 
42 protected:
43  void closeEvent(QCloseEvent* event);
44 
45 private:
47  friend class BundleAdjustmentWidget;
49 
50  void CreateWidgets();
51  void CreateActions();
52  void CreateMenus();
53  void CreateToolbar();
54  void CreateStatusbar();
55  void CreateControllers();
56 
57  void ProjectNew();
58  bool ProjectOpen();
59  void ProjectEdit();
60  void ProjectSave();
61  void ProjectSaveAs();
62  void Import();
63  void ImportFrom();
64  void Export();
65  void ExportAll();
66  void ExportAs();
67  void ExportAsText();
68 
69  void FeatureExtraction();
70  void FeatureMatching();
71  void DatabaseManagement();
72 
73  void AutomaticReconstruction();
74 
75  void ReconstructionStart();
76  void ReconstructionStep();
77  void ReconstructionPause();
78  void ReconstructionReset();
79  void ReconstructionOptions();
80  void ReconstructionFinish();
81  void ReconstructionNormalize();
82  bool ReconstructionOverwrite();
83 
84  void BundleAdjustment();
85  void DenseReconstruction();
86 
87  void Render();
88  void RenderNow();
89  void RenderToggle();
90  void RenderOptions();
91  void RenderSelectedReconstruction();
92  void RenderClear();
93 
94  void SelectReconstructionIdx(const size_t);
95  size_t SelectedReconstructionIdx();
96  bool HasSelectedReconstruction();
97  bool IsSelectedReconstructionValid();
98 
99  void GrabImage();
100  void UndistortImages();
101 
102  void ReconstructionStats();
103  void MatchMatrix();
104  void ShowLog();
105  void ExtractColors();
106 
107  void SetOptions();
108  void ResetOptions();
109 
110  void About();
111  void Documentation();
112  void Support();
113 
114  void ShowInvalidProjectError();
115  void UpdateTimer();
116 
117  void EnableBlockingActions();
118  void DisableBlockingActions();
119 
120  void UpdateWindowTitle();
121 
122  OptionManager options_;
123 
124  ReconstructionManager reconstruction_manager_;
125  std::unique_ptr<IncrementalMapperController> mapper_controller_;
126 
127  Timer timer_;
128 
129  ModelViewerWidget* model_viewer_widget_;
130  ProjectWidget* project_widget_;
131  FeatureExtractionWidget* feature_extraction_widget_;
132  FeatureMatchingWidget* feature_matching_widget_;
133  DatabaseManagementWidget* database_management_widget_;
134  AutomaticReconstructionWidget* automatic_reconstruction_widget_;
135  ReconstructionOptionsWidget* reconstruction_options_widget_;
136  BundleAdjustmentWidget* bundle_adjustment_widget_;
137  DenseReconstructionWidget* dense_reconstruction_widget_;
138  RenderOptionsWidget* render_options_widget_;
139  LogWidget* log_widget_;
140  UndistortionWidget* undistortion_widget_;
141  ReconstructionManagerWidget* reconstruction_manager_widget_;
142  ReconstructionStatsWidget* reconstruction_stats_widget_;
143  MatchMatrixWidget* match_matrix_widget_;
144  LicenseWidget* license_widget_;
145  ThreadControlWidget* thread_control_widget_;
146 
147  QToolBar* file_toolbar_;
148  QToolBar* preprocessing_toolbar_;
149  QToolBar* reconstruction_toolbar_;
150  QToolBar* render_toolbar_;
151  QToolBar* extras_toolbar_;
152 
153  // QStatusBar* status_bar_;
154  QDockWidget* dock_log_widget_;
155 
156  QTimer* statusbar_timer_;
157  QLabel* statusbar_timer_label_;
158 
159  QAction* action_project_new_;
160  QAction* action_project_open_;
161  QAction* action_project_edit_;
162  QAction* action_project_save_;
163  QAction* action_project_save_as_;
164  QAction* action_import_;
165  QAction* action_import_from_;
166  QAction* action_export_;
167  QAction* action_export_all_;
168  QAction* action_export_as_;
169  QAction* action_export_as_text_;
170  QAction* action_quit_;
171 
172  QAction* action_feature_extraction_;
173  QAction* action_feature_matching_;
174  QAction* action_database_management_;
175 
176  QAction* action_automatic_reconstruction_;
177 
178  QAction* action_reconstruction_start_;
179  QAction* action_reconstruction_step_;
180  QAction* action_reconstruction_pause_;
181  QAction* action_reconstruction_reset_;
182  QAction* action_reconstruction_finish_;
183  QAction* action_reconstruction_normalize_;
184  QAction* action_reconstruction_options_;
185 
186  QAction* action_bundle_adjustment_;
187  QAction* action_dense_reconstruction_;
188 
189  QAction* action_render_;
190  QAction* action_render_now_;
191  QAction* action_render_toggle_;
192  QAction* action_render_reset_view_;
193  QAction* action_render_options_;
194 
195  QAction* action_reconstruction_stats_;
196  QAction* action_match_matrix_;
197  QAction* action_log_show_;
198  QAction* action_grab_image_;
199  QAction* action_grab_movie_;
200  QAction* action_undistort_;
201  QAction* action_extract_colors_;
202  QAction* action_set_options_;
203  QAction* action_reset_options_;
204 
205  QAction* action_about_;
206  QAction* action_documentation_;
207  QAction* action_support_;
208  QAction* action_license_;
209 
210  std::vector<QAction*> blocking_actions_;
211 
212  // Necessary for OS X to avoid duplicate closeEvents.
213  bool window_closed_;
214 };
215 
216 } // namespace colmap
MouseEvent event
void closeEvent(QCloseEvent *event)
Definition: main_window.cc:67
void ImportReconstruction(const std::string &path)
Definition: main_window.cc:60
MainWindow(const OptionManager &options)
Definition: main_window.cc:40
static const std::string path
Definition: PointCloud.cpp:59
colmap::RenderOptions RenderOptions
int BundleAdjustment(const std::string &input_path, const std::string &output_path, const colmap::BundleAdjustmentOptions &bundle_adjustment_options)
Definition: sfm.cpp:58