ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ThreadControlWidget.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 namespace colmap {
14 class Thread;
15 }
16 
17 namespace cloudViewer {
18 
19 class ThreadControlWidget : public QWidget {
20 public:
21  explicit ThreadControlWidget(QWidget* parent);
22 
23  void StartThread(const QString& progress_text,
24  const bool stoppable,
25  colmap::Thread* thread);
26  void StartFunction(const QString& progress_text,
27  const std::function<void()>& func);
28 
29 private:
30  QProgressDialog* progress_bar_;
31  QAction* destructor_;
32  std::unique_ptr<colmap::Thread> thread_;
33 };
34 
35 } // namespace cloudViewer
void StartThread(const QString &progress_text, const bool stoppable, colmap::Thread *thread)
void StartFunction(const QString &progress_text, const std::function< void()> &func)
Generic file read and write utility for python interface.