Blender  V3.3
BPy_MaterialF0D.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BPy_MaterialF0D.h"
8 
9 #include "../../../view_map/Functions0D.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //------------------------INSTANCE METHODS ----------------------------------
20 
21 static char MaterialF0D___doc__[] =
22  "Class hierarchy: :class:`freestyle.types.UnaryFunction0D` > "
23  ":class:`freestyle.types.UnaryFunction0DMaterial` > :class:`MaterialF0D`\n"
24  "\n"
25  ".. method:: __init__()\n"
26  "\n"
27  " Builds a MaterialF0D object.\n"
28  "\n"
29  ".. method:: __call__(it)\n"
30  "\n"
31  " Returns the material of the object evaluated at the\n"
32  " :class:`freestyle.types.Interface0D` pointed by the\n"
33  " Interface0DIterator. This evaluation can be ambiguous (in the case of\n"
34  " a :class:`freestyle.types.TVertex` for example. This functor tries to\n"
35  " remove this ambiguity using the context offered by the 1D element to\n"
36  " which the Interface0DIterator belongs to and by arbitrary choosing the\n"
37  " material of the face that lies on its left when following the 1D\n"
38  " element if there are two different materials on each side of the\n"
39  " point. However, there still can be problematic cases, and the user\n"
40  " willing to deal with this cases in a specific way should implement its\n"
41  " own getMaterial functor.\n"
42  "\n"
43  " :arg it: An Interface0DIterator object.\n"
44  " :type it: :class:`freestyle.types.Interface0DIterator`\n"
45  " :return: The material of the object evaluated at the pointed\n"
46  " Interface0D.\n"
47  " :rtype: :class:`freestyle.types.Material`\n";
48 
49 static int MaterialF0D___init__(BPy_MaterialF0D *self, PyObject *args, PyObject *kwds)
50 {
51  static const char *kwlist[] = {nullptr};
52 
53  if (!PyArg_ParseTupleAndKeywords(args, kwds, "", (char **)kwlist)) {
54  return -1;
55  }
56  self->py_uf0D_material.uf0D_material = new Functions0D::MaterialF0D();
57  self->py_uf0D_material.uf0D_material->py_uf0D = (PyObject *)self;
58  return 0;
59 }
60 
61 /*-----------------------BPy_MaterialF0D type definition ------------------------------*/
62 
63 PyTypeObject MaterialF0D_Type = {
64  PyVarObject_HEAD_INIT(nullptr, 0) "MaterialF0D", /* tp_name */
65  sizeof(BPy_MaterialF0D), /* tp_basicsize */
66  0, /* tp_itemsize */
67  nullptr, /* tp_dealloc */
68  0, /* tp_vectorcall_offset */
69  nullptr, /* tp_getattr */
70  nullptr, /* tp_setattr */
71  nullptr, /* tp_reserved */
72  nullptr, /* tp_repr */
73  nullptr, /* tp_as_number */
74  nullptr, /* tp_as_sequence */
75  nullptr, /* tp_as_mapping */
76  nullptr, /* tp_hash */
77  nullptr, /* tp_call */
78  nullptr, /* tp_str */
79  nullptr, /* tp_getattro */
80  nullptr, /* tp_setattro */
81  nullptr, /* tp_as_buffer */
82  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
83  MaterialF0D___doc__, /* tp_doc */
84  nullptr, /* tp_traverse */
85  nullptr, /* tp_clear */
86  nullptr, /* tp_richcompare */
87  0, /* tp_weaklistoffset */
88  nullptr, /* tp_iter */
89  nullptr, /* tp_iternext */
90  nullptr, /* tp_methods */
91  nullptr, /* tp_members */
92  nullptr, /* tp_getset */
93  &UnaryFunction0DMaterial_Type, /* tp_base */
94  nullptr, /* tp_dict */
95  nullptr, /* tp_descr_get */
96  nullptr, /* tp_descr_set */
97  0, /* tp_dictoffset */
98  (initproc)MaterialF0D___init__, /* tp_init */
99  nullptr, /* tp_alloc */
100  nullptr, /* tp_new */
101 };
102 
104 
105 #ifdef __cplusplus
106 }
107 #endif
static char MaterialF0D___doc__[]
PyTypeObject MaterialF0D_Type
static int MaterialF0D___init__(BPy_MaterialF0D *self, PyObject *args, PyObject *kwds)
PyTypeObject UnaryFunction0DMaterial_Type
inherits from class Rep
Definition: AppCanvas.cpp:18