Basic implementation for PluginProgress interface.
More...
#include <SimplePluginProgress.h>
List of all members.
Public Member Functions
- SimplePluginProgress ()
- virtual ProgressState progress (int step, int max_step)
- Notify the progression of the process.
- virtual void cancel ()
- Sets the state flag to cancel, notifying to the process that the user wants to cancel it. Canceling a process must stop it and revert all the changes performed since its start.
- virtual void stop ()
- Sets the state flag to stop, notifying to the process that the user wants to stop it. Stopping a process does not revert changes.
- virtual bool isPreviewMode () const
- The preview mode redraws the graph while applying the algorithm, making it slower.
- virtual void setPreviewMode (bool)
- The preview mode redraws the graph while applying the algorithm, making it slower.
- virtual void showPreview (bool)
- This tells the widget if it should show a preview checkbox, allowing the user to decide if the algorithm should draw a preview or not.
- virtual ProgressState state () const
- Gets the current internal state of the PluginProgress.
- virtual std::string getError ()
- Returns a message describing the error encountered during the process. If no error has been encountered, an empty string is returned.
- virtual void setError (std::string error)
- Sets the message describing the error encountered during the process.
- virtual void setComment (std::string)
- Changes the comment about the process progression.
Protected Member Functions
Detailed Description
Basic implementation for PluginProgress interface.
Constructor & Destructor Documentation
tlp::SimplePluginProgress::SimplePluginProgress |
( |
| ) |
|
Member Function Documentation
virtual void tlp::SimplePluginProgress::cancel |
( |
| ) |
[virtual] |
Sets the state flag to cancel, notifying to the process that the user wants to cancel it. Canceling a process must stop it and revert all the changes performed since its start.
- Returns:
- void
Implements tlp::PluginProgress.
virtual std::string tlp::SimplePluginProgress::getError |
( |
| ) |
[inline, virtual] |
Returns a message describing the error encountered during the process. If no error has been encountered, an empty string is returned.
- Returns:
- :string A description of the encountered error, if any.
Implements tlp::PluginProgress.
virtual bool tlp::SimplePluginProgress::isPreviewMode |
( |
| ) |
const [virtual] |
The preview mode redraws the graph while applying the algorithm, making it slower.
- Returns:
- bool Whether the preview mode is activated.
Implements tlp::PluginProgress.
virtual void tlp::SimplePluginProgress::preview_handler |
( |
bool |
| ) |
[protected, virtual] |
virtual ProgressState tlp::SimplePluginProgress::progress |
( |
int |
step, |
|
|
int |
max_step |
|
) |
| [virtual] |
Notify the progression of the process.
- Parameters:
-
step | The current step number. |
max_step | The total number of steps. |
- Returns:
- :ProgressState a value indicating whether the progress has been stopped, cancelled, or will continue.
Implements tlp::PluginProgress.
virtual void tlp::SimplePluginProgress::progress_handler |
( |
int |
step, |
|
|
int |
max_step |
|
) |
| [protected, virtual] |
virtual void tlp::SimplePluginProgress::setComment |
( |
std::string |
comment | ) |
[inline, virtual] |
Changes the comment about the process progression.
- Parameters:
-
comment | A description of what the plugin is currently doing, displayed to inform the user. |
- Returns:
- void
Implements tlp::PluginProgress.
virtual void tlp::SimplePluginProgress::setError |
( |
std::string |
error | ) |
[inline, virtual] |
Sets the message describing the error encountered during the process.
- Parameters:
-
error | The description of the encountered error. |
- Returns:
- void
Implements tlp::PluginProgress.
virtual void tlp::SimplePluginProgress::setPreviewMode |
( |
bool |
drawPreview | ) |
[virtual] |
The preview mode redraws the graph while applying the algorithm, making it slower.
- Parameters:
-
drawPreview | Whether the preview should be drawn. |
- Returns:
- void
Implements tlp::PluginProgress.
virtual void tlp::SimplePluginProgress::showPreview |
( |
bool |
showPreview | ) |
[virtual] |
This tells the widget if it should show a preview checkbox, allowing the user to decide if the algorithm should draw a preview or not.
- Parameters:
-
showPreview | Whether the progress widget should contain a preview checkbox or not. |
- Returns:
- void
Implements tlp::PluginProgress.
virtual ProgressState tlp::SimplePluginProgress::state |
( |
| ) |
const [virtual] |
virtual void tlp::SimplePluginProgress::stop |
( |
| ) |
[virtual] |
Sets the state flag to stop, notifying to the process that the user wants to stop it. Stopping a process does not revert changes.
- Returns:
- void
Implements tlp::PluginProgress.