6#include <openvdb/util/NullInterrupter.h>
17 , progressThreadId_{ std::this_thread::get_id() } {}
22 if ( cb_ && progressThreadId_ == std::this_thread::get_id() )
23 wasInterrupted_ = !cb_(
float( std::clamp( percent, 0, 100 ) ) / 100.0f );
24 return wasInterrupted_;
29 bool wasInterrupted_{
false };
31 std::thread::id progressThreadId_;
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
Definition MRVDBProgressInterrupter.h:15
bool getWasInterrupted() const
Definition MRVDBProgressInterrupter.h:26
virtual bool wasInterrupted(int percent=-1) override
Definition MRVDBProgressInterrupter.h:18
ProgressInterrupter(ProgressCallback cb)
Definition MRVDBProgressInterrupter.h:16