ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvProgressDialog.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 // Local
11 #include "CV_db.h"
12 
13 // Qt
14 #include <QAtomicInt>
15 #include <QProgressDialog>
16 #include <QTimer>
17 
18 // CV_CORE_LIB
20 
22 
28  : public QProgressDialog,
30  Q_OBJECT
31 
32 public:
34 
42  ecvProgressDialog(bool cancelButton = false, QWidget* parent = 0);
43 
45  virtual ~ecvProgressDialog() {}
46 
47  // inherited method
48  virtual void update(float percent) override;
49  inline virtual void setMethodTitle(const char* methodTitle) override {
50  setMethodTitle(QString(methodTitle));
51  }
52  inline virtual void setInfo(const char* infoStr) override {
53  setInfo(QString(infoStr));
54  }
55  inline virtual bool isCancelRequested() override { return wasCanceled(); }
56  virtual void start() override;
57  virtual void stop() override;
58 
60  virtual void setMethodTitle(QString methodTitle);
62  virtual void setInfo(QString infoStr);
63 
64 protected Q_SLOTS:
65 
67 
71  void refresh();
72 
73 signals:
74 
76  void scheduleRefresh();
77 
78 protected:
80  QAtomicInt m_currentValue;
81 
83  QAtomicInt m_lastRefreshValue;
84 };
signals
#define signals
Definition: PythonPlugin.cpp:26
GenericProgressCallback.h
cloudViewer::GenericProgressCallback::stop
virtual void stop()=0
Notifies the fact that the process has ended.
cloudViewer::GenericProgressCallback::setMethodTitle
virtual void setMethodTitle(const char *methodTitle)=0
Notifies the algorithm title.
cloudViewer::GenericProgressCallback
Definition: GenericProgressCallback.h:20
cloudViewer::GenericProgressCallback::setInfo
virtual void setInfo(const char *infoStr)=0
Notifies some information about the ongoing process.
ecvProgressDialog::isCancelRequested
virtual bool isCancelRequested() override
Checks if the process should be canceled.
Definition: ecvProgressDialog.h:55
ecvProgressDialog
Graphical progress indicator (thread-safe)
Definition: ecvProgressDialog.h:27
ecvProgressDialog::setMethodTitle
virtual void setMethodTitle(const char *methodTitle) override
Notifies the algorithm title.
Definition: ecvProgressDialog.h:49
CV_db.h
ecvProgressDialog::~ecvProgressDialog
virtual ~ecvProgressDialog()
Destructor (virtual)
Definition: ecvProgressDialog.h:45
cloudViewer::GenericProgressCallback::start
virtual void start()=0
ecvProgressDialog::m_currentValue
QAtomicInt m_currentValue
Current progress value (percent)
Definition: ecvProgressDialog.h:80
ecvProgressDialog::setInfo
virtual void setInfo(const char *infoStr) override
Notifies some information about the ongoing process.
Definition: ecvProgressDialog.h:52
ecvProgressDialog::m_lastRefreshValue
QAtomicInt m_lastRefreshValue
Last displayed progress value (percent)
Definition: ecvProgressDialog.h:83
CV_DB_LIB_API
#define CV_DB_LIB_API
Definition: CV_db.h:15
cloudViewer::GenericProgressCallback::update
virtual void update(float percent)=0
Notifies the algorithm progress.