Blender  V3.3
BPy_LocalAverageDepthF0D.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #include "../../../stroke/AdvancedFunctions0D.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.UnaryFunction0D` > "
23  ":class:`freestyle.types.UnaryFunction0DDouble` > :class:`LocalAverageDepthF0D`\n"
24  "\n"
25  ".. method:: __init__(mask_size=5.0)\n"
26  "\n"
27  " Builds a LocalAverageDepthF0D object.\n"
28  "\n"
29  " :arg mask_size: The size of the mask.\n"
30  " :type mask_size: float\n"
31  "\n"
32  ".. method:: __call__(it)\n"
33  "\n"
34  " Returns the average depth around the\n"
35  " :class:`freestyle.types.Interface0D` pointed by the\n"
36  " Interface0DIterator. The result is obtained by querying the depth\n"
37  " buffer on a window around that point.\n"
38  "\n"
39  " :arg it: An Interface0DIterator object.\n"
40  " :type it: :class:`freestyle.types.Interface0DIterator`\n"
41  " :return: The average depth around the pointed Interface0D.\n"
42  " :rtype: float\n";
43 
45  PyObject *args,
46  PyObject *kwds)
47 {
48  static const char *kwlist[] = {"mask_size", nullptr};
49  double d = 5.0;
50 
51  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|d", (char **)kwlist, &d)) {
52  return -1;
53  }
54  self->py_uf0D_double.uf0D_double = new Functions0D::LocalAverageDepthF0D(d);
55  self->py_uf0D_double.uf0D_double->py_uf0D = (PyObject *)self;
56  return 0;
57 }
58 
59 /*-----------------------BPy_LocalAverageDepthF0D type definition ------------------------------*/
60 
61 PyTypeObject LocalAverageDepthF0D_Type = {
62  PyVarObject_HEAD_INIT(nullptr, 0) "LocalAverageDepthF0D", /* tp_name */
63  sizeof(BPy_LocalAverageDepthF0D), /* tp_basicsize */
64  0, /* tp_itemsize */
65  nullptr, /* tp_dealloc */
66  0, /* tp_vectorcall_offset */
67  nullptr, /* tp_getattr */
68  nullptr, /* tp_setattr */
69  nullptr, /* tp_reserved */
70  nullptr, /* tp_repr */
71  nullptr, /* tp_as_number */
72  nullptr, /* tp_as_sequence */
73  nullptr, /* tp_as_mapping */
74  nullptr, /* tp_hash */
75  nullptr, /* tp_call */
76  nullptr, /* tp_str */
77  nullptr, /* tp_getattro */
78  nullptr, /* tp_setattro */
79  nullptr, /* tp_as_buffer */
80  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
81  LocalAverageDepthF0D___doc__, /* tp_doc */
82  nullptr, /* tp_traverse */
83  nullptr, /* tp_clear */
84  nullptr, /* tp_richcompare */
85  0, /* tp_weaklistoffset */
86  nullptr, /* tp_iter */
87  nullptr, /* tp_iternext */
88  nullptr, /* tp_methods */
89  nullptr, /* tp_members */
90  nullptr, /* tp_getset */
91  &UnaryFunction0DDouble_Type, /* tp_base */
92  nullptr, /* tp_dict */
93  nullptr, /* tp_descr_get */
94  nullptr, /* tp_descr_set */
95  0, /* tp_dictoffset */
96  (initproc)LocalAverageDepthF0D___init__, /* tp_init */
97  nullptr, /* tp_alloc */
98  nullptr, /* tp_new */
99 };
100 
102 
103 #ifdef __cplusplus
104 }
105 #endif
PyTypeObject LocalAverageDepthF0D_Type
static int LocalAverageDepthF0D___init__(BPy_LocalAverageDepthF0D *self, PyObject *args, PyObject *kwds)
static char LocalAverageDepthF0D___doc__[]
PyTypeObject UnaryFunction0DDouble_Type
inherits from class Rep
Definition: AppCanvas.cpp:18