MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::ProgressBar Namespace Reference

Typedefs

using TaskWithMainThreadPostProcessing = std::function< std::function<void()>() >
 function that returns post-processing function to be called in main UI thread
 

Functions

MRVIEWER_API void setup (float scaling)
 this function should be called only once for each frame (it is called in MR::Menu (MR::RibbonMenu))
 
MRVIEWER_API void onFrameEnd ()
 call this function on frame end
 
MRVIEWER_API void order (const char *name, const std::function< void()> &task, int taskCount=1)
 
MRVIEWER_API void orderWithMainThreadPostProcessing (const char *name, TaskWithMainThreadPostProcessing task, int taskCount=1)
 
MRVIEWER_API void orderWithManualFinish (const char *name, std::function< void()> task, int taskCount=1)
 
MRVIEWER_API bool isCanceled ()
 
MRVIEWER_API bool isFinished ()
 
MRVIEWER_API float getProgress ()
 
MRVIEWER_API float getLastOperationTime ()
 returns time of last operation in seconds, returns -1.0f if no operation was performed
 
MRVIEWER_API const std::string & getLastOperationTitle ()
 returns title of the last operation
 
MRVIEWER_API bool setProgress (float p)
 sets the current progress and returns false if the user has pressed Cancel button
 
MRVIEWER_API void nextTask ()
 
MRVIEWER_API void nextTask (const char *s)
 
MRVIEWER_API void setTaskCount (int n)
 
MRVIEWER_API void forceSetTaskName (std::string taskName)
 set the current task's name without auto-updating progress value
 
MRVIEWER_API void resetTaskName ()
 
MRVIEWER_API void finish ()
 
MRVIEWER_API bool isOrdered ()
 returns true if progress bar was ordered and not finished
 
MRVIEWER_API bool callBackSetProgress (float p)
 these callbacks allow canceling
 
MRVIEWER_API bool simpleCallBackSetProgress (float p)
 these callbacks do not allow canceling
 
MRVIEWER_API void printTimingTree (double minTimeSec=0.1)
 

Typedef Documentation

◆ TaskWithMainThreadPostProcessing

using MR::ProgressBar::TaskWithMainThreadPostProcessing = std::function< std::function<void()>() >

function that returns post-processing function to be called in main UI thread

Function Documentation

◆ callBackSetProgress()

MRVIEWER_API bool MR::ProgressBar::callBackSetProgress ( float p)

these callbacks allow canceling

◆ finish()

MRVIEWER_API void MR::ProgressBar::finish ( )

◆ forceSetTaskName()

MRVIEWER_API void MR::ProgressBar::forceSetTaskName ( std::string taskName)

set the current task's name without auto-updating progress value

◆ getLastOperationTime()

MRVIEWER_API float MR::ProgressBar::getLastOperationTime ( )

returns time of last operation in seconds, returns -1.0f if no operation was performed

◆ getLastOperationTitle()

MRVIEWER_API const std::string & MR::ProgressBar::getLastOperationTitle ( )

returns title of the last operation

◆ getProgress()

MRVIEWER_API float MR::ProgressBar::getProgress ( )

◆ isCanceled()

MRVIEWER_API bool MR::ProgressBar::isCanceled ( )

◆ isFinished()

MRVIEWER_API bool MR::ProgressBar::isFinished ( )

◆ isOrdered()

MRVIEWER_API bool MR::ProgressBar::isOrdered ( )

returns true if progress bar was ordered and not finished

◆ nextTask() [1/2]

MRVIEWER_API void MR::ProgressBar::nextTask ( )

◆ nextTask() [2/2]

MRVIEWER_API void MR::ProgressBar::nextTask ( const char * s)

◆ onFrameEnd()

MRVIEWER_API void MR::ProgressBar::onFrameEnd ( )

call this function on frame end

◆ order()

MRVIEWER_API void MR::ProgressBar::order ( const char * name,
const std::function< void()> & task,
int taskCount = 1 )

this shall be called in order to start concurrent task execution with progress bar display please call setup() first, otherwise this function just execute task directly

◆ orderWithMainThreadPostProcessing()

MRVIEWER_API void MR::ProgressBar::orderWithMainThreadPostProcessing ( const char * name,
TaskWithMainThreadPostProcessing task,
int taskCount = 1 )

in this version the task returns a function to be executed in main thread please call setup() first, otherwise this function just execute task directly

◆ orderWithManualFinish()

MRVIEWER_API void MR::ProgressBar::orderWithManualFinish ( const char * name,
std::function< void()> task,
int taskCount = 1 )

the task is spawned by the progress bar but the finish method is called from a callback please call setup() first, otherwise this function just execute task directly

◆ printTimingTree()

MRVIEWER_API void MR::ProgressBar::printTimingTree ( double minTimeSec = 0.1)

prints time tree of progress bar thread

Parameters
minTimeSecomit printing records with time spent less than given value in seconds

◆ resetTaskName()

MRVIEWER_API void MR::ProgressBar::resetTaskName ( )

◆ setProgress()

MRVIEWER_API bool MR::ProgressBar::setProgress ( float p)

sets the current progress and returns false if the user has pressed Cancel button

◆ setTaskCount()

MRVIEWER_API void MR::ProgressBar::setTaskCount ( int n)

◆ setup()

MRVIEWER_API void MR::ProgressBar::setup ( float scaling)

this function should be called only once for each frame (it is called in MR::Menu (MR::RibbonMenu))

◆ simpleCallBackSetProgress()

MRVIEWER_API bool MR::ProgressBar::simpleCallBackSetProgress ( float p)

these callbacks do not allow canceling