Blender V5.0
BPy_LocalAverageDepthF1D.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
12#include "../../BPy_Convert.h"
14
15using namespace Freestyle;
16
18
19//------------------------INSTANCE METHODS ----------------------------------
20
22 /* Wrap. */
23 LocalAverageDepthF1D___doc__,
24 "Class hierarchy: :class:`freestyle.types.UnaryFunction1D` > "
25 ":class:`freestyle.types.UnaryFunction1DDouble` > :class:`LocalAverageDepthF1D`\n"
26 "\n"
27 ".. method:: __init__(sigma, integration_type=IntegrationType.MEAN)\n"
28 "\n"
29 " Builds a LocalAverageDepthF1D object.\n"
30 "\n"
31 " :arg sigma: The sigma used in DensityF0D and determining the window\n"
32 " size used in each density query.\n"
33 " :type sigma: float\n"
34 " :arg integration_type: The integration method used to compute a single value\n"
35 " from a set of values.\n"
36 " :type integration_type: :class:`freestyle.types.IntegrationType`\n"
37 "\n"
38 ".. method:: __call__(inter)\n"
39 "\n"
40 " Returns the average depth evaluated for an Interface1D. The average\n"
41 " depth is evaluated for a set of points along the Interface1D (using\n"
42 " the :class:`freestyle.functions.LocalAverageDepthF0D` functor) with a\n"
43 " user-defined sampling and then integrated into a single value using a\n"
44 " user-defined integration method.\n"
45 "\n"
46 " :arg inter: An Interface1D object.\n"
47 " :type inter: :class:`freestyle.types.Interface1D`\n"
48 " :return: The average depth evaluated for the Interface1D.\n"
49 " :rtype: float\n");
51 PyObject *args,
52 PyObject *kwds)
53{
54 static const char *kwlist[] = {"sigma", "integration_type", nullptr};
55 PyObject *obj = nullptr;
56 double d;
57
58 if (!PyArg_ParseTupleAndKeywords(
59 args, kwds, "d|O!", (char **)kwlist, &d, &IntegrationType_Type, &obj))
60 {
61 return -1;
62 }
64 self->py_uf1D_double.uf1D_double = new Functions1D::LocalAverageDepthF1D(d, t);
65 return 0;
66}
67
68/*-----------------------BPy_LocalAverageDepthF1D type definition ------------------------------*/
69
71 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
72 /*tp_name*/ "LocalAverageDepthF1D",
73 /*tp_basicsize*/ sizeof(BPy_LocalAverageDepthF1D),
74 /*tp_itemsize*/ 0,
75 /*tp_dealloc*/ nullptr,
76 /*tp_vectorcall_offset*/ 0,
77 /*tp_getattr*/ nullptr,
78 /*tp_setattr*/ nullptr,
79 /*tp_as_async*/ nullptr,
80 /*tp_repr*/ nullptr,
81 /*tp_as_number*/ nullptr,
82 /*tp_as_sequence*/ nullptr,
83 /*tp_as_mapping*/ nullptr,
84 /*tp_hash*/ nullptr,
85 /*tp_call*/ nullptr,
86 /*tp_str*/ nullptr,
87 /*tp_getattro*/ nullptr,
88 /*tp_setattro*/ nullptr,
89 /*tp_as_buffer*/ nullptr,
90 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
91 /*tp_doc*/ LocalAverageDepthF1D___doc__,
92 /*tp_traverse*/ nullptr,
93 /*tp_clear*/ nullptr,
94 /*tp_richcompare*/ nullptr,
95 /*tp_weaklistoffset*/ 0,
96 /*tp_iter*/ nullptr,
97 /*tp_iternext*/ nullptr,
98 /*tp_methods*/ nullptr,
99 /*tp_members*/ nullptr,
100 /*tp_getset*/ nullptr,
101 /*tp_base*/ &UnaryFunction1DDouble_Type,
102 /*tp_dict*/ nullptr,
103 /*tp_descr_get*/ nullptr,
104 /*tp_descr_set*/ nullptr,
105 /*tp_dictoffset*/ 0,
106 /*tp_init*/ (initproc)LocalAverageDepthF1D___init__,
107 /*tp_alloc*/ nullptr,
108 /*tp_new*/ nullptr,
109};
110
Functions taking 1D input.
IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject *obj)
PyTypeObject IntegrationType_Type
PyDoc_STRVAR(LocalAverageDepthF1D___doc__, "Class hierarchy: :class:`freestyle.types.UnaryFunction1D` > " ":class:`freestyle.types.UnaryFunction1DDouble` > :class:`LocalAverageDepthF1D`\n" "\n" ".. method:: __init__(sigma, integration_type=IntegrationType.MEAN)\n" "\n" " Builds a LocalAverageDepthF1D object.\n" "\n" " :arg sigma: The sigma used in DensityF0D and determining the window\n" " size used in each density query.\n" " :type sigma: float\n" " :arg integration_type: The integration method used to compute a single value\n" " from a set of values.\n" " :type integration_type: :class:`freestyle.types.IntegrationType`\n" "\n" ".. method:: __call__(inter)\n" "\n" " Returns the average depth evaluated for an Interface1D. The average\n" " depth is evaluated for a set of points along the Interface1D (using\n" " the :class:`freestyle.functions.LocalAverageDepthF0D` functor) with a\n" " user-defined sampling and then integrated into a single value using a\n" " user-defined integration method.\n" "\n" " :arg inter: An Interface1D object.\n" " :type inter: :class:`freestyle.types.Interface1D`\n" " :return: The average depth evaluated for the Interface1D.\n" " :rtype: float\n")
static int LocalAverageDepthF1D___init__(BPy_LocalAverageDepthF1D *self, PyObject *args, PyObject *kwds)
PyTypeObject LocalAverageDepthF1D_Type
PyTypeObject UnaryFunction1DDouble_Type
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20