Blender  V2.93
RenderMonitor.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 "render_types.h"
25 
26 #ifdef WITH_CXX_GUARDEDALLOC
27 # include "MEM_guardedalloc.h"
28 #endif
29 
30 namespace Freestyle {
31 
33  public:
34  inline RenderMonitor(Render *re)
35  {
36  _re = re;
37  }
38 
39  virtual ~RenderMonitor()
40  {
41  }
42 
43  inline void setInfo(string info)
44  {
45  if (_re && !info.empty()) {
46  _re->i.infostr = info.c_str();
47  _re->stats_draw(_re->sdh, &_re->i);
48  _re->i.infostr = NULL;
49  }
50  }
51 
52  inline void progress(float i)
53  {
54  if (_re) {
55  _re->progress(_re->prh, i);
56  }
57  }
58 
59  inline bool testBreak()
60  {
61  return _re && _re->test_break(_re->tbh);
62  }
63 
64  protected:
66 
67 #ifdef WITH_CXX_GUARDEDALLOC
68  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:RenderMonitor")
69 #endif
70 };
71 
72 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
void setInfo(string info)
Definition: RenderMonitor.h:43
inherits from class Rep
Definition: AppCanvas.cpp:32
const char * infostr
Definition: RE_pipeline.h:164
void * sdh
Definition: render_types.h:140
void(* progress)(void *handle, float i)
Definition: render_types.h:141
void * prh
Definition: render_types.h:142
RenderStats i
Definition: render_types.h:149
void * tbh
Definition: render_types.h:147
void(* stats_draw)(void *handle, RenderStats *ri)
Definition: render_types.h:139
int(* test_break)(void *handle)
Definition: render_types.h:146