Blender V5.0
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
11
12#include "render_types.h"
13
14#include "MEM_guardedalloc.h"
15
16namespace Freestyle {
17
19 public:
21 {
22 _re = re;
23 }
24
25 virtual ~RenderMonitor() {}
26
27 inline void setInfo(string info)
28 {
29 if (_re && !info.empty()) {
30 _re->i.infostr = info.c_str();
31 _re->display->stats_draw(&_re->i);
32 _re->i.infostr = nullptr;
33 }
34 }
35
36 inline void progress(float i)
37 {
38 if (_re) {
39 _re->display->progress(i);
40 }
41 }
42
43 inline bool testBreak()
44 {
45 return _re && _re->display->test_break();
46 }
47
48 protected:
50
51 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:RenderMonitor")
52};
53
54} /* namespace Freestyle */
Read Guarded memory(de)allocation.
void setInfo(string info)
inherits from class Rep
Definition AppCanvas.cpp:20
i
Definition text_draw.cc:230