ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ProjectWidget.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 <QtWidgets>
12 
13 #include "util/misc.h"
14 #include "util/option_manager.h"
15 
16 namespace cloudViewer {
17 
19 
20 class ProjectWidget : public QWidget {
21 public:
22  ProjectWidget(QWidget* parent, OptionManager* options);
23 
24  bool IsValid() const;
25  void Reset();
26 
27  void persistSave(const std::string& project_path,
28  const std::string& database_path,
29  const std::string& image_path);
30 
31  std::string GetDatabasePath() const;
32  std::string GetImagePath() const;
33  void SetDatabasePath(const std::string& path);
34  void SetImagePath(const std::string& path);
35 
36 private:
37  void Save();
38  void SelectNewDatabasePath();
39  void SelectExistingDatabasePath();
40  void SelectImagePath();
41  QString DefaultDirectory();
42 
43  OptionManager* options_;
44 
45  // Whether file dialog was opened previously.
46  bool prev_selected_;
47 
48  // Text boxes that hold the currently selected paths.
49  QLineEdit* database_path_text_;
50  QLineEdit* image_path_text_;
51 };
52 
53 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
colmap::OptionManager::image_path
std::shared_ptr< std::string > image_path
Definition: option_manager.h:100
cloudViewer::ProjectWidget::ProjectWidget
ProjectWidget(QWidget *parent, OptionManager *options)
Definition: ProjectWidget.cpp:20
ProjectWidget.h
option_manager.h
colmap::OptionManager
Definition: option_manager.h:38
colmap::ProjectWidget::ProjectWidget
ProjectWidget(QWidget *parent, OptionManager *options)
Definition: project_widget.cc:38
cloudViewer::OptionManager
colmap::OptionManager OptionManager
Definition: BundleAdjustmentWidget.h:19
colmap::Database
Definition: database.h:29
cloudViewer::utility::filesystem::HasFileExtension
bool HasFileExtension(const std::string &file_name, const std::string &ext)
Definition: FileSystem.cpp:117
cloudViewer::ProjectWidget::Reset
void Reset()
Definition: ProjectWidget.cpp:67
cloudViewer::t::geometry::path
static const std::string path
Definition: PointCloud.cpp:59
misc.h
database.h
cloudViewer::ProjectWidget::SetImagePath
void SetImagePath(const std::string &path)
Definition: ProjectWidget.cpp:95
cloudViewer::ProjectWidget::GetDatabasePath
std::string GetDatabasePath() const
Definition: ProjectWidget.cpp:83
cloudViewer::ProjectWidget
Definition: ProjectWidget.h:20
colmap::ExistsDir
bool ExistsDir(const std::string &path)
Definition: misc.cc:104
colmap::OptionManager::project_path
std::shared_ptr< std::string > project_path
Definition: option_manager.h:98
colmap::OptionManager::database_path
std::shared_ptr< std::string > database_path
Definition: option_manager.h:99
CVTools.h
CVTools::ToQString
static QString ToQString(const std::string &s)
Definition: CVTools.cpp:92
colmap::GetParentDir
std::string GetParentDir(const std::string &path)
Definition: misc.cc:128
colmap
Definition: AutomaticReconstructionController.h:17
cloudViewer::ProjectWidget::IsValid
bool IsValid() const
Definition: ProjectWidget.cpp:62
cloudViewer::ProjectWidget::GetImagePath
std::string GetImagePath() const
Definition: ProjectWidget.cpp:87
cloudViewer::ProjectWidget::persistSave
void persistSave(const std::string &project_path, const std::string &database_path, const std::string &image_path)
Definition: ProjectWidget.cpp:72
cloudViewer::ProjectWidget::SetDatabasePath
void SetDatabasePath(const std::string &path)
Definition: ProjectWidget.cpp:91