Blender  V3.3
RenderMonitor.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "render_types.h"
11 
12 #ifdef WITH_CXX_GUARDEDALLOC
13 # include "MEM_guardedalloc.h"
14 #endif
15 
16 namespace Freestyle {
17 
19  public:
20  inline RenderMonitor(Render *re)
21  {
22  _re = re;
23  }
24 
25  virtual ~RenderMonitor()
26  {
27  }
28 
29  inline void setInfo(string info)
30  {
31  if (_re && !info.empty()) {
32  _re->i.infostr = info.c_str();
33  _re->stats_draw(_re->sdh, &_re->i);
34  _re->i.infostr = NULL;
35  }
36  }
37 
38  inline void progress(float i)
39  {
40  if (_re) {
41  _re->progress(_re->prh, i);
42  }
43  }
44 
45  inline bool testBreak()
46  {
47  return _re && _re->test_break(_re->tbh);
48  }
49 
50  protected:
52 
53 #ifdef WITH_CXX_GUARDEDALLOC
54  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:RenderMonitor")
55 #endif
56 };
57 
58 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
void setInfo(string info)
Definition: RenderMonitor.h:29
inherits from class Rep
Definition: AppCanvas.cpp:18
const char * infostr
Definition: RE_pipeline.h:150
void * sdh
Definition: render_types.h:109
void(* progress)(void *handle, float i)
Definition: render_types.h:110
void * prh
Definition: render_types.h:111
RenderStats i
Definition: render_types.h:118
void * tbh
Definition: render_types.h:116
void(* stats_draw)(void *handle, RenderStats *ri)
Definition: render_types.h:108
int(* test_break)(void *handle)
Definition: render_types.h:115