Blender  V2.93
Module.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #include "Canvas.h"
25 #include "StyleModule.h"
26 
27 #ifdef WITH_CXX_GUARDEDALLOC
28 # include "MEM_guardedalloc.h"
29 #endif
30 
31 namespace Freestyle {
32 
33 class Module {
34  public:
35  static void setAlwaysRefresh(bool b = true)
36  {
37  getCurrentStyleModule()->setAlwaysRefresh(b);
38  }
39 
40  static void setCausal(bool b = true)
41  {
42  getCurrentStyleModule()->setCausal(b);
43  }
44 
45  static void setDrawable(bool b = true)
46  {
47  getCurrentStyleModule()->setDrawable(b);
48  }
49 
50  static bool getAlwaysRefresh()
51  {
52  return getCurrentStyleModule()->getAlwaysRefresh();
53  }
54 
55  static bool getCausal()
56  {
57  return getCurrentStyleModule()->getCausal();
58  }
59 
60  static bool getDrawable()
61  {
62  return getCurrentStyleModule()->getDrawable();
63  }
64 
65  private:
66  static StyleModule *getCurrentStyleModule()
67  {
68  Canvas *canvas = Canvas::getInstance();
69  return canvas->getCurrentStyleModule();
70  }
71 
72 #ifdef WITH_CXX_GUARDEDALLOC
73  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Module")
74 #endif
75 };
76 
77 } /* 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:69
StyleModule * getCurrentStyleModule()
Definition: Canvas.h:203
static void setDrawable(bool b=true)
Definition: Module.h:45
static void setAlwaysRefresh(bool b=true)
Definition: Module.h:35
static void setCausal(bool b=true)
Definition: Module.h:40
static bool getDrawable()
Definition: Module.h:60
static bool getCausal()
Definition: Module.h:55
static bool getAlwaysRefresh()
Definition: Module.h:50
bool getAlwaysRefresh() const
Definition: StyleModule.h:108
void setCausal(bool b=true)
Definition: StyleModule.h:144
bool getDrawable() const
Definition: StyleModule.h:118
void setAlwaysRefresh(bool b=true)
Definition: StyleModule.h:139
void setDrawable(bool b=true)
Definition: StyleModule.h:149
bool getCausal() const
Definition: StyleModule.h:113
inherits from class Rep
Definition: AppCanvas.cpp:32