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