18 MRVIEWER_API
static void setup(
float scaling );
23 MRVIEWER_API
static void order(
const char * name,
const std::function<
void()>& task,
int taskCount = 1 );
29 MRVIEWER_API
static void orderWithManualFinish(
const char * name, std::function<
void ()> task,
int taskCount = 1 );
46 MRVIEWER_API
static void nextTask(
const char * s);
73 bool tryRun_(
const std::function<
bool ()>& task );
74 bool tryRunWithSehHandler_(
const std::function<
bool ()>& task );
76 float lastOperationTimeSec_{ -1.0f };
77 Time operationStartTime_;
78 std::atomic<float> progress_;
79 std::atomic<int> currentTask_, taskCount_;
81 std::string taskName_, title_;
82 bool overrideTaskName_{
false };
84 FrameRedrawRequest frameRequest_;
87 std::atomic<int> percents_;
90 std::function<void()> onFinish_;
97 std::function<void ()> postInit;
99 std::unique_ptr<DeferredInit> deferredInit_;
101 std::atomic<bool> allowCancel_;
102 std::atomic<bool> canceled_;
103 std::atomic<bool> finished_;
104 ImGuiID setupId_ = ImGuiID( -1 );
106 bool isOrdered_{
false };
107 bool isInit_{
false };
109 bool closeDialogNextFrame_{
false };
Definition MRProgressBar.h:14
static MRVIEWER_API bool isFinished()
static MRVIEWER_API void nextTask(const char *s)
std::function< std::function< void()>() > TaskWithMainThreadPostProcessing
Definition MRProgressBar.h:16
static MRVIEWER_API float getLastOperationTime()
static MRVIEWER_API const std::string & getLastOperationTitle()
static MRVIEWER_API void finish()
static MRVIEWER_API void orderWithMainThreadPostProcessing(const char *name, TaskWithMainThreadPostProcessing task, int taskCount=1)
static MRVIEWER_API float getProgress()
static MRVIEWER_API void resetTaskName()
static MRVIEWER_API void forceSetTaskName(std::string taskName)
static MRVIEWER_API void onFrameEnd()
static MRVIEWER_API bool callBackSetProgress(float p)
static MRVIEWER_API bool simpleCallBackSetProgress(float p)
static MRVIEWER_API bool isCanceled()
static MRVIEWER_API void order(const char *name, const std::function< void()> &task, int taskCount=1)
static MRVIEWER_API bool isOrdered()
static MRVIEWER_API void setTaskCount(int n)
static MRVIEWER_API void nextTask()
static MRVIEWER_API void setup(float scaling)
static MRVIEWER_API void 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
static MRVIEWER_API bool setProgress(float p)
Definition MRCameraOrientationPlugin.h:8
std::chrono::time_point< std::chrono::system_clock > Time
Definition MRAsyncTimer.h:17