Blender  V2.93
BPy_WithinImageBoundaryUP1D.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 
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 using namespace Freestyle;
28 
30 
31 //------------------------INSTANCE METHODS ----------------------------------
32 
34  "Class hierarchy: :class:`freestyle.types.UnaryPredicate1D` > "
35  ":class:`WithinImageBoundaryUP1D`\n"
36  "\n"
37  ".. method:: __init__(xmin, ymin, xmax, ymax)\n"
38  "\n"
39  " Builds an WithinImageBoundaryUP1D object.\n"
40  "\n"
41  " :arg xmin: X lower bound of the image boundary.\n"
42  " :type xmin: float\n"
43  " :arg ymin: Y lower bound of the image boundary.\n"
44  " :type ymin: float\n"
45  " :arg xmax: X upper bound of the image boundary.\n"
46  " :type xmax: float\n"
47  " :arg ymax: Y upper bound of the image boundary.\n"
48  " :type ymax: float\n"
49  "\n"
50  ".. method:: __call__(inter)\n"
51  "\n"
52  " Returns true if the Interface1D intersects with image boundary.\n";
53 
55  PyObject *args,
56  PyObject *kwds)
57 {
58  static const char *kwlist[] = {"xmin", "ymin", "xmax", "ymax", nullptr};
59  double xmin, ymin, xmax, ymax;
60 
61  if (!PyArg_ParseTupleAndKeywords(
62  args, kwds, "dddd", (char **)kwlist, &xmin, &ymin, &xmax, &ymax)) {
63  return -1;
64  }
65  self->py_up1D.up1D = new Predicates1D::WithinImageBoundaryUP1D(xmin, ymin, xmax, ymax);
66  return 0;
67 }
68 
69 /*-----------------------BPy_TrueUP1D type definition ------------------------------*/
70 
72  PyVarObject_HEAD_INIT(nullptr, 0) "WithinImageBoundaryUP1D", /* tp_name */
73  sizeof(BPy_WithinImageBoundaryUP1D), /* tp_basicsize */
74  0, /* tp_itemsize */
75  nullptr, /* tp_dealloc */
76  0, /* tp_vectorcall_offset */
77  nullptr, /* tp_getattr */
78  nullptr, /* tp_setattr */
79  nullptr, /* tp_reserved */
80  nullptr, /* tp_repr */
81  nullptr, /* tp_as_number */
82  nullptr, /* tp_as_sequence */
83  nullptr, /* tp_as_mapping */
84  nullptr, /* tp_hash */
85  nullptr, /* tp_call */
86  nullptr, /* tp_str */
87  nullptr, /* tp_getattro */
88  nullptr, /* tp_setattro */
89  nullptr, /* tp_as_buffer */
90  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
92  nullptr, /* tp_traverse */
93  nullptr, /* tp_clear */
94  nullptr, /* tp_richcompare */
95  0, /* tp_weaklistoffset */
96  nullptr, /* tp_iter */
97  nullptr, /* tp_iternext */
98  nullptr, /* tp_methods */
99  nullptr, /* tp_members */
100  nullptr, /* tp_getset */
101  &UnaryPredicate1D_Type, /* tp_base */
102  nullptr, /* tp_dict */
103  nullptr, /* tp_descr_get */
104  nullptr, /* tp_descr_set */
105  0, /* tp_dictoffset */
106  (initproc)WithinImageBoundaryUP1D___init__, /* tp_init */
107  nullptr, /* tp_alloc */
108  nullptr, /* tp_new */
109 };
110 
112 
113 #ifdef __cplusplus
114 }
115 #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:32