Blender  V2.93
ProgressBar.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #include <string>
25 
26 #ifdef WITH_CXX_GUARDEDALLOC
27 # include "MEM_guardedalloc.h"
28 #endif
29 
30 using namespace std;
31 
32 namespace Freestyle {
33 
34 class ProgressBar {
35  public:
36  inline ProgressBar()
37  {
38  _numtotalsteps = 0;
39  _progress = 0;
40  }
41 
42  virtual ~ProgressBar()
43  {
44  }
45 
46  virtual void reset()
47  {
48  _numtotalsteps = 0;
49  _progress = 0;
50  }
51 
52  virtual void setTotalSteps(unsigned n)
53  {
54  _numtotalsteps = n;
55  }
56 
57  virtual void setProgress(unsigned i)
58  {
59  _progress = i;
60  }
61 
62  virtual void setLabelText(const string &s)
63  {
64  _label = s;
65  }
66 
68  inline unsigned int getTotalSteps() const
69  {
70  return _numtotalsteps;
71  }
72 
73  inline unsigned int getProgress() const
74  {
75  return _progress;
76  }
77 
78  inline string getLabelText() const
79  {
80  return _label;
81  }
82 
83  protected:
84  unsigned _numtotalsteps;
85  unsigned _progress;
86  string _label;
87 
88 #ifdef WITH_CXX_GUARDEDALLOC
89  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:ProgressBar")
90 #endif
91 };
92 
93 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
virtual void setLabelText(const string &s)
Definition: ProgressBar.h:62
string getLabelText() const
Definition: ProgressBar.h:78
virtual void setProgress(unsigned i)
Definition: ProgressBar.h:57
virtual void reset()
Definition: ProgressBar.h:46
unsigned int getProgress() const
Definition: ProgressBar.h:73
unsigned int getTotalSteps() const
Definition: ProgressBar.h:68
virtual void setTotalSteps(unsigned n)
Definition: ProgressBar.h:52
inherits from class Rep
Definition: AppCanvas.cpp:32