Blender V4.3
Module.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 "Canvas.h"
13#include "StyleModule.h"
14
15#ifdef WITH_CXX_GUARDEDALLOC
16# include "MEM_guardedalloc.h"
17#endif
18
19namespace Freestyle {
20
21class Module {
22 public:
23 static void setAlwaysRefresh(bool b = true)
24 {
25 getCurrentStyleModule()->setAlwaysRefresh(b);
26 }
27
28 static void setCausal(bool b = true)
29 {
30 getCurrentStyleModule()->setCausal(b);
31 }
32
33 static void setDrawable(bool b = true)
34 {
35 getCurrentStyleModule()->setDrawable(b);
36 }
37
38 static bool getAlwaysRefresh()
39 {
40 return getCurrentStyleModule()->getAlwaysRefresh();
41 }
42
43 static bool getCausal()
44 {
45 return getCurrentStyleModule()->getCausal();
46 }
47
48 static bool getDrawable()
49 {
50 return getCurrentStyleModule()->getDrawable();
51 }
52
53 private:
54 static StyleModule *getCurrentStyleModule()
55 {
56 Canvas *canvas = Canvas::getInstance();
57 return canvas->getCurrentStyleModule();
58 }
59
60#ifdef WITH_CXX_GUARDEDALLOC
61 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Module")
62#endif
63};
64
65} /* namespace Freestyle */
Class to define a canvas designed to draw style modules.
Read Guarded memory(de)allocation.
Class representing a style module.
static Canvas * getInstance()
Definition Canvas.h:57
StyleModule * getCurrentStyleModule()
Definition Canvas.h:191
static void setDrawable(bool b=true)
Definition Module.h:33
static void setAlwaysRefresh(bool b=true)
Definition Module.h:23
static void setCausal(bool b=true)
Definition Module.h:28
static bool getDrawable()
Definition Module.h:48
static bool getCausal()
Definition Module.h:43
static bool getAlwaysRefresh()
Definition Module.h:38
bool getAlwaysRefresh() const
Definition StyleModule.h:95
void setCausal(bool b=true)
bool getDrawable() const
void setAlwaysRefresh(bool b=true)
void setDrawable(bool b=true)
local_group_size(16, 16) .push_constant(Type b
inherits from class Rep
Definition AppCanvas.cpp:20