Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLOperationProgress Class Reference

Progress of a long operation, such as loading files. More...

#include <Libs/MRML/Logic/vtkMRMLOperationProgress.h>

Inheritance diagram for vtkMRMLOperationProgress:
Collaboration diagram for vtkMRMLOperationProgress:

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual void AbortableOff ()
 
virtual void AbortableOn ()
 
virtual void AbortExecuteOff ()
 
virtual void AbortExecuteOn ()
 
virtual bool GetAbortable ()
 
virtual bool GetAbortExecute ()
 
virtual const char * GetClassName ()
 
virtual int GetCurrentFileIndex ()
 Index of the file that is currently processed (0-based).
 
virtual double GetCurrentFileProgress ()
 
virtual double GetCurrentFileRangeMaximum ()
 
virtual double GetCurrentFileRangeMinimum ()
 Part of the overall progress range that the current file covers.
 
virtual int GetNumberOfFiles ()
 
virtual double GetProgress ()
 
virtual double GetProgressRangeMaximum ()
 
virtual double GetProgressRangeMinimum ()
 
virtual std::string GetProgressText ()
 Text that describes what is being done (translated, can be displayed to the user).
 
virtual std::string GetTitle ()
 Short description of the operation (translated, such as "Loading data"). It does not change during the operation.
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetAbortable (bool)
 
virtual void SetAbortExecute (bool)
 
virtual void SetCurrentFileIndex (int)
 
virtual void SetCurrentFileProgress (double)
 
virtual void SetCurrentFileRangeMaximum (double)
 
virtual void SetCurrentFileRangeMinimum (double)
 
virtual void SetNumberOfFiles (int)
 
virtual void SetProgress (double)
 
virtual void SetProgressRangeMaximum (double)
 
virtual void SetProgressRangeMinimum (double)
 
virtual void SetProgressText (std::string)
 
virtual void SetTitle (std::string)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkMRMLOperationProgress * New ()
 
static vtkMRMLOperationProgress * SafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkMRMLOperationProgress ()
 
 ~vtkMRMLOperationProgress () override
 

Protected Attributes

bool Abortable { false }
 
bool AbortExecute { false }
 
int CurrentFileIndex { 0 }
 
double CurrentFileProgress { -1.0 }
 
double CurrentFileRangeMaximum { 1.0 }
 
double CurrentFileRangeMinimum { 0.0 }
 
int NumberOfFiles { 1 }
 
double Progress { 0.0 }
 
double ProgressRangeMaximum { 1.0 }
 
double ProgressRangeMinimum { 0.0 }
 
std::string ProgressText
 
std::string Title
 

Detailed Description

Progress of a long operation, such as loading files.

The object that performs the operation passes this object as call data of the events that report the start, progress, and end of the operation (for example, vtkMRMLFileIOManager::OperationStartEvent, OperationProgressEvent, and OperationEndEvent). Observers can get the progress and text to display and can request aborting of the operation.

The same object is used for all events of an operation. Work that is done while an operation is in progress (for example, loading each file of a list) is part of that operation. The overall progress never decreases. ProgressEvent is invoked when the progress, the progress text, or the current file changes. The object contains a full state, which is useful if progress update events are skipped because of limits on maximum rate of progress updates. The latest state is always reported before EndEvent.

In Python, the observer must specify that the call data is a VTK object:

@vtk.calldata_type(vtk.VTK_OBJECT)
def onProgress(caller, event, progress):
if progress.GetNumberOfFiles() == 0:
print(f"In progress: {progress.GetProgressText()}") # the total amount of work is unknown
else:
print(f"{progress.GetProgress() * 100:.0f}% {progress.GetProgressText()}")
fileIOManager = slicer.app.applicationLogic().GetFileIOManager()
fileIOManager.AddObserver(fileIOManager.OperationProgressEvent, onProgress)

Definition at line 51 of file vtkMRMLOperationProgress.h.

Member Typedef Documentation

◆ Superclass

Definition at line 55 of file vtkMRMLOperationProgress.h.

