Blender V4.3
BPy_DensityF1D.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
9#include "BPy_DensityF1D.h"
10
12#include "../../BPy_Convert.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19using namespace Freestyle;
20
22
23//------------------------INSTANCE METHODS ----------------------------------
24
26 /* Wrap. */
27 DensityF1D___doc__,
28 "Class hierarchy: :class:`freestyle.types.UnaryFunction1D` > "
29 ":class:`freestyle.types.UnaryFunction1DDouble` > :class:`DensityF1D`\n"
30 "\n"
31 ".. method:: __init__(sigma=2.0, integration_type=IntegrationType.MEAN, sampling=2.0)\n"
32 "\n"
33 " Builds a DensityF1D object.\n"
34 "\n"
35 " :arg sigma: The sigma used in DensityF0D and determining the window size\n"
36 " used in each density query.\n"
37 " :type sigma: float\n"
38 " :arg integration_type: The integration method used to compute a single value\n"
39 " from a set of values.\n"
40 " :type integration_type: :class:`freestyle.types.IntegrationType`\n"
41 " :arg sampling: The resolution used to sample the chain: the\n"
42 " corresponding 0D function is evaluated at each sample point and\n"
43 " the result is obtained by combining the resulting values into a\n"
44 " single one, following the method specified by integration_type.\n"
45 " :type sampling: float\n"
46 "\n"
47 ".. method:: __call__(inter)\n"
48 "\n"
49 " Returns the density evaluated for an Interface1D. The density is\n"
50 " evaluated for a set of points along the Interface1D (using the\n"
51 " :class:`freestyle.functions.DensityF0D` functor) with a user-defined\n"
52 " sampling and then integrated into a single value using a user-defined\n"
53 " integration method.\n"
54 "\n"
55 " :arg inter: An Interface1D object.\n"
56 " :type inter: :class:`freestyle.types.Interface1D`\n"
57 " :return: The density evaluated for an Interface1D.\n"
58 " :rtype: float\n");
59
60static int DensityF1D___init__(BPy_DensityF1D *self, PyObject *args, PyObject *kwds)
61{
62 static const char *kwlist[] = {"sigma", "integration_type", "sampling", nullptr};
63 PyObject *obj = nullptr;
64 double d = 2.0;
65 float f = 2.0;
66
67 if (!PyArg_ParseTupleAndKeywords(
68 args, kwds, "|dO!f", (char **)kwlist, &d, &IntegrationType_Type, &obj, &f))
69 {
70 return -1;
71 }
73 self->py_uf1D_double.uf1D_double = new Functions1D::DensityF1D(d, t, f);
74 return 0;
75}
76
77/*-----------------------BPy_DensityF1D type definition ------------------------------*/
78
79PyTypeObject DensityF1D_Type = {
80 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
81 /*tp_name*/ "DensityF1D",
82 /*tp_basicsize*/ sizeof(BPy_DensityF1D),
83 /*tp_itemsize*/ 0,
84 /*tp_dealloc*/ nullptr,
85 /*tp_vectorcall_offset*/ 0,
86 /*tp_getattr*/ nullptr,
87 /*tp_setattr*/ nullptr,
88 /*tp_as_async*/ nullptr,
89 /*tp_repr*/ nullptr,
90 /*tp_as_number*/ nullptr,
91 /*tp_as_sequence*/ nullptr,
92 /*tp_as_mapping*/ nullptr,
93 /*tp_hash*/ nullptr,
94 /*tp_call*/ nullptr,
95 /*tp_str*/ nullptr,
96 /*tp_getattro*/ nullptr,
97 /*tp_setattro*/ nullptr,
98 /*tp_as_buffer*/ nullptr,
99 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
100 /*tp_doc*/ DensityF1D___doc__,
101 /*tp_traverse*/ nullptr,
102 /*tp_clear*/ nullptr,
103 /*tp_richcompare*/ nullptr,
104 /*tp_weaklistoffset*/ 0,
105 /*tp_iter*/ nullptr,
106 /*tp_iternext*/ nullptr,
107 /*tp_methods*/ nullptr,
108 /*tp_members*/ nullptr,
109 /*tp_getset*/ nullptr,
110 /*tp_base*/ &UnaryFunction1DDouble_Type,
111 /*tp_dict*/ nullptr,
112 /*tp_descr_get*/ nullptr,
113 /*tp_descr_set*/ nullptr,
114 /*tp_dictoffset*/ 0,
115 /*tp_init*/ (initproc)DensityF1D___init__,
116 /*tp_alloc*/ nullptr,
117 /*tp_new*/ nullptr,
118};
119
121
122#ifdef __cplusplus
123}
124#endif
Functions taking 1D input.
IntegrationType IntegrationType_from_BPy_IntegrationType(PyObject *obj)
static int DensityF1D___init__(BPy_DensityF1D *self, PyObject *args, PyObject *kwds)
PyDoc_STRVAR(DensityF1D___doc__, "Class hierarchy: :class:`freestyle.types.UnaryFunction1D` > " ":class:`freestyle.types.UnaryFunction1DDouble` > :class:`DensityF1D`\n" "\n" ".. method:: __init__(sigma=2.0, integration_type=IntegrationType.MEAN, sampling=2.0)\n" "\n" " Builds a DensityF1D object.\n" "\n" " :arg sigma: The sigma used in DensityF0D and determining the window size\n" " 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" " :arg sampling: The resolution used to sample the chain: the\n" " corresponding 0D function is evaluated at each sample point and\n" " the result is obtained by combining the resulting values into a\n" " single one, following the method specified by integration_type.\n" " :type sampling: float\n" "\n" ".. method:: __call__(inter)\n" "\n" " Returns the density evaluated for an Interface1D. The density is\n" " evaluated for a set of points along the Interface1D (using the\n" " :class:`freestyle.functions.DensityF0D` functor) with a user-defined\n" " sampling and then integrated into a single value using a user-defined\n" " integration method.\n" "\n" " :arg inter: An Interface1D object.\n" " :type inter: :class:`freestyle.types.Interface1D`\n" " :return: The density evaluated for an Interface1D.\n" " :rtype: float\n")
PyTypeObject DensityF1D_Type
PyTypeObject IntegrationType_Type
PyTypeObject UnaryFunction1DDouble_Type
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20