MeshLib C++ Docs
Loading...
Searching...
No Matches
MRProgressBar.h
Go to the documentation of this file.
1#pragma once
2
3#include "exports.h"
4#include <functional>
5#include <string>
6
7namespace MR
8{
11
12
14namespace ProgressBar
15{
16
18using TaskWithMainThreadPostProcessing = std::function< std::function<void()>() >;
19
21MRVIEWER_API void setup();
22
24MRVIEWER_API void onFrameEnd();
25
29MRVIEWER_API void order(const char * name, const std::function<void()>& task, int taskCount = 1 );
30
34MRVIEWER_API void orderWithMainThreadPostProcessing( const char* name, TaskWithMainThreadPostProcessing task, int taskCount = 1 );
35
39MRVIEWER_API void orderWithManualFinish( const char * name, std::function<void ()> task, int taskCount = 1 );
40
41MRVIEWER_API bool isCanceled();
42
43MRVIEWER_API bool isFinished();
44
45MRVIEWER_API float getProgress();
46
48MRVIEWER_API float getLastOperationTime();
49
51MRVIEWER_API const std::string& getLastOperationTitle();
52
53MRVIEWER_API void nextTask();
54MRVIEWER_API void nextTask(const char * s);
55
56MRVIEWER_API void setTaskCount( int n );
57
59MRVIEWER_API void forceSetTaskName( std::string taskName );
60MRVIEWER_API void resetTaskName();
61
62MRVIEWER_API void finish();
63
65MRVIEWER_API bool isOrdered();
66
70MRVIEWER_API bool setProgress( float p );
71
75MRVIEWER_API bool callBackSetProgress( float p );
76
80MRVIEWER_API bool simpleCallBackSetProgress( float p );
81
84MRVIEWER_API void printTimingTree( double minTimeSec = 0.1 );
85
86}
87
88}
bool isOrdered()
returns true if progress bar was ordered and not finished
std::function< std::function< void()>() > TaskWithMainThreadPostProcessing
function that returns post-processing function to be called in main UI thread
Definition MRProgressBar.h:18
void order(const char *name, const std::function< void()> &task, int taskCount=1)
void resetTaskName()
void forceSetTaskName(std::string taskName)
set the current task's name without auto-updating progress value
void setup()
this function should be called only once for each frame (it is called in MR::Menu (MR::RibbonMenu))
void orderWithManualFinish(const char *name, std::function< void()> task, int taskCount=1)
float getProgress()
void printTimingTree(double minTimeSec=0.1)
bool setProgress(float p)
float getLastOperationTime()
returns time of last operation in seconds, returns -1.0f if no operation was performed
bool callBackSetProgress(float p)
void orderWithMainThreadPostProcessing(const char *name, TaskWithMainThreadPostProcessing task, int taskCount=1)
const std::string & getLastOperationTitle()
returns title of the last operation
void setTaskCount(int n)
bool simpleCallBackSetProgress(float p)
void onFrameEnd()
call this function on frame end
Utilities to show application progress bar for long operations.
Definition MRProgressBar.h:15
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8