Constructor & Destructor Documentation

◆ vtkMRMLOperationProgress()

vtkMRMLOperationProgress::vtkMRMLOperationProgress ( )
protected

◆ ~vtkMRMLOperationProgress()

vtkMRMLOperationProgress::~vtkMRMLOperationProgress ( )
overrideprotected

Member Function Documentation

◆ AbortableOff()

virtual void vtkMRMLOperationProgress::AbortableOff ( )
virtual

◆ AbortableOn()

virtual void vtkMRMLOperationProgress::AbortableOn ( )
virtual

◆ AbortExecuteOff()

virtual void vtkMRMLOperationProgress::AbortExecuteOff ( )
virtual

◆ AbortExecuteOn()

virtual void vtkMRMLOperationProgress::AbortExecuteOn ( )
virtual

◆ GetAbortable()

virtual bool vtkMRMLOperationProgress::GetAbortable ( )
virtual

True if the operation can be aborted (by setting AbortExecute). It is set before the operation starts and it does not change while the operation is in progress.

◆ GetAbortExecute()

virtual bool vtkMRMLOperationProgress::GetAbortExecute ( )
virtual

Observers can request aborting of the operation by setting this flag (similarly to vtkAlgorithm::AbortExecute). The operation stops at the next point where it can be stopped (for example, when loading of a file is completed). Only has effect if the operation is abortable.

◆ GetClassName()

virtual const char * vtkMRMLOperationProgress::GetClassName ( )
virtual

◆ GetCurrentFileIndex()

virtual int vtkMRMLOperationProgress::GetCurrentFileIndex ( )
virtual

Index of the file that is currently processed (0-based).

◆ GetCurrentFileProgress()

virtual double vtkMRMLOperationProgress::GetCurrentFileProgress ( )
virtual

Progress of processing the current file, in the range of 0.0-1.0. -1 means that progress of processing the current file is unknown (for example, a busy indicator can be displayed).

◆ GetCurrentFileRangeMaximum()

virtual double vtkMRMLOperationProgress::GetCurrentFileRangeMaximum ( )
virtual

◆ GetCurrentFileRangeMinimum()

virtual double vtkMRMLOperationProgress::GetCurrentFileRangeMinimum ( )
virtual

Part of the overall progress range that the current file covers.

◆ GetNumberOfFiles()

virtual int vtkMRMLOperationProgress::GetNumberOfFiles ( )
virtual

Number of files that the operation processes (for example, number of files to load or nodes to export). 0 means that the total amount of work is unknown (progress cannot be estimated, for example a busy indicator can be displayed). The number of files may change while the operation is in progress (for example, from 0 to 1 when it turns out that progress of loading the file is reported).

◆ GetProgress()

virtual double vtkMRMLOperationProgress::GetProgress ( )
virtual

Overall progress of the operation, in the range of 0.0-1.0. It is only meaningful if the number of files is not zero.

◆ GetProgressRangeMaximum()

virtual double vtkMRMLOperationProgress::GetProgressRangeMaximum ( )
virtual

◆ GetProgressRangeMinimum()

virtual double vtkMRMLOperationProgress::GetProgressRangeMinimum ( )
virtual

For internal use by the operation that reports the progress. Observers must not modify these values. Part of the overall progress range that the currently processed item covers. It is smaller than the range of the current file if lists are nested (for example, if loading a file loads a list of other files).

◆ GetProgressText()

virtual std::string vtkMRMLOperationProgress::GetProgressText ( )
virtual

Text that describes what is being done (translated, can be displayed to the user).

◆ GetTitle()

virtual std::string vtkMRMLOperationProgress::GetTitle ( )
virtual

Short description of the operation (translated, such as "Loading data"). It does not change during the operation.

◆ IsA()

virtual int vtkMRMLOperationProgress::IsA ( const char * type)
virtual

◆ IsTypeOf()

static int vtkMRMLOperationProgress::IsTypeOf ( const char * type)
static

◆ New()

