Blender  V2.93
BPy_TipRemoverShader.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_TipRemoverShader.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 
35 static char TipRemoverShader___doc__[] =
36  "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`TipRemoverShader`\n"
37  "\n"
38  "[Geometry shader]\n"
39  "\n"
40  ".. method:: __init__(tip_length)\n"
41  "\n"
42  " Builds a TipRemoverShader object.\n"
43  "\n"
44  " :arg tip_length: The length of the piece of stroke we want to remove\n"
45  " at each extremity.\n"
46  " :type tip_length: float\n"
47  "\n"
48  ".. method:: shade(stroke)\n"
49  "\n"
50  " Removes the stroke's extremities.\n"
51  "\n"
52  " :arg stroke: A Stroke object.\n"
53  " :type stroke: :class:`freestyle.types.Stroke`\n";
54 
55 static int TipRemoverShader___init__(BPy_TipRemoverShader *self, PyObject *args, PyObject *kwds)
56 {
57  static const char *kwlist[] = {"tip_length", nullptr};
58  double d;
59 
60  if (!PyArg_ParseTupleAndKeywords(args, kwds, "d", (char **)kwlist, &d)) {
61  return -1;
62  }
63  self->py_ss.ss = new StrokeShaders::TipRemoverShader(d);
64  return 0;
65 }
66 
67 /*-----------------------BPy_TipRemoverShader type definition ------------------------------*/
68 
69 PyTypeObject TipRemoverShader_Type = {
70  PyVarObject_HEAD_INIT(nullptr, 0) "TipRemoverShader", /* tp_name */
71  sizeof(BPy_TipRemoverShader), /* tp_basicsize */
72  0, /* tp_itemsize */
73  nullptr, /* tp_dealloc */
74  0, /* tp_vectorcall_offset */
75  nullptr, /* tp_getattr */
76  nullptr, /* tp_setattr */
77  nullptr, /* tp_reserved */
78  nullptr, /* tp_repr */
79  nullptr, /* tp_as_number */
80  nullptr, /* tp_as_sequence */
81  nullptr, /* tp_as_mapping */
82  nullptr, /* tp_hash */
83  nullptr, /* tp_call */
84  nullptr, /* tp_str */
85  nullptr, /* tp_getattro */
86  nullptr, /* tp_setattro */
87  nullptr, /* tp_as_buffer */
88  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
89  TipRemoverShader___doc__, /* tp_doc */
90  nullptr, /* tp_traverse */
91  nullptr, /* tp_clear */
92  nullptr, /* tp_richcompare */
93  0, /* tp_weaklistoffset */
94  nullptr, /* tp_iter */
95  nullptr, /* tp_iternext */
96  nullptr, /* tp_methods */
97  nullptr, /* tp_members */
98  nullptr, /* tp_getset */
99  &StrokeShader_Type, /* tp_base */
100  nullptr, /* tp_dict */
101  nullptr, /* tp_descr_get */
102  nullptr, /* tp_descr_set */
103  0, /* tp_dictoffset */
104  (initproc)TipRemoverShader___init__, /* tp_init */
105  nullptr, /* tp_alloc */
106  nullptr, /* tp_new */
107 };
108 
110 
111 #ifdef __cplusplus
112 }
113 #endif
PyTypeObject StrokeShader_Type
static int TipRemoverShader___init__(BPy_TipRemoverShader *self, PyObject *args, PyObject *kwds)
PyTypeObject TipRemoverShader_Type
static char TipRemoverShader___doc__[]
inherits from class Rep
Definition: AppCanvas.cpp:32