ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ReconstructionWidget.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 
15 #include "BundleAdjustmentWidget.h"
19 #include "FeatureMatchingWidget.h"
20 #include "LogWidget.h"
21 #include "MatchMatrixWidget.h"
22 #include "ModelViewerWidget.h"
23 #include "ProjectWidget.h"
26 #include "UndistortionWidget.h"
27 #include "base/reconstruction.h"
28 #include "base/reconstruction_manager.h"
29 #include "controllers/incremental_mapper.h"
30 #include "util/bitmap.h"
31 #include "util/option_manager.h"
32 
33 class MainWindow;
34 
35 namespace cloudViewer {
36 
37 // Directly use colmap's types
42 
45 class ReconstructionWidget : public QWidget {
46  Q_OBJECT
47 public:
48  explicit ReconstructionWidget(MainWindow* app);
49 
50  void ImportReconstruction(const std::string& path);
51 
52  void close();
53  void release();
54 
55  void iniEnvironment();
56 
57  void showLog();
58  void hideLog();
59 
60  QDockWidget* getLogWidget() { return dock_log_widget_; }
61  std::vector<QMenu*>& getReconstructionMenus() { return menus_list_; }
62  std::vector<QToolBar*>& getReconstructionToolbars() {
63  return toolbar_list_;
64  }
65 
66  QLabel* getTimerStatusBar() { return statusbar_timer_label_; }
67  QLabel* getImageStatusBar() {
68  return model_viewer_widget_->statusbar_status_label;
69  }
70 
71 private:
73  friend class BundleAdjustmentWidget;
75 
76  void CreateWidgets();
77  void CreateActions();
78  void CreateMenus();
79  void CreateToolbar();
80  void CreateStatusbar();
81  void CreateControllers();
82 
83  void ProjectNew();
84  bool ProjectOpen();
85  void ProjectEdit();
86  void ProjectSave();
87  void ProjectSaveAs();
88  void Import();
89  void ImportFrom();
90  void Export();
91  void ExportAll();
92  void ExportAs();
93  void ExportAsText();
94 
95  void FeatureExtraction();
96  void FeatureMatching();
97  void DatabaseManagement();
98 
99  void AutomaticReconstruction();
100 
101  void ReconstructionStart();
102  void ReconstructionStep();
103  void ReconstructionPause();
104  void ReconstructionReset();
105  void ReconstructionOptions();
106  void ReconstructionFinish();
107  void ReconstructionNormalize();
108  bool ReconstructionOverwrite();
109 
110  void BundleAdjustment();
111  void DenseReconstruction();
112 
113  void Render();
114  void RenderNow();
115  void RenderToggle();
116  void RenderOptions();
117  void RenderSelectedReconstruction();
118  void RenderClear();
119 
120  void SelectReconstructionIdx(const std::size_t);
121  std::size_t SelectedReconstructionIdx();
122  bool HasSelectedReconstruction();
123  bool IsSelectedReconstructionValid();
124 
125  void GrabImage();
126  void UndistortImages();
127 
128  void ReconstructionStats();
129  void MatchMatrix();
130  void ExtractColors();
131 
132  void SetOptions();
133  void ResetOptions();
134 
135  void ShowInvalidProjectError();
136  void UpdateTimer();
137 
138  void EnableBlockingActions();
139  void DisableBlockingActions();
140 
141  MainWindow* app_;
142 
143  OptionManager options_;
144 
145  colmap::ReconstructionManager reconstruction_manager_;
146  std::unique_ptr<IncrementalMapperController> mapper_controller_;
147 
148  colmap::Timer timer_;
149 
150  ModelViewerWidget* model_viewer_widget_;
151  ProjectWidget* project_widget_;
152  FeatureExtractionWidget* feature_extraction_widget_;
153  FeatureMatchingWidget* feature_matching_widget_;
154  DatabaseManagementWidget* database_management_widget_;
155  AutomaticReconstructionWidget* automatic_reconstruction_widget_;
156  ReconstructionOptionsWidget* reconstruction_options_widget_;
157  BundleAdjustmentWidget* bundle_adjustment_widget_;
158  DenseReconstructionWidget* dense_reconstruction_widget_;
159  RenderOptionsWidget* render_options_widget_;
160  LogWidget* log_widget_;
161  UndistortionWidget* undistortion_widget_;
162  ReconstructionManagerWidget* reconstruction_manager_widget_;
163  ReconstructionStatsWidget* reconstruction_stats_widget_;
164  MatchMatrixWidget* match_matrix_widget_;
165  ThreadControlWidget* thread_control_widget_;
166 
167  QToolBar* reconstruction_toolbar_;
168 
169  QDockWidget* dock_log_widget_;
170 
171  QTimer* statusbar_timer_;
172  QLabel* statusbar_timer_label_;
173 
174  QAction* action_project_new_;
175  QAction* action_project_open_;
176  QAction* action_project_edit_;
177  QAction* action_project_save_;
178  QAction* action_project_save_as_;
179  QAction* action_import_;
180  QAction* action_import_from_;
181  QAction* action_export_;
182  QAction* action_export_all_;
183  QAction* action_export_as_;
184  QAction* action_export_as_text_;
185  QAction* action_quit_;
186 
187  QAction* action_feature_extraction_;
188  QAction* action_feature_matching_;
189  QAction* action_database_management_;
190 
191  QAction* action_automatic_reconstruction_;
192 
193  QAction* action_reconstruction_start_;
194  QAction* action_reconstruction_step_;
195  QAction* action_reconstruction_pause_;
196  QAction* action_reconstruction_reset_;
197  QAction* action_reconstruction_finish_;
198  QAction* action_reconstruction_normalize_;
199  QAction* action_reconstruction_options_;
200 
201  QAction* action_bundle_adjustment_;
202  QAction* action_dense_reconstruction_;
203 
204  QAction* action_render_;
205  QAction* action_render_now_;
206  QAction* action_render_toggle_;
207  QAction* action_render_reset_view_;
208  QAction* action_render_options_;
209 
210  QAction* action_reconstruction_stats_;
211  QAction* action_match_matrix_;
212  QAction* action_log_show_;
213  QAction* action_grab_image_;
214  QAction* action_grab_movie_;
215  QAction* action_undistort_;
216  QAction* action_extract_colors_;
217  QAction* action_set_options_;
218  QAction* action_reset_options_;
219 
220  std::vector<QAction*> blocking_actions_;
221  std::vector<QMenu*> menus_list_;
222  std::vector<QToolBar*> toolbar_list_;
223 };
224 
225 } // namespace cloudViewer
void ImportReconstruction(const std::string &path)
std::vector< QMenu * > & getReconstructionMenus()
std::vector< QToolBar * > & getReconstructionToolbars()
static const std::string path
Definition: PointCloud.cpp:59
Generic file read and write utility for python interface.
colmap::IncrementalMapperOptions IncrementalMapperOptions
colmap::RenderOptions RenderOptions
colmap::OptionManager OptionManager
colmap::IncrementalMapperController IncrementalMapperController