SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLAssimpProgressHandler.h
Go to the documentation of this file.
1 /**
2  * \file SLAssimpProgressHandler.h
3  * \authors Marcus Hudritsch
4  * \date December 2020
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef SLASSIMPPROGRESSHANDLER_H
11 #define SLASSIMPPROGRESSHANDLER_H
12 
13 #ifdef SL_BUILD_WITH_ASSIMP
14 # include <assimp/ProgressHandler.hpp>
15 # include <AppCommon.h>
16 
17 //-----------------------------------------------------------------------------
18 //!
19 class SLProgressHandler
20 {
21 public:
22  virtual bool Update(float percentage = -1.f) = 0;
23 };
24 //-----------------------------------------------------------------------------
25 //!
26 class SLAssimpProgressHandler : SLProgressHandler
27  , Assimp::ProgressHandler
28 {
29 public:
30  virtual bool Update(float percentage = -1.f)
31  {
32  if (percentage >= 0.0f && percentage <= 100.0f)
33  {
34  AppCommon::jobProgressNum((SLint)percentage);
35  return true;
36  }
37  else
38  return false;
39  }
40 };
41 //-----------------------------------------------------------------------------
42 #endif // SL_BUILD_WITH_ASSIMP
43 #endif // SLASSIMPPROGRESSHANDLER_H
The AppCommon class holds the top-level instances of the app-demo.
int SLint
Definition: SL.h:170
static int jobProgressNum()
Definition: AppCommon.h:98