Blender V5.0
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
11
12#include "Canvas.h"
13#include "StyleModule.h"
14
15#include "MEM_guardedalloc.h"
16
17namespace Freestyle {
18
19class Module {
20 public:
21 static void setAlwaysRefresh(bool b = true)
22 {
23 getCurrentStyleModule()->setAlwaysRefresh(b);
24 }
25
26 static void setCausal(bool b = true)
27 {
28 getCurrentStyleModule()->setCausal(b);
29 }
30
31 static void setDrawable(bool b = true)
32 {
33 getCurrentStyleModule()->setDrawable(b);
34 }
35
36 static bool getAlwaysRefresh()
37 {
38 return getCurrentStyleModule()->getAlwaysRefresh();
39 }
40
41 static bool getCausal()
42 {
43 return getCurrentStyleModule()->getCausal();
44 }
45
46 static bool getDrawable()
47 {
48 return getCurrentStyleModule()->getDrawable();
49 }
50
51 private:
52 static StyleModule *getCurrentStyleModule()
53 {
54 Canvas *canvas = Canvas::getInstance();
55 return canvas->getCurrentStyleModule();
56 }
57
58 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Module")
59};
60
61} /* 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:55
StyleModule * getCurrentStyleModule()
Definition Canvas.h:189
static void setDrawable(bool b=true)
Definition Module.h:31
static void setAlwaysRefresh(bool b=true)
Definition Module.h:21
static void setCausal(bool b=true)
Definition Module.h:26
static bool getDrawable()
Definition Module.h:46
static bool getCausal()
Definition Module.h:41
static bool getAlwaysRefresh()
Definition Module.h:36
inherits from class Rep
Definition AppCanvas.cpp:20