Blender  V2.93
BPy_MaterialF0D.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "BPy_MaterialF0D.h"
22 
23 #include "../../../view_map/Functions0D.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 using namespace Freestyle;
30 
32 
33 //------------------------INSTANCE METHODS ----------------------------------
34 
35 static char MaterialF0D___doc__[] =
36  "Class hierarchy: :class:`freestyle.types.UnaryFunction0D` > "
37  ":class:`freestyle.types.UnaryFunction0DMaterial` > :class:`MaterialF0D`\n"
38  "\n"
39  ".. method:: __init__()\n"
40  "\n"
41  " Builds a MaterialF0D object.\n"
42  "\n"
43  ".. method:: __call__(it)\n"
44  "\n"
45  " Returns the material of the object evaluated at the\n"
46  " :class:`freestyle.types.Interface0D` pointed by the\n"
47  " Interface0DIterator. This evaluation can be ambiguous (in the case of\n"
48  " a :class:`freestyle.types.TVertex` for example. This functor tries to\n"
49  " remove this ambiguity using the context offered by the 1D element to\n"
50  " which the Interface0DIterator belongs to and by arbitrary choosing the\n"
51  " material of the face that lies on its left when following the 1D\n"
52  " element if there are two different materials on each side of the\n"
53  " point. However, there still can be problematic cases, and the user\n"
54  " willing to deal with this cases in a specific way should implement its\n"
55  " own getMaterial functor.\n"
56  "\n"
57  " :arg it: An Interface0DIterator object.\n"
58  " :type it: :class:`freestyle.types.Interface0DIterator`\n"
59  " :return: The material of the object evaluated at the pointed\n"
60  " Interface0D.\n"
61  " :rtype: :class:`freestyle.types.Material`\n";
62 
63 static int MaterialF0D___init__(BPy_MaterialF0D *self, PyObject *args, PyObject *kwds)
64 {
65  static const char *kwlist[] = {nullptr};
66 
67  if (!PyArg_ParseTupleAndKeywords(args, kwds, "", (char **)kwlist)) {
68  return -1;
69  }
70  self->py_uf0D_material.uf0D_material = new Functions0D::MaterialF0D();
71  self->py_uf0D_material.uf0D_material->py_uf0D = (PyObject *)self;
72  return 0;
73 }
74 
75 /*-----------------------BPy_MaterialF0D type definition ------------------------------*/
76 
77 PyTypeObject MaterialF0D_Type = {
78  PyVarObject_HEAD_INIT(nullptr, 0) "MaterialF0D", /* tp_name */
79  sizeof(BPy_MaterialF0D), /* tp_basicsize */
80  0, /* tp_itemsize */
81  nullptr, /* tp_dealloc */
82  0, /* tp_vectorcall_offset */
83  nullptr, /* tp_getattr */
84  nullptr, /* tp_setattr */
85  nullptr, /* tp_reserved */
86  nullptr, /* tp_repr */
87  nullptr, /* tp_as_number */
88  nullptr, /* tp_as_sequence */
89  nullptr, /* tp_as_mapping */
90  nullptr, /* tp_hash */
91  nullptr, /* tp_call */
92  nullptr, /* tp_str */
93  nullptr, /* tp_getattro */
94  nullptr, /* tp_setattro */
95  nullptr, /* tp_as_buffer */
96  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
97  MaterialF0D___doc__, /* tp_doc */
98  nullptr, /* tp_traverse */
99  nullptr, /* tp_clear */
100  nullptr, /* tp_richcompare */
101  0, /* tp_weaklistoffset */
102  nullptr, /* tp_iter */
103  nullptr, /* tp_iternext */
104  nullptr, /* tp_methods */
105  nullptr, /* tp_members */
106  nullptr, /* tp_getset */
107  &UnaryFunction0DMaterial_Type, /* tp_base */
108  nullptr, /* tp_dict */
109  nullptr, /* tp_descr_get */
110  nullptr, /* tp_descr_set */
111  0, /* tp_dictoffset */
112  (initproc)MaterialF0D___init__, /* tp_init */
113  nullptr, /* tp_alloc */
114  nullptr, /* tp_new */
115 };
116 
118 
119 #ifdef __cplusplus
120 }
121 #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:32