static vtkMRMLOperationProgress * vtkMRMLOperationProgress::New ( )
static

◆ PrintSelf()

void vtkMRMLOperationProgress::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ SafeDownCast()

static vtkMRMLOperationProgress * vtkMRMLOperationProgress::SafeDownCast ( vtkObject * o)
static

◆ SetAbortable()

virtual void vtkMRMLOperationProgress::SetAbortable ( bool )
virtual

◆ SetAbortExecute()

virtual void vtkMRMLOperationProgress::SetAbortExecute ( bool )
virtual

◆ SetCurrentFileIndex()

virtual void vtkMRMLOperationProgress::SetCurrentFileIndex ( int )
virtual

◆ SetCurrentFileProgress()

virtual void vtkMRMLOperationProgress::SetCurrentFileProgress ( double )
virtual

◆ SetCurrentFileRangeMaximum()

virtual void vtkMRMLOperationProgress::SetCurrentFileRangeMaximum ( double )
virtual

◆ SetCurrentFileRangeMinimum()

virtual void vtkMRMLOperationProgress::SetCurrentFileRangeMinimum ( double )
virtual

◆ SetNumberOfFiles()

virtual void vtkMRMLOperationProgress::SetNumberOfFiles ( int )
virtual

◆ SetProgress()

virtual void vtkMRMLOperationProgress::SetProgress ( double )
virtual

◆ SetProgressRangeMaximum()

virtual void vtkMRMLOperationProgress::SetProgressRangeMaximum ( double )
virtual

◆ SetProgressRangeMinimum()

virtual void vtkMRMLOperationProgress::SetProgressRangeMinimum ( double )
virtual

◆ SetProgressText()

virtual void vtkMRMLOperationProgress::SetProgressText ( std::string )
virtual

◆ SetTitle()

virtual void vtkMRMLOperationProgress::SetTitle ( std::string )
virtual

Member Data Documentation

◆ Abortable

bool vtkMRMLOperationProgress::Abortable { false }
protected

Definition at line 129 of file vtkMRMLOperationProgress.h.

◆ AbortExecute

bool vtkMRMLOperationProgress::AbortExecute { false }
protected

Definition at line 130 of file vtkMRMLOperationProgress.h.

◆ CurrentFileIndex

int vtkMRMLOperationProgress::CurrentFileIndex { 0 }
protected

Definition at line 123 of file vtkMRMLOperationProgress.h.

◆ CurrentFileProgress

double vtkMRMLOperationProgress::CurrentFileProgress { -1.0 }
protected

Definition at line 124 of file vtkMRMLOperationProgress.h.

◆ CurrentFileRangeMaximum

double vtkMRMLOperationProgress::CurrentFileRangeMaximum { 1.0 }
protected

Definition at line 128 of file vtkMRMLOperationProgress.h.

◆ CurrentFileRangeMinimum

double vtkMRMLOperationProgress::CurrentFileRangeMinimum { 0.0 }
protected

Definition at line 127 of file vtkMRMLOperationProgress.h.

◆ NumberOfFiles

int vtkMRMLOperationProgress::NumberOfFiles { 1 }
protected

Definition at line 122 of file vtkMRMLOperationProgress.h.

◆ Progress

double vtkMRMLOperationProgress::Progress { 0.0 }
protected

Definition at line 119 of file vtkMRMLOperationProgress.h.

◆ ProgressRangeMaximum

double vtkMRMLOperationProgress::ProgressRangeMaximum { 1.0 }
protected

Definition at line 126 of file vtkMRMLOperationProgress.h.

◆ ProgressRangeMinimum

double vtkMRMLOperationProgress::ProgressRangeMinimum { 0.0 }
protected

Definition at line 125 of file vtkMRMLOperationProgress.h.

◆ ProgressText

std::string vtkMRMLOperationProgress::ProgressText
protected

Definition at line 121 of file vtkMRMLOperationProgress.h.

◆ Title

std::string vtkMRMLOperationProgress::Title
protected

Definition at line 120 of file vtkMRMLOperationProgress.h.


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