Developer Documentation
ProcessInterface Class Reference

Interface class for Thread handling. More...

#include <OpenFlipper/BasePlugin/ProcessInterface.hh>

Inheritance diagram for ProcessInterface:
DecimaterPlugin IsotropicRemesherPlugin RemesherPlugin

Signals

virtual void startJob (QString _jobId, QString _description, int _min, int _max, bool _blocking=false)
 announce a new job More...
 

Public Member Functions

virtual ~ProcessInterface ()
 Destructor.
 
virtual void setJobState (QString _jobId, int _value)
 update job state More...
 
virtual void setJobName (QString _jobId, QString _name)
 update job's name More...
 
virtual void setJobDescription (QString _jobId, QString _text)
 update job's description text More...
 
virtual void cancelJob (QString _jobId)
 Cancel your job. More...
 
virtual void finishJob (QString _jobId)
 Finish your job. More...
 

Private Slots

virtual void canceledJob (QString _job)
 A job has been canceled. More...
 

Detailed Description

Interface class for Thread handling.

Detailed description
This Interface is used to handle threads in OpenFlipper. You can run arbitrary slots within separate threads.

Definition at line 75 of file ProcessInterface.hh.

Member Function Documentation

virtual void ProcessInterface::canceledJob ( QString  _job)
inlineprivatevirtualslot

A job has been canceled.

This function is called when the user cancels a job. The returned name is the name of the job which has been canceled

Parameters
_jobString which is used as the id of the thread

Reimplemented in DecimaterPlugin.

Definition at line 152 of file ProcessInterface.hh.

virtual void ProcessInterface::cancelJob ( QString  _jobId)
inlinevirtual

Cancel your job.

Parameters
_jobIdString which is used as the id of the thread

Definition at line 132 of file ProcessInterface.hh.

virtual void ProcessInterface::finishJob ( QString  _jobId)
inlinevirtual

Finish your job.

This signal has to be emitted when your job has finished. You can directly connect the threads finished signal to this signal.

Parameters
_jobIdString which is used as the id of the thread

Definition at line 141 of file ProcessInterface.hh.

virtual void ProcessInterface::setJobDescription ( QString  _jobId,
QString  _text 
)
inlinevirtual

update job's description text

Emit this signal to tell the core to change a job's widget's description.

Parameters
_jobIdString which is used as the id of the thread
_textThe text of the job's description

Definition at line 126 of file ProcessInterface.hh.

virtual void ProcessInterface::setJobName ( QString  _jobId,
QString  _name 
)
inlinevirtual

update job's name

Emit this signal to tell the core to change a job's name.

Parameters
_jobIdString which is used as the id of the thread
_nameThe new name of the job

Definition at line 117 of file ProcessInterface.hh.

virtual void ProcessInterface::setJobState ( QString  _jobId,
int  _value 
)
inlinevirtual

update job state

Emit this signal to tell the core about your job status.

Parameters
_jobIdString which is used as the id of the thread
_valueThe status value has to be in the range you defined in ProcessInterface::startJob()

Definition at line 108 of file ProcessInterface.hh.

virtual void ProcessInterface::startJob ( QString  _jobId,
QString  _description,
int  _min,
int  _max,
bool  _blocking = false 
)
inlinevirtualsignal

announce a new job

Use this function to announce a new job. The Job Id should be a unique id for your job. Prepend your PluginName to your id to make it unique across plugins.

The range between _min and _max will be used to compute the progress percentage based on the ProcessInterface::setJobState() values provided by the thread. You could for example set it to the number of steps performed in your algorithm.

Parameters
_jobIdString which is used as the id of the thread
_descriptionThe description will be the string visible to the user.
_minminimum of the status value range
_maxmaximum of the status range
_blockingIf the thread is blocking, no other interaction will be allowed

Definition at line 99 of file ProcessInterface.hh.


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