Blender  V2.93
BPy_BezierCurveShader.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_BezierCurveShader.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:`BezierCurveShader`\n"
37  "\n"
38  "[Geometry shader]\n"
39  "\n"
40  ".. method:: __init__(error=4.0)\n"
41  "\n"
42  " Builds a BezierCurveShader object.\n"
43  "\n"
44  " :arg error: The error we're allowing for the approximation. This\n"
45  " error is the max distance allowed between the new curve and the\n"
46  " original geometry.\n"
47  " :type error: float\n"
48  "\n"
49  ".. method:: shade(stroke)\n"
50  "\n"
51  " Transforms the stroke backbone geometry so that it corresponds to a\n"
52  " Bezier Curve approximation of the original backbone geometry.\n"
53  "\n"
54  " :arg stroke: A Stroke object.\n"
55  " :type stroke: :class:`freestyle.types.Stroke`\n";
56 
57 static int BezierCurveShader___init__(BPy_BezierCurveShader *self, PyObject *args, PyObject *kwds)
58 {
59  static const char *kwlist[] = {"error", nullptr};
60  float f = 4.0;
61 
62  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) {
63  return -1;
64  }
65  self->py_ss.ss = new StrokeShaders::BezierCurveShader(f);
66  return 0;
67 }
68 
69 /*-----------------------BPy_BezierCurveShader type definition ------------------------------*/
70 
71 PyTypeObject BezierCurveShader_Type = {
72  PyVarObject_HEAD_INIT(nullptr, 0) "BezierCurveShader", /* tp_name */
73  sizeof(BPy_BezierCurveShader), /* tp_basicsize */
74  0, /* tp_itemsize */
75  nullptr, /* tp_dealloc */
76  0, /* tp_vectorcall_offset */
77  nullptr, /* tp_getattr */
78  nullptr, /* tp_setattr */
79  nullptr, /* tp_reserved */
80  nullptr, /* tp_repr */
81  nullptr, /* tp_as_number */
82  nullptr, /* tp_as_sequence */
83  nullptr, /* tp_as_mapping */
84  nullptr, /* tp_hash */
85  nullptr, /* tp_call */
86  nullptr, /* tp_str */
87  nullptr, /* tp_getattro */
88  nullptr, /* tp_setattro */
89  nullptr, /* tp_as_buffer */
90  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
91  BezierCurveShader___doc__, /* tp_doc */
92  nullptr, /* tp_traverse */
93  nullptr, /* tp_clear */
94  nullptr, /* tp_richcompare */
95  0, /* tp_weaklistoffset */
96  nullptr, /* tp_iter */
97  nullptr, /* tp_iternext */
98  nullptr, /* tp_methods */
99  nullptr, /* tp_members */
100  nullptr, /* tp_getset */
101  &StrokeShader_Type, /* tp_base */
102  nullptr, /* tp_dict */
103  nullptr, /* tp_descr_get */
104  nullptr, /* tp_descr_set */
105  0, /* tp_dictoffset */
106  (initproc)BezierCurveShader___init__, /* tp_init */
107  nullptr, /* tp_alloc */
108  nullptr, /* tp_new */
109 };
110 
112 
113 #ifdef __cplusplus
114 }
115 #endif
static char BezierCurveShader___doc__[]
static int BezierCurveShader___init__(BPy_BezierCurveShader *self, PyObject *args, PyObject *kwds)
PyTypeObject BezierCurveShader_Type
PyTypeObject StrokeShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:32