29 if ( cb && ( counter % divider == 0 ) )
49 if ( cb && ( counter % divider == 0 ) )
60 res = [cb = std::move( cb ), from, to](
float v ) {
return cb( std::lerp( from, to, v ) ); };
70 res = [cb = std::move( cb ), f = std::forward<F>( f )](
float v ) {
return cb( f( v ) ); };
77 assert( index < count );
79 return [cb = std::move( cb ), index, count] (
float v ) {
return cb( ( (
float)index + v ) / (
float)count ); };
87template <
typename ...Ts>
90 constexpr size_t n =
sizeof...( Ts );
91 static_assert( n > 0,
"at least one threshold is required" );
92 const std::array<float, n + 2> bounds{ 0.0f, float( thresholds )..., 1.0f };
93 return [&]<
size_t ...I>( std::index_sequence<
I...> )
95 return std::tuple{
subprogress( cb, bounds[
I], bounds[
I + 1] )... };
96 }( std::make_index_sequence<n + 1>{} );
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:751
class MRMESH_CLASS I
Definition MRMeshFwd.h:141
auto splitProgress(const ProgressCallback &cb, Ts ... thresholds)
Definition MRProgressCallback.h:88
ProgressCallback subprogress(ProgressCallback cb, float from, float to)
returns a callback that maps [0,1] linearly into [from,to] in the call to
Definition MRProgressCallback.h:55
bool reportProgress(ProgressCallback cb, float v)
safely invokes
Definition MRProgressCallback.h:18
only for bindings generation
Definition MRCameraOrientationPlugin.h:8