Blender  V3.3
BPy_WithinImageBoundaryUP1D.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 using namespace Freestyle;
14 
16 
17 //------------------------INSTANCE METHODS ----------------------------------
18 
20  "Class hierarchy: :class:`freestyle.types.UnaryPredicate1D` > "
21  ":class:`WithinImageBoundaryUP1D`\n"
22  "\n"
23  ".. method:: __init__(xmin, ymin, xmax, ymax)\n"
24  "\n"
25  " Builds an WithinImageBoundaryUP1D object.\n"
26  "\n"
27  " :arg xmin: X lower bound of the image boundary.\n"
28  " :type xmin: float\n"
29  " :arg ymin: Y lower bound of the image boundary.\n"
30  " :type ymin: float\n"
31  " :arg xmax: X upper bound of the image boundary.\n"
32  " :type xmax: float\n"
33  " :arg ymax: Y upper bound of the image boundary.\n"
34  " :type ymax: float\n"
35  "\n"
36  ".. method:: __call__(inter)\n"
37  "\n"
38  " Returns true if the Interface1D intersects with image boundary.\n";
39 
41  PyObject *args,
42  PyObject *kwds)
43 {
44  static const char *kwlist[] = {"xmin", "ymin", "xmax", "ymax", nullptr};
45  double xmin, ymin, xmax, ymax;
46 
47  if (!PyArg_ParseTupleAndKeywords(
48  args, kwds, "dddd", (char **)kwlist, &xmin, &ymin, &xmax, &ymax)) {
49  return -1;
50  }
51  self->py_up1D.up1D = new Predicates1D::WithinImageBoundaryUP1D(xmin, ymin, xmax, ymax);
52  return 0;
53 }
54 
55 /*-----------------------BPy_TrueUP1D type definition ------------------------------*/
56 
58  PyVarObject_HEAD_INIT(nullptr, 0) "WithinImageBoundaryUP1D", /* tp_name */
59  sizeof(BPy_WithinImageBoundaryUP1D), /* tp_basicsize */
60  0, /* tp_itemsize */
61  nullptr, /* tp_dealloc */
62  0, /* tp_vectorcall_offset */
63  nullptr, /* tp_getattr */
64  nullptr, /* tp_setattr */
65  nullptr, /* tp_reserved */
66  nullptr, /* tp_repr */
67  nullptr, /* tp_as_number */
68  nullptr, /* tp_as_sequence */
69  nullptr, /* tp_as_mapping */
70  nullptr, /* tp_hash */
71  nullptr, /* tp_call */
72  nullptr, /* tp_str */
73  nullptr, /* tp_getattro */
74  nullptr, /* tp_setattro */
75  nullptr, /* tp_as_buffer */
76  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
78  nullptr, /* tp_traverse */
79  nullptr, /* tp_clear */
80  nullptr, /* tp_richcompare */
81  0, /* tp_weaklistoffset */
82  nullptr, /* tp_iter */
83  nullptr, /* tp_iternext */
84  nullptr, /* tp_methods */
85  nullptr, /* tp_members */
86  nullptr, /* tp_getset */
87  &UnaryPredicate1D_Type, /* tp_base */
88  nullptr, /* tp_dict */
89  nullptr, /* tp_descr_get */
90  nullptr, /* tp_descr_set */
91  0, /* tp_dictoffset */
92  (initproc)WithinImageBoundaryUP1D___init__, /* tp_init */
93  nullptr, /* tp_alloc */
94  nullptr, /* tp_new */
95 };
96 
98 
99 #ifdef __cplusplus
100 }
101 #endif
PyTypeObject UnaryPredicate1D_Type
static int WithinImageBoundaryUP1D___init__(BPy_WithinImageBoundaryUP1D *self, PyObject *args, PyObject *kwds)
PyTypeObject WithinImageBoundaryUP1D_Type
static char WithinImageBoundaryUP1D___doc__[]
inherits from class Rep
Definition: AppCanvas.cpp:18