Blender  V3.3
Module.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "Canvas.h"
11 #include "StyleModule.h"
12 
13 #ifdef WITH_CXX_GUARDEDALLOC
14 # include "MEM_guardedalloc.h"
15 #endif
16 
17 namespace Freestyle {
18 
19 class 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 #ifdef WITH_CXX_GUARDEDALLOC
59  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Module")
60 #endif
61 };
62 
63 } /* 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
bool getAlwaysRefresh() const
Definition: StyleModule.h:94
void setCausal(bool b=true)
Definition: StyleModule.h:130
bool getDrawable() const
Definition: StyleModule.h:104
void setAlwaysRefresh(bool b=true)
Definition: StyleModule.h:125
void setDrawable(bool b=true)
Definition: StyleModule.h:135
bool getCausal() const
Definition: StyleModule.h:99
inherits from class Rep
Definition: AppCanvas.cpp:18
static const pxr::TfToken b("b", pxr::TfToken::Immortal)