Blender  V3.3
BPy_ConstrainedIncreasingThicknessShader.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #include "../../stroke/BasicStrokeShaders.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //------------------------INSTANCE METHODS ----------------------------------
20 
22  "Class hierarchy: :class:`freestyle.types.StrokeShader` > "
23  ":class:`ConstrainedIncreasingThicknessShader`\n"
24  "\n"
25  "[Thickness shader]\n"
26  "\n"
27  ".. method:: __init__(thickness_min, thickness_max, ratio)\n"
28  "\n"
29  " Builds a ConstrainedIncreasingThicknessShader object.\n"
30  "\n"
31  " :arg thickness_min: The minimum thickness.\n"
32  " :type thickness_min: float\n"
33  " :arg thickness_max: The maximum thickness.\n"
34  " :type thickness_max: float\n"
35  " :arg ratio: The thickness/length ratio that we don't want to exceed. \n"
36  " :type ratio: float\n"
37  "\n"
38  ".. method:: shade(stroke)\n"
39  "\n"
40  " Same as the :class:`IncreasingThicknessShader`, but here we allow\n"
41  " the user to control the thickness/length ratio so that we don't get\n"
42  " fat short lines.\n"
43  "\n"
44  " :arg stroke: A Stroke object.\n"
45  " :type stroke: :class:`freestyle.types.Stroke`\n";
46 
48  BPy_ConstrainedIncreasingThicknessShader *self, PyObject *args, PyObject *kwds)
49 {
50  static const char *kwlist[] = {"thickness_min", "thickness_max", "ratio", nullptr};
51  float f1, f2, f3;
52 
53  if (!PyArg_ParseTupleAndKeywords(args, kwds, "fff", (char **)kwlist, &f1, &f2, &f3)) {
54  return -1;
55  }
56  self->py_ss.ss = new StrokeShaders::ConstrainedIncreasingThicknessShader(f1, f2, f3);
57  return 0;
58 }
59 
60 /*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ---------------*/
61 
63  PyVarObject_HEAD_INIT(nullptr, 0) "ConstrainedIncreasingThicknessShader", /* tp_name */
64  sizeof(BPy_ConstrainedIncreasingThicknessShader), /* tp_basicsize */
65  0, /* tp_itemsize */
66  nullptr, /* tp_dealloc */
67  0, /* tp_vectorcall_offset */
68  nullptr, /* tp_getattr */
69  nullptr, /* tp_setattr */
70  nullptr, /* tp_reserved */
71  nullptr, /* tp_repr */
72  nullptr, /* tp_as_number */
73  nullptr, /* tp_as_sequence */
74  nullptr, /* tp_as_mapping */
75  nullptr, /* tp_hash */
76  nullptr, /* tp_call */
77  nullptr, /* tp_str */
78  nullptr, /* tp_getattro */
79  nullptr, /* tp_setattro */
80  nullptr, /* tp_as_buffer */
81  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
83  nullptr, /* tp_traverse */
84  nullptr, /* tp_clear */
85  nullptr, /* tp_richcompare */
86  0, /* tp_weaklistoffset */
87  nullptr, /* tp_iter */
88  nullptr, /* tp_iternext */
89  nullptr, /* tp_methods */
90  nullptr, /* tp_members */
91  nullptr, /* tp_getset */
92  &StrokeShader_Type, /* tp_base */
93  nullptr, /* tp_dict */
94  nullptr, /* tp_descr_get */
95  nullptr, /* tp_descr_set */
96  0, /* tp_dictoffset */
97  (initproc)ConstrainedIncreasingThicknessShader___init__, /* tp_init */
98  nullptr, /* tp_alloc */
99  nullptr, /* tp_new */
100 };
101 
103 
104 #ifdef __cplusplus
105 }
106 #endif
static char ConstrainedIncreasingThicknessShader___doc__[]
PyTypeObject ConstrainedIncreasingThicknessShader_Type
static int ConstrainedIncreasingThicknessShader___init__(BPy_ConstrainedIncreasingThicknessShader *self, PyObject *args, PyObject *kwds)
PyTypeObject StrokeShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:18