Tulip
4.6.0
Better Visualization Through Research
|
#include <PluginProgress.h>
Public Member Functions | |
virtual void | cancel ()=0 |
virtual std::string | getError ()=0 |
virtual bool | isPreviewMode () const =0 |
virtual ProgressState | progress (int step, int max_step) |
virtual void | setComment (const std::string &comment)=0 |
virtual void | setError (const std::string &error)=0 |
void | setPreviewHandler (ProgressPreviewHandler *) |
virtual void | setPreviewMode (bool drawPreview)=0 |
virtual void | setTitle (const std::string &title)=0 |
virtual void | showPreview (bool showPreview)=0 |
virtual ProgressState | state () const =0 |
virtual void | stop ()=0 |
PluginProcess subclasses are meant to notify about the progress state of some process (typically a plugin)
PluginProgress are mainly used alongside with tlp::Plugin instances to give user a visual feedback about the progress of the plugin. Every plugin in tulip got a pluginProgress member they can call to give progress feedbacks. When running, the plugin should make a call to tlp::PluginProgress::progress() indicating the current state of the compuation. The tlp::PluginProgress returns a tlp::ProgressState indicating what behavior the underleying system should have (see tlp::ProgressState for details)
Definition at line 74 of file PluginProgress.h.
virtual void tlp::PluginProgress::cancel | ( | ) | [pure 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.
virtual std::string tlp::PluginProgress::getError | ( | ) | [pure virtual] |
Returns a message describing the error encountered during the process. If no error has been encountered, an empty string is returned.
virtual bool tlp::PluginProgress::isPreviewMode | ( | ) | const [pure virtual] |
The preview mode redraws the graph while applying the algorithm, making it slower.
virtual ProgressState tlp::PluginProgress::progress | ( | int | step, |
int | max_step | ||
) | [virtual] |
Notifies the progression of the process.
step | The current step number. |
max_step | The total number of steps. |
*
virtual void tlp::PluginProgress::setComment | ( | const std::string & | comment | ) | [pure virtual] |
Changes the comment about the process progression.
comment | A description of what the plugin is currently doing, displayed to inform the user. |
virtual void tlp::PluginProgress::setError | ( | const std::string & | error | ) | [pure virtual] |
Sets the message describing the error encountered during the process.
error | The description of the encountered error. |
virtual void tlp::PluginProgress::setPreviewMode | ( | bool | drawPreview | ) | [pure virtual] |
The preview mode redraws the graph while applying the algorithm, making it slower.
drawPreview | Whether the preview should be drawn. |
virtual void tlp::PluginProgress::setTitle | ( | const std::string & | title | ) | [pure virtual] |
Changes the title of that plugin progress.
title | the title to set |
virtual void tlp::PluginProgress::showPreview | ( | bool | showPreview | ) | [pure 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.
showPreview | Whether the progress widget should contain a preview checkbox or not. |
virtual ProgressState tlp::PluginProgress::state | ( | ) | const [pure virtual] |
Gets the current internal state of the PluginProgress.
virtual void tlp::PluginProgress::stop | ( | ) | [pure 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.