ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvProgressDialog Class Reference

Graphical progress indicator (thread-safe) More...

#include <ecvProgressDialog.h>

Inheritance diagram for ecvProgressDialog:
Collaboration diagram for ecvProgressDialog:

Signals

void scheduleRefresh ()
 Schedules a call to refresh. More...
 

Public Member Functions

 ecvProgressDialog (bool cancelButton=false, QWidget *parent=0)
 Default constructor. More...
 
virtual ~ecvProgressDialog ()
 Destructor (virtual) More...
 
virtual void update (float percent) override
 Notifies the algorithm progress. More...
 
virtual void setMethodTitle (const char *methodTitle) override
 Notifies the algorithm title. More...
 
virtual void setInfo (const char *infoStr) override
 Notifies some information about the ongoing process. More...
 
virtual bool isCancelRequested () override
 Checks if the process should be canceled. More...
 
virtual void start () override
 
virtual void stop () override
 Notifies the fact that the process has ended. More...
 
virtual void setMethodTitle (QString methodTitle)
 setMethodTitle with a QString as argument More...
 
virtual void setInfo (QString infoStr)
 setInfo with a QString as argument More...
 
- Public Member Functions inherited from cloudViewer::GenericProgressCallback
virtual ~GenericProgressCallback ()=default
 Default destructor. More...
 
virtual bool textCanBeEdited () const
 Returns whether the dialog title and info can be updated or not. More...
 

Protected Slots

void refresh ()
 Refreshes the progress. More...
 

Protected Attributes

QAtomicInt m_currentValue
 Current progress value (percent) More...
 
QAtomicInt m_lastRefreshValue
 Last displayed progress value (percent) More...
 

Detailed Description

Graphical progress indicator (thread-safe)

Implements the GenericProgressCallback interface, in order to be passed to the cloudViewer algorithms (check the cloudViewer documentation for more information about the inherited methods).

Definition at line 27 of file ecvProgressDialog.h.

Constructor & Destructor Documentation

◆ ecvProgressDialog()

ecvProgressDialog::ecvProgressDialog ( bool  cancelButton = false,
QWidget *  parent = 0 
)

Default constructor.

By default, a cancel button is always displayed on the progress interface. It is only possible to activate or deactivate this button. Sadly, the fact that this button is activated doesn't mean it will be possible to stop the ongoing process: it depends only on the client algorithm implementation.

Parameters
cancelButtonactivates or deactivates the cancel button
parentparent widget

◆ ~ecvProgressDialog()

virtual ecvProgressDialog::~ecvProgressDialog ( )
inlinevirtual

Destructor (virtual)

Definition at line 45 of file ecvProgressDialog.h.

Member Function Documentation

◆ isCancelRequested()

virtual bool ecvProgressDialog::isCancelRequested ( )
inlineoverridevirtual

Checks if the process should be canceled.

This method is called by some process from time to time to know if it should halt before its normal ending. This is a way for the client application to cancel an ongoing process (but it won't work with all algorithms). Process results may be incomplete/void. The cancel requirement mechanism must be implemented (typically a simple "cancel()" method that will be called by the client application).

Implements cloudViewer::GenericProgressCallback.

Definition at line 55 of file ecvProgressDialog.h.

Referenced by ccCompass::estimateP21(), ccCompass::estimateStrain(), ccCompass::estimateStructureNormals(), ccDBRoot::exportImages(), and LasIOFilter::loadFile().

◆ refresh

void ecvProgressDialog::refresh ( )
protectedslot

Refreshes the progress.

Should only be called in the main Qt thread! This slot is automatically called by 'update' (in Qt::QueuedConnection mode).

◆ scheduleRefresh

void ecvProgressDialog::scheduleRefresh ( )
signal

Schedules a call to refresh.

◆ setInfo() [1/2]

◆ setInfo() [2/2]

virtual void ecvProgressDialog::setInfo ( QString  infoStr)
virtual

setInfo with a QString as argument

◆ setMethodTitle() [1/2]

◆ setMethodTitle() [2/2]

virtual void ecvProgressDialog::setMethodTitle ( QString  methodTitle)
virtual

setMethodTitle with a QString as argument

◆ start()

◆ stop()

virtual void ecvProgressDialog::stop ( )
overridevirtual

Notifies the fact that the process has ended.

Once end() is called, the progress bar and other informations could be hidden (for example).

Implements cloudViewer::GenericProgressCallback.

Referenced by ccCompass::estimateStructureNormals(), ccDBRoot::exportImages(), and StereogramWidget::init().

◆ update()

virtual void ecvProgressDialog::update ( float  percent)
overridevirtual

Notifies the algorithm progress.

The notification is sent by the running algorithm (on the library side). This virtual method shouldn't be called too often, as the real process behind it is unspecified and may be time consuming. Ideally it shouldn't be called more than a few hundreds time.

Parameters
percentcurrent progress, between 0.0 and 100.0

Implements cloudViewer::GenericProgressCallback.

Referenced by qVoxFallProcess::Compute(), ccCompass::estimateP21(), ccCompass::estimateStrain(), and ccCompass::estimateStructureNormals().

Member Data Documentation

◆ m_currentValue

QAtomicInt ecvProgressDialog::m_currentValue
protected

Current progress value (percent)

Definition at line 80 of file ecvProgressDialog.h.

◆ m_lastRefreshValue

QAtomicInt ecvProgressDialog::m_lastRefreshValue
protected

Last displayed progress value (percent)

Definition at line 83 of file ecvProgressDialog.h.


The documentation for this class was generated from the following file: