Blender  V3.3
BlenderStyleModule.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
9 #include "../stroke/StyleModule.h"
10 #include "../system/PythonInterpreter.h"
11 
12 #include "BLI_utildefines.h" // BLI_assert()
13 
14 struct Text;
15 
16 namespace Freestyle {
17 
19  public:
20  BufferedStyleModule(const string &buffer, const string &file_name, Interpreter *inter)
21  : StyleModule(file_name, inter)
22  {
23  _buffer = buffer;
24  }
25 
27  {
28  }
29 
30  protected:
31  virtual int interpret()
32  {
33  PythonInterpreter *py_inter = dynamic_cast<PythonInterpreter *>(_inter);
34  BLI_assert(py_inter != 0);
35  return py_inter->interpretString(_buffer, getFileName());
36  }
37 
38  private:
39  string _buffer;
40 
41 #ifdef WITH_CXX_GUARDEDALLOC
42  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BufferedStyleModule")
43 #endif
44 };
45 
47  public:
48  BlenderStyleModule(struct Text *text, const string &name, Interpreter *inter)
49  : StyleModule(name, inter)
50  {
51  _text = text;
52  }
53 
55  {
56  }
57 
58  protected:
59  virtual int interpret()
60  {
61  PythonInterpreter *py_inter = dynamic_cast<PythonInterpreter *>(_inter);
62  BLI_assert(py_inter != 0);
63  return py_inter->interpretText(_text, getFileName());
64  }
65 
66  private:
67  struct Text *_text;
68 
69 #ifdef WITH_CXX_GUARDEDALLOC
70  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BlenderStyleModule")
71 #endif
72 };
73 
74 } /* namespace Freestyle */
#define BLI_assert(a)
Definition: BLI_assert.h:46
BlenderStyleModule(struct Text *text, const string &name, Interpreter *inter)
BufferedStyleModule(const string &buffer, const string &file_name, Interpreter *inter)
int interpretString(const string &str, const string &name)
int interpretText(struct Text *text, const string &name)
const string getFileName() const
Definition: StyleModule.h:89
Interpreter * _inter
Definition: StyleModule.h:162
ccl_global float * buffer
inherits from class Rep
Definition: AppCanvas.cpp:18