Blender V5.0
BPy_UnaryFunction0D.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
21
22using namespace Freestyle;
23
25
26//-------------------MODULE INITIALIZATION--------------------------------
51
52//------------------------INSTANCE METHODS ----------------------------------
53
55 /* Wrap. */
56 UnaryFunction0D___doc__,
57 "Base class for Unary Functions (functors) working on\n"
58 ":class:`Interface0DIterator`. A unary function will be used by\n"
59 "invoking __call__() on an Interface0DIterator. In Python, several\n"
60 "different subclasses of UnaryFunction0D are used depending on the\n"
61 "types of functors' return values. For example, you would inherit from\n"
62 "a :class:`UnaryFunction0DDouble` if you wish to define a function that\n"
63 "returns a double value. Available UnaryFunction0D subclasses are:\n"
64 "\n"
65 "* :class:`UnaryFunction0DDouble`\n"
66 "* :class:`UnaryFunction0DEdgeNature`\n"
67 "* :class:`UnaryFunction0DFloat`\n"
68 "* :class:`UnaryFunction0DId`\n"
69 "* :class:`UnaryFunction0DMaterial`\n"
70 "* :class:`UnaryFunction0DUnsigned`\n"
71 "* :class:`UnaryFunction0DVec2f`\n"
72 "* :class:`UnaryFunction0DVec3f`\n"
73 "* :class:`UnaryFunction0DVectorViewShape`\n"
74 "* :class:`UnaryFunction0DViewShape`\n");
76{
77 Py_TYPE(self)->tp_free((PyObject *)self);
78}
79
81{
82 return PyUnicode_FromString("UnaryFunction0D");
83}
84
85/*----------------------UnaryFunction0D get/setters ----------------------------*/
86
88 /* Wrap. */
89 UnaryFunction0D_name_doc,
90 "The name of the unary 0D function.\n"
91 "\n"
92 ":type: str\n");
93static PyObject *UnaryFunction0D_name_get(BPy_UnaryFunction0D *self, void * /*closure*/)
94{
95 return PyUnicode_FromString(Py_TYPE(self)->tp_name);
96}
97
98static PyGetSetDef BPy_UnaryFunction0D_getseters[] = {
99 {"name",
101 (setter) nullptr,
102 UnaryFunction0D_name_doc,
103 nullptr},
104 {nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */
105};
106
107/*-----------------------BPy_UnaryFunction0D type definition ------------------------------*/
108
109PyTypeObject UnaryFunction0D_Type = {
110 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
111 /*tp_name*/ "UnaryFunction0D",
112 /*tp_basicsize*/ sizeof(BPy_UnaryFunction0D),
113 /*tp_itemsize*/ 0,
114 /*tp_dealloc*/ (destructor)UnaryFunction0D___dealloc__,
115 /*tp_vectorcall_offset*/ 0,
116 /*tp_getattr*/ nullptr,
117 /*tp_setattr*/ nullptr,
118 /*tp_as_async*/ nullptr,
119 /*tp_repr*/ (reprfunc)UnaryFunction0D___repr__,
120 /*tp_as_number*/ nullptr,
121 /*tp_as_sequence*/ nullptr,
122 /*tp_as_mapping*/ nullptr,
123 /*tp_hash*/ nullptr,
124 /*tp_call*/ nullptr,
125 /*tp_str*/ nullptr,
126 /*tp_getattro*/ nullptr,
127 /*tp_setattro*/ nullptr,
128 /*tp_as_buffer*/ nullptr,
129 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
130 /*tp_doc*/ UnaryFunction0D___doc__,
131 /*tp_traverse*/ nullptr,
132 /*tp_clear*/ nullptr,
133 /*tp_richcompare*/ nullptr,
134 /*tp_weaklistoffset*/ 0,
135 /*tp_iter*/ nullptr,
136 /*tp_iternext*/ nullptr,
137 /*tp_methods*/ nullptr,
138 /*tp_members*/ nullptr,
139 /*tp_getset*/ BPy_UnaryFunction0D_getseters,
140 /*tp_base*/ nullptr,
141 /*tp_dict*/ nullptr,
142 /*tp_descr_get*/ nullptr,
143 /*tp_descr_set*/ nullptr,
144 /*tp_dictoffset*/ 0,
145 /*tp_init*/ nullptr,
146 /*tp_alloc*/ nullptr,
147 /*tp_new*/ PyType_GenericNew,
148};
149
int UnaryFunction0DDouble_Init(PyObject *module)
int UnaryFunction0DEdgeNature_Init(PyObject *module)
int UnaryFunction0DFloat_Init(PyObject *module)
int UnaryFunction0DId_Init(PyObject *module)
int UnaryFunction0DMaterial_Init(PyObject *module)
int UnaryFunction0DUnsigned_Init(PyObject *module)
int UnaryFunction0DVec2f_Init(PyObject *module)
int UnaryFunction0DVec3f_Init(PyObject *module)
int UnaryFunction0DVectorViewShape_Init(PyObject *module)
int UnaryFunction0DViewShape_Init(PyObject *module)
PyTypeObject UnaryFunction0D_Type
PyDoc_STRVAR(UnaryFunction0D___doc__, "Base class for Unary Functions (functors) working on\n" ":class:`Interface0DIterator`. A unary function will be used by\n" "invoking __call__() on an Interface0DIterator. In Python, several\n" "different subclasses of UnaryFunction0D are used depending on the\n" "types of functors' return values. For example, you would inherit from\n" "a :class:`UnaryFunction0DDouble` if you wish to define a function that\n" "returns a double value. Available UnaryFunction0D subclasses are:\n" "\n" "* :class:`UnaryFunction0DDouble`\n" "* :class:`UnaryFunction0DEdgeNature`\n" "* :class:`UnaryFunction0DFloat`\n" "* :class:`UnaryFunction0DId`\n" "* :class:`UnaryFunction0DMaterial`\n" "* :class:`UnaryFunction0DUnsigned`\n" "* :class:`UnaryFunction0DVec2f`\n" "* :class:`UnaryFunction0DVec3f`\n" "* :class:`UnaryFunction0DVectorViewShape`\n" "* :class:`UnaryFunction0DViewShape`\n")
static PyGetSetDef BPy_UnaryFunction0D_getseters[]
static void UnaryFunction0D___dealloc__(BPy_UnaryFunction0D *self)
static PyObject * UnaryFunction0D___repr__(BPy_UnaryFunction0D *)
static PyObject * UnaryFunction0D_name_get(BPy_UnaryFunction0D *self, void *)
int UnaryFunction0D_Init(PyObject *module)
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20
static struct PyModuleDef module
Definition python.cpp:796