Blender  V3.3
ProgressBar.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include <string>
11 
12 #ifdef WITH_CXX_GUARDEDALLOC
13 # include "MEM_guardedalloc.h"
14 #endif
15 
16 using namespace std;
17 
18 namespace Freestyle {
19 
20 class ProgressBar {
21  public:
22  inline ProgressBar()
23  {
24  _numtotalsteps = 0;
25  _progress = 0;
26  }
27 
28  virtual ~ProgressBar()
29  {
30  }
31 
32  virtual void reset()
33  {
34  _numtotalsteps = 0;
35  _progress = 0;
36  }
37 
38  virtual void setTotalSteps(unsigned n)
39  {
40  _numtotalsteps = n;
41  }
42 
43  virtual void setProgress(unsigned i)
44  {
45  _progress = i;
46  }
47 
48  virtual void setLabelText(const string &s)
49  {
50  _label = s;
51  }
52 
54  inline unsigned int getTotalSteps() const
55  {
56  return _numtotalsteps;
57  }
58 
59  inline unsigned int getProgress() const
60  {
61  return _progress;
62  }
63 
64  inline string getLabelText() const
65  {
66  return _label;
67  }
68 
69  protected:
70  unsigned _numtotalsteps;
71  unsigned _progress;
72  string _label;
73 
74 #ifdef WITH_CXX_GUARDEDALLOC
75  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:ProgressBar")
76 #endif
77 };
78 
79 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
virtual void setLabelText(const string &s)
Definition: ProgressBar.h:48
string getLabelText() const
Definition: ProgressBar.h:64
virtual void setProgress(unsigned i)
Definition: ProgressBar.h:43
virtual void reset()
Definition: ProgressBar.h:32
unsigned int getProgress() const
Definition: ProgressBar.h:59
unsigned int getTotalSteps() const
Definition: ProgressBar.h:54
virtual void setTotalSteps(unsigned n)
Definition: ProgressBar.h:38
inherits from class Rep
Definition: AppCanvas.cpp:18