Blender  V2.93
BPy_GuidingLinesShader.cpp
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 
21 #include "BPy_GuidingLinesShader.h"
22 
23 #include "../../stroke/BasicStrokeShaders.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 using namespace Freestyle;
30 
32 
33 //------------------------INSTANCE METHODS ----------------------------------
34 
36  "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`GuidingLinesShader`\n"
37  "\n"
38  "[Geometry shader]\n"
39  "\n"
40  ".. method:: __init__(offset)\n"
41  "\n"
42  " Builds a GuidingLinesShader object.\n"
43  "\n"
44  " :arg offset: The line that replaces the stroke is initially in the\n"
45  " middle of the initial stroke bounding box. offset is the value\n"
46  " of the displacement which is applied to this line along its\n"
47  " normal.\n"
48  " :type offset: float\n"
49  "\n"
50  ".. method:: shade(stroke)\n"
51  "\n"
52  " Shader to modify the Stroke geometry so that it corresponds to its\n"
53  " main direction line. This shader must be used together with the\n"
54  " splitting operator using the curvature criterion. Indeed, the\n"
55  " precision of the approximation will depend on the size of the\n"
56  " stroke's pieces. The bigger the pieces are, the rougher the\n"
57  " approximation is.\n"
58  "\n"
59  " :arg stroke: A Stroke object.\n"
60  " :type stroke: :class:`freestyle.types.Stroke`\n";
61 
63  PyObject *args,
64  PyObject *kwds)
65 {
66  static const char *kwlist[] = {"offset", nullptr};
67  float f;
68 
69  if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) {
70  return -1;
71  }
72  self->py_ss.ss = new StrokeShaders::GuidingLinesShader(f);
73  return 0;
74 }
75 
76 /*-----------------------BPy_GuidingLinesShader type definition ------------------------------*/
77 
78 PyTypeObject GuidingLinesShader_Type = {
79  PyVarObject_HEAD_INIT(nullptr, 0) "GuidingLinesShader", /* tp_name */
80  sizeof(BPy_GuidingLinesShader), /* tp_basicsize */
81  0, /* tp_itemsize */
82  nullptr, /* tp_dealloc */
83  0, /* tp_vectorcall_offset */
84  nullptr, /* tp_getattr */
85  nullptr, /* tp_setattr */
86  nullptr, /* tp_reserved */
87  nullptr, /* tp_repr */
88  nullptr, /* tp_as_number */
89  nullptr, /* tp_as_sequence */
90  nullptr, /* tp_as_mapping */
91  nullptr, /* tp_hash */
92  nullptr, /* tp_call */
93  nullptr, /* tp_str */
94  nullptr, /* tp_getattro */
95  nullptr, /* tp_setattro */
96  nullptr, /* tp_as_buffer */
97  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
98  GuidingLinesShader___doc__, /* tp_doc */
99  nullptr, /* tp_traverse */
100  nullptr, /* tp_clear */
101  nullptr, /* tp_richcompare */
102  0, /* tp_weaklistoffset */
103  nullptr, /* tp_iter */
104  nullptr, /* tp_iternext */
105  nullptr, /* tp_methods */
106  nullptr, /* tp_members */
107  nullptr, /* tp_getset */
108  &StrokeShader_Type, /* tp_base */
109  nullptr, /* tp_dict */
110  nullptr, /* tp_descr_get */
111  nullptr, /* tp_descr_set */
112  0, /* tp_dictoffset */
113  (initproc)GuidingLinesShader___init__, /* tp_init */
114  nullptr, /* tp_alloc */
115  nullptr, /* tp_new */
116 };
117 
119 
120 #ifdef __cplusplus
121 }
122 #endif
PyTypeObject GuidingLinesShader_Type
static char GuidingLinesShader___doc__[]
static int GuidingLinesShader___init__(BPy_GuidingLinesShader *self, PyObject *args, PyObject *kwds)
PyTypeObject StrokeShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:32