22#include <xatlas/xatlas.h>
24namespace lagrange::xatlas::internal {
39 std::function<
void(
const std::string&,
float)> notification_func,
40 const std::atomic_bool* cancel)
noexcept;
43 void install(::xatlas::Atlas* atlas)
noexcept;
52 static bool progress_thunk(::xatlas::ProgressCategory category,
int progress,
void* user_data);
54 std::function<void(
const std::string&,
float)> m_notification_func;
55 const std::atomic_bool* m_cancel;
56 std::atomic_bool m_was_cancelled{
false};
58 static constexpr size_t kNumCategories = 4;
59 std::array<int, kNumCategories> m_last_progress;
61 std::mutex m_callback_mutex;
62 std::exception_ptr m_pending_exception;
void rethrow_if_pending()
Rethrow any exception captured from the user notification callback.
Definition progress_bridge.cpp:62
void install(::xatlas::Atlas *atlas) noexcept
Install on an atlas (no-op if both members are null).
Definition progress_bridge.cpp:55
bool was_cancelled() const noexcept
True if the user requested cancellation, or the bridge cancelled due to a user exception.
Definition progress_bridge.h:46