Tulip  6.0.0
Large graphs analysis and drawing
tlp::PluginProgress Class Referenceabstract

#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 void showStops (bool show)=0
 
virtual void showText (bool)
 
virtual ProgressState state () const =0
 
virtual void stop ()=0
 

Detailed Description

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 computation. The tlp::PluginProgress returns a tlp::ProgressState indicating what behavior the underlying system should have (see tlp::ProgressState for details)

Definition at line 83 of file PluginProgress.h.

Member Function Documentation

◆ cancel()

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.

Returns
void

◆ getError()

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.

Returns
:string A description of the encountered error, if any.

◆ isPreviewMode()

virtual bool tlp::PluginProgress::isPreviewMode ( ) const
pure virtual

The preview mode redraws the graph while applying the algorithm, making it slower.

Returns
bool Whether the preview mode is activated.

◆ progress()

virtual ProgressState tlp::PluginProgress::progress ( int  step,
int  max_step 
)
virtual

Notifies the progression of the process.

Parameters
stepThe current step number.
max_stepThe total number of steps.
Warning
For default previsualisation handling to work, be sure to call PluginProgress::progress in this method (the return value can be ignored)
Returns
tlp::ProgressState a value indicating whether the progress has been stopped, cancelled, or will continue.
See also
tlp::ProgressState

◆ setComment()

virtual void tlp::PluginProgress::setComment ( const std::string &  comment)
pure virtual

Changes the comment about the process progression.

Parameters
commentA description of what the plugin is currently doing, displayed to inform the user.
Returns
void

◆ setError()

virtual void tlp::PluginProgress::setError ( const std::string &  error)
pure virtual

Sets the message describing the error encountered during the process.

Parameters
errorThe description of the encountered error.
Returns
void

◆ setPreviewMode()

virtual void tlp::PluginProgress::setPreviewMode ( bool  drawPreview)
pure virtual

The preview mode redraws the graph while applying the algorithm, making it slower.

Parameters
drawPreviewWhether the preview should be drawn.
Returns
void

◆ setTitle()

virtual void tlp::PluginProgress::setTitle ( const std::string &  title)
pure virtual

Changes the title of that plugin progress.

Parameters
titlethe title to set
Returns
void

◆ showPreview()

virtual void tlp::PluginProgress::showPreview ( bool  showPreview)
pure virtual

This tells the progress if it can allow the user to decide if the algorithm should draw a preview or not.

Parameters
showPreviewWhether preview display can be managed or not
Returns
void

◆ showStops()

virtual void tlp::PluginProgress::showStops ( bool  show)
pure virtual

This tells the progress if it can allow the user to decide to stop or cancel the plugin execution.

Parameters
showWhether stop or cancellation can be managed or not
Returns
void

◆ showText()

virtual void tlp::PluginProgress::showText ( bool  )
inlinevirtual

This tells the progress if it has to show text indicating execution progression.

Parameters
showWhether text has to be displayed or not
Returns
void

Definition at line 161 of file PluginProgress.h.

◆ state()

virtual ProgressState tlp::PluginProgress::state ( ) const
pure virtual

Gets the current internal state of the PluginProgress.

Returns
tlp::ProgressState The current state.

◆ stop()

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.

Returns
void