Blender V4.3
RenderMonitor.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include "render_types.h"
13
14#ifdef WITH_CXX_GUARDEDALLOC
15# include "MEM_guardedalloc.h"
16#endif
17
18namespace Freestyle {
19
21 public:
23 {
24 _re = re;
25 }
26
27 virtual ~RenderMonitor() {}
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->i);
34 _re->i.infostr = nullptr;
35 }
36 }
37
38 inline void progress(float i)
39 {
40 if (_re) {
41 _re->progress(i);
42 }
43 }
44
45 inline bool testBreak()
46 {
47 return _re && _re->test_break();
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)
inherits from class Rep
Definition AppCanvas.cpp:20
const char * infostr
bool test_break() override
void progress(float progress) override
RenderStats i
void stats_draw(RenderStats *render_stats) override